Upgrading to React 17 #2301
Replies: 6 comments 4 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Can the focus of this discussion be specifically on what it would take to migrate away from Enzyme and what the alternatives are? The issue isn't upgrading React 17. We know we need and want to do that. The issue is the waning support of Enzyme and the impact that is having on test writing and support. |
Beta Was this translation helpful? Give feedback.
-
Ok, so let's be focused on what we want to do. The options as it seems to me is going to be:
In the past a strategy we've tried to do is write new things with the new library or tool and swap over old things when we need to make edits, but I think that usually results in a hybrid that never gets finished. What I'm going to suggest since many (all?) of us are wrapping up development cycles on certain feature sets right now is to have a focus week on just doing a conversion from enzyme to react-testing-library, see how far we get, and then evaluate how to go from there: maybe schedule another maintenance focus week with the whole team in the near future or swap to the gradual approach. |
Beta Was this translation helpful? Give feedback.
-
Since #2281 has been merged & deployed due to an urgent security fix, how do we archive this discussion, or set it as resolved? (I see "lock conversation" and "delete discussion" in the menu.) For those just coming in to this thread, since the last on 14 Jul...
|
Beta Was this translation helpful? Give feedback.
-
Visx officially supports React 17 now, so we should probably upgrade. airbnb/visx#1268 |
Beta Was this translation helpful? Give feedback.
-
React 18 is out of beta now, and the This gives a useful overview of the background and context. There's an interesting quote from Rachel Nabors, in that article. Maybe we should discourage class components in new code?
|
Beta Was this translation helpful? Give feedback.
-
Next 11 came out in June, and requires React 17 as a minimum. I've opened #2281 for the upgrade.
React 17 was released in October 2020 and adds no new features to React. It's a stepping stone, intended to make it easier to gradually upgrade to future versions of React. React 18 was announced a couple of weeks ago, and does include changes that we're probably going to need for SSR. 18 is out in alpha now, so that library authors can work on upgrades.
We use enzyme to test React components. An enzyme adapter for React 17 was started in August 2020 (when React 17 was first released) but is still in development. The enzyme adapter is the work of a single person, and they have publicly asked for help to complete it. In the interim, an unofficial adapter is available. The developer of the unofficial adapter has said that their adapter will only be supported until the official adapter is available. They are also working on the PR to release an official adapter.
I've used the unofficial React 17 adapter in #2281, but opened this discussion to talk about whether we continue to use enzyme, or move to another testing library eg. React Testing Library.
Beta Was this translation helpful? Give feedback.
All reactions