-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Send data from hooks to page load functions without a server load function #6714
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
Comments
Totally agree there needs to be a way to clearly separate business logic from data retrieval/caching. The former probably needs to be run every request (as used to be possible with Related to #6315. |
I only partially agree.
it could also be
The fact is that This I believe is for security reasons, in the sense that it is assumed that the data produced by The consideration made is more than fair, it is what I would also need. But at this point we might think we have 2 types of data:
|
@pilcrowonpaper you seemed to have a change of heart in #7107 (comment) (and I think you're right that #7107 was a dupe of this) — does that mean this issue should be closed? (For anyone following along: #7107 (comment) articulates why passing data from |
@Rich-Harris oops, forgot to close this, thanks for reminding me! |
Describe the problem
When implementing auth, it's impossible to run load functions in parallel. This is roughly how auth are implemented right now:
locals
locals
in+layout.server.ts
and add that to page dataawait parent()
in load functions to check for userIt would be great if we can move step 2 to a new function from a load function so it won't block all load functions below it from running.
Describe the proposed solution
I would like to see something similar to
getSession()
in hooks, that runs between hooks and load functions. This function can populate page data or populate a different new object.Alternatives considered
none
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: