Skip to content

feat: add transpileJsxSource api for raw jsx input. - #83

Merged
knightedcodemonkey merged 4 commits into
mainfrom
bananas
Mar 15, 2026
Merged

feat: add transpileJsxSource api for raw jsx input.#83
knightedcodemonkey merged 4 commits into
mainfrom
bananas

Conversation

@knightedcodemonkey

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 14, 2026 21:48

Copilot AI left a comment

Copy link
Copy Markdown

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 new public API to transpile raw JSX/TSX source strings into React.createElement(...) calls, intended for editor-like scenarios where you need JSX support without Babel.

Changes:

  • Introduces transpileJsxSource() implementation built on oxc-parser, magic-string, and a JSX-to-createElement builder.
  • Exposes the new API and types from the package root entry.
  • Adds README documentation and a Vitest test suite for the new transpiler.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/transpile.ts Implements the new raw-source JSX transpilation API.
src/index.ts Re-exports the new API/types from the public entrypoint.
test/transpile.test.ts Adds initial unit tests for transpileJsxSource().
README.md Documents the new source transpilation API and options.
package.json Bumps version to 1.8.0.
package-lock.json Updates lockfile version fields to 1.8.0.
.gitattributes Sets text normalization and LF endings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/transpile.ts
Comment thread test/transpile.test.ts
Comment thread src/transpile.ts Outdated
Comment thread src/transpile.ts
@codecov

codecov Bot commented Mar 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.51948% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.12%. Comparing base (4ee5c89) to head (3c3573d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/transpile.ts 80.51% 16 Missing and 14 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #83      +/-   ##
==========================================
- Coverage   88.81%   88.12%   -0.69%     
==========================================
  Files          23       24       +1     
  Lines        1707     1861     +154     
  Branches      460      502      +42     
==========================================
+ Hits         1516     1640     +124     
- Misses         54       70      +16     
- Partials      137      151      +14     

☔ 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.

Copilot AI review requested due to automatic review settings March 15, 2026 00:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new transpileJsxSource API intended to transform raw JSX source strings into React.createElement(...) calls (and fragments), without relying on Babel, and wires it into the package via a new subpath export.

Changes:

  • Add src/transpile.ts implementing transpileJsxSource() using oxc-parser + magic-string.
  • Add comprehensive unit tests for source transpilation behavior.
  • Publish/document the new API via package.json export (./transpile) and README updates (plus version bump).

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/transpile.ts Implements the new raw-source JSX transpilation API.
test/transpile.test.ts Adds unit coverage for the new transpilation behavior and options.
package.json Bumps version and adds ./transpile subpath export.
package-lock.json Lockfile version bump alignment.
README.md Documents transpileJsxSource usage and customization options.
docs/how-it-compares.md Updates size figures to reflect latest build outputs.
examples/esm-demo.html Updates displayed bundle size numbers in the demo page.
test/fixtures/e2e.html Updates displayed bundle size numbers for e2e fixture.
playwright.config.ts Switches default Playwright project to chromium.
.github/workflows/playwright.yml Installs chromium instead of chrome in CI.
.gitattributes Enforces LF line endings via git attributes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/transpile.ts
Comment thread src/transpile.ts
@knightedcodemonkey
knightedcodemonkey merged commit fe3c9f5 into main Mar 15, 2026
4 checks passed
@knightedcodemonkey
knightedcodemonkey deleted the bananas branch March 15, 2026 00:53
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