Make WordPress Core

Opened 7 months ago

Closed 3 months ago

#64900 closed defect (bug) (fixed)

Improve `browserslist:update` Grunt task

Reported by: desrosj Owned by: cbravobernal
Priority: normal Milestone: 7.0.1
Component: Build/Test Tools Version:
Severity: normal Keywords: good-first-bug has-patch dev-reviewed
Cc: Focuses:

Description

The browserslist:update Grunt task was previously run as a part of the sync-gutenberg-packages script when the update-browserlist flag was specified.

This script was removed in [62062], but the browserslist:update task was left in place because it should still be run periodically.

The task should be re-surfaced somewhere in the relevant build scripts (maybe added to precommit:css or as a script in package.json), or documented somewhere so it's clear when/how it should be used.

The npx browserslist@latest --update-db command is run for the task, but the --update-db command is deprecated. This should be replaced with npx update-browserslist-db@latest.

Attachments (1)

64900.diff​ (498 bytes ) - added by ekla 7 months ago.
This patch replaces the deprecated --update-db command in the browserslist:update Grunt task with update-browserslist-db@latest. Tested by running npx grunt browserslist:update, which executed successfully.

Download all attachments as: .zip

Change History (12)

@ekla
7 months ago

This patch replaces the deprecated --update-db command in the browserslist:update Grunt task with update-browserslist-db@latest. Tested by running npx grunt browserslist:update, which executed successfully.

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


7 months ago
#1

  • Keywords has-patch added

This patch replaces the deprecated --update-db command in the browserslist:update Grunt task with update-browserslist-db@latest.

Tested by running npx grunt browserslist:update, which executed successfully.

Trac ticket: https://core.trac.wordpress.org/ticket/64900

## Use of AI Tools
AI assistance: Yes
Tool(s): ChatGPT
Model(s): GPT-5.3
Used for: Testing the patch and understanding why it exists

#2 @desrosj
7 months ago

Related #53685.

#3 @ant1busted
4 months ago

Test Report

Env:

OS: Debian 13
Plugins: None
WordPress: trunk
Patch: PR 11316
Localhost: wp-env

Results

Gruntfile was updated properly ✅
npx grunt browserslist:update works fine ✅

Works as expected ✅

#4 @vedantere
4 months ago

Test Report
Env:
OS: macOS (Apple Silicon)
Node: v22.16.0
npm: 10.9.2
WordPress: trunk
Patch PR: PR #11316

Results:

Gruntfile updated correctly ✅
npx grunt browserslist:update runs without deprecation warning ✅

caniuse-lite updated successfully ✅
Works as expected ✅

Last edited 4 months ago by vedantere (previous) (diff)

#5 @jorgelopezrepiso
4 months ago

Test Report

Env:

  • OS: Ubuntu 24.04.4 LTS
  • Node: v20.20.2
  • npm: 10.8.2
  • WordPress: trunk
  • Patch: PR #11316

Results:

  • Tested the patch manually on a fresh local trunk install.
  • Before applying the change, running npx grunt browserslist:update triggered the expected deprecation warning (The --update-db command is deprecated).
  • Modified Gruntfile.js to use npx update-browserslist-db@latest as proposed.
  • After the change, the task executed successfully, the database updated without any deprecation warnings, and the output is perfectly clean.
  • Works as expected ✅

​@masteradhoc commented on ​PR #11316:


3 months ago
#6

@desrosj @cbravobernal Could you do a second committer sign off here so we can get this included in WP 7.0.1?

#7 @cbravobernal
3 months ago

  • Owner set to cbravobernal
  • Resolution → fixed
  • Status new → closed

In 62570:

Build Tools: Replace deprecated browserslist --update-db command.

Replaces the deprecated --update-db command in the browserslist:update Grunt task with update-browserslist-db@latest.

Props ekla, sergeybiryukov, masteradhoc.

Fixes #64900.

#8 @cbravobernal
3 months ago

  • Keywords dev-feedback added

Reopening ticket for second committer sign off.

#9 @dmsnell
3 months ago

  • Keywords dev-reviewed added; dev-feedback removed

Looks good for a backport.

#10 @wildworks
3 months ago

  • Resolution fixed
  • Status closed → reopened

I am reopening this ticket as the backport to 7.0.1 does not appear to be complete yet.

#11 @cbravobernal
3 months ago

  • Resolution → fixed
  • Status reopened → closed

In 62589:

Build Tools: Replace deprecated browserslist --update-db command.

Replaces the deprecated --update-db command in the browserslist:update Grunt task with update-browserslist-db@latest.

Reviewed by dmsnell, cbravobernal.
Merges [62570] to the 7.0 branch.

Props ekla, sergeybiryukov, masteradhoc.
Fixes #64900.

Note: See TracTickets for help on using tickets.