Make WordPress Core

Opened 7 weeks ago

Closed 7 weeks ago

Last modified 7 weeks ago

#64909 closed defect (bug) (fixed)

`assets/script-*-packages.min.php` files are not minified

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

Description

Follow up to #64393.

The build script creates four files in the wp-includes/assets directory:

  • script-loader-packages.php
  • script-loader-packages.min.php
  • script-modules-packages.php
  • script-modules-packages.min.php

Despite one version of the file being named .min.php, both files are unminified. The .min files should either be minified or removed.

Change History (4)

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


7 weeks ago
#1

This removes the script-loader-packages.min.php and script-modules-packages.min.php files.

They were not being minified and an unminified vesion of the file is more human readable. The unminified file is roughly 10KB larger, which seems like a reasonable tradeoff.

Trac ticket: Core-64909.

## Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Sonnet 4.6
Used for: A detailed prompt was given to Claude to work through the changes required. The results were reviewed by me and adjustments were made.
-->

#2 @desrosj
7 weeks ago

  • Owner set to desrosj
  • Status changed from new to assigned

#3 @desrosj
7 weeks ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 62072:

Build/Test Tools: Stop generating unminified .min file.

The generated wp-includes/assets/script-loader-packages.min.php and wp-includes/assets/script-modules-packages.min.php files are not actually minified. Additionally, the only purpose they serve is to pass a different script handle to the script loader (.min.js vs. .js).

This eliminates the need for those files entirely since the difference in file size is negligible, and a human-readable version is more useful.

Props peterwilsoncc, desrosj.
Fixes #64909.

#4 @desrosj
7 weeks ago

#50460 was marked as a duplicate.

Note: See TracTickets for help on using tickets.