Skip to content

Commit

Permalink
Remove legacy webpack DefinePlugin configuration
Browse files Browse the repository at this point in the history
WordPress/gutenberg#61486 changed the variables
compiled into Gutenberg packages via the webpack DefinePlugin.

https://core.trac.wordpress.org/changeset/58193 added the new
DefinePlugin configuration, but did not remove the legacy configuration
in order to be compatible with new and old Gutenberg versions before the
packages were updated.

Now that packages have been update, the legacy configuration should be
removed.

Closes https://core.trac.wordpress.org/ticket/61262.

Follow-up to https://core.trac.wordpress.org/changeset/58193.
  • Loading branch information
sirreal committed Jun 25, 2024
1 parent 03fc69d commit b0f637c
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions tools/webpack/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ const getBaseConfig = ( env ) => {
watch: env.watch,
plugins: [
new DefinePlugin( {
/*
* These variables are part of https://github.com/WordPress/gutenberg/pull/61486
* They're expected to be released in an upcoming version of Gutenberg.
*
* Defining this before the packages are released is harmless.
*
* @todo Remove the non-globalThis defines here when packages have been upgraded to the globalThis versions.
*/

// Inject the `IS_GUTENBERG_PLUGIN` global, used for feature flagging.
'globalThis.IS_GUTENBERG_PLUGIN': JSON.stringify( false ),
// Inject the `IS_WORDPRESS_CORE` global, used for feature flagging.
Expand All @@ -58,13 +49,6 @@ const getBaseConfig = ( env ) => {
'globalThis.SCRIPT_DEBUG': JSON.stringify(
mode === 'development'
),

// Inject the `IS_GUTENBERG_PLUGIN` global, used for feature flagging.
'process.env.IS_GUTENBERG_PLUGIN': JSON.stringify( false ),
// Inject the `IS_WORDPRESS_CORE` global, used for feature flagging.
'process.env.IS_WORDPRESS_CORE': JSON.stringify( true ),
// Inject the `SCRIPT_DEBUG` global, used for dev versions of JavaScript.
SCRIPT_DEBUG: JSON.stringify( mode === 'development' ),
} ),
],
};
Expand Down

0 comments on commit b0f637c

Please sign in to comment.