Navigating the Wild Seas of Native ES Modules
summary
Node v12 aims to make browser and Node ES modules a single system that can just work without bundlers by using explicit extensions and package metadata, e.g. type="module" or .mjs and package.json type=module, plus a browser-side resolution layer via import maps. Modules load via separate HTTP GETs today (hundreds of files is the “black hole problem”), Chrome implements import maps experimentally, and longer-term fixes include HTTP/2 push and web packaging; timeline suggested to be 2020–2021.
AI-written summary · about
chapters (13)
- 0:00Start
- 3:48Webpack? Babel? Bundling? Configuration hell?
- 4:51Using ES Modules Today
- 6:02New concept: two kinds of codes
- 6:47Script
- 7:57Execution model (TC39 Defined)
- 8:44No! No npm code in the browser yet...
- 9:52Node.js already has a module solution
- 14:35Solution: type = "module"
- 16:56An opportunity to define things for browsers
- 18:37The Path to Universal ES Modules
- 20:10Let's review...
- 22:48Summary
related talks
29mExtra Special Modules
22mPlease wait... loading: a tale of two loaders
32mES Modules in Node JS
32mPlease Wait... Loading: A Talk of Two Loaders
47mNative JavaScript Modules: import {Browsers, Node.js}; export {production};
48mESM: EcmaScript Modules in browser and NodeJS. It's about time!
26mNode Es Modules - Something Almost, but not Quite Entirely Unlike Commonjs
48mTomorrow's ES modules today
