I wasn't able to make it to Laracon last week, but I am thrilled that
@taylorotwell was able to share all the awesome improvements to Inertia.js that
@joetannenbaum and I have been working on the last number of months.
If you missed his presentation, definitely go and give it a watch!
Inertia.js v2.0 is going to be *awesome*.
We finally figured out the right way to handle asynchronous visits in Inertia — something I've wanted for a very long time to better handle background data reloading.
The solution we landed on is so simple and elegant. If you make an async visit and the response comes back for the page you're currently on, the props are merged and your page updates. Great! Exactly what you wanted.
However, if for whatever reason your async visits ends up on a *different* page, for example your session expires and you're redirected to the login page, that async visit is now "upgraded" to a standard visit, and you're brought to the login page.
The `router.reload()` feature is now async by default, meaning you can technically have multiple reloads happening at once now if needed.
Further, as Taylor explains in his talk, the async visit feature also enables a whole bunch of other new features, like polling, prefetching, infinite scrolling, lazy loading when scrolling into view, and deferred props.
I continue to be amazed at what we can accomplish with Inertia.js, and I honestly love working with it today just as much as I did when I first released it back in 2019!
youtube.com/watch?v=AwWepVU5…