-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Migrate to React 19 #4409
Draft
aryaemami59
wants to merge
57
commits into
reduxjs:master
Choose a base branch
from
aryaemami59:migrate-to-react-19
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Migrate to React 19 #4409
Conversation
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
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 8fb2a7c:
|
✅ Deploy Preview for redux-starter-kit-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
aryaemami59
force-pushed
the
migrate-to-react-19
branch
from
May 16, 2024 11:57
ec60b9a
to
c1c42eb
Compare
aryaemami59
force-pushed
the
migrate-to-react-19
branch
from
June 21, 2024 12:22
60fa41a
to
48084da
Compare
aryaemami59
force-pushed
the
migrate-to-react-19
branch
7 times, most recently
from
August 27, 2024 14:19
ad370d1
to
9abb7ac
Compare
aryaemami59
force-pushed
the
migrate-to-react-19
branch
from
September 4, 2024 01:46
5cd1cad
to
29aea28
Compare
aryaemami59
force-pushed
the
migrate-to-react-19
branch
2 times, most recently
from
September 12, 2024 09:40
0d943ab
to
bc3b72b
Compare
- We set the `@types/react` and `@types/react-dom` package resolutions to `npm:types-react` and `npm:types-react-dom` according to the React 19 migration guide.
- According to latest documentation of `@testing-library/react`, `fireEvent` methods are already wrapped inside `act` calls making manual wrapping unnecessary.
- There currently seems to be an issue involving `sinon` fake timers used by `vitest`, `@testing-library/react` only supporting `jest` fake timers and `@testing-library/user-event` using `setTimeout` internally to simulate user actions such as button presses. Currently `@testing-library/react` only works with `jest` fake timers, which means if there are any component updates while `sinon` fake timers are running in `vitest` , `@testing-library/react` will not catch it and things start to break. - To workaround this issue, We have to setup the `user` by calling `userEvent.setup({ delay: null })`. The reason why We do this is because `@testing-library/user-event` uses `setTimeout` internally which cannot be awaited in a test while fake timers are running as it can cause the tests to indefinitely hang. So the current workaround is to disable the `delay` functionality of `userEvent` and prevent it from calling `setTimeout`. We also have to pass in `shouldAdvanceTime: true` to `vi.useFakeTimers()` as it can get around the issue of `@testing-library/react` not tracking `sinon` fake timers in `vitest`.
- Fixed test names in `fork.test.ts` which could cause the terminal to flicker in Windows.
- `.mockReset()` should not be called in spies since it calls `.mockClear()` and returns the implementation to its **initial** form. In this case it was silencing some of the `act` related warnings emitted by `@testing-library/react` which needed to be resolved since they were calling issues. So `.mockReset()` calls on spies need to be changed to `.mockRestore()` calls since `.mockRestore()` restores the implementation to its **original** form.
…iddleware.test.ts`
- This was done to make sure `toHaveBeenCalledWith` will fail if we pass in the wrong Error constructor. For example the assertion will now fail if we pass in an `Error` instead of a `TypeError`.
- This was done because it was causing the unit tests in example workspaces to fail.
aryaemami59
force-pushed
the
migrate-to-react-19
branch
from
September 13, 2024 22:37
bc3b72b
to
8fb2a7c
Compare
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR:
react
andreact-dom
to v19 beta.@types/react
and@types/react-dom
package resolutions tonpm:types-react
andnpm:types-react-dom
according to the React 19 migration guide.@testing-library/react
to latest version.@testing-library/user-event
to latest version.@testing-library/dom
.ReactDOM.render
calls with therender
function from@testing-library/react
as recommended in the React 19 migration guide.ReactDOM.unmountComponentAtNode
calls with thecleanup
function from@testing-library/react
as recommended in the React 19 migration guide.act
wrappers aroundfireEvent
method calls since they are already wrapped inact
calls.react
inpeerDependencies
to include version 19.console
spies.act
warnings emitted by@testing-library/react
.sinon
fake timers.