Skip to content

feat: add stripTypes in transpilation.#85

Merged
knightedcodemonkey merged 2 commits intomainfrom
bananas
Mar 16, 2026
Merged

feat: add stripTypes in transpilation.#85
knightedcodemonkey merged 2 commits intomainfrom
bananas

Conversation

@knightedcodemonkey
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 16, 2026 19:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 typescript option ('preserve' | 'strip') on TranspileJsxSourceOptions, with AST walking and MagicString-based edits to strip TS syntax
  • TS wrapper handling inside the JSX compileExpression path so expressions within JSX attributes/children are also stripped
  • Tests, README docs, and a roadmap note about potentially adopting oxc-transform in 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
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 88.15789% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.51%. Comparing base (3280173) to head (d1a68fb).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/transpile.ts 88.15% 3 Missing and 6 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@knightedcodemonkey knightedcodemonkey merged commit 720732c into main Mar 16, 2026
7 checks passed
@knightedcodemonkey knightedcodemonkey deleted the bananas branch March 16, 2026 19:42
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.

2 participants