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
useInsertionEffect
when it's available
#2600
Merged
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
bc5265d
Upgrade React 18 to its latest RC version
Andarist 502ebbd
Refactored tests to RTL to run tests easier against different React v…
Andarist f88d21c
Add separate Jest config to run tests with React 18
Andarist 0f15058
Move rule insertion to the inner `<Insertion/>` for the css prop
Andarist f563929
Fixed Enzyme's shallow tests
Andarist 5722bc5
Make test pass with real `useInsertionEffect`
Andarist c8d4b33
Use `<Insertion/> and `useInsertionEffect` for all injection points i…
Andarist 5a98d24
Fixed import-prod test problem with production React 18 throwing when…
Andarist 9369f77
Refactor one last test that was using JSDOM explicitly
Andarist 7d118a3
Fixed CI
Andarist 2177c9a
Update packages/css/test/no-babel/index.test.js
emmatown f820725
Merge branch 'main' into use-insertion-effect
emmatown 7be5a95
add changesets
Andarist File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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,9 @@ | ||
const baseConfig = require('./jest.config.js') | ||
|
||
module.exports = Object.assign({}, baseConfig, { | ||
moduleNameMapper: { | ||
'^react($|\\/.+)': 'react18$1', | ||
'^react-dom($|\\/.+)': 'react18-dom$1', | ||
'^react-test-renderer($|\\/.+)': 'react18-test-renderer$1' | ||
} | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,52 +91,6 @@ exports[`hydration only inserts rules that are not in the critical css 3`] = ` | |
box-shadow: -15px -15px 0 0 aqua,-30px -30px 0 0 cornflowerblue; | ||
} | ||
|
||
@font-face { | ||
font-family: 'Patrick Hand SC'; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: local('Patrick Hand SC'),local('PatrickHandSC-Regular'),url(https://fonts.gstatic.com/s/patrickhandsc/v4/OYFWCgfCR-7uHIovjUZXsZ71Uis0Qeb9Gqo8IZV7ckE.woff2) format('woff2'); | ||
unicode-range: U+0100-024f,U+1-1eff,U+20a0-20ab,U+20ad-20cf,U+2c60-2c7f,U+A720-A7FF; | ||
} | ||
|
||
@keyframes animation-i9f7qw-bounce { | ||
from, 20%, 53%, 80%, to { | ||
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); | ||
transform: translate3d(0, 0, 0); | ||
} | ||
|
||
40%, 43% { | ||
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); | ||
transform: translate3d(0, -30px, 0); | ||
} | ||
|
||
70% { | ||
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); | ||
transform: translate3d(0, -15px, 0); | ||
} | ||
|
||
90% { | ||
transform: translate3d(0, -4px, 0); | ||
} | ||
} | ||
|
||
.no-prefix { | ||
display: flex; | ||
justify-content: center; | ||
} | ||
|
||
.some-key-14e1j2p-hoverStyles-Something_Main { | ||
color: hotpink; | ||
display: flex; | ||
} | ||
|
||
.some-key-14e1j2p-hoverStyles-Something_Main:hover { | ||
color: hotpink; | ||
background-color: lightgray; | ||
border-color: aqua; | ||
box-shadow: -15px -15px 0 0 aqua,-30px -30px 0 0 cornflowerblue; | ||
} | ||
|
||
.some-key-1h1w8ez-Image { | ||
animation: animation-i9f7qw-bounce; | ||
border-radius: 50%; | ||
|
@@ -157,9 +111,7 @@ exports[`renderStylesToString renders large recursive component 1`] = ` | |
> | ||
.some-key-127stik{color:hotpink;} | ||
</style> | ||
<div class="some-key-127stik" | ||
data-reactroot | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is a comment somewhere about this - React 18 is not using this attribute any longer (I'm still confirming this with React 18 Working Group), so I'm normalizing this to avoid snapshot mismatched between versions |
||
> | ||
<div class="some-key-127stik"> | ||
woah there | ||
<span> | ||
hello world | ||
|
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
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.
those were duplicated in the snapshot - I'm not entirely sure why, but the test setup here (and in other 3 tests that very similar) was a little bit convoluted, with using JSDOM manually etc. I've migrated those tests to
disableBrowserEnvTemporarily
strategy and this has "fixed" the problem accidentally.