Skip to content

Externalize the Jetpack connection data store to avoid duplicate registration #49751

Description

@kraftbj

Background

PR #49494 externalized the Jetpack modules and WordPress.com plans data stores into the new @automattic/jetpack-shared-stores package, building them into a single bundle so each store registers exactly once. That resolved the "Store … is already registered" warnings caused by the same store being bundled into multiple scripts.

Problem

The Jetpack connection store (@automattic/jetpack-connection) has the same duplicate-registration exposure and is the natural next candidate for the same treatment.

In the review of #49494, @manzoorwanijk noted:

This looks good to me and works great. Next, we should do something about the connection store

Proposed work

  • Move the connection store into @automattic/jetpack-shared-stores (or apply the same externalization pattern).
  • Register it in the shared-stores bundle and add it to the webpack DependencyExtractionPlugin request map so consumers depend on the shared bundle instead of re-bundling it.
  • Re-export it from @automattic/jetpack-connection for backward compatibility.

Follow-up to #49494.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions