-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
useInsertionEffect
when it's available (#2600)
* Upgrade React 18 to its latest RC version * Refactored tests to RTL to run tests easier against different React version, also run test suite with React 18 * Add separate Jest config to run tests with React 18 * Move rule insertion to the inner `<Insertion/>` for the css prop * Fixed Enzyme's shallow tests * Make test pass with real `useInsertionEffect` * Use `<Insertion/> and `useInsertionEffect` for all injection points in `@emotion/react` and `@emotion/styled`` * Fixed import-prod test problem with production React 18 throwing when used with RTL cause it's using act * Refactor one last test that was using JSDOM explicitly * Fixed CI * Update packages/css/test/no-babel/index.test.js * add changesets Co-authored-by: Mitchell Hamilton <mitchell@hamil.town>
- Loading branch information
Showing
50 changed files
with
865 additions
and
983 deletions.
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,6 @@ | ||
--- | ||
'@emotion/react': minor | ||
'@emotion/styled': minor | ||
--- | ||
|
||
Refactored code to use the upcoming `React.useInsertionEffect` when it's available (this is a new hook that is going to be introduced in React 18). This shouldn't have any effect on existing codebases and the change should be transparent. |
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/utils': minor | ||
--- | ||
|
||
Introduced `registerStyles` helper that is shared across between other packages. This is just an internal util that shouldn't be used by packages other than `@emotion/*` packages. |
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/jest': patch | ||
--- | ||
|
||
Adjusted Enzyme-related code path to accomodate for changes related to the refactor around using `React.useInsertionEffect`. |
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
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.