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
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:909cb9b1-7138-bba7-ceaf-9347aa63ce58 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BA28:622FF:302B50:45B452:6A4E2C51 |
| html-safe-nonce | bb21aca2f0c441d574d819ae69c0d89507e5e05fc53321a6ca29142bc72c3cde |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTI4OjYyMkZGOjMwMkI1MDo0NUI0NTI6NkE0RTJDNTEiLCJ2aXNpdG9yX2lkIjoiMTE0Mzg3MzkzMDE0ODA2NDMzNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 752ea33bbebfecb479a02925f03e76e28c65d416a1b3eab2834f24629bdc2041 |
| hovercard-subject-tag | pull_request:3211781526 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/bQuery/bQuery/pull/29/files |
| twitter:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| og:image:alt | 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... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/bQuery/bQuery git https://github.com/bQuery/bQuery.git |
| octolytics-dimension-user_id | 256381806 |
| octolytics-dimension-user_login | bQuery |
| octolytics-dimension-repository_id | 1139284244 |
| octolytics-dimension-repository_nwo | bQuery/bQuery |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1139284244 |
| octolytics-dimension-repository_network_root_nwo | bQuery/bQuery |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d9dd20d38f8ae3c4cb6b597807431db300d0bd2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width