Playing
01. Upgrading

Transcript

00:00
Let's kick things off by talking about the upgrade process from Inertia v1 to Inertia v2 and the breaking changes,
00:07
which we are going to be covering in this course as well. Now, depending on when you're watching this course, you may already find that Inertia 2 is out of beta. At the moment, it's in beta, so there may be some issues and we have to go ahead and, particularly if we're using a starter kit, manually go ahead and install v2.
00:25
So let's go through the process with a fresh Laravel application that I've already set up. You can see I've got this over here. We're just using Laravel Breeze and let's go ahead and upgrade this together. So this is using Inertia and Vue. Let's go ahead and upgrade this. OK, so we've got an overview here of what's new.
00:42
We're going to cover everything in this course here and let's go ahead and upgrade this. So to do this, we just need to run two commands like we would if we were just manually installing Inertia. We need the client-side stuff and we need the back-end stuff. And we're using Vue, but of course you can choose which front-end framework you're working with to get this working.
01:01
So let's go over to our application and let's go ahead and run the command to get the front-end dependencies upgraded. That will pull the correct version into our package.json file. And let's go ahead and do the same for the back-end stuff within our framework. Again, depending on which framework you're using with Inertia, you'll have to tweak this around.
01:21
OK, let's go ahead and pull that one in as well. And to be honest, that's pretty much all we need to do. It's likely that you're going to be using a starter kit. So once you run these two commands, that will have upgraded everything.
01:32
Even if you already have an app built in Inertia, this should work fine. We'll talk about the breaking changes in just a second. And we're going to focus on one of them specifically in this course. OK, if we head over to our app now, let's just go ahead and make sure we're running npm run dev to compile everything.
01:48
And everything looks good. So if we head over, you can see that the app works exactly the same. Everything is fine. We can process our profile information update on the Breeze starter kit.
01:59
And this should work absolutely perfectly. So that brings us to the breaking changes within Inertia. So we don't have many breaking changes apart from version upgrades. So we have Laravel 8 and 9 support dropped.
02:14
So it now requires Laravel 10 and PHP 8.1 minimum. So if you are following along, you're going to need to make sure that you're running Laravel 10 at least and PHP 8.1 at least as well. Vue 2 support has also been dropped. So Vue is reaching end of life.
02:30
That makes sense. So the Vue 2 adapter has been removed. We can't use this anymore. That makes sense.
02:36
So we're going to have to upgrade to Vue 3 if you have an existing app. We'll ignore the Svelte adapter because we're not focusing on that specifically here. But you can go ahead and read that if you are. And the one thing here, which we are going to focus on in this course,
02:50
we're going to pull together a demo for you, is that partial reloads are now asynchronous. So previously, partial reloads were synchronous, and now they have changed to asynchronous requests.
03:01
Let's not talk about that too much right now, because I'm going to dedicate an entire episode to this, and I'm going to demonstrate the impact that might have on your application. So we'll pull together an example of how this is going to affect your apps.
03:15
Okay, so as we are following through every episode of this course, we are going to be using Laravel Breeze with the Vue and Inertia starter kit selection when we install Laravel. And what we're going to do is go through and upgrade this every single time.
03:29
I'm going to do that off camera, but if you are following along, and you want to build a local project to follow each of the episodes, just make sure you head over to the upgrade guide and pull in both of these versions every single time you create an app.
03:43
Okay, that is how we upgrade. There are not many breaking changes, which is great. Let's go through the rest of the episodes in this course and look at each of the new features plus some additional bits as well.
9 episodes1 hr 27 mins

Overview

With the release of Inertia v2, let’s cover everything new — now and into the future.

Each episode of this course will cover a new feature or significant change, so you’re ready to adapt and introduce new functionality into your Inertia-powered applications.

Alex Garrett-Smith
Alex Garrett-Smith
Hey, I'm the founder of Codecourse!

Episode discussion

No comments, yet. Be the first!