cypress icon indicating copy to clipboard operation
cypress copied to clipboard

Update react/mount to point to react18 mount

Open rockindahizzy opened this issue 1 year ago • 2 comments

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.

rockindahizzy avatar Oct 06 '22 21:10 rockindahizzy

Hey team! Please add your planning poker estimate with Zenhub @amehta265 @astone123 @lmiller1990 @marktnoonan @mike-plummer @rockindahizzy @warrensplayer @ZachJW34

baus avatar Oct 25 '22 13:10 baus

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
  • ???

lmiller1990 avatar Nov 23 '22 02:11 lmiller1990

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:

  1. text based migration guide (most users will hit a confusing error, and have to find this)
  2. use migration UI (a bit time consuming to design + implement, but a vastly better experience
  3. 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.

lmiller1990 avatar Nov 30 '22 23:11 lmiller1990

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.

lmiller1990 avatar Feb 24 '23 04:02 lmiller1990