-
Notifications
You must be signed in to change notification settings - Fork 192
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
Support React 18 as a peer dependency #312
Conversation
Based on #293, it appears this package works fine with React 18
This resolves a whole bunch of warnings and build issues from using out of date packages. Became sort of necessary when we couldn't npm install anymore because our out-of-date node-sass version demanded Python v2.
We've expanded our peer dependencies to allow React 18. This isn't really a breaking change, but usage of this with React >16 is under-tested. So we're going to do a major version bump so that any projects that depend on this package don't implicitly pick up this new version, resolve to a different version of React, and suddenly find old things not working. Also, we revamped the build code and there are minor compiler / TypeScript-ish changes there, so a little extra caution feels warranted.
@@ -1,3 +1,7 @@ | |||
/** | |||
* @jest-environment jsdom | |||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is admittedly weird, but this directive is needed because @nteract/mockument
is loaded before every Jest test (and it's doing a few setup things that even the server version of this package seems to dpeend on).
In an ideal world, we'd probably remove this and put a little more thought into what the server-side rendering environment looks like.
this.uCallback = sinon.spy(next); | ||
this.uCallback(); | ||
uCallback = sinon.spy(next); | ||
uCallback(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TypeScript doesn't like this floating this
(which ends up referring to window
, which is how the tests previously passed).
@@ -192,7 +213,9 @@ describe('DOM Events', () => { | |||
expect(onFocus).toBeTruthy(); | |||
done(); | |||
}} | |||
/>); | |||
/>, | |||
{ attachTo: container } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Focus-related Enzyme tests don't work without being attached to an actual DOM element in the document.
The immediate goal of this PR is to bump the peer dependency of this to support React 18. Per #293 (and as far as I can tell), it shuld work.
But the build dependencies and CI integration for this package are very out of date, so we had to update a whole bunch of other things just to get here.
rQIb4Vw.mp4
As part of this PR, we also bump the package version to v8. It technically shouldn't be necessary for a major version bump just to support React 18, but this integration is sort of undertested with v18. So we're doing a major version bump to force folks to explicit bump what they have rather than just bringing it in by default and maybe seeing things subtly breaking unexpectedly.