feat: add stripTypes in transpilation.#85
Merged
knightedcodemonkey merged 2 commits intomainfrom Mar 16, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a typescript: 'strip' mode to transpileJsxSource that erases TypeScript type-only declarations and inline type syntax (type annotations, as, satisfies, non-null assertions, type assertions) while still transpiling JSX.
Changes:
- New
typescriptoption ('preserve'|'strip') onTranspileJsxSourceOptions, with AST walking andMagicString-based edits to strip TS syntax - TS wrapper handling inside the JSX
compileExpressionpath so expressions within JSX attributes/children are also stripped - Tests, README docs, and a roadmap note about potentially adopting
oxc-transformin the future
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/transpile.ts | Core implementation: new types, strip-edit collection/application, TS wrapper handling in expression compilation |
| test/transpile.test.ts | Three new test cases covering preserve-default, strip with JSX, and strip without JSX |
| README.md | Documents the new typescript option |
| docs/next-steps.md | Roadmap item about evaluating oxc-transform |
| package.json | Version bump to 1.9.1 |
| package-lock.json | Lockfile version bump |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #85 +/- ##
==========================================
+ Coverage 88.44% 88.51% +0.07%
==========================================
Files 25 25
Lines 1913 1986 +73
Branches 516 540 +24
==========================================
+ Hits 1692 1758 +66
- Misses 70 72 +2
- Partials 151 156 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.