Disclaimer: All links to the "Advanced Inertia" ebook on this page are affiliate links. This means that if you buy the book after clicking on one of my links, I'll get a tiny kickback that helps to support the blog.
Introduction
I recently finished reading Boris Lepikhin's book, "Advanced Inertia".
I've been using Inertia for a while now, but I've never really felt like I've been using it to its full potential. I've always felt like I've been missing something. So I thought I'd give the book a read to see if I could use it to improve my Inertia skills. And I'm glad I did!
๐ Buy Advanced Inertia Now!
Book Summary
Advanced Inertia is a 180-page ebook that teaches you how to build robust and maintainable Laravel applications with an Inertia frontend.
The book is available in two packages:
- Basic Package ($59): The book itself.
- Premium Package ($99): The book and the source code of a production-ready Laravel/Inertia application called MixJobs.
Without giving too much away, the book covers:
Introduction to TypeScript
The book starts by giving you an introduction to TypeScript and how it works. This is great because I've never really used TypeScript before (apart from the odd bit of tinkering), so it was good to get a basic understanding of it. This section alone has sold me on the benefits of using TypeScript, so I'll be considering it for my next project.
Frontend Tooling
It then delves into the tooling you need to build a modern frontend (such as Vite, ESLint, and Prettier). I absolutely love this because it really emphasises the importance of making sure you have the right static analysis and code-quality tools in place before you start writing any code.
Directory Structure
Following this, it goes into how to structure your code. Boris dives into the directory structure you can use to keep your frontend code organised and maintainable. This is something I've always struggled with, so I found this section really helpful.
Composition API
The book then covers the Composition API in Vue and how to use it. I've never used the Composition API before (all my Vue/Inertia projects are still using Vue 2), so this was a great introduction to it because he only shows how the Composition API differs from the Options API.
Working with Data
The book then discusses the best ways to work with data in your Inertia apps. It covers how to pass your data from your Laravel backend to your Vue frontend, and vice versa.
This part of the book fascinated me! Boris shows how you can set up some packages on your backend so that your frontend code (and IDE) are aware of the data you'll be passing it. I don't want to give anything away, but it's a game-changer (at least for me!).
One of the things I've struggled with when using Inertia is my IDE not knowing what types of data I'm passing to my frontend from my controllers. I end up having to guess the names of properties and I'm always making typos and getting them wrong. So, after reading this section, I'm excited to try out Boris's approach because I'll be able to let my IDE do the heavy lifting for me and have autocomplete suggestions.
Authorisation, Pagination, and Routing
The book then covers how to handle authorisation, pagination, and routing in your Inertia apps.
Again, I don't want to give anything away, but I loved the approaches that were covered in these sections. These aren't things I've struggled with when building my own Inertia apps, but I'm still excited to try out Boris' approaches and see how they can improve my code.
Flash Notifications and Error Handling
Flash notifications and error handling are two things that are used in pretty much every app I've ever worked on.
The book delves into how you can handle these in your Inertia apps. I thought the approach Boris used here was nice and simple, so I'll be giving them a try in my next project.
Persistent Layouts
The book then moves on to discuss persistent layouts. This is something I've never really had to use in my Inertia apps, so I found it a little hard to compare the approach to anything else. But I can see how it would be useful in some situations, and if I need to implement it in the future, I'll be referring back to this section.
What I Loved About It
The book was a fantastic read and I genuinely feel like a better developer after reading it! I actually ended up reading the book in one sitting because I was enjoying it that much.
I loved it for a few reasons:
Packed Full of Actionable Examples and Advice
Advanced Inertia is packed full of information that's actually useful. It's not just meaningless theory that you'll never use.
It's actually got a lot of actionable examples and advice that you can use to improve your Inertia apps. They're examples and scenarios that I've come across in my own projects, so I found them really relatable. There were a lot of moments when I was reading the book and I said "Oh, that's how you do that!".
I've already started implementing some of the things I learned in my own projects, and I'm excited to see how they improve my code.
Shows You How to Structure Your Frontend Code
Some developers love having the freedom to decide on their own directory and code structures. But I'm the type of developer who prefers to be pushed in a certain direction. I want to spend less time thinking about where something lives and more time thinking about how to solve the problem at hand.
When building a Laravel backend, the general Laravel-y conventions help to give me this structure. But on the frontend, I've always been a bit clueless about how to structure my code, so I just guess. And it always ends up feeling wrong!
This book gave me a clear path to follow. I've already been going back and referencing it while working on existing projects. I'll be aiming to follow the structure Boris lays out in my future projects.
Static Analysis Code-Quality Tools
I've never really understood the difference between some of the different code-quality tools available in the JavaScript ecosystem. And because I usually jump on projects that are already set up, I've never had to set them on myself. Advanced Inertia gave me a good understanding of what each tool does and how to set them up. I could instantly see how each of the tools would help me avoid bugs that I've come across in the past.
Boris takes us through the step-by-step process of setting up Vite, ESLint, and Prettier.
Next time I start a new Inertia project, I'll be referring straight back to the book to make sure I've got all of these tools set up correctly.
Introduction to TypeScript
If you've read any of my books (Battle Ready Laravel and Consuming APIs in Laravel), you'll know that I love using types everywhere in my PHP code. It's helped me to write better code and catch bugs before they happen.
So using JavaScript without types has always felt a bit "unsafe" (for lack of a better term) to me. I've always wanted to use TypeScript, but I've never really had the time or need to learn it. As I've mentioned, I'm usually working on existing projects that don't use TypeScript. So apart from a couple of hours of tinkering, I've never really used it.
Reading this section of the book has sold me on TypeScript. I'll be considering it for my next project. Especially because Boris shows exactly how to get it set up, so I can refer back to the book when I need to.
Transferable Skills
Although the book is aimed mainly at building Inertia applications, I feel like it teaches a lot of transferable skills that you can use outside of Inertia.
For example, the section on TypeScript and the section on setting up code-quality tools.
I also feel like the section on structuring your frontend code is something that can be applied to any frontend project, not just Inertia.
What I Didn't Love About the Book
I've not really got anything bad to say about the book. I really enjoyed reading it!
And I know what you're thinking "You're just saying that because you're an affiliate". But I promise, I genuinely enjoyed reading it and wouldn't recommend you spending your hard-earned money on it if I didn't think it was worth it.
Although, I would have loved to see a section on how to test the frontend. Apart from Cypress or Laravel Dusk tests, I've never really written tests for the frontend. I'd love to see how Boris would recommend doing it because I liked his approaches to using other tools.
The MixJobs Source Code
I only bought the "Basic Package" which just included the book. But there's also a "Premium Package" available that includes the source code of a production-ready Laravel/Inertia application called MixJobs.
Since I've not seen the code, I can't really comment on it. But I'd imagine it's a great resource to have if you're looking to see how everything comes together in a real-world application.
Would I Recommend Buying It?
Absolutely! I think the book is a great value for money, and I wish I'd read it earlier because I genuinely feel like a better developer after reading it.
I put off buying the book for a while because it had "Advanced" in the name, so I assumed I had to be pretty good at using Inertia in the first place to make the most of what it was teaching. But I was wrong. I think it's a great book for all skill levels, no matter if you're just starting out with Inertia or have been using it for a while.
I'd like to think that after you've read the book that you'll come away with a better understanding of how to build maintainable and robust Inertia applications.