Skip to content

Conversation

Rich-Harris
Copy link
Member

Fixes #12236. The implementation isn't totally ideal — it causes the server load return value to be serialized twice if data is used in a universal load function, and changing that would be finicky — but given our overall trajectory towards remote functions I think it's an acceptable trade-off given that using data is probably relatively rare (and it only affects SSR, not data for subsequent client-side navigations).


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.

@svelte-docs-bot
Copy link

Copy link

changeset-bot bot commented Aug 19, 2025

🦋 Changeset detected

Latest commit: 5aab6bf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

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

@Rich-Harris Rich-Harris merged commit c5a9794 into main Aug 19, 2025
21 checks passed
@Rich-Harris Rich-Harris deleted the gh-12236 branch August 19, 2025 20:45
@github-actions github-actions bot mentioned this pull request Aug 19, 2025
PatrickG added a commit to PatrickG/kit that referenced this pull request Aug 22, 2025
Rich-Harris added a commit that referenced this pull request Aug 28, 2025
…ternative (#14298)

* add universal load to /streaming/server test

* revert #14268

* server data serializer

* Satisfy linter

* rethrow serialization error after load promises are resolved

* format

* add changeset

* get rid of the global placeholder

* fix dumb mistake

* fix errors

* return directly again

* return iterator even if all promises are resolved already

* prevent memory leak

* format

* use `DEV` from `esm-env`

* revert reordering

* revert reordering

* revert reordering

* revert reordering

* remove type, everything is a type in a .d.ts file

* revert reordering

* serialize -> add_node

* unused

* simplify create_async_iterator

* avoid the need for set_nonce dance

---------

Co-authored-by: Rich Harris <rich.harris@vercel.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.

mutating the data prop in a universal load affects the data returned from a server load
2 participants