-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
feat(gatsby): Support React 17's new JSX Transform #26652
Conversation
Gatsby Cloud Build Reportusing-reach-skip-nav 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 21s PerformanceLighthouse report
|
Gatsby Cloud Build Reportclient-only-paths 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 18s PerformanceLighthouse report
|
Gatsby Cloud Build Reportusing-styled-components 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 20s PerformanceLighthouse report
|
Gatsby Cloud Build Reportgatsby 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 22m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks Blaine! Left a few comments
72d1138
to
357a858
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! Nice work, I fixed some review things myself to get it merged.
Great work! |
@marcobiedermann I noticed the same thing. @blainekasten Do you have any suggestion? We might be able to contribute. |
Description
React has a new JSX transformation setup. See the blog post here.
Dan Abramov and Luna Ruan from the React core team reached out and asked if we could add support for it and that is what this PR does!
To test it out you can install
gatsby@jsx-transform
From initial tests, if you have React 17 installed in your gatsby project, you are able to omit the classic
import React from 'react'
statement with this new transform. And if you use React 16, the old functionality of requiring that import is still in place.Future:
runtime: automatic
all the timeDocumentation
This really shouldn't matter for the end user. It's just a code transformation optimization.
Related Issues