Opened 4 years ago
Closed 4 years ago
#55017 closed task (blessed) (fixed)
Remove GUTENBERG_PHASE configuration from webpack
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Build/Test Tools | Keywords: | has-patch |
| Focuses: | Cc: |
Description (last modified by )
The Gutenberg repo has been using a GUTENBERG_PHASE environment variable for a while to feature flag particular features (mostly experimental blocks).
When the packages from Gutenberg are compiled by webpack in core, the idea is that this feature flagged code is removed from the build via webpack's dead code elimination feature.
The variable was set to an integer representing the phases of Gutenberg (core set to 1 and gutenberg set to 2), so that when the project moves to a new phase the value is incremented. That didn't really turn out to be a useful approach though.
Recently in the Gutenberg project this variable was renamed to IS_GUTENBERG_PLUGIN and changed to a boolean (https://github.com/WordPress/gutenberg/pull/38202).
It should now be possible to remove this configuration from WordPress core and rely on the falseyness of it being undefined.
Here are the details of what needs to be removed:
https://github.com/WordPress/wordpress-develop/search?q=GUTENBERG_PHASE
Change History (9)
This ticket was mentioned in PR #2255 on WordPress/wordpress-develop by talldan.
4 years ago
#3
- Keywords has-patch added; needs-patch removed
4 years ago
#4
I'm not sure how to fix the Test NPM failure on CI, if anyone has advice that would be very much appreciated 😄
4 years ago
#5
Running npm run build:dev should generate an updated script-loader-packages.php file.
4 years ago
#7
I didn’t notice this PR before. We replaced this constant with the new one used in Gutenberg. See https://github.com/WordPress/wordpress-develop/commit/bab610091d59f6dd21c7db84ba3e1ca0bab6a211. Should we skip it altogether in WordPress core insteas?
Removes the GUTENBERG_PHASE configuration that was previously used to remove feature flagged gutenberg code. The way this works has changed in the Gutenberg codebase (see https://github.com/WordPress/gutenberg/pull/38202). The variable is now called
IS_GUTENBERG_PLUGINand is a boolean value.It should be fine to remove this configuration as setting it to
falsewould have the same result in it not being present, givenundefinedis also a falsey value.Trac ticket: 55017