Opened 3 years ago
Closed 2 years ago
#55017 closed task (blessed) (fixed)
Remove GUTENBERG_PHASE configuration from webpack
Reported by: | talldanwp | Owned by: | talldanwp |
---|---|---|---|
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.
3 years ago
#3
- Keywords has-patch added; needs-patch removed
3 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 😄
3 years ago
#5
Running npm run build:dev
should generate an updated script-loader-packages.php
file.
2 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_PLUGIN
and is a boolean value.It should be fine to remove this configuration as setting it to
false
would have the same result in it not being present, givenundefined
is also a falsey value.Trac ticket: 55017