InertiaJS 2.0 was one of the highlights of Laracon US 2024, marking a significant upgrade for developers who enjoy building modern, single-page applications with a server-driven approach. The update comes packed with new features designed to improve performance, developer experience, and overall functionality. Here's a look at what InertiaJS 2.0 has to offer:
Async Requests
All requests are now asynchronous by default, setting the stage for the other new features by improving speed and responsiveness.
Polling
This feature allows manual or automatic polling, ideal for applications that need to frequently update data without requiring user input.
WhenVisible
Expensive elements, like those at the bottom of a page, can now be enabled only when they come into view. This boosts performance by delaying data fetching and rendering until the user scrolls down.
Infinite Scrolling with WhenVisible
Leveraging the WhenVisible feature, InertiaJS 2.0 supports infinite scrolling with mergeable props, making it easier to handle large lists of data without affecting performance.
Prefetching
Prefetching enables data to be loaded before it’s actually needed, enhancing the user experience by reducing wait times for certain actions or page transitions.
Deferred Props
Props are no longer evaluated on the initial page load. Instead, they are requested automatically right after the page loads, optimizing initial performance while still ensuring necessary data is available quickly.