~/talk

Migrating Babel from CommonJS to ESM

Talkat jsday 2023 · 2023-04-13..04-14· [javascript, nodejs]
slides:none on file

Babel migrates by changing concrete parts not slogans: tests move first, Babel adds an importInteropNode option to ignore _interop flags, and a single codebase runs both sync and async via gen-synch. Synchronous APIs that must stay synchronous use worker + Atomics to block the main thread, and Jest issues get solved with a jest lite runner. Tests go from ~5 to ~2 minutes, dual-package edge cases require many small npm patches, and a full ESM release targets Babel 8.

AI-written summary · about

  1. 0:00Babel and ESM migration
  2. 5:28CommonJS to ESM challenges
  3. 11:27ESM in Babel's config files
  4. 15:40Backward compatibility in integrations
  5. 21:45Interoperability with native ESM
  6. 26:22Test runner limitations for ESM
  7. 28:30Babel runtime to dual packages
  8. 31:20Dual workflow for ESM
  9. 33:10Community support importance
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.