unstale

npm / es-module-lexer

es-module-lexer

What changed in es-module-lexer 2 to 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-20.

11 breaking2 security8 new APIs and options6 performance3 behavior and defaults1 tooling20 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

es-module-lexer 334 changes

Breaking changes 10

  • init is now a function, changing how developers use the API.

    3.0.2release notes

  • This entry point is the asm.js build; the unmaintained pure-JS port is removed.

    3.0.0release notes

  • New entry point with the v2-shaped API: parse returns only imports and exports, at is dropped, and re-exported imported names are reported in ln/ls/le.

    3.0.0release notes

  • export default interface Foo now reports Foo as its local name.

    3.0.0release notes

  • Reexports resolve to their originating import regardless of statement order; export * is represented as reexport-all and its import as reexport-star.

    3.0.0release notes

  • Full-build records now use tagged unions discriminated by type, with descriptive fields replacing the terse v2 names and numeric type tags.

    3.0.0release notes

  • ImportType is now a type-only union of named numeric literal aliases; no runtime enum is exported.

    3.0.0release notes

  • initSync is no longer exported; parse initializes on first use.

    3.0.0release notes

  • Node.js 18 or later is required.

    3.0.0release notes

  • Invalid escape sequences now throw a parse error instead of yielding undefined.

    3.0.0release notes

Security 2

  • Module strings decode without eval, improving one-import parse speed and allowing Wasm builds under --disallow-code-generation-from-strings.

    3.0.0release notes

  • Nesting past 1024 brackets or 512 dynamic imports now produces a parse error instead of memory corruption.

    3.0.0release notes

New APIs and options 6

  • A glob flag is added on dynamic imports.

    3.0.1release notes

  • A specifier is added on import.meta.

    3.0.1release notes

  • typeOnly is added on import.meta.

    3.0.1release notes

  • Dynamic import attributes are typed null; attributesStart locates the options argument.

    3.0.0release notes

  • Dynamic imports carry a best-effort probablyTypeOnly field in full builds.

    3.0.0release notes

  • Full builds lex TypeScript type-only imports, exports, aliases, interfaces, and ambient declarations; type-only edges carry typeOnly.

    3.0.0release notes

Performance 3

  • Reduces TypeScript lookahead work, improving lexer performance.

    3.0.4release notes

  • Parser wrapper overhead was reduced.

    3.0.2release notes

  • The full Wasm build uses SIMD scanning for long line comments and templates; the minimal build stays Wasm MVP.

    3.0.0release notes

Behavior and default changes 2

  • The minimal build enforces Wasm MVP and uses no post-MVP features.

    3.0.0release notes

  • parse initializes Wasm synchronously on first call; await init is only required on browser main threads, and all four entry points share the parse/init API.

    3.0.0release notes

Fixes and other changes 11

  • Preserves complete import attribute metadata in parser results.

    3.0.4release notes

  • Lexes / after a postfix non-null assertion as division.

    3.0.4release notes

  • Fixes handling of ASI and repeated non-null assertions in TypeScript export bindings.

    3.0.3release notes

  • Handles TypeScript generic commas in exported bindings.

    3.0.3release notes

  • Minimal build reexports report no local name.

    3.0.1release notes

  • Unannotated declare let/var no longer erases the following statement.

    3.0.0release notes

  • Shorthand declare module no longer erases the following statement.

    3.0.0release notes

  • A dynamic import with a single template-literal argument reports a glob specifier with each interpolation collapsed to *.

    3.0.0release notes

  • Typed export binding lists now collect every declarator.

    3.0.0release notes

  • export { type as } and type as as now follow TypeScript's specifier table.

    3.0.0release notes

  • U+00A0 is treated as whitespace around import/export names.

    3.0.0release notes

es-module-lexer 217 changes

Breaking changes 1

New APIs and options 2

  • A minimal build variant is available for es-module-shims.

    2.3.0release notes

  • The export statement start position is exposed as ss.

    2.2.0release notes

Performance 3

  • The lexer skips identifier and number runs, improving lexer performance.

    2.3.2release notes

  • The lexer gates keywordStart on the next byte for i/c tokens.

    2.3.1release notes

  • Node uses a fast native UTF-16 source copy into Wasm memory.

    2.3.1release notes

Behavior and default changes 1

Tooling 1

  • Adds side-effects metadata to package.json, which can inform bundler behavior.

    2.3.2release notes

Fixes and other changes 9

  • The asm.js integer return type annotation is fixed.

    2.3.2release notes

  • The sourcename is now forwarded through the pre-init parse path.

    2.3.2release notes

  • WebAssembly memory can grow for sources over ~4MB, including in the minimal build.

    2.3.0release notes

  • A method named import with two or more arguments is no longer treated as a dynamic import.

    2.2.0release notes

  • Export var, let, and const declarations now detect every binding.

    2.2.0release notes

  • The n field is now reported for dynamic imports using no-substitution template literals.

    2.2.0release notes

  • Dynamic import attributes are always excluded from the specifier range.

    2.1.0release notes

  • Handles new of conflict cases.

    2.1.0release notes

  • A global reference issue has been fixed.

    2.0.0release notes