Skip to content

refactor(assets): align dist filenames with webpack manifest#488

Open
firestar300 wants to merge 6 commits intomasterfrom
refactor/assets-name
Open

refactor(assets): align dist filenames with webpack manifest#488
firestar300 wants to merge 6 commits intomasterfrom
refactor/assets-name

Conversation

@firestar300
Copy link
Copy Markdown
Contributor

@firestar300 firestar300 commented Apr 24, 2026

  • Use stable output names in production (app.js, [name].css) and same MiniCssExtract + WebpackManifestPlugin in all modes.
  • Register theme JS/CSS from assets.json only; remove is_minified() and SCRIPT_DEBUG-based branching.
  • Fix get_asset_data() static cache to key by the requested filename.
  • Update PHPDoc and inline comments to match the new flow.

Note

Medium Risk
Touches build outputs and runtime asset URL resolution; a mismatch between webpack manifest entries and expected keys could break script/style loading in production.

Overview
Build output is changed to use stable production filenames ([name].js, [name].css) and to always emit dist/assets.json via WebpackManifestPlugin, with MiniCssExtractPlugin configured consistently across modes.

Theme PHP asset resolution is refactored to rely on assets.json for JS/CSS/editor/login filenames (falling back to app.js/app.css/login.css when missing), removes is_minified()/SCRIPT_DEBUG branching, fixes get_asset_data() caching to key by the requested filename, and updates stylesheet_uri/login CSS filters accordingly.

Reviewed by Cursor Bugbot for commit 1b44a96. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread inc/Services/Assets.php
Comment thread inc/Services/Editor.php Outdated
Comment thread inc/Services/Assets.php
Comment thread inc/Services/Assets.php
Comment thread inc/Services/Editor.php Outdated
@francoistibo
Copy link
Copy Markdown
Contributor

francoistibo commented Apr 27, 2026

TODO :
Actions maj la doc pour supprimer le SCRIPT_DEBUG (modèle de wiki + wiki projets)

ICI : https://github.com/BeAPI/wp-skeleton/wiki/06-Th%C3%A8mes#la-constante-script_debug

- Use stable output names in production (app.js, [name].css) and same
  MiniCssExtract + WebpackManifestPlugin in all modes.
- Register theme JS/CSS from assets.json only; remove is_minified() and
  SCRIPT_DEBUG-based branching.
- Fix get_asset_data() static cache to key by the requested filename.
- Update PHPDoc and inline comments to match the new flow.
Add empty-file check, dist/login.css fallback, and pass through filter
default to avoid invalid dist/ URL when get_min_file returns empty.
@firestar300 firestar300 force-pushed the refactor/assets-name branch from d2775dc to c287362 Compare April 30, 2026 14:41
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c287362. Configure here.

Comment thread inc/Services/Editor.php Outdated
@firestar300
Copy link
Copy Markdown
Contributor Author

TODO : Actions maj la doc pour supprimer le SCRIPT_DEBUG (modèle de wiki + wiki projets)

ICI : https://github.com/BeAPI/wp-skeleton/wiki/06-Th%C3%A8mes#la-constante-script_debug

C'est modifié. ✅

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