Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack: Fix watch on .json and .php files #34024

Merged
merged 1 commit into from
Aug 12, 2021

Conversation

walbo
Copy link
Member

@walbo walbo commented Aug 11, 2021

Description

Only ignore watch on files in the src folder that are handled by the build script.

This fixes a bug where .json and .php files in blocks isn't copied in development mode.

Fixes #33993

How has this been tested?

See steps in issue

Screenshots

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

Only ignore watch on files in the src folder that are handled by the build script.

This fixes a bug where `.json` and `.php` files in blocks isn't copied in development mode.
@glendaviesnz
Copy link
Contributor

Thanks @walbo, this fixed the issue for me when tested locally. I will leave it to @gziolo to give a signoff on it in case there are any gotchas with the other webpack upgrade changes that I am overlooking.

@ramonjd ramonjd added the [Type] Build Tooling Issues or PRs related to build tooling label Aug 12, 2021
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

Great catch, that makes a lot of sense. I'm surprised it worked correctly before 😄

As a separate task, we probably should consider whether it would be a good idea to stop publishing src folders to npm and copy PHP and JSON files to build folders for the block library.

@gziolo gziolo added the [Type] Bug An existing feature does not function as intended label Aug 12, 2021
@gziolo gziolo merged commit 32f4af8 into WordPress:trunk Aug 12, 2021
@github-actions github-actions bot added this to the Gutenberg 11.4 milestone Aug 12, 2021
@walbo walbo deleted the fix/webpack-watch-ignored branch August 12, 2021 08:54
@walbo
Copy link
Member Author

walbo commented Aug 12, 2021

Yeah, must have been a bug in webpack 4 that made it work before the upgrade.

Makes sense to me to move the PHP and JSON files in npm. A bit odd that you have build folders but have to fetch some files from src 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended [Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Block supports: value changes on block.json not reflected in block store after watch task runs
4 participants