Skip to content

Add optional TypeScript runtime support - #124

Open
noise64 wants to merge 7 commits into
mainfrom
typescript-runtime-foundation
Open

Add optional TypeScript runtime support#124
noise64 wants to merge 7 commits into
mainfrom
typescript-runtime-foundation

Conversation

@noise64

@noise64 noise64 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor
  • implements GOL-220 with opt-in strip-only and transform-capable TypeScript runtime features
  • adds Node 22.14-compatible module.stripTypeScriptTypes, TypeScript module loading, feature reporting, and node_modules rejection behavior
  • applies the selected strip/transform mode to module files and inline wasm-rquickjs:execution jobs across P2 and P3
  • preserves the default component footprint for users who do not enable TypeScript; measured raw P2 Wasm grows from 4.68 MB to 8.06 MB when enabled
  • removes a redundant TypeScript transform from ESM graph classification and covers disabled, size-limit, async-entry, strip-only, transform, and latency behavior
  • updates README guidance, DTS goldenfiles, and the generated Node compatibility inventory

Node compatibility

  • primary CI-enforced: 3228/4425 (72.9%)3236/4425 (73.1%)
  • full public: 3228/5750 (56.1%)3236/5750 (56.3%)
  • module: 120 passing / 34 gaps129 passing / 25 gaps
  • util: 89 passing / 8 gaps88 passing / 9 gaps, honestly classifying transformed TypeScript call-site source-map remapping as unsupported
  • enables all nine Node 22.14 test-module-strip-types subtests; remaining TypeScript CLI fixtures retain precise process.execPath/flag-emulation deferrals

Validation

  • focused P2 and P3 TypeScript runtime tests
  • P2 and P3 execution isolation tests
  • 9/9 Node stripTypeScriptTypes compatibility cases
  • focused P2/P3 test-util-getcallsites verification: 12 passed, 1 explicit source-map gap
  • generated compatibility report and TypeScript DTS goldenfiles
  • all-targets build, formatting, workspace clippy, Prettier, ESLint, and TypeScript build
  • independent Codex review and authorized Claude review; Claude remediation re-review verdict: clear

@blacksmith-sh

This comment has been minimized.


sqlite = ["dep:rusqlite"]
timezone = ["dep:chrono-tz"]
typescript-runtime = [

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's follow the grouping style already used here, and for the swc deps

# This matches the validation the Preview 2 path gets from `golem-wasi-http` (which re-exports the
# same `http` crate) without depending on `golem-wasi-http` itself.
http = { version = "1", optional = true }
swc_common = { version = "24", optional = true }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these okay to be not pinned? What are the guarantees defined by swc project versioning

const MAX_OUTPUT_BYTES: usize = 64 * 1024 * 1024;
// Native SWC work cannot be interrupted while Rust is executing. Keep inline
// jobs tightly bounded; worst-case sibling-job latency is tracked by GOL-347.
const MAX_SOURCE_BYTES: usize = 256 * 1024;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's revisit if this is reasonable / needed constraint.

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