Re: [webcomponents] On-demand custom elements using modules (#444)

This isn't a job for the custom elements API. Rather, you should be able to use composable pieces like MutationObserver + the module loader to monitor for instances of a tag name and load modules with corresponding definitions on demand. It's true that the module loader API is not defined yet, but that's an issue to take up with https://github.com/whatwg/loader.

Note that

> System.import() adds an extra wrapper around a block of code and any custom elements would need to be created inside that wrapper because of the recent no-upgrade decision.

will be a problem even with your proposed solution. Even with your syntax, until the module loads you cannot create custom elements for those names. Your syntax is in fact worse since it gives you no way to know when the module loads, unlike System.import() (or whatever the loader spec ends up deciding on). Unless you were proposing sync XHR-like module loads, which of course is not OK.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/444#issuecomment-197313251

Received on Wednesday, 16 March 2016 13:03:32 UTC