Skip to content

Remove unminified .min files.#11314

Closed
desrosj wants to merge 3 commits into
WordPress:trunkfrom
desrosj:remove/unminified-min-asset-files
Closed

Remove unminified .min files.#11314
desrosj wants to merge 3 commits into
WordPress:trunkfrom
desrosj:remove/unminified-min-asset-files

Conversation

@desrosj
Copy link
Copy Markdown
Member

@desrosj desrosj commented Mar 20, 2026

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.
-->


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

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.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 20, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props desrosj, peterwilsoncc.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the unminified “.min.php” package manifest files for script loader packages and script modules, consolidating generation and consumption to a single, non-suffixed PHP manifest file while still applying the runtime JS suffix (.min) when building script URLs.

Changes:

  • Update tools/gutenberg/copy.js to generate only script-loader-packages.php and script-modules-packages.php (no .min.php variants).
  • Update core loaders (wp_default_packages_scripts() and wp_default_script_modules()) to always include the non-suffixed manifest file.
  • Adjust script module path handling so .min is appended at runtime (and VIPS modules always use .min.js).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tools/gutenberg/copy.js Stops generating *.min.php manifest files; writes a single manifest with .js keys.
src/wp-includes/script-modules.php Loads a single manifest file and appends suffixes at runtime (with special handling for VIPS).
src/wp-includes/script-loader.php Loads a single manifest file and derives handles/paths from .js keys plus runtime suffix.
Comments suppressed due to low confidence (1)

tools/gutenberg/copy.js:364

  • This JSDoc says the directory walk finds .asset.php files, but the code only matches entry.name.endsWith( '.min.asset.php' ). Please update the comment to reflect that only minified asset manifests are considered.
	/**
	 * Recursively process directory to find .asset.php files.
	 *

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/gutenberg/copy.js Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@desrosj desrosj force-pushed the remove/unminified-min-asset-files branch from ab144fe to 7875041 Compare March 20, 2026 02:41
@desrosj desrosj requested a review from peterwilsoncc March 20, 2026 03:10
Comment thread tools/gutenberg/copy.js Outdated
@desrosj desrosj requested a review from peterwilsoncc March 20, 2026 03:57
Copy link
Copy Markdown
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and tests well.

  1. rm -rf gutenberg .gutenberg-hash; npm ci; npm run grunt clean:qunit; npm run build:dev
  2. Review the files are generated in the assets directory as expected
  3. Set define( 'SCRIPT_DEBUG', true );
  4. Visit post editor, font library and site editor to ensure everything loaded as expected
  5. Review scripts and styles in Query Monitor to ensure they're uncompressed versions
  6. Set define( 'SCRIPT_DEBUG', false );
  7. Visit same again
  8. Review scripts and styles in Query Monitor to ensure they're compressed versions

@github-actions
Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 62072
GitHub commit: 7ac6151

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants