Title: Fix router base path handling, bq-if DOM stability, and CHANGELOG consistency by Copilot · Pull Request #22 · bQuery/bQuery · GitHub
Open Graph Title: Fix router base path handling, bq-if DOM stability, and CHANGELOG consistency by Copilot · Pull Request #22 · bQuery/bQuery
X Title: Fix router base path handling, bq-if DOM stability, and CHANGELOG consistency by Copilot · Pull Request #22 · bQuery/bQuery
Description: Addresses 6 issues from PR #16 review: router base path mismatch causing navigation failures, bq-if breaking when elements move, and CHANGELOG inconsistencies. Router base path handling Problem: Routes were stored with base prefixed (/app/page), but path matching stripped base from URLs, causing mismatches: // Before: routes contain base, but matching receives stripped paths flattenRoutes([{ path: '/page' }], '/app') // → [{ path: '/app/page' }] getCurrentPath() // strips base: '/app/page' → '/page' createRoute('/page', routes) // tries to match '/page' against '/app/page' → FAIL Fix: Keep route definitions base-relative. Only apply base when reading/writing browser history: // After: routes stay base-relative flattenRoutes([{ path: '/page' }]) // → [{ path: '/page' }] getCurrentPath() // strips base: '/app/page' → '/page' createRoute('/page', routes) // matches '/page' against '/page' → SUCCESS history.pushState({}, '', `${base}${path}`) // base applied here only flattenRoutes(): Renamed parameter base → parentPath, removed base logic createRouter(): Pass routes without base to flattenRoutes() Test updated to expect base-relative paths in router.routes bq-if directive DOM stability Problem: Parent node captured at mount time becomes stale when element is moved: const parent = el.parentNode; // Captured once // Later, if element moved to different parent... parent?.replaceChild(el, placeholder); // Throws: el not child of parent Fix: Use replaceWith() which resolves current parent dynamically: placeholder.replaceWith(el); // Works even after element moved el.replaceWith(placeholder); CHANGELOG fixes Typos: dangrous → dangerous, brodken → broken Format: (1.1.2) → [1.1.2] for consistency with Keep a Changelog standard (applied to all versions) 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Open Graph Description: Addresses 6 issues from PR #16 review: router base path mismatch causing navigation failures, bq-if breaking when elements move, and CHANGELOG inconsistencies. Router base path handling Problem: Ro...
X Description: Addresses 6 issues from PR #16 review: router base path mismatch causing navigation failures, bq-if breaking when elements move, and CHANGELOG inconsistencies. Router base path handling Problem: Ro...
Opengraph URL: https://github.com/bQuery/bQuery/pull/22
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:08627cf9-f0cd-9a13-988e-3d5df6b4dba7 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8184:2A256:397400:532033:6A4E2C36 |
| html-safe-nonce | 3ad7f0121e6a7f8e3e2aedc6d815055984b3aa3836e91e363c471d498707e745 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTg0OjJBMjU2OjM5NzQwMDo1MzIwMzM6NkE0RTJDMzYiLCJ2aXNpdG9yX2lkIjoiNzMyNzcyOTQxNTg1NjQ2Njk5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8d51ff8e5f4c5763feb4522cf47ad7a651534c5d9ebeeb6bee4a961daf793c3d |
| hovercard-subject-tag | pull_request:3210088411 |
| 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/22/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 | Addresses 6 issues from PR #16 review: router base path mismatch causing navigation failures, bq-if breaking when elements move, and CHANGELOG inconsistencies. Router base path handling Problem: Ro... |
| 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