Repository navigation
Change copying PHP files to dist directory to opt-in via a CLI flag. - #39171
Merged
Merged
Conversation
ryanwelcher
requested review from
ajitbohra,
gziolo,
nerrad and
ntwb
as code owners
March 2, 2022 18:59
This was referenced Mar 2, 2022
gziolo
approved these changes
Mar 3, 2022
gziolo
left a comment
Member
There was a problem hiding this comment.
Thank you @ryanwelcher for providing this fix. Let's keep it optional for now and maybe we can figure out some ways where we could extend the block.json metadata in a way that allows automatically detecting necessary PHP block files.
gziolo
added a commit
that referenced
this pull request
Mar 3, 2022
…39171) * Enable accepting --webpack-copy-php flag from the CLI commands * Update the glob pattern based on existence of --webpack-copy-php flag. * Update README and changelog files. * Add PR to the changelog. * Update CHANGELOG.md * Update README.md Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Based on feedback post #38715 being merged, this PR changes the approach around copying PHP files by moving to an opt-in approach via providing a
--webpack-copy-phpflag to either thestartorbuildcommands. By moving to opt-in, we should be able to avoid more unintentional issues with existing projects while still allowing the functionality to be accessed.Testing Instructions
I created a block using npx @wordpress/create-block@ my-first-dynamic-block --template=@ryanwelcher/dynamic-block-template ( this contains an template.php file in the
srcdirectory )Then ran node {FULLPATH}/gutenberg/packages/scripts/bin/wp-scripts.js -- build --webpack-copy-php
Types of changes
Changes the approach for copying PHP files to be opt-in via a CLI flag.
Checklist:
*.native.jsfiles for terms that need renaming or removal).