Skip to content

[babel 8] Use the JSX automatic runtime by default#12630

Merged
nicolo-ribaudo merged 2 commits into
babel:mainfrom
nicolo-ribaudo:backport/react-default-runtime
Jan 19, 2021
Merged

[babel 8] Use the JSX automatic runtime by default#12630
nicolo-ribaudo merged 2 commits into
babel:mainfrom
nicolo-ribaudo:backport/react-default-runtime

Conversation

@nicolo-ribaudo

@nicolo-ribaudo nicolo-ribaudo commented Jan 14, 2021

Copy link
Copy Markdown
Member
Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change? Yes, behind process.env.BABEL_8_BREAKING
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link babel/website#2778
Any Dependency Changes?
License MIT

Backport of #11436 / b31ebbe.

Comment on lines +33 to +37
runtime: RUNTIME_DEFAULT = process.env.BABEL_8_BREAKING
? "automatic"
: development
? "automatic"
: "classic",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is not

     RUNTIME_DEFAULT = process.env.BABEL_8_BREAKING || development
        ? "automatic"
        : "classic",

So that at build time it is easily converted to development ? "automatic" : "classic" or "automatic" depending on BABEL_8_BREAKING.

@babel-bot

Copy link
Copy Markdown
Collaborator

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

@codesandbox-ci

Copy link
Copy Markdown

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 d99f468:

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

@JLHwung JLHwung left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❤️

var div = /*#__PURE__*/React.createElement(Component, Object.assign({}, props, {
var _reactJsxRuntime = require("react/jsx-runtime");

var div = /*#__PURE__*/_reactJsxRuntime.jsx(Component, Object.assign({}, props, {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It doesn't matter to keep this test as classic or not right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it's ok to use the automatic runtime, since it still tests that the transform-to-object-assign works on the JSX transform output.

@nicolo-ribaudo nicolo-ribaudo changed the title [babel 8] Make automatic runtime the default for JSX compilation [babel 8] Use the JSX automatic runtime by default Jan 19, 2021
@nicolo-ribaudo
nicolo-ribaudo merged commit 10978bb into babel:main Jan 19, 2021
@nicolo-ribaudo
nicolo-ribaudo deleted the backport/react-default-runtime branch January 19, 2021 00:41
@github-actions github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Apr 20, 2021
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 20, 2021
@JLHwung JLHwung added PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release and removed babel 8 labels Aug 9, 2023
@JLHwung JLHwung added this to the v8.0.0 milestone Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: react outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants