Make WordPress Core

Opened 8 months ago

Closed 3 months ago

Last modified 15 hours ago

#64968 closed task (blessed) (fixed)

Update/Audit NPM Dependencies for 7.1

Reported by: desrosj Owned by:
Priority: normal Milestone: 7.1
Component: Build/Test Tools Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

Previously:

Change History (19)

This ticket was mentioned in ​PR #11954 on ​WordPress/wordpress-develop by ​@khokansardar.


6 months ago
#1

  • Keywords has-patch added

This updates the following devDependencies for WP 7.1:

Package Previous Version New Version
@playwright/test 1.58.2 1.60.0
@wordpress/e2e-test-utils-playwright 1.42.0 1.46.0
@wordpress/prettier-config 4.42.0 4.46.0
@wordpress/scripts 31.7.0 32.2.0
autoprefixer 10.4.27 10.5.0
cssnano 7.1.3 7.1.9
dotenv 17.3.1 17.4.2
grunt 1.6.1 1.6.2
grunt-legacy-util ~2.0.1 2.0.2
php-array-reader 2.1.3 2.1.4
postcss 8.5.8 8.5.15
react-refresh 0.14.0 0.18.0
sass 1.98.0 1.100.0
terser-webpack-plugin 5.4.0 5.6.0
wait-on 9.0.4 9.0.10
webpack 5.105.4 5.107.1

Additionally, npm audit fix and npm dedupe have been run.

#2 @desrosj
4 months ago

In 62743:

Build/Test Tools: Update npm devDependencies.

This updates the following npm devDependencies to their latest versions:

  • @playwright.test from 1.58.2 to 1.61.1
  • @types/node from 20.19.41 to 20.19.43
  • @wordpress/e2e-test-utils-playwright from 1.42.0 to 1.51.0
  • @wordpress/prettier-config from 4.42.0 to 4.51.0
  • @wordpress/scripts from 31.7..0 to 33.0.0
  • autoprefixer from 10.4.27 to 10.5.3
  • cssnano from 7.1.3 to 7.1.9
  • dotenv from 17.3.1 to 17.4.2
  • dotenv-expand from 12.0.3 to 13.0.0
  • grunt from 1.6.1 to 1.6.2
  • grunt-legacy-utils from 2.0.1 to 2.0.2
  • php-array-reader from 2.1.3 to 2.1.4
  • postcss from 8.5.8 to 8.5.19
  • qunit from 2.25.0 to 2.26.0
  • sass from 1.98.0 to 1.101.0
  • typescript from 5.9.3 to 6.0.3
  • uuid from 13.0.0 to 14.0.1
  • wait-on from 9.0.4 to 9.0.10
  • webpack from 5.105.4 to 5.108.4

The terser-webpack-plugin was also renamed to minimizer-webpack-plugin and updated from 5.4.0 to 5.6.1.

npm audit fix has also been run.

See #64968.

#3 @sabernhardt
4 months ago

Theme packages:

Package Version in themes Latest version Themes
@wordpress/browserslist-config ^6.34.0 6.51.0 T19, T20, T21, T22, T25
@wordpress/eslint-plugin ^22.20.0 25.7.0 T21
@wordpress/scripts ^30.27.0 33.0.0 T20
@wordpress/stylelint-config ^21.30.0 24.0.0 T21
autoprefixer ^10.4.22 10.5.3 T19, T20, T21
chokidar-cli ^3.0.0 no change T19, T21
concurrently ^9.2.1 10.0.3 T20
cssnano ^7.1.2 7.1.9 T22, T25
eslint ^8.57.1 10.7.0 T21
minimist ^1.2.8 no change T21
node-sass ^9.0.0 deprecated T19
npm-run-all ^4.1.5 no change T19, T21
postcss ^8.5.6 8.5.19 T19, T20, T21, T22, T25
postcss-calc ^10.1.1 no change T21
postcss-cli ^11.0.1 no change T19, T20, T21, T22, T25
postcss-css-variables ^0.19.0 no change T21
postcss-custom-media ^11.0.6 12.0.1 T21
postcss-discard-duplicates ^7.0.2 8.0.1 T21
postcss-discard-empty ^7.0.1 8.0.1 T21
postcss-focus-within ^9.0.1 10.0.0 T19, T21
postcss-merge-rules ^7.0.7 8.0.1 T21
postcss-nested ^7.0.2 no change T21
rtlcss ^4.3.0 no change T19, T20, T21
sass ^1.83.0 1.101.0 T21
stylelint ^14.16.1 17.14.0 T21
stylelint-a11y ^1.2.3 no change T20
stylelint-config-recommended-scss ^16.0.2 17.0.1 T21

