Content pfp
Content
@
0 reply
0 recast
0 reaction

Darryl Yeo 🛠️ pfp
Darryl Yeo 🛠️
@darrylyeo
Excellent rundown of how data fetching works in SvelteKit – specifically, the relationship between the “rendering tree” (`+layout.svelte` / `+page.svelte`) and the “data tree” (`+layout.server.ts` / `+layout.ts` / `+page.server.ts` / `+page.ts`). https://youtu.be/j9Wf_nyKin4
4 replies
1 recast
20 reactions

Rafi pfp
Rafi
@rafi
Good one! +layout.svelte is v useful for modals and transient views. Instead of embedding modal logic within parent page, it's possible to put modal on a different route while keeping +layout state intact. This makes parent view free from modal logic and comes with free perks like component lazy loading
1 reply
0 recast
1 reaction

Rafi pfp
Rafi
@rafi
Ah, and one more due praise for svelte: opt-in parent's load() from a child view is such a simple solution of cascading data. It's nice example of how Svelte is svelte
1 reply
0 recast
0 reaction

Darryl Yeo 🛠️ pfp
Darryl Yeo 🛠️
@darrylyeo
Yes!! The implicit parallelization is so handy especially the more deeply nested your routes are.
0 reply
0 recast
0 reaction