"Stuff" not present with Shadow Endpoints
See original GitHub issueDescribe the problem
With the recent advent of shadow endpoints https://github.com/sveltejs/kit/issues/3532, it is now possible to move all database requests or other external loading to the .ts
or .js
file.
However:
- Shadow endpoints do not have an output of
stuff
likeload
functions. - Therefore, a
load
function is still required when wanting to passstuff
to__layout.svelte
files. - While this doesn’t seem like a big deal, it is. When every page needs to pass
stuff
as an output - for example, for<meta>
tags - then the entire point of shadow endpoints is defeated.
Describe the proposed solution
A possible solution could be to add an export of stuff
to endpoint files. The complexity of this is unknown.
Alternatives considered
Require the user to provide a redundant load
function on every page. However, this is suboptimal.
Importance
Would make my life a lot easier!
Additional Information
*crickets chirp*
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Shadow Endpoints In Svelte Kit - Weekly Svelte - YouTube
Our first course drop coming March 3rd https://www.youtube.com/watch?v=LATf_lVYoMQ https://github.com/sveltejs/kit/issues/3532 Sign up for ...
Read more >Device Shadow error messages - AWS IoT Core
The Device Shadow service publishes a message on the error topic (over MQTT) when an attempt to change the state document fails. This...
Read more >Full Stack SvelteKit For Beginners - Joy of Code
SvelteKit is an opinionated full stack framework that ties the frontend and backend together delivering the best developer and user experience.
Read more >box-shadow - CSS: Cascading Style Sheets - MDN Web Docs
The box-shadow CSS property adds shadow effects around an element's ... and that ranges from the full shadow color at the radius endpoint...
Read more >Combining a shadow endpoints in Sveltekit with a form - Reddit
The get part works to serve the props data, but the form is not handled properly by the endpoint. Instead the page is...
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
Are you sure it’s that extreme?
The original issue for shadow endpoints includes an example of writing a
load
function easier than before when you can’t get away with not having aload
function:For this situation, it’d be like:
It is still the case, though, that you can’t send something from
stuff
to a shadow endpoint, but that isn’t what this issue explains.Yes, I missed that you specified output in your description. So the only technical challenge would be merging any
stuff
from layouts (client-side) withstuff
passed from shadow endpoints to the client. Which should be pretty straightforward.I’ll update my comment to mention that it was a misunderstanding.