-
Notifications
You must be signed in to change notification settings - Fork 894
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
Upgrade to Yarn 4 #21345
base: trunk
Are you sure you want to change the base?
Upgrade to Yarn 4 #21345
Conversation
@igorschoester Please be aware that following packages have been abandoned and are not actively maintained anymore:
Please consider using the other packages instead. |
ca3b242
to
437a80c
Compare
Pull Request Test Coverage Report for Build 587e72c0edd016c85999e7a649dd4a649bb979b1Details
💛 - Coveralls |
Yarn 4 removed pre- and post- lifecycle scripts: https://yarnpkg.com/advanced/lifecycle-scripts
* tweak lint to use .eslintignore file instead of only running in the src and tests folders * use `@yoast/analysis-report` from this repo instead of NPM (by aligning the version)
Move lint ignore to separate file
* upgrade @wordpress/components to WP 6.4 version, fixes a test failing on UUID sub dependency having require * move lint ignore to separate file
* add own config * auto-fix comma-dangle
* add own config * auto-fix comma-dangle
* rename clean:build to clean, inline with the other packages * prefix node commands with yarn, as per their recommendedation when using PnP linking mode: https://yarnpkg.com/migration/pnp#enabling-yarn-pnp * switch to lint all vs just src (ignore missing test deps) * add missing jest jsdom, even though tests are disabled
* introducing ignore file * tune the max warnings to the current number
* move to JS format * remove exceptions * change react to detect * add css/dist/ to ignore list * auto-fix comma-dangle
* starting with the upgrade in our jest-preset * upgrade the other packages to match * fixes needed, coming in next commits
* an error would result in an infinite loop: add url = false * an error would not result in the error being displayed: add wait for next cycle * the above fixes the indexation tests
* missing act * the closing would result in further state changes that were not captured by the fireEvent.click * solution: wrap next check in waitFor
* remove the UI library source from the module mapping, it is expected to run build before test instead * remove different node_module overrides * add WP i18n to the module mapping to ensure a singleton, this fixes the text-domain warnings
* see https://lerna.js.org/docs/concepts/task-pipeline-configuration * upgrade lerna * ran lerna repair * specify ignore cache in grunt tasks, just to ensure no change there * add clean task (handy for cache busting too) * alphabetize scripts
* skipping preset upgrades - lets not require minor upgrades * feature-flag: remove unused babel plugins
* align versions * fix missing tailwindcss in root * fix wrong tailwindcss/forms version (not as per postcss-preset requirement)
* remove unused from JS * add missing webpack peer dep to UI lib
* move to actual deps: @yoast/helpers and styled-components * remove unused json dep * add peer deps: react and react-dom * add browserslist config to extend the yoast config
* @reduxjs/toolkit requires react-redux 7 or 8 * react-redux 8 requires redux 4 * remove redux-thunk and unused script that was using it
* add react and react-dom to root, to satisfy peer deps * remove unused @testing-library/react-hooks, warned about wanting older version of react-renderer (16.9.0 or 17.0.0 vs actual 18.2.0)
* required by grunt-contrib-clean, grunt-shell and grunt-git * update grunt-git to work with grunt 1.6.1
* because it supports React 18 * turns out the close on click outside error is fixed too: * removing shouldCloseOnClickOutside false for: SearchAppearanceModal, SocialAppearanceModal, SEMrushRelatedKeyphrasesModal, WincherSEOPerformanceModal (Elementor) and InsightsModal (Elementor)
* not using React 18 (but 16 at the latest)
* inactive package since 5 years * still requiring React 16.3.x * moving over to already used WP a11y' speak * adding a hook and wrapper component for ease of use, as per downside of original PR: #19615
* due to warning about React 18 (package was using 17 before)
* was requiring old React version (via react-test-renderer) * not really used at the moment
(or packages provided by WP) * trigger was some requiring older React version -- not totally solved yet: * WP components at WP 6.5 version will solve Reakit * WP block-editor still requires react-autosize-textarea, which is archived since March 1, 2024 * WP compose and WP data still use use-memo-one 1.1.2 or 1.1.1 where 1.1.3 has React 18 support * we are not providing these packages in our plugin, so this is only affecting testing and development
* no more transform ignore or mapping of Yoast packages or lodash-es * remove unused find-with-regex * fix test import of lodash-es to use lodash
* they are required as peer deps by @yoast/style-guide now * and it makes a bit more sense that it is actually used, even though it is mostly indirectly via WP element
* using versions from @yoast/grunt-plugin-tasks range to prevent potential problems * fixing version of @yoast/grunt-plugin-tasks
There are no tests in the root folder
437a80c
to
8ae6c68
Compare
@igorschoester Please be aware that following packages have been abandoned and are not actively maintained anymore:
Please consider using the other packages instead. |
* ran: yarn constraints --fix * for packages where repo was new, I moved them to above the scripts
Within the monorepo we want to use the current version. And the range should be auto-changed to the current version when publishing. Using this we prevent potential forgetting to bump versions (as was already the case in this PR). See: https://yarnpkg.com/features/workspaces#cross-references
* bump packages to highest used variant * js-yaml * refactor `safeLoad` to `load` as per migration guide: https://github.com/nodeca/js-yaml/blob/master/migrate_v3_to_v4.md * test => linting still works * react-animate-height * refactor `onAnimationEnd` to `onHeightAnimationEnd` as per changelog: https://github.com/Stanko/react-animate-height/blob/v3/CHANGELOG.md#v300-v303 * test => FTC step animation and FTC FadeInAlert
Not sure if adding it here is the best option. However, we already have the dependencies here and this is coding standards too.
@igorschoester Please be aware that following packages have been abandoned and are not actively maintained anymore:
Please consider using the other packages instead. |
Context
Summary
This PR can be summarized in the following changelog entry:
clean:build
script toclean
.lodash-es
exceptions from thetransformIgnorePatterns
.jest
peer dependency from version^27.5.1
to^29.7.0
.jest-environment-jsdom
with version^29.7.0
as peer dependency.Relevant technical choices:
Based the branch on the
yoast-components
removal branch (#21344). As that probably helps skipping some old dependencies.Add Yarn 4
.yarnrc
and.yarn
to be able to set to use Yarn 4yarn set version berry
, which made the above's Yarn 4 variantsnohoist
removal which is no longer supported (and unused anyway -- we don't have that dependency).yarnrc.yml
The commits that follow are based on output from yarn install or what I came across trying the scripts in each package
Rename UI library
clean:build
toclean
as our other packages have that insteadRan into problems with the Indexation tests, seems it won't behave nicely with React 18 still is my best guess. So I refactored it: c5320d8
Might be some scope creep while I was there:
yarn test --scope @yoast/wordpress-seo
instead ofcd packages/js && yarn test
)Add Yarn constraints
Constraints allow enforcement of rules across workspace packages. See their documentation.
repository
inpackage.json
-- we had old references in there still87c53b8
Within the monorepo we want to use the current version. And the range should be auto-changed to the current version when publishing.
Using this we prevent potential forgetting to bump versions (as was already the case in this PR).
See: https://yarnpkg.com/features/workspaces#cross-references
safeLoad
toload
as per migration guideonAnimationEnd
toonHeightAnimationEnd
as per changelogTest instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Test all the things 😅
But here are some specific areas:
Site features
toSite basics
) should announce the name (e.g.Site basics Settings - Yoast SEO
)#a11y-speak-polite
changes to it (inner workings of WP a11y)Relevant test scenarios
Test instructions for QA when the code is in the RC
QA can test this PR by following these steps:
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
UI changes
Other environments
[shopify-seo]
, added test instructions for Shopify and attached theShopify
label to this PR.Documentation
Quality assurance
Innovation
innovation
label.Fixes #