- From: Justin Fagnani <notifications@github.com>
- Date: Fri, 05 Oct 2018 10:49:17 -0700
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 5 October 2018 17:49:38 UTC
@dandclark thanks for the proposal, it's very exciting to have some implementor interest and alignment here! Overall this looks really good. It looks like it mostly subsets what I was proposing and sidesteps some tricky questions around exports from HTML. Nice :) One feedback about `import.meta.document`: I think `import.meta.scriptElement` would be more useful, and has the same constraints that it would need to be available only in inline modules. There are patterns where a script may want to know it's location in a document, say: ```html <awesome-element name="MyElement"> <template>...</template> <script> class MyElement extends AwesomeElement { static script = import.meta.scriptElement; } </script> <awesome-element> ``` Here AwesomeElement finds the template (or other DOM resources) with something like: ```js this.constructor.script.parentElement.querySelector('template'); ``` Of course there are other ways to arrange things for similar effect (require ids, add a HTMLScriptElement.module property, etc.), but as long as we add the constraint that this in only available in inline modules I think we might as well go all the way to the script element. -- 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/645#issuecomment-427446523
Received on Friday, 5 October 2018 17:49:38 UTC