Skip to content
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

Populate event.params before calling handle #4344

Merged
merged 43 commits into from Mar 16, 2022
Merged

Populate event.params before calling handle #4344

merged 43 commits into from Mar 16, 2022

Conversation

Rich-Harris
Copy link
Member

This is made possible by #4330 — now that we can match routes without needing to load/run them, we can populate event.params before calling handle, instead of mutating the event object as we work our way through the route manifest.

A nice follow-up would be to expose the route key, making it possible to address #3840 without introducing a new hook.

Closes #1194.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpx changeset and following the prompts. All changesets should be patch until SvelteKit 1.0

@benmccann benmccann mentioned this pull request Mar 16, 2022
8 tasks
@Rich-Harris Rich-Harris mentioned this pull request Mar 16, 2022
5 tasks
* 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
@Rich-Harris Rich-Harris merged commit 04dd532 into master Mar 16, 2022
@Rich-Harris Rich-Harris deleted the gh-1194 branch March 16, 2022 16:48
rmunn added a commit to rmunn/kit that referenced this pull request Apr 7, 2022
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.
ignatiusmb added a commit that referenced this pull request Apr 7, 2022
* 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>
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.

request.params not available in handle hook as docs / types indicate
2 participants