Make WordPress Core

Opened 7 months ago

Closed 7 months ago

#65007 closed defect (bug) (fixed)

Contents of some `.min.js` files are no longer minified

Reported by: desrosj Owned by: peterwilsoncc
Priority: normal Milestone: 7.0
Component: Build/Test Tools Version: 7.0
Severity: normal Keywords: fixed-major commit dev-reviewed
Cc: Focuses:

Description

The contents of 4 files are no longer minified despite that being the case in 6.9:

  • wp-polyfill-node-contains.min.js
  • wp-polyfill-dom-rect.min.js
  • regenerator-runtime.min.js
  • wp-polyfill-fetch.min.js

Follow up to #64393.

Attachments (2)

65007-before.png​ (585.2 KB ) - added by ozgursar 7 months ago.
Before applying patch 11418
65007-after.png​ (450.7 KB ) - added by ozgursar 7 months ago.
After applying patch 11418

Download all attachments as: .zip

Change History (10)

#1 @desrosj
7 months ago

  • Version → trunk

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


7 months ago
#2

  • Keywords has-patch added

The tools/vendor/copy-vendors.js file was added in r61438 to copy files from the node_modules directory the appropriate location in built WordPress. This was previously handled by Webpack, but the majority of the Webpack code was also removed as part of that change.

In Grunt, there is a grunt copy task that is used to handle copying of files, and there is even a copy:vendor-js subtask. This moves all of the vendor file paths into this task to keep all vendor copying logic in one place.

Trac ticket: Core-65007. See also: Core-64393.

## Use of AI Tools

AI assistance: Yes
Tool(s): Claude
Model(s): Sonnet 4.6
Used for: Created the initial first draft of the PR.

This ticket was mentioned in ​Slack in #core-test by r1k0. ​View the logs.


7 months ago

@ozgursar
7 months ago

Before applying patch 11418

@ozgursar
7 months ago

After applying patch 11418

#4 @ozgursar
7 months ago

Patch Testing Report

Patch Tested: ​https://github.com/WordPress/wordpress-develop/pull/11418

Environment

  • WordPress: 7.1-alpha-20260407.182057
  • PHP: 8.3.30
  • Server: PHP.wasm
  • Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
  • Browser: Opera
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.1

Steps taken

  1. Run npm run build in your WordPress Develop folder cloned from the GitHub repo ​https://github.com/WordPress/wordpress-develop.
  2. Observe the following files in wp-includes/js/dist/vendor/ that they are not minified.
  • wp-polyfill-node-contains.min.js
  • wp-polyfill-dom-rect.min.js
  • regenerator-runtime.min.js
  • wp-polyfill-fetch.min.js
  1. Apply the patch.
  2. Rerun npm run build.
  3. Observe the files again and confirm that they are the minified versions.
  4. ✅ Patch is solving the problem.

Expected result

  • We expect to see the minified versions of the .min.js files in the wp-includes/js/dist/vendor/ folder.

Screenshots/Screencast with results

Before
https://core.trac.wordpress.org/raw-attachment/ticket/65007/65007-before.png

After
https://core.trac.wordpress.org/raw-attachment/ticket/65007/65007-after.png

#5 @peterwilsoncc
7 months ago

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

In 62258:

Build/Test Tools: Consolidate vendor file copying to ensure .min.js files are minified.

Relocates the copying of vendor JavaScript files back to the grunt copy:vendor-js subtask to ensure the files are in place prior to the grunt uglify step running to minify the files.

Props desrosj.
Fixes #65007.
See #64393.

#6 @peterwilsoncc
7 months ago

  • Keywords dev-feedback fixed-major added; has-patch removed
  • Resolution fixed
  • Status closed → reopened

Reopening for merge to the 7.0 branch pending another committers sign-off.

#8 @desrosj
7 months ago

  • Resolution → fixed
  • Status reopened → closed

In 62276:

Build/Test Tools: Consolidate vendor file copying to ensure .min.js files are minified.

Relocates the copying of vendor JavaScript files back to the grunt copy:vendor-js subtask to ensure the files are in place prior to the grunt uglify step running to minify the files.

Reviewed by desrosj, peterwilsoncc.
Merges [62258] to the 7.0 branch.

Props desrosj, peterwilsoncc.
Fixes #65007.
See #64393.

#7 @desrosj
7 months ago

  • Keywords commit dev-reviewed added; dev-feedback removed
Note: See TracTickets for help on using tickets.