-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
page.server endpoints/server load functions can't trigger a layout.server rerun and refresh $page on the client #11415
Comments
mostrecent
changed the title
page.server endpoints/serveer load functions can't trigger a layout.server rerun and refresh $page on the client
page.server endpoints/server load functions can't trigger a layout.server rerun and refresh $page on the client
Dec 20, 2023
I found that I can let layout.server rerun with adding await parent() to the children endpoints. But it does not change $page on the client in case the rerun gave new values. only those new from the children endpoint are populated in $page while those from layout stay the same from the first run |
This was referenced Dec 20, 2023
Closed in favor of #9355 |
Reopening because of #6315 (comment) and #9355 (comment) |
closing as duplicate of #9355 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the problem
Sometimes you need to refresh "a global object" which was passed from layout.server but the refresh needs to happen from an children server load function/page.server endpoint (or to be more precise: should be triggered when a children endpoint is called).
Now, you can do this only with a full page reload or not using layout.server but ensuring that the object is sent with every endpoint/sever load func.
Describe the proposed solution
Option A, either some flag on the server load functions which let layout.server rerun
Option B, we can let hook.server pass stuff directly through the endpoints without manually passing stuff: locals.stuff in the server load func response
B should be actually covered by layouts (but, again, which do not rerun), so A might be more intuitive
Alternatives considered
No response
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: