Write once, run anywhere - cross-env JS
summary
Claim: a single codebase can run on browser Node and Deno but only by shrinking to their common feature set and by adding platform-specific adapters. Uses a monorepo that outputs ESM and CommonJS dual builds (Rollup suggested) and drops most third-party deps, producing handcrafted lightweight code. Handles disjoint features with dependency injection using a persistent storage interface injection pattern (localStorage vs filesystem). Result trades fewer runtime deps for more build complexity and explicit adapter code that actually works across the three runtimes.
AI-written summary · about
chapters (6)
- 0:00Introduction and philosophy
- 2:30Complexity in programming
- 3:32Cross-environment strategy
- 6:24Benefits of platform unity
- 8:26Build chain considerations
- 10:23Handling disjunct features
related talks
31mDeno: The JavaScript Runtime for the Serverless Era
24mPublishing in the JavaScript Ecosystem & Keeping Users Happy
24m[Eng Sub]Deno: Next Generation JavaScript Runtime
34mTowards a simpler JavaScript ecosystem
30mDeno is a New Way to JavaScript
23mPublishing in JavaScript Ecosystem: How to Keep Everyone Happy?
56mDeno, a new way to JavaScript
40mIt's Not Just Node.js Anymore
