Skip to content

Conversation

@gigitux
Copy link
Collaborator

@gigitux gigitux commented Jul 7, 2025

Fixes #723.

This PR fixes the core/interface registration error, but it doesn't fix the other errors mentioned in the issue.

This error happens because core/interface is a package included in the bundle and not available on the document object.
Currently, on the /new-pattern/ route are loaded the site-editor scripts and the bundle of the pattern creator editor.
Both of them, under the hood, load the @wordpress/editor package and this causes that the core/interface store is registered twice.

With this PR, the @wordpress/editor is bundled in the pattern creator editor and the site-editor scripts aren't loaded. In this way, the core/interface store is registered once.

At the same time, while this PR can be a good temporary solution, I think that we need to explore #719. As mentioned in #719, this will reduce the maintenance cost and fix other issues too.

Props ,

Screenshots

How to test the changes in this Pull Request:

  1. Visit /new-pattern/
  2. Open the dev tools.
  3. Ensure that Store "core/interface" is already registered. isn't visible.

Copy link
Contributor

@ryelle ryelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, fixes the error as described.

The failing test is also failing on trunk, and it's two parts— first, the call to npm run test:unit --workspace=wporg-pattern-directory-theme can be removed, since the old theme is not used anymore. But then the creator tests also fail with "SyntaxError: Unexpected token 'export'". Out of scope for this PR, and maybe irrelevant with #719 since it removes the separate creator plugin.

@gigitux
Copy link
Collaborator Author

gigitux commented Jul 8, 2025

Thanks for the review! Should I merge the PR?

@ryelle let me know how I can assist you to make #719 ready to be reviewed!

@dd32 dd32 merged commit a3da67f into WordPress:trunk Jul 17, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WP Pattern Directory Pattern Editor not working properly due to store core/interface' already registered error

3 participants