Skip to content

feat: router and runtime audit fixes#1656

Open
fingersandmind wants to merge 4 commits intomainfrom
fix/router-and-runtime-audit-fixes
Open

feat: router and runtime audit fixes#1656
fingersandmind wants to merge 4 commits intomainfrom
fix/router-and-runtime-audit-fixes

Conversation

@fingersandmind
Copy link
Copy Markdown
Contributor

No description provided.

…e link conflicts

- Add AbortController to cancel in-flight fetches on new navigation
- Fix rapid back/forward by resetting isNavigating and aborting pending fetches on popstate
- Normalize cache keys to pathname only so prefetch and navigate share the same cache
- Implement 5-minute cache TTL (was documented but never implemented)
- Consolidate updateNav() and updateActiveLinks() into single updateActiveLinks()
- Use consistent matching: exact for exactActiveClass, startsWith for activeClass
- Normalize trailing slashes in all URL comparisons
- Save scroll position in history.state before navigating away
- Restore scroll position on back/forward (popstate) navigation
- Swap meta tags (description, og:*, twitter:*) from new page on navigation
- Preserve persistent meta tags (charset, viewport)
…risk

- Add onDestroy cleanup for popstate/stx:navigate listeners in useSearchParams
- Add max cache size (50 entries) with LRU eviction for _queryCache
- Sanitize @html directive output by stripping <script> tags and on* event handlers
- Capture and clearTimeout after Promise.race resolves to prevent dangling timer
- Wrap JSON.parse(propsAttr) in try-catch with warning fallback to {}
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 17, 2026

Deploy Preview for stacks-stx failed. Why did it fail? →

Name Link
🔨 Latest commit d87b008
🔍 Latest deploy log https://app.netlify.com/projects/stacks-stx/deploys/69b99089ab91a10008e88b57

@fingersandmind fingersandmind force-pushed the fix/router-and-runtime-audit-fixes branch from 69e4f7e to d87b008 Compare March 17, 2026 17:33
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 17, 2026

Open in StackBlitz

npm i https://pkg.pr.new/bun-plugin-stx@1656
npm i https://pkg.pr.new/@stacksjs/components@1656
npm i https://pkg.pr.new/@stacksjs/stx@1656

commit: d87b008

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant