Skip to content

runtime: land #8535 (native TypeScript transpileModule) with union conflicts resolved - #8554

Merged
proggeramlug merged 5 commits into
mainfrom
merge/8535-typescript-transpile
Aug 21, 2026
Merged

runtime: land #8535 (native TypeScript transpileModule) with union conflicts resolved#8554
proggeramlug merged 5 commits into
mainfrom
merge/8535-typescript-transpile

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Lands #8535 (native TypeScript transpileModule subset) with its conflicts against current main resolved.

#8535 could not be merged directly: it conflicted in four files with #8532 (@parcel/watcher), which merged first. It is a fork PR, so the rebase could not be pushed to its branch.

Every conflict was a union conflict — two independent features adding at the same insertion point, where taking either side silently drops the other's symbols:

file collision
Cargo.toml both add a workspace member and a path dependency
crates/perry/well_known_bindings.toml both add a [bindings.*] block
crates/perry-api-manifest/src/entries.rs both add module-name entries
docs/src/api/reference.md a generated entry total (2969 vs 2956)

The first three are resolved as unions, keeping both features. The generated doc total is left to regeneration rather than picked by hand.

One consequence the union does not fix by itself, and the reason a naive resolution would have shipped broken: workspace-architecture.json stores counters, and both PRs incremented the same ones. The union kept only one side's numbers, leaving the baseline at workspace_members: 79 / externalize: 32 against a live tree of 80 / 33. That failed workspace_architecture --check and is corrected in a separate commit.

Validation on the resolved tree:

check exit
cargo check --workspace --all-targets 0
check_file_size.sh 0
workspace_architecture.py --check 0
raw_handle_debt.py 0
check_gc_scanner_latches.py 0
check_test_registration.py 0

Closes #8535.

Summary by CodeRabbit

  • New Features
    • Added partial TypeScript compatibility through a native transpilation API.
    • Supports TypeScript and TSX transpilation, React JSX lowering, compiler constants, and diagnostic formatting.
    • Added declarations for the typescript module and supported exports.
  • Bug Fixes
    • Improved handling of TypeScript enum imports and unsupported API diagnostics.
  • Documentation
    • Documented the supported TypeScript compatibility surface and provenance.

Ralph Küpper added 5 commits August 22, 2026 00:29
…icts

#8535 and the recently-merged #8532 (@parcel/watcher) both add a workspace
crate, a well-known binding, and API-manifest module entries at the same
insertion points. Every conflict is two independent features colliding on a
list, so each resolves as a union — taking either side drops the other's
symbols. docs/src/api/reference.md holds a generated entry total and is
regenerated rather than resolved by hand.
#8532 and #8535 each add one externalize-category crate. Both incremented
workspace_members and decision_counts.externalize; the union conflict kept
only one side's numbers, so the baseline read 79/32 against a live 80/33.
@proggeramlug
proggeramlug merged commit 3885ba4 into main Aug 21, 2026
19 of 20 checks passed
@proggeramlug
proggeramlug deleted the merge/8535-typescript-transpile branch August 21, 2026 23:13
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dc8723ea-3e53-4691-b6c4-472d2721f94f

📥 Commits

Reviewing files that changed from the base of the PR and between 497c28a and 0b6e0df.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • Cargo.toml
  • changelog.d/8535-typescript-transpile-module.md
  • crates/perry-api-manifest/src/entries.rs
  • crates/perry-api-manifest/src/entries/part_2.rs
  • crates/perry-codegen/src/ext_registry.rs
  • crates/perry-codegen/src/lower_call/native_table/mod.rs
  • crates/perry-codegen/src/lower_call/native_table/typescript.rs
  • crates/perry-ext-typescript/Cargo.toml
  • crates/perry-ext-typescript/src/lib.rs
  • crates/perry-hir/src/lower/module_decl.rs
  • crates/perry-hir/src/lower/module_decl/typescript.rs
  • crates/perry-hir/src/lower/tests.rs
  • crates/perry-hir/tests/unimplemented_api_check.rs
  • crates/perry/tests/issue_8511_typescript_transpile_module.rs
  • crates/perry/well_known_bindings.toml
  • docs/api/perry.d.ts
  • workspace-architecture.json

📝 Walkthrough

Walkthrough

The PR adds a partial native TypeScript binding backed by SWC. It supports TS/TSX transpilation, React JSX lowering, diagnostics, diagnostic flattening, compiler enums, native dispatch, public declarations, and end-to-end regression tests.

Changes

TypeScript transpilation support

Layer / File(s) Summary
Binding registration
Cargo.toml, crates/perry-ext-typescript/Cargo.toml, crates/perry-api-manifest/..., crates/perry/well_known_bindings.toml, docs/api/perry.d.ts, workspace-architecture.json
Registers perry-ext-typescript, its SWC dependencies, the partial typescript binding, supported manifest entries, public declarations, and workspace metadata.
Native dispatch and HIR lowering
crates/perry-codegen/..., crates/perry-hir/src/lower/module_decl*
Routes typescript calls to native implementations. Defers unsupported named imports and lowers ScriptTarget, ModuleKind, and DiagnosticCategory members as HIR enums.
SWC implementation and FFI
crates/perry-ext-typescript/src/lib.rs
Adds option validation, TypeScript and TSX parsing, type erasure, React JSX lowering, ESNext emission, diagnostics, diagnostic flattening, and Perry FFI entry points.
Regression and compatibility validation
crates/perry-hir/src/lower/tests.rs, crates/perry-hir/tests/unimplemented_api_check.rs, crates/perry/tests/issue_8511_typescript_transpile_module.rs, changelog.d/8535-typescript-transpile-module.md
Tests supported native imports, enum folding, rejected createProgram usage, compiled runtime behavior, and the documented compatibility scope.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TypeScriptCode
  participant PerryHIR
  participant NativeDispatch
  participant TypeScriptFFI
  participant SWC
  TypeScriptCode->>PerryHIR: import typescript APIs and enums
  PerryHIR->>NativeDispatch: resolve supported exports
  NativeDispatch->>TypeScriptFFI: call transpileModule
  TypeScriptFFI->>SWC: parse, transform, and emit source
  SWC-->>TypeScriptFFI: JavaScript output and diagnostics
  TypeScriptFFI-->>TypeScriptCode: return serialized result
Loading

Suggested reviewers: jdalton, thehypnoo

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch merge/8535-typescript-transpile

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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