cypress
cypress copied to clipboard
Update react/mount to point to react18 mount
Current behavior
Currently react/mount points to the component mount that works for react <=17.
Desired behavior
As part as our evergreen strategy with Cy 11 we want react/mount to point the the react18/mount. We should leave react18/mount so that there are no dead ends.
Hey team! Please add your planning poker estimate with Zenhub @amehta265 @astone123 @lmiller1990 @marktnoonan @mike-plummer @rockindahizzy @warrensplayer @ZachJW34
I will pick this up.
Things to consider
- ensure onboarding is all updated and working as expected
- no dead ends - -react18 should still work, react should throw an error "This library works with React 18. If you have an older version, use cypress/react17"
- npm major version bump for cypress/react
- ???
After the initial implementation in https://github.com/cypress-io/cypress/pull/24832 we found that there isn't a good way to error and inform users to move from cypress/react
to cypress/react17
- the bundler will error, and we can't catch it. Once updating to Cy 12, React users will hit https://user-images.githubusercontent.com/19196536/204223887-21a00218-491c-48a0-bd90-000edcb41ff0.png which is not great.
We'd need to write a bundler-specific plugins to catch this error. We tried something similar when we tried supporting React 17 & 18 with the same adapter, it proved to be quite complex and not very reliable.
The options are:
- text based migration guide (most users will hit a confusing error, and have to find this)
- use migration UI (a bit time consuming to design + implement, but a vastly better experience
- deviate from evergreen strategy (this would mean our adapters naming becomes inconsistent).
We decided not to rush this prior to Cy 12, but revisit it once we've thought about it more and talked to Brian.
We decided we wouldn't do this -- too disruptive. We do scaffold react18
by default for new, React 18 projects. Since we have no planned work on this, I'll close it.