Skip to content

Conversation

@youknowriad
Copy link
Contributor

Related #72032

What

This continues the work on the build tool. This PR auto-registers styles (like we did scripts and modules before) based on the packages built in the current plugin.

Why?

  • Reduces maintenance burden - no need to manually update PHP registration code when adding/removing scripts
  • Improved DevX for plugin authors that would like to register scripts as well.

How?

  • Build process now collects styles metadata during bundling
  • Uses PHP templates to generate two files:
  • build/styles/index.php - module registry data array
  • build/styles - registration logic with hooks

Testing Instructions

E2E tests should pass (scripts are used everywhere)

@youknowriad youknowriad self-assigned this Oct 27, 2025
@youknowriad youknowriad added the [Type] Build Tooling Issues or PRs related to build tooling label Oct 27, 2025
@github-actions
Copy link

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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: youknowriad <youknowriad@git.wordpress.org>

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

@youknowriad youknowriad added the No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core label Oct 27, 2025
@youknowriad youknowriad force-pushed the add/auto-register-styles branch from 35501e8 to 41fcd34 Compare October 27, 2025 13:24
@youknowriad youknowriad force-pushed the add/auto-register-styles branch from 41fcd34 to ebd5b18 Compare October 28, 2025 07:12
@github-actions
Copy link

Flaky tests detected in 3463767.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18867656511
📝 Reported issues:

@youknowriad youknowriad merged commit 7b0c350 into trunk Oct 28, 2025
34 checks passed
@youknowriad youknowriad deleted the add/auto-register-styles branch October 28, 2025 08:23
@github-actions github-actions bot added this to the Gutenberg 22.0 milestone Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core [Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants