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.
Background
PR #49494 externalized the Jetpack modules and WordPress.com plans data stores into the new
@automattic/jetpack-shared-storespackage, 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:
Proposed work
@automattic/jetpack-shared-stores(or apply the same externalization pattern).DependencyExtractionPluginrequest map so consumers depend on the shared bundle instead of re-bundling it.@automattic/jetpack-connectionfor backward compatibility.Follow-up to #49494.