IssueRaiser

HTML Modules

Now that JavaScript modules are on the verge of widespread browser support, we should think about an HTML module system that plays well with it. HTML Imports doesn't have a mechanism for exporting symbols, nor can they be imported by JavaScript, however its loading behavior is quite compatible with JavaScript modules. @dglazkov sketched out a proposal for HTML modules here: https://github.com/dglazkov/webcomponents/blob/html-modules/proposals/HTML-Imports-and-ES-Modules.md The main points are that, using the JavaScript modules plumbing, you can import HTML. Either in HTML: ```html <script type="module" url="foo.html"> ``` or JavaScript: ```js import * as foo from "foo.html"; ``` But within the scope of that sketch there are still several questions about the specifics of exporting symbols from HTML and importing to JavaScript.

Posted by justinfagnani on Jun 20, 2017, 3:30 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments

support (Software)

HTML Modules

justinfagnaniJun 20, 2017, 3:30 PM

Now that JavaScript modules are on the verge of widespread browser support, we should think about an HTML module system that plays well with it. HTML Imports doesn't have a mechanism for exporting symbols, nor can they be imported by JavaScript, however its loading behavior is quite compatible with JavaScript modules. @dglazkov sketched out a proposal for HTML modules here: https://github.com/dglazkov/webcomponents/blob/html-modules/proposals/HTML-Imports-and-ES-Modules.md The main points are that, using the JavaScript modules plumbing, you can import HTML. Either in HTML: ```html <script type="module" url="foo.html"> ``` or JavaScript: ```js import * as foo from "foo.html"; ``` But within the scope of that sketch there are still several questions about the specifics of exporting symbols from HTML and importing to JavaScript.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue