Chore/moose 382/package updates#348
Conversation
…ts between ` @dnd-kit/core` and `@wordpress/icons`.
| "wp-cli/wp-cli-bundle": "^2.12", | ||
| "wpackagist-plugin/disable-emojis": "^1.7", | ||
| "wpackagist-plugin/duplicate-post": "^4.5", | ||
| "wpackagist-plugin/limit-login-attempts-reloaded": "^2.26", |
There was a problem hiding this comment.
This will be removed in #342 / MOOSE-187 as well. So, rather than updating, I removed here.
| @@ -1,18 +1,19 @@ | |||
| import * as React from 'react'; | |||
There was a problem hiding this comment.
I rant the icon-picker npm script to confirm the icons are being generated after the respective package update. You can safely ignore the changed JS files in this directory.
| "peerDependencies": { | ||
| "react": "^18.3", | ||
| "react-dom": "^18.3" | ||
| }, |
There was a problem hiding this comment.
Pinning React to v18 to resolve a conflict between @dnd-kit/core wanting v19 and and @wordpress/icons wanting v18.
There was a problem hiding this comment.
I've seen this pattern used more for React/React Native repos in open source libs than the overrides key in #323 @LayaTaal @dpellenwood but I don't know which would technically be better either.
LayaTaal
left a comment
There was a problem hiding this comment.
Hey @dpellenwood I was looking into this some and it looks like @dnd-kit has a new major release that I think will solve our problems altogether with the React version mismatch. The new version supports React 18 and 19. We will need to update our imports some to use it, though.
@LayaTaal Hmm... As I understand it, dbd-kit already supported both versions of React, but since it installed first and required v19 or v18, v19 got installed since we didn't specify, which then caused conflicts with the icons package. Ans actually, after playing with this some more, I reverted to using overrides and added a couple more packages to resole some security warnings on install. This gives us a 100% clean |
That works for me and I do think overrides makes more sense here than peer dependencies. For dnd-kit, that issue I recall is that the version we are installing had a loose React requirement of the latest version above 16, which would default to 19. But the newest version of dnd-kit specifically requires 18 or 19. The new version of dnd-kit is namespaced different than what we are importing, for example |
Gotcha! It's weird b/c the new version has complete changed the version numbering, too. It doesn't show as an available update when running |
What does this do/fix?
@dnd-kit/coreand@wordpress/icons@LayaTaal this is an alternative approach to #323 . I'm not sure which one is better, tbh. I was really hoping that WP Core would support React 19 by now, but it looks like that won't happen until v7.1 at the earliest [sigh].
QA
Links to relevant issues
Pull request checklist