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

Rename GUTENBERG_PHASE to IS_GUTENBERG_PLUGIN #37174

Closed
noisysocks opened this issue Dec 7, 2021 · 1 comment · Fixed by #38202
Closed

Rename GUTENBERG_PHASE to IS_GUTENBERG_PLUGIN #37174

noisysocks opened this issue Dec 7, 2021 · 1 comment · Fixed by #38202
Assignees
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

Comments

@noisysocks
Copy link
Member

noisysocks commented Dec 7, 2021

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

@noisysocks noisysocks added [Type] Build Tooling Issues or PRs related to build tooling Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts labels Dec 7, 2021
@youknowriad
Copy link
Contributor

That makes sense 👍

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants