-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
fix: compatibility with react 19 in snapshots #15729
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
base: main
Are you sure you want to change the base?
Conversation
|
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
babel-jest
babel-plugin-jest-hoist
babel-preset-jest
create-jest
@jest/diff-sequences
expect
@jest/expect-utils
jest
jest-changed-files
jest-circus
jest-cli
jest-config
@jest/console
@jest/core
@jest/create-cache-key-function
jest-diff
jest-docblock
jest-each
@jest/environment
jest-environment-jsdom
@jest/environment-jsdom-abstract
jest-environment-node
@jest/expect
@jest/fake-timers
@jest/get-type
@jest/globals
jest-haste-map
jest-jasmine2
jest-leak-detector
jest-matcher-utils
jest-message-util
jest-mock
@jest/pattern
jest-phabricator
jest-regex-util
@jest/reporters
jest-resolve
jest-resolve-dependencies
jest-runner
jest-runtime
@jest/schemas
jest-snapshot
@jest/snapshot-utils
@jest/source-map
@jest/test-result
@jest/test-sequencer
@jest/transform
@jest/types
jest-util
jest-validate
jest-watcher
jest-worker
pretty-format
commit: |
d0d571d
to
793988e
Compare
793988e
to
26a3968
Compare
I tried to create This change would make this PR breaking and it would also have incomplete support for older React versions. I am leaving this PR open if somebody can give some hint about how to approach this problem, but right now, I am not sure how to accomplish full support for both React 18 and 19 at the same time. Btw. Amazing testing coverage, the problem got discovered right away. |
I'd really prefer us not to take on the responsibility of maintaining this code. It will get out of sync more often than we think, and then we have to figure out the compatibility story each time. Is there no way we can use react-is 19, and add a bunch of things around it so it correctly identifies pre react 19 elements? |
I don't really see a way to do this without having a custom implementation. Actually, I don't even see a way how to do this with a custom implementation, that will stay compatible with multiple major React versions. In the beginning, I thought I can simply extend the Right now, I would just wait for React v19 to be more widely used and then switch to it with next major release. If some people still use React v18, then they need to add the overrides configuration to their project -> #15402 (comment) The only thing I am worried about is future React releases. If there is such a strong link between Jest and React versions, then this issue will keep reoccurring. We could also make We could also try to identify what react version is installed and select proper react-is implementation somehow, but I don't see an easy way how to do this. I have no good solutions here. |
Summary
Remove
react-is
dependency in favor of custom implementation, which is compatible with both React 18 and React 19.Resolves #15402
Test plan