René's URL Explorer Experiment


Title: Fix router base path duplication and add SSR guards for Element checks by Copilot · Pull Request #29 · bQuery/bQuery · GitHub

Open Graph Title: Fix router base path duplication and add SSR guards for Element checks by Copilot · Pull Request #29 · bQuery/bQuery

X Title: Fix router base path duplication and add SSR guards for Element checks by Copilot · Pull Request #29 · bQuery/bQuery

Description: Completed: PR #16 and PR #29 review feedback Original issues from PR #16 (thread 3706891136) Fix router base path duplication in interceptLinks() Add SSR/non-DOM guards for instanceof Element checks Fix SSR safety for interceptLinks() default parameter Handle null router case explicitly Additional issues from PR #29 (thread 3707704436) Add typeof window guard before window.location.origin check (comment 2729005583) Fix base="/" edge case to prevent path stripping (comment 2729005572) Clarify error handling comments for null router (comment 2729005603) Add comprehensive test coverage for base path stripping (comment 2729005595) Code quality improvements Fix window guard to properly short-circuit Remove trailing whitespace Run full test suite (413/413 pass) Run linter (no errors) Run security scan (no vulnerabilities) Final code review (no issues) Summary of changes Files modified: src/router/types.ts - Added base and hash properties to Router type src/router/router.ts - Exposed base and hash on router instance src/router/links.ts - Fixed base path stripping, added SSR guards, improved error handling src/core/utils/type-guards.ts - Added SSR guard to isElement() src/motion/scroll.ts - Added SSR guard to resolveElements() tests/router.test.ts - Added 2 test cases for base path stripping Key improvements: Router links now correctly strip base paths before navigation All code safe in SSR/non-DOM environments Edge cases (base="/", missing window) handled correctly Comprehensive test coverage added Clear documentation via comments All issues resolved and validated. ✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Open Graph Description: Completed: PR #16 and PR #29 review feedback Original issues from PR #16 (thread 3706891136) Fix router base path duplication in interceptLinks() Add SSR/non-DOM guards for instanceof Element ch...

X Description: Completed: PR #16 and PR #29 review feedback Original issues from PR #16 (thread 3706891136) Fix router base path duplication in interceptLinks() Add SSR/non-DOM guards for instanceof Element ch...

