inertia icon indicating copy to clipboard operation
inertia copied to clipboard

[Svelte] Improve typescript types + minor fixes

Open pedroborges opened this issue 1 year ago • 2 comments

Reopening #1881 originally created by @jamesst20.

pedroborges avatar Sep 06 '24 18:09 pedroborges

Hey @pedroborges

If you ever reopen the minimal upgrade for Svelte 5, I found a bug this week where I noticed SSR is no longer working with newer build of Svelte 5 starting from next.179+.

You may want to apply this as well

https://github.com/jamesst20/inertia/commit/c8493ab9358fb520461940ef7f043987f0b39d17

This is because Svelte 5 uses anchors (comments) and the div id=app is passed into the render(...) function of Svelte server and it makes anchors outside the div. So when it comes to hydrate the div it completely crash

jamesst20 avatar Sep 06 '24 19:09 jamesst20

Thanks for letting me know @jamesst20, I'll check it out. Really appreciate your work on these PRs 🙇‍♂️

pedroborges avatar Sep 06 '24 20:09 pedroborges

This all looks good, thank you both for all of the work you put into this.

When I fire up the Svelte playground I'm getting a bunch of warnings in the console, I just want to make sure that they aren't a by-product of this PR. Any insight here?

CleanShot 2024-09-11 at 16 46 08@2x

joetannenbaum avatar Sep 11 '24 20:09 joetannenbaum

When I fire up the Svelte playground I'm getting a bunch of warnings in the console, I just want to make sure that they aren't a by-product of this PR. Any insight here?

@joetannenbaum the adapter passes all props from server to every layout and page components. Since each component only declares the props it needs Svelte warns you about the extra ones. You only see these warnings in development so we are good 👍

pedroborges avatar Sep 11 '24 21:09 pedroborges