Skip to content
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

Add `jsxPragmaFrag` support to typescript transform #11950

merged 1 commit into from Oct 14, 2020


Copy link

@JLHwung JLHwung commented Aug 11, 2020

Q                       A
Fixed Issues? Resolves #11935
Minor: New Feature? Yes
Tests Added + Pass? Yes
Documentation PR Link babel/website#1945
Any Dependency Changes?
License MIT

This PR adds support for jsxPragmaFrag so that preset-typescript does not elide Fragment imports like import { Fragment } from "preact".

Prior work: #9317, unfortunately that PR was abandoned due to lack of upstream support at that time. /cc @Tarnadas, the author of #9317.

Copy link

@codesandbox codesandbox bot commented Aug 11, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 2ec058d:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration
Copy link

@babel-bot babel-bot commented Aug 11, 2020

Build successful! You can test your changes in the REPL here:

@@ -47,15 +47,16 @@ export default declare(
jsxPragma = "React",
jsxPragma = "React.createElement",

This comment has been minimized.


JLHwung Aug 11, 2020
Author Contributor

This change is invisible to users since (jsxPragmaFrag).split(".")[0] still returns React. It is meant to align with

const DEFAULT = {
pragma: "React.createElement",
pragmaFrag: "React.Fragment",

@JLHwung JLHwung force-pushed the JLHwung:add-jsxPragmaFrag branch from 7e29bc1 to 2ec058d Aug 11, 2020
Copy link

@calebeby calebeby commented Aug 31, 2020

Hi! Is there a blocker for merge or is this ready to go?

@JLHwung JLHwung added this to the v7.12.0 milestone Sep 17, 2020
@nicolo-ribaudo nicolo-ribaudo changed the title feat: add jsxPragmaFrag support to typescript transform Add `jsxPragmaFrag` support to typescript transform Oct 14, 2020
@nicolo-ribaudo nicolo-ribaudo merged commit d0d1fdb into babel:main Oct 14, 2020
8 of 9 checks passed
8 of 9 checks passed
test262-pr Workflow: test262-pr
Gitpod Open an online workspace in Gitpod
Travis CI - Pull Request Build Passed
babel/repl REPL preview is available
build-standalone Workflow: build-standalone
ci/codesandbox Building packages succeeded.
codecov/project 91.62% (target 90.00%)
e2e Workflow: e2e
@nicolo-ribaudo nicolo-ribaudo deleted the JLHwung:add-jsxPragmaFrag branch Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

6 participants
You can’t perform that action at this time.