Skip to content

Commit

Permalink
Revert "Create @wordpress/interactivity-router package"
Browse files Browse the repository at this point in the history
This reverts commit 7b9e112.
  • Loading branch information
DAreRodz committed Jan 24, 2024
1 parent 3e50a84 commit e551609
Show file tree
Hide file tree
Showing 24 changed files with 15 additions and 172 deletions.
6 changes: 0 additions & 6 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1673,12 +1673,6 @@
"markdown_source": "../packages/icons/README.md",
"parent": "packages"
},
{
"title": "@wordpress/interactivity-router",
"slug": "packages-interactivity-router",
"markdown_source": "../packages/interactivity-router/README.md",
"parent": "packages"
},
{
"title": "@wordpress/interactivity",
"slug": "packages-interactivity",
Expand Down
2 changes: 1 addition & 1 deletion lib/experimental/interactivity-api/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function gutenberg_register_interactivity_modules() {
defined( 'GUTENBERG_VERSION' ) ? GUTENBERG_VERSION : get_bloginfo( 'version' )
);
gutenberg_register_module(
'@wordpress/interactivity-router',
'@wordpress/interactivity/router',
gutenberg_url( '/build/interactivity/router.min.js' ),
array( '@wordpress/interactivity' ),
defined( 'GUTENBERG_VERSION' ) ? GUTENBERG_VERSION : get_bloginfo( 'version' )
Expand Down
24 changes: 0 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/block-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@wordpress/i18n": "file:../i18n",
"@wordpress/icons": "file:../icons",
"@wordpress/interactivity": "file:../interactivity",
"@wordpress/interactivity-router": "file:../interactivity-router",
"@wordpress/keycodes": "file:../keycodes",
"@wordpress/notices": "file:../notices",
"@wordpress/patterns": "file:../patterns",
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/query/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function register_block_core_query() {
array(
'@wordpress/interactivity',
array(
'id' => '@wordpress/interactivity-router',
'id' => '@wordpress/interactivity/router',
'type' => 'dynamic',
),
),
Expand Down
6 changes: 3 additions & 3 deletions packages/block-library/src/query/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ store( 'core/query', {
}, 400 );

const { actions } = yield import(
'@wordpress/interactivity-router'
'@wordpress/interactivity/router'
);
yield actions.navigate( ref.href );

Expand Down Expand Up @@ -75,7 +75,7 @@ store( 'core/query', {
.wpNavigationDisabled;
if ( isValidLink( ref ) && ! isDisabled ) {
const { actions } = yield import(
'@wordpress/interactivity-router'
'@wordpress/interactivity/router'
);
yield actions.prefetch( ref.href );
}
Expand All @@ -87,7 +87,7 @@ store( 'core/query', {
const { ref } = getElement();
if ( url && isValidLink( ref ) ) {
const { actions } = yield import(
'@wordpress/interactivity-router'
'@wordpress/interactivity/router'
);
yield actions.prefetch( ref.href );
}
Expand Down
1 change: 0 additions & 1 deletion packages/block-library/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
{ "path": "../i18n" },
{ "path": "../icons" },
{ "path": "../interactivity" },
{ "path": "../interactivity-router" },
{ "path": "../notices" },
{ "path": "../keycodes" },
{ "path": "../primitives" },
Expand Down
1 change: 0 additions & 1 deletion packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"dependencies": {
"@wordpress/e2e-test-utils": "file:../e2e-test-utils",
"@wordpress/interactivity": "file:../interactivity",
"@wordpress/interactivity-router": "file:../interactivity-router",
"@wordpress/jest-console": "file:../jest-console",
"@wordpress/jest-puppeteer-axe": "file:../jest-puppeteer-axe",
"@wordpress/scripts": "file:../scripts",
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/plugins/interactive-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function () {
array(
'@wordpress/interactivity',
array(
'id' => '@wordpress/interactivity-router',
'id' => '@wordpress/interactivity/router',
'type' => 'dynamic',
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const { actions } = store( 'directive-context-navigate', {
ctx.newText = 'some new text';
},
navigate() {
return import( '@wordpress/interactivity-router' ).then(
return import( '@wordpress/interactivity/router' ).then(
( { actions: routerActions } ) =>
routerActions.navigate(
window.location,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ store( 'directive-each', {
actions: {
*navigate() {
const { actions } = yield import(
"@wordpress/interactivity-router"
"@wordpress/interactivity/router"
);
return actions.navigate( window.location, {
force: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ store( 'directive-key', {
actions: {
*navigate() {
const { actions } = yield import(
"@wordpress/interactivity-router"
"@wordpress/interactivity/router"
);
return actions.navigate( window.location, {
force: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const { state } = store( 'directive-run', {
},
*navigate() {
const { actions } = yield import(
"@wordpress/interactivity-router"
"@wordpress/interactivity/router"
);
return actions.navigate( window.location, {
force: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const { state } = store( 'router', {
const { timeout } = state;

const { actions } = yield import(
"@wordpress/interactivity-router"
"@wordpress/interactivity/router"
);
yield actions.navigate( e.target.href, { force, timeout } );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const { state } = store( 'router-regions', {
*navigate( e ) {
e.preventDefault();
const { actions } = yield import(
"@wordpress/interactivity-router"
"@wordpress/interactivity/router"
);
yield actions.navigate( e.target.href );
},
Expand Down
1 change: 0 additions & 1 deletion packages/interactivity-router/.npmrc

This file was deleted.

1 change: 0 additions & 1 deletion packages/interactivity-router/CHANGELOG.md

This file was deleted.

76 changes: 0 additions & 76 deletions packages/interactivity-router/README.md

This file was deleted.

34 changes: 0 additions & 34 deletions packages/interactivity-router/package.json

This file was deleted.

11 changes: 0 additions & 11 deletions packages/interactivity-router/tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/interactivity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- Remove `data-wp-slot` and `data-wp-fill`. ([#57854](https://github.com/WordPress/gutenberg/pull/57854))
- Remove `wp-data-navigation-link` directive. ([#57853](https://github.com/WordPress/gutenberg/pull/57853))
- Remove unused `state` and rename `props` to `attributes` in `getElement()`. ([#57974](https://github.com/WordPress/gutenberg/pull/57974))
- Convert `navigate` and `prefetch` function to actions of the new `core/router` store, available when importing the `@wordpress/interactivity-router` module. ([#57924](https://github.com/WordPress/gutenberg/pull/57924))
- Convert `navigate` and `prefetch` function to actions of the new `core/router` store, available when importing the `@wordpress/interactivity/router` module. ([#57924](https://github.com/WordPress/gutenberg/pull/57924))

### Bug Fix

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tools/webpack/interactivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
name: 'interactivity',
entry: {
index: `./packages/interactivity/src/index.js`,
router: `./packages/interactivity-router/src/index.js`,
router: `./packages/interactivity/router/index.js`,
navigation: './packages/block-library/src/navigation/view.js',
query: './packages/block-library/src/query/view.js',
image: './packages/block-library/src/image/view.js',
Expand Down Expand Up @@ -89,7 +89,7 @@ module.exports = {
} ),
new DependencyExtractionWebpackPlugin( {
requestToExternalModule: ( request ) =>
request === '@wordpress/interactivity-router',
request === '@wordpress/interactivity/router',
} ),
],
watchOptions: {
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
{ "path": "packages/i18n" },
{ "path": "packages/icons" },
{ "path": "packages/interactivity" },
{ "path": "packages/interactivity-router" },
{ "path": "packages/is-shallow-equal" },
{ "path": "packages/keycodes" },
{ "path": "packages/lazy-import" },
Expand Down

0 comments on commit e551609

Please sign in to comment.