Commit Graph
9 Commits
Author SHA1 Message Date
ldm0 d05e0988d5 feat(modules): support text module imports
Compile UTF-8 text into synthetic default exports across Window and Worker module graphs. Share typed module records with modulepreload and retain CORS, integrity, and text fetch destinations through Service Worker updates.
2026-10-11 18:06:44 +08:00
ldm0 d2ef2d70a0 fix(modules): preserve source locations through exception reporting
Carry inline document URLs and parser offsets into V8, and report retained exception locations without reading author properties. Keep import.meta tied to the preparation-time resolution base and pass the actual document URL to child parsers.

Add seven regressions and mark evaluation-error-5.html passing after fixed-binary CLI/CDP comparisons. Full fmt, workspace Clippy, and nextest checks pass.
2026-10-11 18:04:10 +08:00
ldm0 4a6192afdd fix(modules): preserve original exceptions through error reporting 2026-10-11 18:04:10 +08:00
ldm0 47806b1d58 fix(modules): retain parse and static request exception identity
Carry realm-owned exception tokens through the module tree, preserve V8 compile exceptions, and cache static dependency validation failures without caching direct import resolution or network errors. Keep values GC-traced and isolated across WindowProxy reuse.

Add identity, shared-dependency, realm, GC, and pending-sibling regressions. Validated with fmt, full workspace Clippy, 17647 nextest passes, and a matched 148-case CLI/CDP WPT slice. The target now passes 11/11 subtests; smoke is 42/43 with the baseline missing-node Puppeteer failure.
2026-10-11 18:04:10 +08:00
ldm0 4cd59fc906 perf(modules): share immutable binary sources across compilation
Use Arc<[u8]> for Binary sources in the portable module tree and renderer.
Cloning fetched sources and module-map entries now shares the original bytes
instead of copying the entire Wasm file. Compilers still borrow &[u8].

Preserve the existing policy that retains Wasm raw bytes in the module map
after compilation. Keep this change separate from synthetic text ownership.

Exercise both evaluation and source import phases through the actual module
tree compile path. Verify identical byte addresses, one remaining strong
owner after fetch temporaries are dropped, and release on document disposal.
The new regression fails with the previous Vec<u8> representation.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast: 19,014 passed, 16 skipped
2026-09-30 19:04:39 +08:00
ldm0 bfa903ab43 fix(modules): share synthetic source text and release map references
JSON/CSS compilation retained independent copies in the module map and the
synthetic module record. Share immutable text with Arc<str> across fetched
sources, the portable module tree, and synthetic evaluation records instead
of copying String buffers during cloning and registration.

Release the module-map source after successful JavaScript/JSON/CSS compilation.
Make fetched-source retention an exhaustive ModuleKind policy, preserving Wasm
and text-preload source semantics. Context lookups remain weak record references.

Cover the actual module-tree compile path: the record keeps exactly one strong
reference to the original text allocation after fetch temporaries are dropped,
and destroys it when disposed. Verify record clones share the same source and
Wasm entries retain their binary source.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast: 19,013 passed, 16 skipped
2026-09-30 19:04:39 +08:00
ldm0 bc998c5748 fix(modules): preserve constructors through module trees
Retain Error and WebAssembly CompileError/LinkError kinds when translating module failures into and out of the shared module tree. Cover cached graph failures and malformed Wasm import rejection, including author-replaced constructors.
2026-09-18 20:26:35 +08:00
ldm0 52e84d5fec fix(modules): report invalid import types as TypeError
Source-commit: ce5586c822
2026-09-12 06:01:44 +08:00
ldm0 27b5135cb6 Public preview 2026-08-11 00:10:12 +08:00