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

It seems there are a few things we should decide on that will affect our
API decision:

   1. Are we comfortable with having <script> elements scoped to templates
   or elements they are associated with - this means adjusting the value of
   'this' or 'self', etc.
   2. How do we want to associate <template> elements with custom tags?
   Which direction is the association made, template tells the element "I'm
   coming over for dinner <element>, better set a place!", or element says
   "Hey there template, you're looking pretty cool, I'd like to use you." - I
   prefer the latter, as it provides for many more use-cases (don't think this
   is opinion) via more sane way that developers will expect (this may be
   opinion).
   3. Do we use events for the <template> actions (bind, unbind, etc), or
   script tags with special attributes that dictate when a code block (or
   linked resource) is run? (would the latter mean we need another special
   attribute like 'runwhenunbound'?)

*As usual, let me know if I have it wrong anywhere :)*

Once we answer the open items above, I believe the optimal implementation
will be easier to recognize.


On Wed, Apr 10, 2013 at 3:42 PM, John J Barton
<johnjbarton@johnjbarton.com>wrote:

>
>
>
> On Wed, Apr 10, 2013 at 3:30 PM, Daniel Buchner <daniel@mozilla.com>wrote:
>
>> @John - in my opinion, <template bindtotagname="my-yay"> is the wrong
>> direction. You should be declaring which *template* an *element* uses, not
>> which element a template captures. Having templates latch onto element
>> types from afar breaks the one-to-many case, prevents sane swapping of
>> templates on a specific element node, and many other oddities.
>> Alternatively, <element template="id-of-some-template"> is more flexible
>> and the right 'direction' for such an association that suffers none of
>> those issues, at least in my opinion. Feel free to disagree or set me
>> straight if anything I said is not accurate :)
>>
>
> I don't have any opinion on this aspect, sorry. I was only offering a
> modernization of an old and not-popular-among-purists way of connecting
> scripts and elements.
>  jjb
>

Received on Thursday, 11 April 2013 00:23:11 UTC