Skip to content

Conversation

@GaryJones
Copy link
Contributor

Summary

  • Replaces custom 107-line webpack configuration with wp-scripts
  • Aligns build tooling with other Automattic plugins (co-authors-plus, liveblog)
  • Removes ~20 redundant devDependencies now provided by @wordpress/scripts
  • Updates PHP enqueue calls to use auto-generated .asset.php files for dependency management
  • Converts wp.* globals to ES imports in custom-status-block.js for proper dependency detection

Net change: -2,200 lines of configuration code.

Changes

File Change
package.json Use wp-scripts build/start, remove redundant deps
webpack.config.js 107 lines → 9 lines (extends wp-scripts default)
.babelrc.js Deleted (wp-scripts includes babel config)
.gitignore Add build/ folder
custom-status.php Use .asset.php for dependencies
calendar.php Use .asset.php for dependencies
custom-status-block.js Convert to ES imports

Benefits

  • Automatic dependency detection - No more manual dependency arrays in PHP
  • Simplified maintenance - Less custom config to maintain
  • Consistent tooling - Same build system as CAP and Liveblog
  • Better cache busting - Content hash in .asset.php version

Test plan

  • npm run build succeeds
  • All 11 e2e tests pass
  • Manual testing of custom status panel in block editor
  • Manual testing of calendar page

🤖 Generated with Claude Code

@GaryJones GaryJones requested a review from a team as a code owner December 17, 2025 14:19
@GaryJones GaryJones added this to the Next (minor) milestone Dec 17, 2025
@GaryJones GaryJones added the type: maintenance Routine maintenance and code quality improvements label Dec 17, 2025
@GaryJones GaryJones self-assigned this Dec 17, 2025
@GaryJones
Copy link
Contributor Author

Waiting on Automattic/eslint-config-wpvip#235 to use the correct formatting code style.

@GaryJones GaryJones force-pushed the chore/wp-scripts-migration branch 3 times, most recently from 5d76564 to db025ae Compare December 18, 2025 17:23
Replaces custom webpack configuration with @wordpress/scripts for simpler,
more maintainable build tooling.

Changes:
- webpack.config.js: Use wp-scripts default config with custom entry points
- Output moves from dist/ to build/ directory
- Remove .babelrc.js (wp-scripts handles babel internally)
- Add babel.config.js for Jest JSX support
- Update PHP asset loading to use build/ directory
- Update CI workflow for new build paths
- Configure ESLint for JSX parsing and WordPress imports
- Add @wordpress/* packages needed for Jest tests

Build outputs:
- build/calendar-react.js (was modules/calendar/lib/dist/...)
- build/custom-status-block.js (was dist/custom-status.build.js)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@GaryJones GaryJones force-pushed the chore/wp-scripts-migration branch from db025ae to ae6b240 Compare December 18, 2025 22:21
@GaryJones GaryJones merged commit 2acc096 into develop Dec 18, 2025
12 checks passed
@GaryJones GaryJones deleted the chore/wp-scripts-migration branch December 18, 2025 22:46
@GaryJones GaryJones mentioned this pull request Dec 19, 2025
@GaryJones GaryJones mentioned this pull request Jan 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: maintenance Routine maintenance and code quality improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants