-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esbuild plugin: use esbuild "jsx" loader if output is JSX #2593
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
why do you want to use esbuild’s jsx loader? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2593 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 21 -2
Lines 2693 2647 -46
Branches 2 2
=========================================
- Hits 2693 2647 -46 ☔ View full report in Codecov by Sentry. |
(updated with test & fix for undefined-options; linked #2594 with repro steps for properness)
somehow I knew you'd ask! pragmatically, this can be useful?
philosophically, this feels like a basic correctness fix?
|
It is probably good to add the same feature to other loaders. Though perhaps not in this PR. I do think it’s better to not use this. That much of your troubles come from integrating so closely with JSX instead of the other ASTs. |
Initial checklist
Description of changes
In the esbuild plugin, if the MDX pipeline is configured to output unprocessed JSX (via
jsx: true
in its options), have esbuild expect JSX (vialoader: "jsx"
instead of the default"js"
). This allows users to freely choose whether the JSX-to-JS processing happens in the MDX pipeline or in esbuild (both are capable of doing it).