Skip to content

Pass the full VisitProposal to registered RouteDecisionHandler instances#203

Merged
jayohms merged 4 commits into
mainfrom
route-visit-proposal
Jul 2, 2026
Merged

Pass the full VisitProposal to registered RouteDecisionHandler instances#203
jayohms merged 4 commits into
mainfrom
route-visit-proposal

Conversation

@jayohms

@jayohms jayohms commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Pass VisitProposal to route decision handlers

Route decision handlers previously only received the destination location string, which limited the routing logic apps could implement. This change passes the full VisitProposal instead — giving apps access to the location, visit options, path configuration properties, and bundle so they can build more comprehensive RouteDecisionHandlers.

⚠️ Breaking API changes

  • RouteDecisionHandler.matches(location: String, ...)matches(proposal: VisitProposal, ...)
  • RouteDecisionHandler.handle(location: String, ...)handle(proposal: VisitProposal, ...)
  • HotwireDestination.customRouteDecision(newLocation: String)customRouteDecision(proposal: VisitProposal)

Apps with custom RouteDecisionHandler implementations or customRouteDecision overrides will need to update their signatures. The location is still available via proposal.location.

Notes

The built-in handlers (app navigation, system navigation, browser tab) and their tests have been updated accordingly.

jayohms added 3 commits July 2, 2026 13:29
… pass along a VisitProposal instead of just the location
… the same VisitProposal changes made to the RouteDecisionHandler interface
@jayohms
jayohms requested review from mbarta and svara July 2, 2026 18:23
@jayohms
jayohms merged commit 3725b5b into main Jul 2, 2026
1 check passed
@jayohms
jayohms deleted the route-visit-proposal branch July 2, 2026 18:38

@svara svara left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants