Rename GUTENBERG_PHASE to IS_GUTENBERG_PLUGIN #37174
Labels
Gutenberg Plugin
Issues or PRs related to Gutenberg Plugin management related efforts
[Status] In Progress
Tracking issues with work in progress
[Type] Build Tooling
Issues or PRs related to build tooling
Gutenberg currently has an environment variable at
process.env.GUTENBERG_PHASE
.It is set to
1
in Core:https://github.com/WordPress/wordpress-develop/blob/a9e66f4bcb8a857c78ac29f7de30f8f9f3d129c5/tools/webpack/blocks.js#L187
It is set to
2
in the Gutenberg plugin:https://github.com/WordPress/gutenberg/blob/trunk/package.json#L22
The original intention with this variable was that
GUTENBERG_PHASE
would be incremented gradually. 2 for full site editing, 3 for collaboration, 4 for multilingual support, etc. This would then be used for feature gating so that we're not shipping experimental features to Core.In practice, this variable has only ever been used as a way to mark code which should be stripped out of the JavaScript when bundled for use in Core.
I propose we give the variable a new name that explains how it's used in practice.
IS_GUTENBERG_PLUGIN
is my pick as it aligns with a PHP constant recently introduced in #37021.cc. @WordPress/gutenberg-core
The text was updated successfully, but these errors were encountered: