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

Put React.jsx and React.jsxDEV behind experimental build #18023

Merged
merged 1 commit into from Mar 3, 2020

Conversation

lunaruan
Copy link
Contributor

@lunaruan lunaruan commented Feb 12, 2020

This PR puts the React.jsx and React.jsxDEV (enableJSXTransformAPI feature flag) in the experimental build so that we can use it to test React Native.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 12, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 12, 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 79d4c58:

Sandbox Source
wizardly-pine-sksfj Configuration

@sizebot
Copy link

sizebot commented Feb 12, 2020

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against 79d4c58

@sizebot
Copy link

sizebot commented Feb 12, 2020

Details of bundled changes.

Comparing: 8cb2fb2...79d4c58

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react.development.js +5.4% +3.3% 101.94 KB 107.4 KB 24.88 KB 25.69 KB UMD_DEV
react.production.min.js 🔺+3.7% 🔺+2.7% 12.02 KB 12.46 KB 4.68 KB 4.81 KB UMD_PROD
react.profiling.min.js +2.8% +1.7% 15.56 KB 16 KB 5.79 KB 5.89 KB UMD_PROFILING
react.development.js +8.2% +4.5% 63.71 KB 68.91 KB 17.19 KB 17.96 KB NODE_DEV
react.production.min.js 🔺+6.4% 🔺+3.7% 7.06 KB 7.51 KB 2.81 KB 2.91 KB NODE_PROD
React-dev.js 0.0% 0.0% 73.76 KB 73.76 KB 18.72 KB 18.73 KB FB_WWW_DEV
React-prod.js 0.0% 🔺+0.1% 17.65 KB 17.65 KB 4.56 KB 4.56 KB FB_WWW_PROD
React-profiling.js 0.0% +0.1% 17.65 KB 17.65 KB 4.56 KB 4.56 KB FB_WWW_PROFILING

React: size: 🔺+3.7%, gzip: 🔺+2.7%

Size changes (experimental)

Generated by 🚫 dangerJS against 79d4c58

Copy link
Contributor

@threepointone threepointone left a comment

Choose a reason for hiding this comment

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

approving pending CI passing

}
if (__DEV__) {
React.jsxDEV = jsxWithValidation;
React.jsx = jsxWithValidationDynamic;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you consider moving .jsx and .jsxs up to Line 106?

  jsx: __DEV__ ? jsxWithValidationDynamic : jsx,
  jsxs: __DEV__ ? jsxWithValidationStatic : jsx,

and leave React.jsxDEV = jsxWithValidation; as it is here in this __DEV__ check

Just for consistency with createElement.

@sebmarkbage
Copy link
Collaborator

sebmarkbage commented Feb 13, 2020

This warning is enabled in jsx:

'React.jsx: Spreading a key to JSX is a deprecated pattern. ' +
'Explicitly pass a key after spreading props in your JSX call. ' +
'E.g. <ComponentName {...props} key={key} />',

This means that upgrading to future Babel plugins would enable this warning. Should we wait to enable this until later so it becomes part of a React upgrade instead of a Babel upgrade?

Edit: It's our top firing warning internally. That said, it's not that many unique callsites.

Edit 2: We need to at least dedupe this one. It's firing so much because it's not deduped.

@threepointone
Copy link
Contributor

The 'Spreading a key to JSX' warning is now behind a feature flag (#18074). Could we rebase and land this?

@lunaruan lunaruan changed the title Ship React.jsx and React.jsxDEV Put React.jsx and React.jsxDEV behind experimental build Mar 3, 2020
@lunaruan lunaruan merged commit 7e83af1 into facebook:master Mar 3, 2020
sthagen added a commit to sthagen/facebook-react that referenced this pull request Mar 3, 2020
Put React.jsx and React.jsxDEV behind experimental build (facebook#18023)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants