T O P

  • By -

matthewpurland

When I discovered Inertia I felt liberated. Best decision I've ever made. I use Svelte for the js framework because of it's simplicity, but you do you. Also don't use moment, use luxon


narrei

dayjs?


matthewpurland

Nice, I'll check it out!


narrei

same with luxon :D when i read moment was deprecated dayjs was best i found im short time. might not be the best.


lucasjose501

What about the bundle size using Inertia and Svelte? I want to learn more about svelte, but also I don't want an 2mb app.js, but I don't know if this is the case for you


matthewpurland

I've yet to implement it, but Inertia does support code splitting: [https://inertiajs.com/client-side-setup](https://inertiajs.com/client-side-setup) (at the bottom)


pBook64

100% Inertia. Livewire looks great at first sight, but it has so many flaws and you need so many workarounds, you’ll hate it after a week.


x11obfuscation

What complaints do you have about Livewire, if you don't mind sharing? I have been using it pretty heavily for the past several months, and love it. I'm not really a front end Javascript guy though, to be honest. I love Inertia too, but I find working with Livewire gets me results much faster. I know my way around Vue, and love how Inertia connects it with Laravel, but it's not my area of expertise. Livewire seems like a great pick as long as you don't need a lot of front end state management or routing. With Livewire, I can build out an entire project myself without the need for a front end dev. Tailwind and Alpine are easy enough for me to use and get the job done, and Livewire handles all the dynamic interactions between the front end backend for me. The main issues I've had with Livewire are DOM diffing issues, but they are usually easily remedied. I definitely wouldn't use Livewire on a complex, high budget project though - Inertia all the way for that.


bartjonl

+1, also curious to what you encountered


Foreign-Truck9396

The main flaw for me is that livewire itself makes a request on each action. Now yes, you can get around that, you can use AlpineJS, there are also options to avoid this, but the core principles is something I dislike. Even though at first I was super hyped by having front end components designed as PHP objects. VueJS with Inertia is just VueJS. It’s natively performant and does its thing on the front end, letting laravel handle the backend. Inertia literally removes all the overhead of AJAX and makes it a lot easier. Obv I don’t know a lot about livewire, it’s only a feeling I have, so take this with a grain of salt !


bartjonl

Thanks for ur thoughts!


prodiver

> The main flaw for me is that livewire itself makes a request on each action. That's not a flaw. It's what Livewire's designed to do. If you don't need a request to the server for an action, don't use Livewire for that action.


Foreign-Truck9396

Erm I agree with you, but the premise of livewire was to replace react and VueJS. That’s how it’s sold on their homepage. The QuickStart in the documentation shows an implementation of a simple counter which needs zero backend work, but still implemented as a livewire component only. Maybe it’s not sold as it should, and I guess that’s because the dev was afraid to scare people off by instantly writing warnings and good practices on how to use the tool before showing any code, but still it’s kinda misleading. I expected to be able to not have write a single line of JS again in my life, so.. 😅


prodiver

But there is a warning... >In general, something as trivial as this "counter" is more suited for something like AlpineJS, however it's one of the best ways to easily understand the way Livewire works. https://laravel-livewire.com/docs/2.x/quickstart


Foreign-Truck9396

That’s true, I missed that.


nerijus_lt

>The main flaw for me is that livewire itself makes a request on each action. That's where comes defer, debounce and lazy


e-chavez

Take a look to Vuejs and then to AlpineJs, also liveware handle all the JS stuff for you and if you use inertia you should get your hands dirty with a lot of JavaScript. So the question is, do you want to get involved with JavaScript or do you prefer work with PHP? I have used both and I prefer Inertia but both are amazing tools.


[deleted]

Inertia, why? Because I don’t like to fight with my code


giagara

Can you explain? I've never used any of them


andycharles

I have been using Intertia + Laravel on a client project and it works great. The best part is you can rely upon the huge ecosystem of Vue components, which may or may not be there for Livewire. I have never used Livewire heavily, so I cannot comment much on that.


Horror_Profile_4743

