W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2015

Re: Custom element design with ES6 classes and Element constructors

From: Ryosuke Niwa <rniwa@apple.com>
Date: Mon, 12 Jan 2015 17:27:50 -0800
Cc: Anne van Kesteren <annevk@annevk.nl>, WebApps WG <public-webapps@w3.org>
Message-id: <D6DCF606-D1AA-4F88-85DA-88663EA5999D@apple.com>
To: Domenic Denicola <d@domenic.me>

> On Jan 12, 2015, at 5:14 PM, Domenic Denicola <d@domenic.me> wrote:
> From: Ryosuke Niwa [mailto:rniwa@apple.com] 
>> There's no brilliant solution here.  I'm suggesting to introduce something akin to sync script element.
>> In this particular example, my-el will remain HTMLUnknownElement since it had already appeared when the script element to load the module is parsed.  A more interesting example would be the one where the script element to load my-module.js appears before my-el.  In that case, the instantiation of my-el is delayed until my-module.js is loaded.
> I am still trying to tease out what "the instantiation of my-el is delayed" means.

I mean that the parse would stop processing nodes at that point.  I expect that many people will be unhappy with this approach since it would have the same ramification as a "sync" script element (without "defer" or "async" attributes).

> What would happen in my example where the my-module.js appears before my-el? I'm guessing from your response above, it would need to be <script type="sync-module" src="my-mobile.js"> to be any different, and just moving the <script type="module"> tag as-is would not change anything?

The HTML parser would stop parsing until my-module.js is loaded.

- R. Niwa
Received on Tuesday, 13 January 2015 01:28:24 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:25 UTC