chore(web): upgrade @tanstack/react-router to ^1.170.8#722
Open
swear01 wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Findings
- [Major] Router upgrade removes an export used by the app —
@tanstack/router-core@1.171.6no longer exportsscrollRestorationCache, butweb/src/lib/scrollStorageGuard.ts:7imports it and uses.set; this makes the web typecheck/build fail after the dependency bump atweb/package.json:27.
Suggested fix:Or keep"@tanstack/react-router": "1.145.6", "@tanstack/router-core": "1.145.6"
1.170.8and updatescrollStorageGuardto avoid the removed internal cache export, for example:import { storageKey } from '@tanstack/router-core' const STORAGE_KEY = storageKey // remove ScrollCacheUpdater/writeScrollRestorationCache and the scrollRestorationCache.set(...) sync path
Summary
- Review mode: initial
- Found one build-breaking dependency API incompatibility. The new package still exports
storageKey, but notscrollRestorationCache; the previous1.143.6and1.145.6package types export that cache.
Testing
- Not run (automation; inspected diff and package type exports only)
HAPI Bot
| "@tanstack/react-query-devtools": "^5.91.1", | ||
| "@tanstack/react-router": "^1.143.6", | ||
| "@tanstack/react-router": "^1.170.8", | ||
| "@tanstack/router-core": "^1.171.6", |
There was a problem hiding this comment.
[MAJOR] @tanstack/router-core@1.171.6 no longer exports scrollRestorationCache, but web/src/lib/scrollStorageGuard.ts:7 imports it and uses .set. With this dependency bump, bun typecheck:web/vite build will fail on the missing export before the app ships.
Suggested fix:
"@tanstack/react-router": "1.145.6",
"@tanstack/router-core": "1.145.6"Or keep 1.170.8 and update scrollStorageGuard to use exported API only:
import { storageKey } from '@tanstack/router-core'
const STORAGE_KEY = storageKey
// remove ScrollCacheUpdater/writeScrollRestorationCache and the scrollRestorationCache.set(...) sync path… API `scrollRestorationCache` was removed from the public exports; replace with `storageKey` import and simplify `hardResetScrollRestorationPersistedState` to a plain `removeItem`. Remove the now-stale in-memory cache sync path and its associated tests. Upstream try-catch (>=1.145.6) covers crash prevention; this guard continues to proactively prune sessionStorage. via [HAPI](https://hapi.run) Co-Authored-By: HAPI <noreply@hapi.run>
5d082f4 to
cb42ffe
Compare
There was a problem hiding this comment.
Findings
- No issues found.
Summary
- Review mode: follow-up after new commits
- The prior bot finding about
scrollRestorationCachebeing removed is addressed: the guard now imports the exportedstorageKeyfrom@tanstack/router-core, and package metadata for@tanstack/router-core@1.171.6confirms that export exists. Residual risk: I could not run the web typecheck/tests in this runner becausebunis not installed.
Testing
- Not run (automation;
bununavailable in this environment)
HAPI Bot
4 tasks
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.
Summary
Upgrade
@tanstack/react-routerfrom^1.143.6→^1.170.8to fixQuotaExceededErrorin scroll position restoration.Problem
sessionStorage.setItem('tsr-scroll-restoration-v1_3', ...)throwsQuotaExceededErrorwhen the scroll restoration cache grows beyond the browser's sessionStorage quota, crashing the app.@tanstack/react-router— upstream already has built-in scroll-restoration quota fix #683Fix
Upstream
@tanstack/react-router>=1.145.6 wrapssessionStorage.setItemwith try-catch in thescroll-restorationmodule, preventing the crash.Verification
bun typecheckpasses on all packages (cli / web / hub)Notes
This fix prevents the crash but does not actively prune the scroll cache when it approaches quota. For proactive pruning, #717 is still needed.