Twenty Twenty-Five and Twenty Twenty-Two have 3 updates available, and I think those two themes should be updated.

        "devDependencies": {
-               "@wordpress/browserslist-config": "^6.34.0",
-               "postcss": "^8.5.6",
+               "@wordpress/browserslist-config": "^6.51.0",
+               "postcss": "^8.5.19",
                "postcss-cli": "^11.0.1",
-               "cssnano": "^7.1.2"
+               "cssnano": "^7.1.9"
        },

Twenty Twenty-One has 14 updates available.

        "devDependencies": {
-               "@wordpress/browserslist-config": "^6.34.0",
-               "@wordpress/eslint-plugin": "^22.20.0",
-               "@wordpress/stylelint-config": "^21.30.0",
-               "autoprefixer": "^10.4.22",
+               "@wordpress/browserslist-config": "^6.51.0",
+               "@wordpress/eslint-plugin": "^25.7.0",
+               "@wordpress/stylelint-config": "^24.0.0",
+               "autoprefixer": "^10.5.3",
                "chokidar-cli": "^3.0.0",
-               "eslint": "^8.57.1",
+               "eslint": "^10.7.0",
                "minimist": "^1.2.8",
                "npm-run-all": "^4.1.5",
-               "postcss": "^8.5.6",
+               "postcss": "^8.5.19",
                "postcss-calc": "^10.1.1",
                "postcss-cli": "^11.0.1",
                "postcss-css-variables": "^0.19.0",
-               "postcss-custom-media": "^11.0.6",
-               "postcss-discard-duplicates": "^7.0.2",
-               "postcss-discard-empty": "^7.0.1",
-               "postcss-focus-within": "^9.0.1",
-               "postcss-merge-rules": "^7.0.7",
+               "postcss-custom-media": "^12.0.1",
+               "postcss-discard-duplicates": "^8.0.1",
+               "postcss-discard-empty": "^8.0.1",
+               "postcss-focus-within": "^10.0.0",
+               "postcss-merge-rules": "^8.0.1",
                "postcss-nested": "^7.0.2",
                "rtlcss": "^4.3.0",
-               "sass": "^1.83.0",
-               "stylelint": "^14.16.1",
-               "stylelint-config-recommended-scss": "^16.0.2"
+               "sass": "^1.101.0",
+               "stylelint": "^17.14.0",
+               "stylelint-config-recommended-scss": "^17.0.1"
        },

