Skip to content
Programing

Inertia.js v3.0: Refined, Decoupled, and Scaling the Modern Monolith

Published: Duration: 5:36
0:00 0:00

Transcript

Host: Hey everyone, welcome back to Allur, the show where we break down the latest shifts in PHP, Laravel, and the broader world of full-stack and mobile development. I’m your host, Alex Chan. Host: I am so excited to welcome Elena Rodriguez to the show. Elena is a Senior Software Architect and a well-known contributor in the Laravel space, specifically focusing on frontend-to-backend integration. She’s been an early adopter of the "Modern Monolith" philosophy since the very beginning. Elena, it’s so great to have you here on Allur! Guest: Thanks so much for having me, Alex! It’s an exciting time to be talking about Inertia. v3 feels like it’s finally "grown up," if that makes sense. Host: It totally does! I mean, I remember when Inertia first dropped. It felt like this "secret weapon" for developers who loved Laravel but wanted that snappy Vue or React feel. But looking at v3, the phrase being thrown around is "architectural refinement." What does that actually mean in practice for someone who’s been using v1 or v2? Guest: Yeah, that’s a great way to put it. In the early days, Inertia felt like a really clever helper library. It was basically a wrapper that said, "Hey, let me handle the Axios call and just swap out the component." But with version 3, the team has really gone under the hood. They’ve essentially decoupled Inertia from general-purpose tools. They realized that to make the Modern Monolith truly scale, they needed total control over the request-response cycle. It’s less of a "bridge" now and more of a precision engine. Host: You mentioned Axios. That’s probably the biggest headline, right? "Farewell to Axios." I have to admit, when I first read that, I was like, "Wait, Axios is the industry standard. Why would they move away from it?" What was the struggle there? Guest: Oh, I totally get that reaction! I felt the same way at first. But here’s the thing: Axios is a general-purpose HTTP client. It’s designed to handle everything from a simple API fetch to complex browser interactions. Because it’s so "general," Inertia was often fighting against Axios's default behaviors—especially when it came to cancelling requests or tracking upload progress in a way that felt native to Inertia’s routing. By building their own custom XHR client, the Inertia team stripped out all that extra weight. Host: And that leads to the bundle size, right? Because we’re all obsessed with Core Web Vitals now. Guest: Exactly! The bundle size reduction is… honestly, it’s impressive. By removing Axios and optimizing the internal logic, the client-side footprint is significantly smaller. If you’re a developer worried about "Time to Interactive" or TTI, this is a huge win. It makes Inertia a much more viable candidate for public-facing sites where SEO and initial load speed are critical. It’s just… leaner. Host: Interesting! So, it’s not just about removing a dependency; it’s about making the whole framework feel "lighter" on its feet. Now, let’s talk about something that I think every frontend developer struggles with: the latency gap. You know, that split second where a user clicks "Like" and nothing happens while the server thinks. v3 introduces "Optimistic UI" natively. How big of a deal is this? Guest: Oh, Alex, it’s a game-changer. Honestly. Before v3, if you wanted that "instant" feel, you usually had to reach for something like Pinia or Redux to manually update your local state, then sync it with the server, and then handle the rollback if the server failed. It was so much boilerplate! Now, in v3, you can literally just pass an `optimistic: true` flag in your router request. Host: Wait, really? Just a flag? Guest: Pretty much! The framework handles the "fake" update immediately, and if the request fails, it automatically reverts the state for you. It’s that "aha!" moment where you realize you don't need a massive state management library for 90% of your interactions. It makes the app feel "app-like" without the headache of manual synchronization. Host: That is huge. I can see that saving hours of debugging state-sync issues. But okay, let's address the elephant in the room. There’s always this debate in the Laravel community: "Should I use Livewire or should I use Inertia?" With Livewire 4 on the horizon and Inertia v3 here now, how do you see that playing out? Is there a clear winner? Guest: (Laughs) The age-old question! Honestly, I think the release of v3 has actually made the choice *clearer* rather than more confusing. Livewire is incredible for those who want to stay almost entirely in PHP. But if you need high-fidelity interactivity—think complex drag-and-drop, interactive charts, or things that are native to the NPM ecosystem—Inertia v3 is the clear winner. It gives you the full power of Vue or React but keeps that "monolith" simplicity. Host: Right, so it’s less about "which is better" and more about "what does your team know and what are you building?" Guest: Exactly. If your team has deep JS expertise and you want that "instant" optimistic feel we talked about, Inertia v3 is just… it’s so refined now. It feels like the "Modern Monolith" has finally shed its "experimental" skin and is ready for the enterprise at a massive scale. Host: I love that. "Shedding its experimental skin." That’s a great visual. Before we wrap up, Elena, for the developers listening who are currently on v2 and are maybe a bit nervous about the upgrade—any words of wisdom or specific features they should look at first? Guest: Don’t be intimidated! The transition is actually very smooth. I’d say start by looking at the new request handling hooks—`onBefore` and `onStart`. They give you so much more precision for loading states. And definitely, definitely play with the optimistic updates. Once you see how much code you can delete from your controllers and components, you’ll be sold. Host: Delete code? That’s music to my ears. (Laughs) Elena, this has been so insightful. Thank you for walking us through the evolution of the Modern Monolith. Guest: My pleasure, Alex! Thanks for having me on Allur. Host: What a great conversation. The takeaway for me is that Inertia v3.0 is really about maturity. By ditching Axios for a custom XHR client and bringing in native optimistic UI, the team has managed to make the developer experience smoother while actually improving performance. It’s a rare win-win.

Tags

Frontend web development php inertia.js laravel spa optimistic ui