ESM: EcmaScript Modules in browser and NodeJS. It's about time!
summary
Covers how ECMAScript modules are now usable in modern browsers and Node.js but still impose concrete frictions: browsers are ~99% compatible yet require dual code paths via type="module" vs nomodule, browser imports need explicit .js extensions, and default exports create naming/alias pitfalls. Describes migration patterns from RequireJS/CommonJS using TypeScript transpilation and bundlers (Webpack, Rollup) to produce both module and legacy bundles, and demonstrates a small Express router/singleton example with live demos that illustrate the practical tradeoffs.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:05JavaScript modules history
- 2:15Pre-ESM module systems
- 3:37ECMAScript Modules (ESM)
- 4:02TypeScript demo
- 16:09Browser module usage
- 26:55Express ESM app demo
- 39:00Module compatibility
- 46:32Conclusion
related talks
31mECMAScript Modules: Past, Present, and Future
22mPlease wait... loading: a tale of two loaders
47mNative JavaScript Modules: import {Browsers, Node.js}; export {production};
26mNode Es Modules - Something Almost, but not Quite Entirely Unlike Commonjs
32mES Modules in Node JS
29mExtra Special Modules
34mNode.js: Path to ES6 modules
24mNavigating the Wild Seas of Native ES Modules
