breaking: revert #16751 - #16772
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/d0d1147df42b6e9d866a0686dd0ecafb9eb43b58Open in |
|
|
I agree. But an argument can be made that getRequestEvent() returns a RequestEvent, so that type sits next to a function that produces it, whereas nothing at runtime hands you a ServerLoadEvent. "Types co-located with the runtime exports that return them" would be a stopping point that doesn't cascade. Also, in practice ServerLoadEvent is mostly reached through ./$types (PageServerLoad etc) rather than imported by name, so the asymmetry wouldn't be very visible for 99% of uses. |
|
Yeah, there's no absolutely correct answer here. Reverting is the easier option, we can also sneak in one last breaking change before the stable release if we decide it's a mistake |
Reverts #16751. Moving
RequestEventandCookiesto$app/serverwas a reasonable enough idea but it leaves an awkward asymmetry withServerLoadEvent(which extendsRequestEventbut remains in@sveltejs/kit) andLoadEvent(which extendsNavigationEvent; both of these are also in@sveltejs/kit).We could move
ServerLoadEventto$app/serverinstead, though then we would probably need to moveServerLoad, and at that point we should probably also consider movingAction/Actions/ActionFailure/AwaitedActionsthere too, and if we're moving stuff that defines exports from route files then it would probably be weird to leavePrerenderOptionbehind (except that obviously doesn't belong in$app/server).And if we did that, we should probably move
LoadEventandNavigationEventto...$app/navigationpresumably? But then we would also want to moveLoadandLoadPropertiesthere and I'm not sure how I feel about that.I'm not 100% on any of this. But I think the safest option is probably to move
RequestEventandCookiesback to the@sveltejs/kitdumping ground.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits