chore: read the request state from the event instead of threading it alongside - #16969
Open
Nic-Polumeyv wants to merge 4 commits into
Open
chore: read the request state from the event instead of threading it alongside#16969Nic-Polumeyv wants to merge 4 commits into
Nic-Polumeyv wants to merge 4 commits into
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/3caf1f5090ee952f5450f4a440ca7d636bd20b2aOpen in |
|
Nic-Polumeyv
force-pushed
the
request-state-on-event
branch
from
August 28, 2026 00:02
9a99f6e to
b0d8267
Compare
Nic-Polumeyv
force-pushed
the
request-state-on-event
branch
5 times, most recently
from
August 28, 2026 01:32
c47397d to
6f3c17a
Compare
Nic-Polumeyv
force-pushed
the
request-state-on-event
branch
from
August 28, 2026 01:40
6f3c17a to
3caf1f5
Compare
Nic-Polumeyv
marked this pull request as ready for review
August 28, 2026 03:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RequestStateis passed as an(event, state)pair through 16 functions inruntime/server, and the request store exists to carry the same pair to$app/servercode. Every function that has the event already has the request, so both are redundant.respond.jsnow registers the state in aWeakMapkeyed byevent.requestandget_state(event)reads it back. The request is the one object that exists once per request and survives every{ ...event }copy, so nothing is added to the event itself; the live-query event replacesrequestand re-attaches. With the state reachable from the event, the store has nothing of its own left:with_request_store({ event, state })becomeswith_event(event),get_request_store()becomesget_event(), andRequestStoreis gone. The 16 signatures takeeventalone;internal_respond,internal_fetchandfork_state_for_subrequeststill takestatebecause they run before the event exists.