Modules for JS.next
summary
Proposes adding a real module system with a module keyword and explicit export/import so declarations are local by default, plus compile‑time loading that does IO in a preexecution compilation phase so the UI thread does not block. Declares modules as singletons, supports static imports (including import.star) with early errors, and dynamic require callbacks. Prototypes live in a metacircular evaluator called Narcissus and a Firefox add‑on zaphod, demos work there, and the plan targets early deployment (Firefox ~7) while tooling and polyfills bridge today’s npm/AMD/CommonJS ecosystem.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 3:18Module Pattern
- 5:10Design Pattern
- 5:35Frameworks
- 6:16Common JS
- 8:17Creating a Module
- 10:10The Trick
- 13:52Singletons
- 14:17Dynamic Loading
- 15:58eval is evil
- 20:07Overview
- 20:38Demo
- 29:21Proxy
- 30:05ImportStar
related talks
47mNative JavaScript Modules: import {Browsers, Node.js}; export {production};
31mECMAScript Modules: Past, Present, and Future
19mModule Frontiers
28mPast, Present, and Future
32mPlease Wait... Loading: A Talk of Two Loaders
26mNode Es Modules - Something Almost, but not Quite Entirely Unlike Commonjs
45mLoading Modules Everywhere!
46mES Modules: The next revolution?
