feat(premium-analytics): port routing package from next-woocommerce-analytics#49266
Merged
chihsuan merged 4 commits intoJun 10, 2026
Merged
Conversation
Contributor
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
0bc6f06 to
8ec819e
Compare
25e6b44 to
9b948a7
Compare
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
c08daf2 to
2c8048b
Compare
29a61ea to
efd9362
Compare
1b2f9f3 to
9e656b7
Compare
efd9362 to
e93fdb6
Compare
Base automatically changed from
wooa7s-1316-integrate-data-package-into-analytics
to
trunk
June 10, 2026 06:35
e93fdb6 to
790de85
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Third leaf in M2 — Shared Packages Integration (WOOA7S-1317): port
@next-woo-analytics/routinginto@automattic/jetpack-premium-analyticsas an internal package. Provides the routing/URL-search layer — date-range and comparison search-param encoders that write to the URL via@wordpress/route, thederiveComparisonRangehelper, and theuseStagedSearchhook (staged UI edits + atomic URL commits).Routing is Layer 1 and depends on both prerequisite packages, which have now landed on
trunk: every helper imports from@jetpack-premium-analytics/dataand@jetpack-premium-analytics/datetime.Commits
Reviewed most easily commit-by-commit — the verbatim copy is isolated first, so every later diff shows exactly what the monorepo port changed.
b3a0aa5f8cpackages/routing(verified withdiff -r); skim only3b2d1ec070tsconfig.jsondeletion, README name adaptation4b1dc4e641prettier --write+eslint --fixoutput, no manual edits mixed in; skim only790de85a29Monorepo adaptations
name: @next-woo-analytics/routingname: @automattic/jetpack-premium-analytics-routingREADME.md): the import specifier (@jetpack-premium-analytics/routing) comes fromwpPlugin.packageNamespace; thename:field is separate and uses the@automattic/...formimport … from '@next-woo-analytics/data'/'…/datetime'… from '@jetpack-premium-analytics/data'/'…/datetime'@next-woo-analytics/*in doc examples@jetpack-premium-analytics/*name:; import examples use the bare-scope specifier consumers actually import — same convention as the data package READMEwpModule: true@wordpress/buildequivalent iswpScriptModuleExports, but adding it today breakspnpm build: the@jetpack-premium-analytics/*specifiers are tsconfig-paths-only (leaf packages aren't pnpm workspace members), so the module build can't Node-resolve them. Same call as the data port (#49263); wired up with the first consumer@tanstack/react-routerindependenciesdate-fnsindependencies@wordpress/routeis the only external runtime dep@wordpress/route 0.12.0pinned on the leaftsconfig.jsonincludes: [packages/**/*]and supplies the@jetpack-premium-analytics/*path alias; mirrorspackages/datetime/andpackages/data/Parent-level wiring (
projects/packages/premium-analytics/):package.json: untouched.@wordpress/route 0.12.0andreactare already on the parent manifest, and — as on feat(premium-analytics): port data package from next-woocommerce-analytics #49263 — alllink:wiring for the internal packages is deferred to the first consumer PR (thevalid-dependencieslint rejectslink:entries anyway).eslint.config.mjs(temporary): adds a routing-only override block (packages/routing/**) softening the JSDoc rules the upstream style trips (require-jsdoc,require-param,require-returns,check-indentation) and silencing thereactextraneous-dependency false positive (the hook importsreactdirectly; the internal package's deps live on the parent manifest). No shared glob is widened — datetime/data overrides are unchanged.What's intentionally not here
package.json/link:changes — deferred to the first consumer PR, same as feat(premium-analytics): port data package from next-woocommerce-analytics #49263.wpScriptModuleExports— see thewpModulerow above.@tanstack/react-router— unused upstream.date-fnsleaf dep — not imported by routing.eslint.config.mjscomments.Does this pull request change what data or activity we track or use?
No.
Testing instructions
Requires Node 24 (repo
engineStrict).To verify the copy commit is verbatim:
git diff <copy-commit> -- projects/packages/premium-analytics/packages/routingagainst a checkout of upstreamnext-woocommerce-analytics/packages/routingis empty (modulonode_modules).