Always run build:gutenberg -- --dev after downloading built asset#11294
Always run build:gutenberg -- --dev after downloading built asset#11294desrosj wants to merge 3 commits intoWordPress:trunkfrom
build:gutenberg -- --dev after downloading built asset#11294Conversation
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
b5448d5 to
8966534
Compare
Test using WordPress PlaygroundThe 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
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
Merged in r62052. |
A side effect of the changes from Core-64393 has surfaced that is potentially affecting anyone looking to run WordPress from
src/.Previously, the relevant block editor-related files were subject to version control within the
src/directory. They were always present, and they were updated from the dependencies installed through npm whennpm run build:devwas run. Because of this, someone could clonewordpress-developand immediately run the PHPUnit tests without having to run a build script (the files were already in the right spots).The
copy:block-jsonGrunt task was also responsible for generating thesrc/wp-includes/blocks/blocks-json.phpfile and was run before anygrunt copycommands were run. This ensured it was present insrc/before copying all of the files over tobuildonnpm run build.The side effect of this is that when the PHPUnit test suite is run from
src/, there are unexpected failures whenever anyone:npm run buildand notnpm run build:devbuildscript at all assuming the files are in place.This issue surfaced in WordPress/phpunit-test-runner#307 and there are many Hosting Test reporters failing with the same errors currently. This is due to the fact that the
phpunit-test-runneralways runsnpm run buildas a part of the setup. I haven't found specific reasoning why. But if I had to guess, it's becausenpm run build:devwas not necessary previously. So runningbuildensured both ways of running the test suite would work.On one hand, the test runner is
_doing_it_wrong()because regardless of whether the tests are being run frombuildorsrc,npm run buildis always the command that's run. But given that the files were removed from version control withinsrc/, I think it makes sense to always runbuild:gutenberg -- --devto ensure that the expected source files are present in thesrc/directory.Also worth noting is that #11064 aims to restore the files that were removed from version control along with the associated history. Once this happens, this likely wouldn't be necessary anymore (the files will again always at least exist because they are versioned). But because these files have gone missing unexpectedly, this is what I recommend as a fix until #11064 is merged.
Trac ticket: Core-64393.
Use of AI Tools
AI assistance: Yes
Tool(s): Claude
Model(s): Sonnet 4.6
Used Claude to investigate the root cause, and recommend a possible way to fix the issue. An approach different than the one suggested was ultimately used.
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.