0

I've been thinking about the consequences of using programmatic JavaScript components versus HTML markup. For example I looked into the Enyo Framework, which has its power in composition. One can build components composed of simpler components, and at the end they may be built from tags, but one doesn't write HTML Markup with it.

I also thought that it would be possible to develop a swing-like UI library which renders itself on an HTML5 canvas. There also would be no need for any markup.

But is there a need for this? Isn't HTML5 capable enough for these goals? I did some brain storming on a webapp similar to draw.io where there would be many Items which need to be resizable and draggable. They would need to be connected, transformed, rotated, etc., and all of that needs to be obvious from varying the borders of items, and other UI clues.

Is it possible to achieve this with HTML5, or since I have to code a lot anyway, would there be any harm to use only Javascript components without HTML markup? What are the trade-offs and what yields more pain?

1

Frameworks are all about managing the level of abstraction that you work in.

This Fiddle, for example, shows how you can use a few lines of Javascript to create an HTML5 toolbar.

enyo.kind({
    name: "MySample",
    components: [
        {kind: "onyx.Toolbar", content: "Your sample here"}
    ]
});

new MySample({fit:true}).write();

The question becomes, "How much HTML5 and CSS3 would I have to write by hand to accomplish the same thing?"

Like all good software abstractions, frameworks like Enyo allow you to create something once, and then reuse that thing in new applications without having to write it again.

See Also
Enyo Showcase
Enyo Demo

  • yeah, but I guess for the thing I talked about, one would need to do almost all from scratch. But what about the implications for SEO, usability, cross-browser, browser history, caching, etc. I'm sure one can be successful with either way. But I am looking for the consequences of a design without html markup? – Angelo.Hannes Feb 14 '14 at 7:48
  • There is always markup. The only difference is whether you write all that markup yourself, or it's generated from some other tool. All of the implications you describe derive from the relative strength of the tool creating the markup. If you desire absolute control, then you either need to modify the tool to suit your needs, or write the markup by hand yourself. The tool is simply a leveraging mechanism. – Robert Harvey Feb 14 '14 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.