Opengraph URL: https://github.com/bQuery/bQuery/pull/29

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:909cb9b1-7138-bba7-ceaf-9347aa63ce58
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBA28:622FF:302B50:45B452:6A4E2C51
html-safe-noncebb21aca2f0c441d574d819ae69c0d89507e5e05fc53321a6ca29142bc72c3cde
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTI4OjYyMkZGOjMwMkI1MDo0NUI0NTI6NkE0RTJDNTEiLCJ2aXNpdG9yX2lkIjoiMTE0Mzg3MzkzMDE0ODA2NDMzNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac752ea33bbebfecb479a02925f03e76e28c65d416a1b3eab2834f24629bdc2041
hovercard-subject-tagpull_request:3211781526
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/bQuery/bQuery/pull/29/files
twitter:imagehttps://avatars.githubusercontent.com/in/1143301?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/in/1143301?s=400&v=4
og:image:altCompleted: PR #16 and PR #29 review feedback Original issues from PR #16 (thread 3706891136) Fix router base path duplication in interceptLinks() Add SSR/non-DOM guards for instanceof Element ch...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/bQuery/bQuery git https://github.com/bQuery/bQuery.git
octolytics-dimension-user_id256381806
octolytics-dimension-user_loginbQuery
octolytics-dimension-repository_id1139284244
octolytics-dimension-repository_nwobQuery/bQuery
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1139284244
octolytics-dimension-repository_network_root_nwobQuery/bQuery
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released9dd20d38f8ae3c4cb6b597807431db300d0bd2a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/bQuery/bQuery/pull/29/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FbQuery%2FbQuery%2Fpull%2F29%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FbQuery%2FbQuery%2Fpull%2F29%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=bQuery%2FbQuery
Reloadhttps://github.com/bQuery/bQuery/pull/29/files
Reloadhttps://github.com/bQuery/bQuery/pull/29/files
Reloadhttps://github.com/bQuery/bQuery/pull/29/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/29/files
bQuery https://github.com/bQuery
bQueryhttps://github.com/bQuery/bQuery
Please reload this pagehttps://github.com/bQuery/bQuery/pull/29/files
Notifications https://github.com/login?return_to=%2FbQuery%2FbQuery
Fork 0 https://github.com/login?return_to=%2FbQuery%2FbQuery
Star 1 https://github.com/login?return_to=%2FbQuery%2FbQuery
Code https://github.com/bQuery/bQuery
Issues 0 https://github.com/bQuery/bQuery/issues
Pull requests 0 https://github.com/bQuery/bQuery/pulls
Actions https://github.com/bQuery/bQuery/actions
Security and quality 0 https://github.com/bQuery/bQuery/security
Insights https://github.com/bQuery/bQuery/pulse
Code https://github.com/bQuery/bQuery
Issues https://github.com/bQuery/bQuery/issues
Pull requests https://github.com/bQuery/bQuery/pulls
Actions https://github.com/bQuery/bQuery/actions
Security and quality https://github.com/bQuery/bQuery/security
Insights https://github.com/bQuery/bQuery/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FbQuery%2FbQuery%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FbQuery%2FbQuery%2Fissues%2Fnew%2Fchoose
JosunLPhttps://github.com/JosunLP
developmenthttps://github.com/bQuery/bQuery/tree/development
copilot/sub-pr-16https://github.com/bQuery/bQuery/tree/copilot/sub-pr-16
Conversation 11 https://github.com/bQuery/bQuery/pull/29
Commits 5 https://github.com/bQuery/bQuery/pull/29/commits
Checks 5 https://github.com/bQuery/bQuery/pull/29/checks
Files changed https://github.com/bQuery/bQuery/pull/29/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/29/files
Fix router base path duplication and add SSR guards for Element checks https://github.com/bQuery/bQuery/pull/29/files#top
Show all changes 5 commits https://github.com/bQuery/bQuery/pull/29/files
8220e59 Initial plan Copilot Jan 26, 2026 https://github.com/bQuery/bQuery/pull/29/commits/8220e59d165cdc1ef546a1a1b31579fddc7ebb98
845f959 Fix router base path duplication and add SSR guards for Element checks Copilot Jan 26, 2026 https://github.com/bQuery/bQuery/pull/29/commits/845f9598dc327c228e72a443b60150f2dc90eca1
954736c Fix SSR safety for interceptLinks default parameter and null router h… Copilot Jan 26, 2026 https://github.com/bQuery/bQuery/pull/29/commits/954736c3cad262429893ef863a322629eb518175
5f5f428 Address PR review comments: add window guard, fix base="/" edge case,… Copilot Jan 26, 2026 https://github.com/bQuery/bQuery/pull/29/commits/5f5f42838b7fb46f4512800a74a23d087364b5ff
ffd5fe9 Fix window guard short-circuit and remove trailing whitespace Copilot Jan 26, 2026 https://github.com/bQuery/bQuery/pull/29/commits/ffd5fe928473d376cad86d2b73f55514ed98440e
Clear filters https://github.com/bQuery/bQuery/pull/29/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/29/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/29/files
type-guards.ts https://github.com/bQuery/bQuery/pull/29/files#diff-62aedb4ffd8496e7e1bdc3095e7da281cf12211192de719503624d8bcc4bd30e
scroll.ts https://github.com/bQuery/bQuery/pull/29/files#diff-bc04dc272baf6f5950435e702198649131e8de7c22848b6511cec3b7128bc5fc
links.ts https://github.com/bQuery/bQuery/pull/29/files#diff-125d7e3398caadda51e6b31f74d0520acbb873d1309b6b0b485cbfcd20f38079
router.ts https://github.com/bQuery/bQuery/pull/29/files#diff-a85a0f5e1d8548395d0d121ff26322f9c4259241bb6b86adfedc23439893516a
types.ts https://github.com/bQuery/bQuery/pull/29/files#diff-fde71c0f0096ad87d64df708f0fc36252de8e881f07398229dcd06b0198d6fc1
router.test.ts https://github.com/bQuery/bQuery/pull/29/files#diff-56c92063910ea376ca11a7f6c8f093e3a4a58b7635a6fdb53ec7912c5f5be269
src/core/utils/type-guards.tshttps://github.com/bQuery/bQuery/pull/29/files#diff-62aedb4ffd8496e7e1bdc3095e7da281cf12211192de719503624d8bcc4bd30e
View file https://github.com/bQuery/bQuery/blob/ffd5fe928473d376cad86d2b73f55514ed98440e/src/core/utils/type-guards.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/29/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/29/files#diff-62aedb4ffd8496e7e1bdc3095e7da281cf12211192de719503624d8bcc4bd30e
https://github.com/bQuery/bQuery/pull/29/files#diff-62aedb4ffd8496e7e1bdc3095e7da281cf12211192de719503624d8bcc4bd30e
src/motion/scroll.tshttps://github.com/bQuery/bQuery/pull/29/files#diff-bc04dc272baf6f5950435e702198649131e8de7c22848b6511cec3b7128bc5fc
View file https://github.com/bQuery/bQuery/blob/ffd5fe928473d376cad86d2b73f55514ed98440e/src/motion/scroll.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/29/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/29/files#diff-bc04dc272baf6f5950435e702198649131e8de7c22848b6511cec3b7128bc5fc
https://github.com/bQuery/bQuery/pull/29/files#diff-bc04dc272baf6f5950435e702198649131e8de7c22848b6511cec3b7128bc5fc
src/router/links.tshttps://github.com/bQuery/bQuery/pull/29/files#diff-125d7e3398caadda51e6b31f74d0520acbb873d1309b6b0b485cbfcd20f38079
View file https://github.com/bQuery/bQuery/blob/ffd5fe928473d376cad86d2b73f55514ed98440e/src/router/links.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/29/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/29/files#diff-125d7e3398caadda51e6b31f74d0520acbb873d1309b6b0b485cbfcd20f38079
https://github.com/bQuery/bQuery/pull/29/files#diff-125d7e3398caadda51e6b31f74d0520acbb873d1309b6b0b485cbfcd20f38079
https://github.com/bQuery/bQuery/pull/29/files#diff-125d7e3398caadda51e6b31f74d0520acbb873d1309b6b0b485cbfcd20f38079
https://github.com/bQuery/bQuery/pull/29/files#diff-125d7e3398caadda51e6b31f74d0520acbb873d1309b6b0b485cbfcd20f38079
Please reload this pagehttps://github.com/bQuery/bQuery/pull/29/files
https://github.com/bQuery/bQuery/pull/29/files#diff-125d7e3398caadda51e6b31f74d0520acbb873d1309b6b0b485cbfcd20f38079
src/router/router.tshttps://github.com/bQuery/bQuery/pull/29/files#diff-a85a0f5e1d8548395d0d121ff26322f9c4259241bb6b86adfedc23439893516a
View file https://github.com/bQuery/bQuery/blob/ffd5fe928473d376cad86d2b73f55514ed98440e/src/router/router.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/29/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/29/files#diff-a85a0f5e1d8548395d0d121ff26322f9c4259241bb6b86adfedc23439893516a
https://github.com/bQuery/bQuery/pull/29/files#diff-a85a0f5e1d8548395d0d121ff26322f9c4259241bb6b86adfedc23439893516a
src/router/types.tshttps://github.com/bQuery/bQuery/pull/29/files#diff-fde71c0f0096ad87d64df708f0fc36252de8e881f07398229dcd06b0198d6fc1
View file https://github.com/bQuery/bQuery/blob/ffd5fe928473d376cad86d2b73f55514ed98440e/src/router/types.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/29/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/29/files#diff-fde71c0f0096ad87d64df708f0fc36252de8e881f07398229dcd06b0198d6fc1
tests/router.test.tshttps://github.com/bQuery/bQuery/pull/29/files#diff-56c92063910ea376ca11a7f6c8f093e3a4a58b7635a6fdb53ec7912c5f5be269
View file https://github.com/bQuery/bQuery/blob/ffd5fe928473d376cad86d2b73f55514ed98440e/tests/router.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/29/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/29/files#diff-56c92063910ea376ca11a7f6c8f093e3a4a58b7635a6fdb53ec7912c5f5be269
https://github.com/bQuery/bQuery/pull/29/files#diff-56c92063910ea376ca11a7f6c8f093e3a4a58b7635a6fdb53ec7912c5f5be269
Please reload this pagehttps://github.com/bQuery/bQuery/pull/29/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.