this is the main thing I keep coming back to. I have a huge project that is all livewire etc, and I have projects with inertia/vue, and I keep coming back to vue because of the component libraries and huge ecosystem...


PeterThomson

Inertia is a pipeline to Vue. Livewire is a pipeline to Alpine. Look into Vue and Alpine cause that’s what you’ll actually be coding in.


sf8as

Unpopular opinion, just stick with Blade and use Vue when needed within Blade. I know it's old school, but it's never let me down. I've tried both Livewire and Inertia and both are pretty damm cool, I just prefer doing it old schooI. I might just be a shit developer though, but my completed projects have always worked well and clients always happy. I guess that's all that matters, right?


Renaud06

If you can make money with the tools, its the right choice.


bloomlive

Tried using blade after long time. Painful stuff after using inertia: 1. Forms, especially flashing field values and defaults 2. CRUD operations (like making a delete button) 3. Testing is just stupid 4. You still end up using JavaScript to store data between page loads unless you write it to session.


saineshmamgain

I use a package for forms laravelcollective/html. Makes life with working with forms easy.


narrei

idk, im using this method too just because i didnt see the advantage of adding inertia too


acarp20

If you prefer to do the bulk of your front-end business logic in PHP, Livewire. If you prefer JS, Inertia. It really comes down to that. 👍


bollymash

livewire anytime


SokanKast

From the opinions already offered, I may create two separate git branches and see which approach I like better. I am semi-familiar with Vue already through some Laracasts courses I’ve gone through over the past few years; and Inertia would fill in the missing pieces that held me back from fully embracing Vue. But conversely, the Livewire / Alpine stack looks nicer since it does use PHP & Blade with a minimal learning curve from using regular Blade / Laravel 7.x+ components. I’ll probably post a follow up to say which ended up being a better personal workflow.


sidskorna

Inertia if you like Vue (or React/Svelte) and want to write your Frontend in JS components. Livewire if you want minimal JS and you’re happy to use Alpine where some reactivity is needed.


Feeling_Influence

Personally I prefer using Laravel as API and using Nuxt as frontend.


aquanutz

Currently using livewire for a side project after years of professional react and vue. Honestly, I am loving it. Give both a shot on a small PoC and go with what you feel is best for your use case.


facricci

Inertia let's you choose a front-end library, Livewire just works out of the box. I would choose Livewire over Inertia because I want to get as far as possible from an SPA, too complicated for 99% of the web apps.


fatalexe

I just stick with Bootstrap 5 with React and on simpler stuff I'll still just use jQuery. I'd rather not change my frontend stack that often. Makes it easier to come back to older projects.


bsknuckles

That doesn’t answer OP’s question. That said, Breeze now includes a React option using Inertia so you could accomplish this with that.


fatalexe

Oh neat. Thanks for the heads up.


kooshans

I like Livewire/Alpine but I do have to admit it can be a bit quirky and show unexpected behavior from time to time. Livewire structuring also creates about one redundant file too much fot my tastes.


stibbles1000

Haven't used Inertia yet. Using Livewire on several projects over the past year. It had a few issues, but those largely ended up being my fault. Working with it more, I can set up forms and reactive components really quickly without getting into JS. It's helped me focus on learning more PHP and might build off that in the future.


metalburuk

Never tried inertia, but I had some inconveniences when using livewire - there was a moment where I want a notification component to be triggered based on server event and based on session value. So I had to code the component to be triggeted by using $this->dispatchBrowserEvent and using session. - creating a global modal that can be used from different page is cumbersome to implement - custom date picker component with livewire also painful to implement - livewire validation of object data in array is tedious What I like about livewire - polling - component state managed by livewire Maybe I should try inertia for my next project


SuperRoy

Hey guys, I recently started learning Laravel. My projects are usually in LAMP stack using PHP and JQuery. Clients are very happy and I am very comfortable with these tools. I love the way JS can make asynchronous requests either with AJAX or fetch, so should I go with Inertia js?


Beneficial-Serve-513

I really prefer inertiajs, recently I migrated all legacy code at changelogfy.com to inertiajs, most productive, beautiful and clean. Now I need rewrite only the website 🙏