Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Again, that's not about Sciter but rather discussion of Web Components idea in general.

Essentially WebComponent is the way of associating some JS class with custom DOM elements.

At the nutshell, WebComponents is just this one JS function:

    customElements.define('hello-world', HelloWorld);
But it is quite limited as you see - a) only custom elements and b) you need to load some JS file in order to initialize bindings.

That element->JS code binding could be done by CSS with much greater flexibility:

    /* custom element */
    hello-world { aspect: HelloWorld url(hello-world.js); }

    /* existing element */
    span.hello-world { aspect: HelloWorld url(hello-world.js); }

    /* existing element, conditionally */
    a[href^="http"] { aspect: HelloWorld url(hello-world.js); }
Yet note that, in case of CSS bindings, hello-world.js will be loaded only if your document will have matching elements - better componentization I would say.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: