dart2esm 0.2.0
dart2esm: ^0.2.0 copied to clipboard
A Dart-to-native-ESM compiler that emits clean modern JavaScript modules.
0.2.0 #
- Split CLI, compiler driver, Dart/CFE frontend, Kernel adapter, semantic core, transforms, runtime linking, and code generation into explicit boundaries.
- Add immutable compiler profiles for host, ECMAScript target, and debug or release optimization; Kernel input now requires an explicit host profile.
- Add stable structured diagnostics with codes, phases, and Kernel source locations.
- Add safe release optimization, runtime relinking, and compact ESM printing.
- Add release-only member reachability for imported classes, including
conservative virtual, dynamic,
noSuchMethod, and public API retention. - Mangle non-exported module bindings in release builds while preserving ESM exports, dynamic members, raw JavaScript properties, string-visible names, and lexical scope safety.
- Extend release mangling to parameters, local bindings, and linked runtime globals; reserve runtime ABI names during lowering so user locals cannot shadow compiler calls.
- Shorten compiler-owned private member properties without changing exports, dynamic names, raw JavaScript properties, or user-visible strings.
- Replace structural constant cache keys with collision-free numeric ids and emit frozen constant instances as compact native object literals.
- Factor repeated writable field descriptors into one module-local helper and compact structured operators plus linked raw runtime code.
- Reduce the checked-in YAML release benchmark below dart2js
-O2: 0.894x raw and 0.629x gzip size on the current toolchain. - Define runtime helper ABI contracts for entry names, dependencies, host requirements, and conservative effects.
- Replace the network-dependent language-spec test with a pinned, machine- readable conformance manifest and offline coverage checks.
- Add a reproducible debug/release benchmark command with optional dart2js comparison.
0.1.1 #
- Bundle the minimal Dart 3.12.2 Kernel reader required by the compiler instead of cloning the complete Dart SDK as a Git dependency.
- Pin the matching hosted
_fe_analyzer_sharedrelease and limit activation to Dart 3.12, whose Kernel binary format this release supports. - Add a minimal pub.dev package manifest that excludes development fixtures and JavaScript test tooling from the distributed archive.
0.1.0 #
- Compile Dart source or Kernel
.dillinput into native ECMAScript modules. - Use Dart CFE/Kernel as the frontend through
dart compile kernelandpackage:kernel. - Emit ESM exports for the entry library, including top-level functions, variables, classes, enums, records, constructors, and supported static members.
- Lower modern Dart syntax produced by CFE, including collection control-flow,
null-aware operators, cascades, pattern destructuring, switch expressions,
sync generators, async generators, and
await for. - Select neutral, browser, or Node platform lowering without a redundant JavaScript target abstraction.
- Emit canonical module-level constructor tear-offs instead of duplicating function bodies at every reference.
- Link runtime helpers by referenced symbol instead of emitting whole helper families, and validate the transitive dependency closure during compilation.
- Discover reserved runtime names from actual declarations rather than a manually synchronized global-name list.
- Emit Node-backed
dart:iothrough hoisted staticnode:imports, add usable link and stdin operations, and reject unimplemented IO methods at compile time instead of generating broken calls. - Split
dart:iolowering into pure ECMAScript, Web API, and Node capability groups with compile-time platform enforcement. - Lower client
HttpClientrequests to Fetch/Headers streams andWebSocket.connectto the WebSocket Web API in browser and modern Node runtimes. - Compile browser-targeted
dart:iothrough VM Kernel while retaining the DDC fallback for web-only SDK libraries. - Replace same-thread isolate simulation with real Node Workers and browser
module Workers for top-level
Isolate.spawnandIsolate.runentries, using MessageChannel-backed SendPort delivery and structured-clone validation. - Reject worker-incompatible isolate closures and unsupported message shapes instead of silently sharing the main module heap.
- Remove the numeric
dart:ffipointer simulation. FFI now fails at compile time until an explicit native-addon or WebAssembly ABI backend exists. - Add focused golden and runtime fixtures that compare Dart VM behavior with Node running generated ESM.
0.0.0 #
- Reserve the
dart2esmpackage name. - Add a placeholder command-line executable.