Skip to content

fix(react,journeys): bump peer @modular-react/core to ^2.0.0#33

Merged
diogomiguel merged 1 commit intomainfrom
fix/peer-deps-core-2x
May 7, 2026
Merged

fix(react,journeys): bump peer @modular-react/core to ^2.0.0#33
diogomiguel merged 1 commit intomainfrom
fix/peer-deps-core-2x

Conversation

@diogomiguel
Copy link
Copy Markdown
Collaborator

@diogomiguel diogomiguel commented May 7, 2026

Summary

  • Peer-dep drift: @modular-react/react@2.0.0 and @modular-react/journeys@1.0.0 declare @modular-react/core: ^1.2.0, but both packages already require a 2.x core at runtime.
  • Bumps the peer ranges to ^2.0.0 and adds the same fix to journeys' peer of @modular-react/react.
  • Peer-descriptor correction only — no behavior change. CHANGELOG entry added under Unreleased.

Why this matters for consumers

Trying to install @modular-react/journeys@1.0.0 against @modular-react/core@^2.0.0 (the version that actually contains the lazy entry-point support journeys depends on) produces:

npm error code ERESOLVE
npm error peer @modular-react/core@"^1.2.0" from @modular-react/journeys@1.0.0

The --legacy-peer-deps / --force workarounds installed but produced a dual-copy resolution:

+-- @modular-react/core@2.0.0
+-- @modular-react/journeys@1.0.0
| +-- @modular-react/core@1.5.0          ← nested copy via stale peer range
| `-- @modular-react/react@1.4.0
|   `-- @modular-react/core@1.5.0 deduped

That fragments registry, defineEntry identity, and any other singleton in core — calls from journeys' code (lazy resolution, JourneyOutlet preload) would be operating against a different core instance than the host app's registry.register(...). Hard to debug.

The runtime code in journeys 1.0.0 already imports EagerModuleEntryPoint | LazyModuleEntryPoint and resolveEntryComponent — symbols introduced in core 2.0.0. The ^1.2.0 peer was just never bumped when the lazy work landed in #30. Same drift on react@2.0.0's own peer of core.

Verification

After this lands and ships (assuming via the workspace release-same-version flow), a consumer doing:

npm install @modular-react/core@^2.0.0 @modular-react/journeys@^1.0.1

resolves to a single hoisted core@2.x everywhere — no nested copies, no ERESOLVE.

Test plan

  • pnpm install at the workspace root still resolves cleanly (workspace deps use workspace:* so the changed peer ranges don't affect internal resolution)
  • git diff shows only peer ranges and the CHANGELOG entry — no behavior code touched

Summary by CodeRabbit

  • Behavior Changes

    • Navigation item ordering now maintains insertion order when order values are equal or unset, rather than using alphabetical sorting.
  • Dependencies

    • Updated peer dependency versions to 2.0.0 for compatibility alignment across packages.

`@modular-react/react@2.0.0` and `@modular-react/journeys@1.0.0` already
require a 2.x core at runtime — lazy entry-points, the
`EagerModuleEntryPoint | LazyModuleEntryPoint` union, and
`resolveEntryComponent` all live in core 2.x — but the peer descriptors
still pointed at `^1.2.0`. Consumers installing `journeys@1.0.0` against
`core@^2.0.0` hit ERESOLVE; falling back to `--legacy-peer-deps` ends up
dual-installing core (hoisted 2.x + nested 1.x under journeys), which
fragments singletons (registry, defineEntry identity) at runtime.

Same fix on `@modular-react/journeys` peer of `@modular-react/react`
(`^1.2.0` → `^2.0.0`). Peer-descriptor correction, no behavior change.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d93e51c5-84c7-47d7-93d8-1540dce0de27

📥 Commits

Reviewing files that changed from the base of the PR and between 4dd0129 and e557774.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • packages/journeys/package.json
  • packages/react/package.json

📝 Walkthrough

Walkthrough

This PR updates peer dependency ranges for @modular-react/core from ^1.2.0 to ^2.0.0 across the @modular-react/react and @modular-react/journeys packages. The CHANGELOG documents a tie-breaking behavior change in buildNavigationManifest/useNavigation where items now preserve insertion order instead of using label/i18n-key string comparison when order is unset or equal.

Changes

Version 2.0.0 Release Documentation and Peer Dependencies

Layer / File(s) Summary
Release Notes and Behavior Changes
CHANGELOG.md
Navigation manifest tie-breaking behavior documented: insertion order preserved instead of label comparison when order is unset or equal. Peer dependency range corrections for @modular-react/core documented from ^1.2.0 to ^2.0.0.
Peer Dependency Constraints
packages/react/package.json, packages/journeys/package.json
@modular-react/core peer dependency updated from ^1.2.0 to ^2.0.0 in both packages.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • kibertoad/modular-react#29: The main PR's CHANGELOG documents the same buildNavigationManifest/useNavigation tie-breaking change (preserve insertion order instead of label comparison), so the changes are directly related.

Suggested labels

patch

Suggested reviewers

  • casamitjana

Poem

🐰 Hops through versions, two-point-oh,
Ties now break where orders flow,
Insertion order, neat and bright,
Dependencies aligned just right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: updating peer dependency ranges for @modular-react/core to ^2.0.0 across react and journeys packages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/peer-deps-core-2x

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@diogomiguel diogomiguel merged commit 4fb1c1d into main May 7, 2026
12 of 13 checks passed
@diogomiguel diogomiguel deleted the fix/peer-deps-core-2x branch May 7, 2026 16:08
diogomiguel added a commit that referenced this pull request May 7, 2026
Same peer-descriptor correction we did for journeys/react in #33, applied
to all six router-modules packages. Testing packages also bump their peer
of `@modular-react/journeys` from `^1.0.0` to `^1.0.1` to match the
upstream peer correction. No behavior change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants