Skip to content

fix: serialize server load data before passing to universal load alternative - #14298

Merged
Rich-Harris merged 27 commits into
sveltejs:mainfrom
PatrickG:issue-14291
Aug 28, 2025
Merged

Rich-Harris merged 27 commits into
sveltejs:mainfrom
PatrickG:issue-14291

Conversation

@PatrickG

@PatrickG PatrickG commented Aug 22, 2025 •

Copy link
Copy Markdown
Member

Alternative to #14268
Fixes #14291

CC @Rich-Harris


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

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 Markdown

@changeset-bot

changeset-bot Bot commented Aug 22, 2025 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 530de88

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

@PatrickG
PatrickG marked this pull request as draft August 22, 2025 22:51
@PatrickG
PatrickG marked this pull request as ready for review August 23, 2025 13:51
@PatrickG

Copy link
Copy Markdown
Member Author

Finally all green.

@Rich-Harris

Copy link
Copy Markdown
Member

Please resist the temptation to make drive-by tidy-ups, especially ones as large as these! It drowns out the substance of the PR and makes it much harder to understand what has actually changed. My tendency as a reviewer is to put PRs with large diffs in the 'ugh... later' pile, and I suspect a lot of maintainers are the same way.

Now that I've reverted all those changes I can get to work on the actual review :)

@PatrickG

Copy link
Copy Markdown
Member Author

Sorry, it wasn't a temptation, it happened automatically on save. I usually undo these myself before committing, must have forgotten.

@Rich-Harris

Copy link
Copy Markdown
Member

Ah, interesting. FWIW they were good changes — the imports are very raggedy. Would just be nice to update them all en masse (and maybe add similar tooling to keep them organised afterwards), once there are no open PRs that doing so would create merge conflicts with

@Rich-Harris Rich-Harris left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome work, thank you!

@Rich-Harris
Rich-Harris merged commit 1c416bc into sveltejs:main Aug 28, 2025
@github-actions github-actions Bot mentioned this pull request Aug 28, 2025
@PatrickG

Copy link
Copy Markdown
Member Author

Nice solution for that nonce thing

dummdidumm pushed a commit that referenced this pull request Sep 12, 2025
Fixes #14298
When a load function errors, we still need the serialized data of the successfully run layout load functions.
Copilot AI pushed a commit to Stadly/kit that referenced this pull request Mar 6, 2026
…ternative (sveltejs#14298)

* add universal load to /streaming/server test

* revert sveltejs#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 <[email protected]>
Copilot AI pushed a commit to Stadly/kit that referenced this pull request Mar 6, 2026
Fixes sveltejs#14298
When a load function errors, we still need the serialized data of the successfully run layout load functions.
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.

Streaming a custom class promise from server to client fails when a load function is in +page.ts

2 participants