Skip to content

Avoid duplicate CommonJS TypeScript transforms (GOL-418) - #133

Open
noise64 wants to merge 5 commits into
mainfrom
gol-418-single-cjs-ts-transform
Open

Avoid duplicate CommonJS TypeScript transforms (GOL-418)#133
noise64 wants to merge 5 commits into
mainfrom
gol-418-single-cjs-ts-transform

Conversation

@noise64

@noise64 noise64 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • establish one transform owner for every CommonJS TypeScript entry path
  • carry prepared CommonJS graphs through synchronous require transactions while reusing cached child metadata
  • classify TypeScript module format from transformed AST semantics, including erased type-only syntax and top-level-await edge cases
  • preserve cache rollback, source registration, export metadata, cycles, and ESM interop

Validation

  • focused P2 and P3 TypeScript runtime contracts
  • P2 and P3 strip and transform-immutability tests
  • module-loader architecture suite
  • targeted AST classifier unit coverage
  • root and changed-source formatting/Clippy checks
  • final independent exact-SHA review passed at d107dc6cdaffdbe1f4e069a1a6b4c3d7a16472c6

CI note

All substantive CI lanes passed except one recurring Preview 3 runtime-group-2 transport failure (fetch_with_referrer_policy, Hyper IncompleteMessage / HttpProtocolError). The targeted group-8 rerun passed, and the same group-2 signature is independently reproduced and owned by GOL-420; no GOL-418 source change is indicated.

@noise64

noise64 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

Exact-SHA correction review and local verification completed for d107dc6cdaffdbe1f4e069a1a6b4c3d7a16472c6.

The correction establishes one AST-based TypeScript module-format decision for CommonJS preparation, including type-only import/export erasure, .mts/.cts precedence over package type, CommonJS-wrapper lexical bindings and destructuring, erased ambient declarations, import.meta, top-level await, for await, and await using with nested-function exclusions.

Regression coverage now verifies recursive CJS reexport preparation, exact transform ownership/counts, cached child reuse, true ESM avoidance, failure rollback, a type: module package containing .cts, lexical-only ESM markers, and top-level versus nested for await / await using behavior.

Independent delta review: PASS with no remaining findings.

Local exact-SHA verification:

  • root and skeleton formatting: PASS
  • targeted AST classifier unit: PASS (1 passed, 45 filtered)
  • host runtime Clippy with -D warnings: PASS
  • focused P2 TypeScript runtime contract: PASS
  • focused P3 TypeScript runtime contract: PASS
  • targeted skeleton Clippy: no findings in changed internal/typescript.rs; it reproduces the same 39 documented older-branch module_loading.rs diagnostics

The tracked tree is clean, Cargo.toml_ is restored, generated skeleton artifacts are removed, and Cargo.lock is unchanged. CI is now running against this exact SHA.

@noise64

noise64 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

Targeted rerun of test-runtime-p3 (2) completed at the reviewed SHA d107dc6cdaffdbe1f4e069a1a6b4c3d7a16472c6 and reproduced the same transport-owned failure a second time.

The failing case is again runtime::fetch::fetch_with_referrer_policy; the host reports Hyper IncompleteMessage, and Preview 3 surfaces ErrorCode::HttpProtocolError. This is the independently reproduced GOL-420 transport lifecycle flake, not a TypeScript transformation failure.

No source changes were made. Every other substantive P2/P3 runtime, node-compat, build, and test lane is green, including the targeted group 8 rerun.

@noise64
noise64 marked this pull request as ready for review August 29, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant