Skip to content

Commit 1e7c22d

Browse files
committed
feat: add comprehensive ES Modules concept page with tests
- Complete rewrite of ES Modules documentation covering: - Why ES Modules matter (static analysis, tree-shaking) - ESM vs CommonJS comparison with detailed table - Live bindings explanation with ASCII diagrams - Export syntax (named, default, re-exports, barrel files) - Import syntax (named, default, namespace, side-effect) - Module characteristics (strict mode, scope, singleton) - Dynamic imports with real-world use cases - Top-level await patterns - Browser vs Node.js differences - Import maps for bare specifiers - Common mistakes section - Added 57 comprehensive tests covering: - Live bindings behavior vs CommonJS value copies - Read-only import bindings - Circular dependencies and TDZ (ReferenceError) - Module singleton behavior - Dynamic import patterns - Export/import syntax variations - Module characteristics (strict mode, this, scope) - Common mistakes (named vs default, extensions)
1 parent f4d5246 commit 1e7c22d

2 files changed

Lines changed: 2498 additions & 38 deletions

File tree

0 commit comments

Comments
 (0)