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
merged 1 commit into from Oct 14, 2020

Conversation

@JLHwung
Copy link
Contributor

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

@codesandbox
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
@babel-bot
Copy link
Collaborator

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

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/27256/

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

This comment has been minimized.

@JLHwung

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
@calebeby
Copy link
Contributor

@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
build
Details
test262-pr Workflow: test262-pr
Details
Gitpod Open an online workspace in Gitpod
Details
Travis CI - Pull Request Build Passed
Details
babel/repl REPL preview is available
Details
build-standalone Workflow: build-standalone
Details
ci/codesandbox Building packages succeeded.
Details
codecov/project 91.62% (target 90.00%)
Details
e2e Workflow: e2e
Details
@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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

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