[wp-trac] [WordPress Trac] #55017: Remove GUTENBERG_PHASE configuration from webpack

WordPress Trac noreply at wordpress.org
Tue Feb 1 03:33:03 UTC 2022


#55017: Remove GUTENBERG_PHASE configuration from webpack
------------------------------+------------------------
 Reporter:  talldanwp         |       Owner:  talldanwp
     Type:  task (blessed)    |      Status:  assigned
 Priority:  normal            |   Milestone:  6.0
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  needs-patch       |     Focuses:
------------------------------+------------------------
Description changed by talldanwp:

Old description:

> 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 integers 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

New description:

 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

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55017#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list