inertiajs / inertia

Inertia.js lets you quickly build modern single-page React, Vue and Svelte apps using classic server-side routing and controllers.
https://inertiajs.com
MIT License
6.56k stars 435 forks source link

Svelte fix when using deferred props #2026

Closed saml-dev closed 1 month ago

saml-dev commented 1 month ago

This fixes #2012

saml-dev commented 1 month ago

I just added tests. When I updated server.js to return an object to Page1 instead of text, it caused the svelte and react tests to fail, but strangely I couldn't get the Vue tests to fail. I updated Page1.vue anyway but let me know if I'm missing something there.

pedroborges commented 1 month ago

Thanks for working on this, @saml-dev. After reviewing this change, I realized it could potentially cause significant compatibility issues for existing projects. Instead, I developed an approach that makes $page updates more predictable and implemented another fix for the <Deferred /> component.

I would greatly appreciate it if you could test these PRs and provide your feedback. 🙏

reinink commented 1 month ago

@saml-dev Hey thanks so much for this contribution, but as @pedroborges mentioned he's solved this in a slightly different way in #2037, which I just merged in. Thanks so much either way! 🙏

saml-dev commented 1 month ago

Hey no problem! It was a good exercise to get familiar with the Inertia code base. Hopefully I can contribute another way in the future!