use Skeleton Modals with Shallow routing #2328
-
Hello brothers |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey @IslamZaoui, Shallow Routing is a pretty exciting feature for SvelteKit v2. But given it just launched a few days ago it's not really at the forefront for us right now. We're still testing general support per these posts: Unfortunately this isn't a feature that can just be tacked onto the existing modal system in Skeleton. Modals will need to be purpose built to support this from the ground up. Plus, it's a SvelteKit ONLY feature. While we only provide official troubleshooting and support for SvelteKit, we go out of our away to avoid breaking support for Svelte/Vite, Astro, and other means of using Svelte. This feature simply won't work for those options. This means we likely won't ever be able to support this with the feature, because again - Skeleton supports Svelte (not just SvelteKit). That said, all features in Skeleton are optional and opt-in. Given this, you always have the option of rolling your own alternative. Our friend Huntabyte actually provided a great walk through of the Shallow Routing and showcase of how to create a modal system using this feature though: https://www.youtube.com/watch?v=B19DEGEclfk&t=371s Hopefully that help get you up and running! |
Beta Was this translation helpful? Give feedback.
-
I got shallow routing working with the below heavily borrowed from Huntabyte's work in the video linked. I was having issues with getting the data into meta using $page.state.data so I'm circumventing it by getting the data directly from the result once checking that it was loaded successfully. Function for the a tag.
Modal component:
|
Beta Was this translation helpful? Give feedback.
Hey @IslamZaoui, Shallow Routing is a pretty exciting feature for SvelteKit v2. But given it just launched a few days ago it's not really at the forefront for us right now. We're still testing general support per these posts:
Unfortunately this isn't a feature that can just be tacked onto the existing modal system in Skeleton. Modals will need to be purpose built to support this from the ground up. Plus, it's a SvelteKit ONLY feature. While we only provide official troubleshooting and support for SvelteKit, we go out of our away to avoid breaking support for Svelte/Vite, Astro, and other means of using Svelte. This feature simply won't work for those options.
This means we l…