Node.js: Path to ES6 modules
summary
Chronicles the concrete migration from IIFEs and globals through CommonJS, AMD and UMD to native ES modules by walking live examples: a battle.js/main.js game demo runs as an IIFE, then as CommonJS bundled with a browser bundler (demo builds with browserify/“proterra” style CLI), then AMD/UMD, and finally as ES modules that load natively in the browser and in Node (uses .mjs file extension and package.json type: "module"). Shows Node support history (8.5 experimental → rewrite in 12.0 → flag removed by 13.2; runs cleanly on Node 14) and demonstrates CommonJS ↔ ESM interoperability with default and dynamic imports/await.
AI-written summary · about
chapters (8)
- 0:00Introduction and welcome
- 2:02The need for modules
- 5:55Namespace pollution and IIFEs
- 10:25CommonJS and bundlers
- 15:30AMD and UMD specifications
- 21:04Introduction to ES modules
- 26:04Interoperability and usage
- 31:55Conclusion and wrap-up
related talks
48mESM: EcmaScript Modules in browser and NodeJS. It's about time!
47mNative JavaScript Modules: import {Browsers, Node.js}; export {production};
26mNode Es Modules - Something Almost, but not Quite Entirely Unlike Commonjs
31mECMAScript Modules: Past, Present, and Future
22mPlease wait... loading: a tale of two loaders
19mModule Frontiers
45mLoading Modules Everywhere!
24mNavigating the Wild Seas of Native ES Modules
