-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Added new JSX entry points for the automatic runtime #1970
Merged
Merged
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
d1c9bc6
re-export react jsx-runtime to test project config
4967f9c
minimal react playground app
6eeb60a
demonstrate w/o import
8d3d88e
ignore react in scope rule
23c7074
custom pragma end to end w/ react/jsx-runtime pass thru
0750e8f
dupe jsx for future rewriting, at least get React's jsx fallback when…
bcd6918
copy the CRA code over
338a0e8
Remove the minimal-react playground
Andarist 5dec9f1
Remove console.log
Andarist 09b5a55
Rename jsx-runtime entrypoint to jsx-runtime.js
Andarist 5b3250f
Add jsx-runtime.js to the publishable files
Andarist 82b44ba
Move createElement export to the root entry of @emotion/core
Andarist c471b94
Move configuration of the umdName to the @emotion/core package.json
Andarist 17680e7
Minor refactor in babel-preset-css-prop
Andarist 70f0969
Align the import source value to use the convention used in the outpu…
Andarist 6181943
Try to bump node version on CircleCI
Andarist 45b28c3
Refactor jsx runtimes so they share the css prop-related implementati…
Andarist faac259
Fixed an issue with label extraction from the stack of the bundles files
Andarist 5159b99
Merge branch 'master' into jsx-runtime
Andarist ed682ee
"fix" flow errors
emmatown a1cc40b
Add snapshot tests for the runtime option
Andarist 341b5a6
Disable react/react-in-jsx-scope rule
Andarist 733b6f7
Add basic runtime tests for new JSX runtimes
Andarist 23e68d3
Add UMD builds back to @emotion/core
emmatown 386b855
Remove .js suffix from our runtimes as per latest Babel revert
Andarist 2798e54
Add changesets
Andarist ad892cb
Update .changeset/nine-waves-play.md
emmatown 8f6271e
Merge branch 'master' into jsx-runtime
emmatown File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@emotion/core': minor | ||
--- | ||
|
||
Support for [the new JSX runtimes](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) has been added. They require compatible React versions and shouldn't be manually used. | ||
|
||
To use them you can use the new `@jsxImportSource @emotion/core` pragma instead of the old `@jsx jsx` or you can use `@emotion/babel-preset-css-prop` with `{ runtime: 'automatic' }` option to have it handled automatically for you for the whole project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@emotion/babel-preset-css-prop': minor | ||
--- | ||
|
||
A new `runtime` option has been added that can be configured to `'automatic'` to opt into [the new JSX runtimes](<(https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html)>). To use this a compatible React version has to be used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/babel-preset-css-prop/__tests__/__fixtures__/fragment.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export let Button = ({ loading, ...props }) => { | ||
return ( | ||
<> | ||
<button css={{ color: 'hotpink' }} {...props} /> | ||
{loading && <span>{'Loading...'}</span>} | ||
</> | ||
) | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/babel-preset-css-prop/__tests__/__fixtures__/key-after-spread.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export let Buttons = ({ buttons }) => { | ||
return ( | ||
<div> | ||
{buttons.map(({ id, label, ...rest }) => ( | ||
<button | ||
{...rest} | ||
key={id} | ||
css={{ | ||
color: 'hotpink' | ||
}} | ||
> | ||
{label} | ||
</button> | ||
))} | ||
</div> | ||
) | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/babel-preset-css-prop/__tests__/__fixtures__/no-static-children.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export let Button = props => { | ||
return ( | ||
<button | ||
css={{ | ||
color: 'hotpink' | ||
}} | ||
{...props} | ||
/> | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/babel-preset-css-prop/__tests__/__fixtures__/static-children.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export let Button = () => { | ||
return ( | ||
<button | ||
css={{ | ||
color: 'hotpink' | ||
}} | ||
> | ||
{'Test'} | ||
</button> | ||
) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
These don't actually exist but we still want UMD builds for Emotion so these are just to make it so Preconstruct can make a build