-
Notifications
You must be signed in to change notification settings - Fork 31
Clean up and update node & packages #1109
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
Open
gabrielcld2
wants to merge
20
commits into
develop
Choose a base branch
from
update/node-packages
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Approach
Package upgrades exceptions
Some packages couldn't be upgraded to the latest due to specific dependencies:
eslintcannot upgrade to version 9 yet due to@wordpress/eslint-pluginnot being compatible with that version. See herereactcannot be upgraded to version 19 at the moment as the wordpress packages don't support it:Manual code changes
Problem: we use tippy.js for any on hover tips displayed. This works fine as a standalone. However, we also used a a react wrapper for that library in situations we needed it in React (only one case actually). That wrapper isn't maintained anymore, and doesn't support React 18.
The easiest approach I found was to write a new custom hook so that we can keep using the tippy library, but we can remove the react wrapper library for it.
CodeMirror is used to display JSON content in an editor view. CodeMirror version 6 is vastly different than previous version: the library is split into several separate packages and works in a different way.
I've managed to make it work with a small caveat:
The theme is slightly different. The previous one (material dark) isn't available in CodeMirror 6. There is an unofficial package for it, but the output still looks different (different font sizes and weight), so I think it's better to stick to an official package which is also a dark theme.
It now looks like this:
QA notes
nvm useto use node v22 (you might need to install it if you don't have it already on your machine)npm installto install the dependenciesnpm outdatedto check all packages are up-to-date (minus the exceptions mentioned previously)npm run buildto build the assets