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

build(react/remix): Use new jsx JSX transform instead of React.createElement #12204

Merged
merged 2 commits into from
May 24, 2024

Conversation

lforst
Copy link
Member

@lforst lforst commented May 24, 2024

Resolves #11932

React 17 (backported to React 16) introduced a new jsx transform. React 19 will emit a warning if the old transform is used. This PR switches us over to the new jsx transform.

Includes the following changes:

  • Vendors in the rollup sucrase plugin. The published version does not have the option to pass in what jsx runtime should be used.
  • Splits up the options of the vendored rollup sucrase plugin so that sucrase options can be passed in separately.
  • Uses the new "automatic" runtime for the react and remix SDKs.
  • Uses the old "classic" runtime for the Feedback integration (based on preact).

Copy link
Contributor

github-actions bot commented May 24, 2024

size-limit report 📦

Path Size
@sentry/browser 21.74 KB (0%)
@sentry/browser (incl. Tracing) 32.88 KB (0%)
@sentry/browser (incl. Tracing, Replay) 68.25 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 61.66 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 72.28 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) 84.33 KB (0%)
@sentry/browser (incl. Feedback) 37.75 KB (0%)
@sentry/browser (incl. sendFeedback) 26.31 KB (0%)
@sentry/browser (incl. FeedbackAsync) 30.73 KB (0%)
@sentry/react 24.43 KB (+0.01% 🔺)
@sentry/react (incl. Tracing) 35.89 KB (+0.05% 🔺)
@sentry/vue 25.68 KB (0%)
@sentry/vue (incl. Tracing) 34.7 KB (0%)
@sentry/svelte 21.88 KB (0%)
CDN Bundle 24.28 KB (0%)
CDN Bundle (incl. Tracing) 34.35 KB (0%)
CDN Bundle (incl. Tracing, Replay) 68.04 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) 73.03 KB (0%)
CDN Bundle - uncompressed 71.46 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 101.87 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 211.5 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 223.85 KB (0%)
@sentry/nextjs (client) 35.14 KB (0%)
@sentry/sveltekit (client) 33.48 KB (0%)
@sentry/node 114.32 KB (-0.01% 🔽)
@sentry/aws-serverless 103.2 KB (0%)

@lforst lforst marked this pull request as ready for review May 24, 2024 09:28
@lforst lforst requested a review from a team as a code owner May 24, 2024 09:28
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Nice

I wonder if with React 19 we have to pre-compile the library code with the new compiler as well.

@lforst
Copy link
Member Author

lforst commented May 24, 2024

I wonder if with React 19 we have to pre-compile the library code with the new compiler as well.

We could probably use the compiler but in general I would argue that this is a user concern, since we would be influencing how often user-code rerenders. We definitely don't have to.

@lforst lforst merged commit 805c577 into develop May 24, 2024
102 checks passed
@lforst lforst deleted the lforst-new-react-jsx branch May 24, 2024 10:17
andreiborza added a commit that referenced this pull request Jul 5, 2024
…g react 17 (#12775)

Undoes some of the changes in
#12204 and
#12740 to fix
#12608.
andreiborza added a commit that referenced this pull request Jul 5, 2024
Adds a react 17 test app so we can hopefully catch breaking react 17, as
we did recently
(#12608) with
#12204 and
#12740.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Outdated JSX transform
2 participants