Automattic / Automattic/jetpack
Externalize the Jetpack connection data store to avoid duplicate registration
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
## 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.
Contributor guide
Assessment
This issue has not been assessed yet.