You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
Describe the bug
If the server preload returns something falsy, the client-side preload is run upon hydration.
Expected behavior
If the server preload returns something serializable (even if it's falsy), the client-side preload should not be run upon hydration.
I imagine this could be solved by doing a || {} thing earlier in the process, so that the client actually gets a serialized {} in the initial rendered page, and knows not to run preload.
Severity
Probably low. If a preload is returning no data, it's probably not making any wasteful repeated ajax requests on the client.
The text was updated successfully, but these errors were encountered:
However this did raise a question of what to do when people are mainly writing a preload for its side effects. This seems to be more likely with layout preloads. Someone could conceivably write a layout preload which checks for something in the session, and either calls this.redirect or returns undefined. Currently this preload would (kind of by accident) be calls on each route change within its purview. With the above changes it would not. Is this a design goal? Do we want to change/fix the behavior only for route-specific preloads?
Describe the bug
If the server preload returns something falsy, the client-side preload is run upon hydration.
Expected behavior
If the server preload returns something serializable (even if it's falsy), the client-side preload should not be run upon hydration.
I imagine this could be solved by doing a
|| {}
thing earlier in the process, so that the client actually gets a serialized{}
in the initial rendered page, and knows not to run preload.Severity
Probably low. If a preload is returning no data, it's probably not making any wasteful repeated ajax requests on the client.
The text was updated successfully, but these errors were encountered: