Skip to content

breaking: revert #16751 - #16772

Merged
Rich-Harris merged 1 commit into
version-3from
revert-16751
Aug 13, 2026
Merged

breaking: revert #16751#16772
Rich-Harris merged 1 commit into
version-3from
revert-16751

Conversation

@Rich-Harris

@Rich-Harris Rich-Harris commented Aug 12, 2026

Copy link
Copy Markdown
Member

Reverts #16751. Moving RequestEvent and Cookies to $app/server was a reasonable enough idea but it leaves an awkward asymmetry with ServerLoadEvent (which extends RequestEvent but remains in @sveltejs/kit) and LoadEvent (which extends NavigationEvent; both of these are also in @sveltejs/kit).

We could move ServerLoadEvent to $app/server instead, though then we would probably need to move ServerLoad, and at that point we should probably also consider moving Action/Actions/ActionFailure/AwaitedActions there too, and if we're moving stuff that defines exports from route files then it would probably be weird to leave PrerenderOption behind (except that obviously doesn't belong in $app/server).

And if we did that, we should probably move LoadEvent and NavigationEvent to... $app/navigation presumably? But then we would also want to move Load and LoadProperties there 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 RequestEvent and Cookies back to the @sveltejs/kit dumping ground.


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 pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@pkg-svelte-dev

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from d0d1147:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/d0d1147df42b6e9d866a0686dd0ecafb9eb43b58

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/16772

@changeset-bot

changeset-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d0d1147

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@svelte-docs-bot

Copy link
Copy Markdown

@Nic-Polumeyv

Nic-Polumeyv commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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.

@Rich-Harris

Copy link
Copy Markdown
Member Author

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

@Rich-Harris
Rich-Harris merged commit 6f14f6f into version-3 Aug 13, 2026
26 of 27 checks passed
@Rich-Harris
Rich-Harris deleted the revert-16751 branch August 13, 2026 00:15
dummdidumm added a commit to sveltejs/cli that referenced this pull request Aug 13, 2026
dummdidumm added a commit to sveltejs/cli that referenced this pull request Aug 13, 2026
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.

3 participants