WICG / webcomponents

Web Components specifications
Other
4.34k stars 371 forks source link

HTML Modules #645

Open justinfagnani opened 7 years ago

justinfagnani commented 7 years ago

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:

<script type="module" url="foo.html">

or JavaScript:

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.

justinfagnani commented 7 years ago

@TakayoshiKochi made a polyfill (based on the Githubissues.

  • Githubissues is a development platform for aggregating issues.