-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix: clone server data before running universal load on server #12235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: d37f5f5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
packages/kit/test/apps/basics/src/routes/load/mutated-server-data/+page.js
Outdated
Show resolved
Hide resolved
|
I think the simplest fix for this is to shallow clone the object because:
|
|
Thanks for the exploration, but I'm closing this (for now, we can always reopen later) for the reasons given in #12236 (comment) |
fixes #12236
A refactor attempt to serialize the server data before it's passed to the universal load functions.I'm sure I haven't implemented this correctly:1. I don't think it's correct to await all the server loads, to serialize the server data, and only then run the universal load functions (might slow down when they start and finish).1. I also don't like the code duplication shared between rendering the page and error (and whatever needs to serialise server code in the future).Maybe someone can take a better shot at this.EDIT: decided on shallow cloning the server data (see #12235 (comment))
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