@jsenv/navi 0.27.56 → 0.27.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14691,7 +14691,7 @@ const setupBrowserIntegrationViaHistory = ({
14691
14691
  url,
14692
14692
  {
14693
14693
  reason,
14694
- navigationType, // "push", "reload", "replace", "traverse"
14694
+ navigationType, // "load", "reload", "replace", "push", "traverse"
14695
14695
  state,
14696
14696
  },
14697
14697
  ) => {
@@ -14718,8 +14718,15 @@ const setupBrowserIntegrationViaHistory = ({
14718
14718
  updateDocumentState(state);
14719
14719
  }
14720
14720
 
14721
- // Routes only match on URL — skip route matching for state-only changes.
14722
- if (isSameUrl && navigationType !== "reload") {
14721
+ // Skip route matching for state-only changes: push/replace to the same URL
14722
+ // (e.g. useNavState updating document state without changing the route).
14723
+ // Do NOT apply for "traverse" — window.location.href is already updated by
14724
+ // the browser before the popstate handler runs, so isSameUrl is always true
14725
+ // for back/forward navigation regardless of whether the URL actually changed.
14726
+ if (
14727
+ isSameUrl &&
14728
+ (navigationType === "push" || navigationType === "replace")
14729
+ ) {
14723
14730
  return undefined;
14724
14731
  }
14725
14732
 
@@ -14842,7 +14849,7 @@ const setupBrowserIntegrationViaHistory = ({
14842
14849
  const state = history.state;
14843
14850
  handleRoutingTask(url, {
14844
14851
  reason: "routing initialization",
14845
- navigationType: "replace",
14852
+ navigationType: "load",
14846
14853
  state,
14847
14854
  });
14848
14855
  };