-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expose event.routeId
and page.routeId
#4345
Conversation
🦋 Changeset detectedLatest commit: d25b687 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Do we want to expose this in |
We definitely could put it in page (one of the changes in this series of PRs makes all page keys available to the client as a side effect), I was just being as conservative as possible. Do you have a use for it? |
It was one of my original ideas in #269 before that turned into exposing |
In that case is |
For posterity: we decided on |
event.routeId
and page.routeId
* remove fallthrough * changeset * remove fallthrough documentation * tweak docs * simplify * simplify * simplify a tiny bit * add failing test of param validators * client-side route parsing * tidy up * add validators to manifest data * client-side validation * simplify * server-side param validation * lint * oops * clarify * docs * minor fixes * fixes * ease debugging * vanquish SPA reloading bug * simplify * lint * windows fix * changeset * match route before calling handle - closes #1194 * changeset * throw error if validator module is missing a validate export * update configuration.md * Update documentation/docs/01-routing.md * tighten up validator naming requirements * disallow $ in both param names and types * changeset * point fallthrough users at validation docs * add some JSDoc commentsd * expose `event.routeId` and `page.routeId` (#4345) * expose event.routeKey - closes #3840 * change routeKey to routeId * rename routeKey to routeId, expose page.routeId * rename route.key -> route.id everywhere * adapter-node sure picked a weird time to stop typechecking * oops * Update .changeset/mean-crews-unite.md
Because of how sveltejs#4345 was merged into sveltejs#4344, the script that automatically adds PR numbers to the changelog got the wrong PR number for the "Expose `event.routeId` and `page.routeId`" feature. This manual change to the CHANGELOG.md file fixes that minor error.
* Update one incorrect PR number in changelog Because of how #4345 was merged into #4344, the script that automatically adds PR numbers to the changelog got the wrong PR number for the "Expose `event.routeId` and `page.routeId`" feature. This manual change to the CHANGELOG.md file fixes that minor error. * Update packages/kit/CHANGELOG.md Fix link destination as well as link text Co-authored-by: Ignatius Bagus <ignatius.mbs@gmail.com> Co-authored-by: Ignatius Bagus <ignatius.mbs@gmail.com>
closes #3840 (and #3907) by exposing the internal
route.key
asevent.routeKey
. This is a string based on the filename of the page/endpoint:event.routeKey
""
"about"
"blog"
"blog"
"blog/[slug]"
"blog/archive/[page=integer]"
"[...catchall]"
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpx changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0