@rangojs/router 0.0.0-experimental.37 → 0.0.0-experimental.39

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.
@@ -1745,7 +1745,7 @@ import { resolve } from "node:path";
1745
1745
  // package.json
1746
1746
  var package_default = {
1747
1747
  name: "@rangojs/router",
1748
- version: "0.0.0-experimental.37",
1748
+ version: "0.0.0-experimental.39",
1749
1749
  description: "Django-inspired RSC router with composable URL patterns",
1750
1750
  keywords: [
1751
1751
  "react",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rangojs/router",
3
- "version": "0.0.0-experimental.37",
3
+ "version": "0.0.0-experimental.39",
4
4
  "description": "Django-inspired RSC router with composable URL patterns",
5
5
  "keywords": [
6
6
  "react",
@@ -480,14 +480,16 @@ export function createNavigationBridge(
480
480
  addTransitionType("navigation-back");
481
481
  }
482
482
  onUpdate(popstateUpdate);
483
+ // Restore inside the transition so React commits the new
484
+ // content before scroll restoration measures scrollHeight.
485
+ handleNavigationEnd({ restore: true, isStreaming });
483
486
  });
484
487
  } else {
485
488
  onUpdate(popstateUpdate);
489
+ // Restore scroll position for back/forward navigation
490
+ handleNavigationEnd({ restore: true, isStreaming });
486
491
  }
487
492
 
488
- // Restore scroll position for back/forward navigation
489
- handleNavigationEnd({ restore: true, isStreaming });
490
-
491
493
  // SWR: If stale, trigger background revalidation
492
494
  if (isStale) {
493
495
  debugLog("[Browser] Cache is stale, background revalidating...");
@@ -302,6 +302,10 @@ export function restoreScrollPosition(options?: {
302
302
  cancelScrollRestorationPolling();
303
303
  }
304
304
  }, SCROLL_POLL_INTERVAL_MS);
305
+
306
+ // Return true to prevent handleNavigationEnd from falling through
307
+ // to scrollToTop(). The polling will handle the final scroll.
308
+ return true;
305
309
  }
306
310
 
307
311
  return false;