[feat] pass data from `locals` to `load`
See original GitHub issueDescribe the problem
My site queries an external API with the following pattern:
handle
extracts user ID from cookie+layout.svelte
fetches user by user ID+page.svelte
fetches profile by user ID
These fetches previously happened in parallel. With $session
removed I have no way to write this code without introducing a waterfall
Describe the proposed solution
I’m happy with any solution folks can think of that solves this problem
I think we could potentially solve this as part of https://github.com/sveltejs/kit/issues/7105
Alternatives considered
No response
Importance
i cannot use SvelteKit in a performant manner without it
Additional Information
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:11
- Comments:17 (12 by maintainers)
Top Results From Across the Web
FEAT/UserGuide - FSL - FslWiki
Highpass temporal filtering uses a local fit of a straight line (Gaussian-weighted within the line to give a smooth response) to remove low ......
Read more >Introduction to Keras, Part One: Data Loading | by Samhita Alla
To load images from a URL, use the get_file() method to fetch the data by passing the URL as an arguement. This stores...
Read more >Local State - FlutterFlow Docs
1. Create a local state variable · 2. Set data into the local state variable · 3. Create/add a custom widget · 4....
Read more >MySQL 8.0 Reference Manual :: 5.1.8 Server System Variables
To explicitly cause the server to refuse or permit LOAD DATA LOCAL ... However, the server does not send to the client more...
Read more >Pass a variable from javascript to ejs - node.js - Stack Overflow
The app.locals.myVar approach should work, so something must be getting in the way. But you could avoid using app.locals.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Copying my Discord-thoughts into here:
What became clear to me that getSession was used for multiple things at once.
Because it had so many use cases in once, it became somewhat confusing what runs when, because people may only think about 4 and then wonder about 3. So I think removing it in its form was correct, but we need some features that bring back the mentioned points in a easy-to-use way. Right now we have this situation:
–> I feel like we need to add recipes and/or APIs to ease this
The idea of more fine-grained
await parent()
is a interesting idea. Another way could be to optionally passparent
a function to tell it what to wait for, or a list of top level keys.Edit: They key-version is probably not possible. How would the function know that the
user
key that is returned by some upperload
function is actually the last with that key? If there are two load functions returninguser
, we need to wait for the later load function in the chain, but we don’t know that there’s something coming later on.