Re: [webcomponents]: Platonic form of custom elements declarative syntax

On Thu, Apr 11, 2013 at 7:57 AM, Erik Arvidsson <arv@chromium.org> wrote:

> The problem here is how do you register `My_yay` as the class that goes
> with the tag name `my_yay`. One option could be to use the completion
> value but it seems too magical/unreliable. It also does not scale well. I
> would like us to be able to put all custom component classes in a single
> js file:
>
> <element name="my-foo">
>   ...
> </element>
> <element name="my-bar">
>   ...
> </element>
> <element name="my-baz">
>   ...
> </element>
> <script src="my-elements.js></script>
>
> // my-elements.js
> someDocument.querySelector('[name=my-foo]').registerConstructor(MyFoo);
> someDocument.querySelector('[name=my-bar]').registerConstructor(MyBar);
> someDocument.querySelector('[name=my-baz]').registerConstructor(MyBaz);
>
>
> This calls out for a less verbose and more DRY API.
>

To me this seems to defeat modularity. Force me to organize all of MyFoo
JS/HTML/CSS together and separate from MyBar and MyBaz.  I already can
create a big messy pile. Help me clean up my room.

jjb

Received on Thursday, 11 April 2013 15:10:58 UTC