Twenty Twenty has 5 updates available.

        "devDependencies": {
-               "@wordpress/browserslist-config": "^6.34.0",
-               "@wordpress/scripts": "^30.27.0",
-               "autoprefixer": "^10.4.22",
-               "concurrently": "^9.2.1",
-               "postcss": "^8.5.6",
+               "@wordpress/browserslist-config": "^6.51.0",
+               "@wordpress/scripts": "^33.0.0",
+               "autoprefixer": "^10.5.3",
+               "concurrently": "^10.0.3",
+               "postcss": "^8.5.19",
                "postcss-cli": "^11.0.1",

Twenty Nineteen has 4 updates available. However, I'm not sure it would be worth updating three or four of the packages when the theme still has node-sass (#63013) and might remove postcss-focus-within (#46976).

Package Version in theme Latest version
@wordpress/browserslist-config ^6.34.0 6.51.0
autoprefixer ^10.4.22 10.5.3
postcss ^8.5.6 8.5.19
postcss-focus-within ^9.0.1 10.0.0

This ticket was mentioned in ​PR #12826 on ​WordPress/wordpress-develop by ​@sabernhardt.


4 months ago
#4

Updates 3 dependencies in Twenty Twenty-Two and Twenty Twenty-Five:

  • @wordpress/browserslist-config from 6.34.0 to 6.52.0
  • cssnano from 7.1.2 to 8.0.2
  • postcss from 8.5.6 to 8.5.25

I ran the following commands in both src\wp-content\themes\twentytwentytwo and src\wp-content\themes\twentytwentyfive:

  1. npm install
  2. npm audit fix
  3. npm dedupe
  4. npm run build

Props: aakashverma1

Trac 64968

Use of AI Tools: none by me

This ticket was mentioned in ​PR #12861 on ​WordPress/wordpress-develop by ​@desrosj.


3 months ago
#5

Updates all devDependency-ies to their latest versions and runs npm audit fix.

Updates are as follows:

  • @playwright/test from 1.61.1 to 1.62.1
  • @types/codemirror from 5.60.17 to 5.60.18
  • @wordpress/e2e-test-utils-playwright from 1.51.0 to 1.52.0
  • @wordpress/prettier-config from 4.51.0 to 4.52.0
  • @wordpress/scripts from 33.0.0 to 34.0.0
  • autoprefixer from 10.5.3 to 10.5.4
  • grunt from 1.6.2 to 1.6.3
  • postcss from 8.5.19 to 8.5.25
  • sass from 1.101.0 to 1.102.0
  • wait-on from 9.0.10 to 9.1.0
  • webpack from 5.108.4 to 5.109.2

Trac ticket: Core-64968.

## Use of AI Tools

None

​@desrosj commented on ​PR #12861:


3 months ago
#6

There's a few issues to look into before this can be committed.

#7 @desrosj
3 months ago

I briefly chatted with @sabernhardt today in Slack and I think that it's desirable and acceptable for the dependency updates in the default themes to be committed after the RC1 point of the release cycle.

Since branching is delayed until RC2 next week, I've also opened one more PR to update devDependencies in trunk before branching.

#8 @wildworks
3 months ago

Thank you for your work on this. A final RC for 7.1 will be released tomorrow. Are there any tasks that need to be addressed before then?

​@wildworks commented on ​PR #11954:


3 months ago
#9

Closing this in favor of #12861

​@wildworks commented on ​PR #12826:


3 months ago
#11

Thanks for the PR. I have two concerns regarding this PR.

As Copilot pointed out, cssnano8 requires Node.js 22 or higher, so we need to decide how to address this.

We either need to require Node 22 or above, or downgrade the version of cssnano slightly. As far as I've researched, there are no default themes that require Node 22 or above yet.

​@desrosj commented on ​PR #12826:


3 months ago
#12

Thanks for the PR. I have two concerns regarding this PR.

As Copilot pointed out, cssnano8 requires Node.js 22 or higher, so we need to decide how to address this.

We either need to require Node 22 or above, or downgrade the version of cssnano slightly. As far as I've researched, there are no default themes that require Node 22 or above yet.

The current plan is to update wordpress-develop/gutenberg to 24.x after the 7.1 release. See Core-65451, ​https://github.com/WordPress/gutenberg/issues/72973.

#13 @desrosj
3 months ago

  • Resolution → fixed
  • Status new → closed

While it would be nice to have packages as up to date as possible when each release is finished, we've run out of time to consider further changes.

I'm going to close this out.

I've created #65857 for the 7.2 release and will change the Trac ticket references on the remaining open PRs to point to that one.

​@sabernhardt commented on ​PR #12826:


3 months ago
#14

In case these themes are updated sooner than WordPress 7.2, I accepted the change to cssnano 7.1.9 and reran the four commands to update package.lock.

However, if the next update is with WordPress 7.2 or later, this pull request probably should be closed and replaced with one that includes other themes.

​@wildworks commented on ​PR #12826:


3 months ago
#15

I don't have a strong opinion, but if we are updating the Node version to 24.x in the 7.2 release, we could consider updating the default theme afterwards.

​@mukesh27 commented on ​PR #12826:


2 months ago
#16

@sabernhardt Since WordPress set Node 24 in ​https://github.com/WordPress/wordpress-develop/commit/62439bbb0ae8dc2e73f32bd42372a356e8ea55c1, could you please rebase your PR and update the Trac ticket for 7.2?

​@mukesh27 commented on ​PR #12861:


2 months ago
#17

@desrosj Can you make this ready for 7.2? As it's not committed in 7.1.

​@sabernhardt commented on ​PR #12826:


7 weeks ago
#18

This PR was designed for the 7.1 branch, so I'll just close it. A new patch can be created in November, likely for more themes.

​@desrosj commented on ​PR #12861:


15 hours ago
#19

Merged in r65557.

Note: See TracTickets for help on using tickets.