react-terminal
react-terminal copied to clipboard
Update to React 18
Changes
To insure compatibility with React 18 (both in development and production), this PR:
- Removes Enzyme libraries and use directly
react-test-renderer
(updated) - Jest has been updated to version 28, which provoked ts-jest and then typescript to be updated as well
Suggestions
Remove the npm-install-peers
package and include react
and react-dom
as developement dependencies, as suggested by the package's maintainers: it would make installing peer dependencies easier for contributors, since they will all be managed by yarn/npm in one step.
@raaaahman π Thanks for the PR. I have changed the main branch to develop to test out the changes but looks like there are some conflicts. Can you please resolve them?
After working on updating the packages, I didn't find a configuration that works for both React 17 AND React 18: The issue is the react-test-renderer
package that can only work with one or another.
Fortunately, this is just about development dependencies, but installing the package with the --legacy-peer-deps
flag is totally viable in a React 18 app at the moment.
So it all depends on whether you'd like continue the development in a React 17 or 18 environment.
Maybe then, adding your preferred development version in the devDependencies and specifying react@^17.0.2 || ^18.1.0
would be all it takes to allow installing it without the --legacy-peer-deps
flag?
Ah I see. I believe we can get this PR ready to only work with React 18. Letβs make this compatible with latest React version.
Here, I rebased my work on your latest develop
commit. Not sure if this is worth it though, since the example run in React 18 pretty well.
Maybe all you need is to update the readme to say that it needs the --legacy-peer-deps
flag to be installed through npm?
Another solution would be to move the React 17.0.2 dependency in the dev dependencies, and put react@>=17.0.2 in the peer dependencies? So you would be running React 17 in development, and React 17 || 18 in production, without NPM warnings...
Tell me if this last solution interests you, I might try to implement it (this would replace this PR though).
Closing this as the package was recently updated to support react 18