Skip to content

Commit 15aa390

Browse files
committed
Interactivity API: Router's experimental full-page script module should not be bundled in WordPress.
The `"./full-page"` entry defined in the `@wordpress/interactivity-router`'s `wpScriptModuleExport` field should not be bundled in WordPress Core yet as it is experimental. There is no mechanism in `wpScriptModuleExports` right now to support building a script module but not including it in WordPress Core. Since this is likely to be a rare instance we have opted to hard-code an exclusion in WordPress Core's build until this module is no longer experimental. Props samueljseay, westonruter, youknowriad. Fixes #64137. git-svn-id: https://develop.svn.wordpress.org/trunk@61072 602fd350-edb4-49c9-b593-d223f7449a82
1 parent d15e85d commit 15aa390

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('interactivity/index.min.js' => array('dependencies' => array(), 'version' => '441cab46d043b0a45f6f', 'type' => 'module'), 'interactivity/debug.min.js' => array('dependencies' => array(), 'version' => '4b216ecdeb745ab1b420', 'type' => 'module'), 'interactivity-router/index.min.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/a11y', 'import' => 'dynamic')), 'version' => '765a6ee8162122b48e6c', 'type' => 'module'), 'interactivity-router/full-page.min.js' => array('dependencies' => array(array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => 'ac76172d5956969e2227', 'type' => 'module'), 'a11y/index.min.js' => array('dependencies' => array(), 'version' => 'b7d06936b8bc23cff2ad', 'type' => 'module'), 'block-library/accordion/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '5fa6ee20ae87460b9868', 'type' => 'module'), 'block-library/file/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'f9665632b48682075277', 'type' => 'module'), 'block-library/form/view.min.js' => array('dependencies' => array(), 'version' => 'baaf25398238b4f2a821', 'type' => 'module'), 'block-library/image/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '26816800d42394b0a5f5', 'type' => 'module'), 'block-library/navigation/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '3d4d582d5a6b3cf1185b', 'type' => 'module'), 'block-library/query/view.min.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => 'f55e93a1ad4806e91785', 'type' => 'module'), 'block-library/search/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '208bf143e4074549fa89', 'type' => 'module'), 'block-editor/utils/fit-text-frontend.min.js' => array('dependencies' => array(), 'version' => '6e035d66824ec76d9de1', 'type' => 'module'));
1+
<?php return array('interactivity/index.min.js' => array('dependencies' => array(), 'version' => '441cab46d043b0a45f6f', 'type' => 'module'), 'interactivity/debug.min.js' => array('dependencies' => array(), 'version' => '4b216ecdeb745ab1b420', 'type' => 'module'), 'interactivity-router/index.min.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/a11y', 'import' => 'dynamic')), 'version' => '765a6ee8162122b48e6c', 'type' => 'module'), 'a11y/index.min.js' => array('dependencies' => array(), 'version' => 'b7d06936b8bc23cff2ad', 'type' => 'module'), 'block-library/accordion/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '5fa6ee20ae87460b9868', 'type' => 'module'), 'block-library/file/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'f9665632b48682075277', 'type' => 'module'), 'block-library/form/view.min.js' => array('dependencies' => array(), 'version' => 'baaf25398238b4f2a821', 'type' => 'module'), 'block-library/image/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '26816800d42394b0a5f5', 'type' => 'module'), 'block-library/navigation/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '3d4d582d5a6b3cf1185b', 'type' => 'module'), 'block-library/query/view.min.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => 'f55e93a1ad4806e91785', 'type' => 'module'), 'block-library/search/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '208bf143e4074549fa89', 'type' => 'module'), 'block-editor/utils/fit-text-frontend.min.js' => array('dependencies' => array(), 'version' => '6e035d66824ec76d9de1', 'type' => 'module'));

tools/webpack/script-modules.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ for ( const packageName of MODULES.concat( SCRIPT_AND_MODULE_DUAL_PACKAGES ) ) {
4848
for ( const [ exportName, exportPath ] of Object.entries(
4949
wpScriptModuleExports
5050
) ) {
51+
// Exclude the experimental './full-page' export from @wordpress/interactivity-router.
52+
// This export is defined in Gutenberg's package.json but should not be bundled in Core
53+
// as the feature is still experimental and not ready for inclusion.
54+
if ( moduleName === 'interactivity-router' && exportName === './full-page' ) {
55+
continue;
56+
}
57+
5158
if ( typeof exportPath !== 'string' ) {
5259
throw new Error( 'wpScriptModuleExports paths must be strings' );
5360
}

0 commit comments

Comments
 (0)