ES6 Modules vs. HTML Imports

后端 未结 2 492
梦如初夏
梦如初夏 2021-02-05 20:52

HTML Imports are a part of the Web Components specification and provide a way to handle dependencies on the Web. ES6 modules also do the same thing, but just for Javascript code

2条回答
  •  不要未来只要你来
    2021-02-05 21:26

    Here's the latest on this: Chrome has native support for all 4 Web Component specs, while Mozilla announced they will not ship an implementation of HTML Imports precisely because of this pending reconciliation with ES6 Modules, which isn't going to be resolved anytime soon, specially coz here's what Mozilla has to say about it:

    We expect that once JavaScript modules — a feature derived from JavaScript libraries written by the developer community — is shipped, the way we look at this problem will have changed. We have also learned from Gaia and others, that lack of HTML Imports is not a problem as the functionality can easily be provided for with a polyfill if desired.

    `

提交回复
热议问题