Laravelstream· Jan 28, 2025· 1:11:16· 3,853 views on YouTube
React at a moment you like. The best moments light up here.
[Music]
sh [Music]
hello world technical difficulty to start 2025 but that's all right hello world we are live welcome to the January 2025 edition of the larel worldwide Meetup it's hard to believe it's 2025 already I was saying to someone that feels like a a year that should be in the future somewhere but uh here we are it's a it's a new year new beginnings but uh what we know we're going to be bringing you this year are more great talks and more great people from the uh
the larel community uh Margaret how are you doing how's 2025 been for you so far I've been pretty great it's crazy to realize that we've been doing this for a year now so insane but yeah I've been doing awesome thanks Dan what about you uh same yeah it's uh it's moving along it's we're almost we're on the doorstep of February already hard to believe I'll say it again uh but here we go and uh yeah like like I was reflecting too it's it's been a year now and and our first talk last year was uh was Caleb porio uh
obviously Mr Mr Lille Livewire and uh kind of fitting that that our talk today is is is Livewire focused as well so looking forward to it we're gonna have Josh out here in a moment but uh before we do that we have got a little bit of housekeeping to to touch on so without further Ado what do we got here Margaret awesome thank you Dan um so yeah welcome to anyone that's new to the Meetup and welcome back to anyone who's been a part of this Meetup we're going to run through some resources here if you haven't heard about laravel news it's a great resource ran by the great Eric Barnes they have a weekly email
newsletter and you can check them out at llne news.com they also have a podcast ran by the wonderful Jake Bennett and Michael drinda where they discuss all the latest larel releases in the last week they have tutorials and happenings in larel community next is larell podcast hosted by the wonderful Matt stofer um so this season he's joined regularly by Taylor ell and so if you want to learn more you can check them out at laral podcast.com Lara jobs is another wonderful resource so if you're looking to hire you're looking to post a job and really for all
your laral job needs you can check them out at lar jobs.com what we wanted to do this month is feature a couple of companies that are looking to hire LOL and PHP developers this month so you can check out prompt Therapy Solutions not wild Alaskan company and the number company we'll include their link and their job postings in the description below so if you're a laral developer looking for work be sure to check them out next is Lara Cass so big thank you to Jeffrey way for running this awesome resource for anyone looking to build
their larel skills we and it's really a platform to learn with others in the larel community so check them out if you want to learn some larel all right for some upcoming events that's happening later this year LaRon EU is just right around the corner so tickets unfortunately are sold out but there is a waiting list so if you'd like to get on that make sure to check them out at l.u it's going to be happening in the Amsterdam in Amsterdam Netherlands and that's yeah February 3rd and
4th up next is LaRon India it's going to be held in atad India so that's going to be March 8th and 9th 2025 if you'd like to learn some more you can check them out at l.in another wonderful online Meetup resource is the GTA PHP user group so they are a wonderful group of developers um especially in PHP that talk monthly and you can check them out at meetup.com
it's in the greater Toronto area and again thank you to our host for their support and relaunching this Meetup they have a great team of Developers so if you want if you have a lirell problem they'd be happy to help you out make sure to hit them up at vehicle.com or go at vehicle.com and also thank you to our sponsor Jeet brains for being able to give away a couple of one-year subscriptions to any Jeet brains IDE so you can sign up by scanning that QR code and the winners
will receive an email from our team so watch out for that email and I'll pass it off to Dan to introduce our speaker for this month thank you Margaret our speaker this month uh like I said is going to be talking about something Lar rated it's Josh Siri you've probably uh encountered Josh either met him in person or you've encountered some of his awesome videos on the Lille YouTube uh Channel or across the social medias uh Josh Works in developer relations at Lille and today he's going to share a
really kind of interesting Tool uh that exists in the Lille ecosystem uh called mingle JS so without further Ado let's uh let's bring Josh in here Josh how you doing today hey everyone I'm doing pretty good how are you all doing excellent excellent we were uh we we chatted last week I was taking back a little bit that that wasn't quite the the same background I was expecting from all your awesome videos on YouTube and such but understand you're you're in the process of setting up a new office there but uh things are looking good how's
that coming along yeah process of setting up we we just recently moved so process of setting up uh a new office New Studio the good thing is I have a lot of big plans for this space and a lot of uh kind of flexibility and and uh new new stuff so I I won't get to show all the new new stuff in the office today but that that'll come shortly so I have a lot of a lot of big plans a lot of big goals yeah one of those things I'm sure that's a lot of work but also exciting to do every time you get to to build a new office and build up build
out all those things right yeah it's exciting but it's also annoying too because then you start to realize like uh like all the things that you're like oh like this would be nice to have and then you gota like you know like Amazon is great but you still got to wait you know a day or two to like get the thing and then it's like setting it up and you realize oh that's too short or that won't work or it's not not good enough kind of thing so it's a it's a it's a process you always I always think I have everything I need and then you know three three days four days later I don't have
it settle it'll be good all right cool so I think I think we're good to go if you are Jos if you want to go ahead and share your screen and then uh Margaret and I will just kind of Step backstage and uh we'll hear uh we'll hear all about mingle JS so without further Ado we'll hand things off to you and uh we'll chat with you in a few minutes good awesome hey every one I'm probably not going to be following the chat too much but if you like have any questions
as I go thanks so much for everyone for being here I'm super excited to share this kind of tool I I discovered um o probably over a year ago uh that was created by someone by the name of Patricio I think he's actually in the chat as well Patricio on code on Twitter GitHub as well uh but this talk is entitled let your Livewire app mingle so as I go make sure if you have any
questions about either what I'm talking about or just you know things related to this um uh if I can't answer them I know Patricio who is who is out here uh will be able to answer them as well so I always love to share things that I find uh things that are especially in the laravel ecosystem laravel community and things that I just find interesting in general I do a lot of tinkering in my spare time I do a lot of building even
if it's just a little things like hey how would I use this PDF export Lille spoty package how do I how would I use this when I actually need that tool and so hopefully the goal of this talk is to give you another tool in your proverbial tool belt to be able to say hey now that I have now I that I know this exists maybe that one time I actually need something like this then it will come
into handy so this talk is entitled let your Live Wire app mingle so Live Wire is great even on the Livewire uh homepage Taylor otwell said that uh IMO that's in my opinion for those who don't know Live Wire takes blade to the next level it's basically what blade should be by default so I love live wire I came from the JavaScript ecosystem
back a couple years ago when I started uh three or so years ago when I started building in laravel I came from JavaScript I knew react I knew a little bit of view I knew felt I liked those things I knew what the front end should look like and like what I liked about the front end but I moved into larabel Livewire clicked with me because I could call these things from the server without having to write a controller and
that blew my mind and so I love Livewire it's something that I am really passionate about and most of my demo applications or just anything that I build within whether that be like side projects or just demo projects or even uh you know larger applications usually I start and reach for live like for example you could have this public function save right here and
I don't have to create a whole new controller to do this to create a new post and then redirect to slash poost I can just call it on the front end and if you're here you probably already know what Live Wire is but live wire is great in the sense that it makes things like this this easy but ecosystem is everything we're part of the laravel ecosystem and one of
the things that really sold me on coming to uh laravel I always tell tell my story about like how I decided to start building in Lille and a lot of it came from um a guy named Chris Sev who just recently joined the laravel team he put out this notion document about two and a half years ago maybe three years go where they basically said hey these are the reasons why we're moving our uh
project from nextjs to Lille and a lot of it came down to ecosystem there's so much that not only laravel as a first party gives you for free but so many third party systems and while liveware is great um it's not the same tenure as something like uh react or view or even felt for example I mean we have things like flux now which help we have things like filament which is built in live
wire and a lot of those things make Live Wire better and I'm super grateful for them but there's a reason why View and react are so widely used whether you love view love react or you hate view or hate react or you just haven't even tried them and maybe you're just still using uh PHP with laravel and blade and you're not even touching Live Wire regardless of where you're coming from
today whether you're Livewire expert uh or and you know Livewire more than me or you're a view or react expert with inertia there's no denying that view and react have their place in the developer ecosystem they have tools that have been have stood the test of time they have uh they have people using them each and every single day and the more you use a
tool the better it gets because other people are using it too that's why larel for example consistently gets better so the better the ecosystem the better opportunities you have to find that one package or that one library or that one thing that you might need so if you wanted to build a um application and you knew that you needed a either a specific library that was a viewer react specific library
and it would be a little bit more difficult to just build that in plain vanilla JavaScript or you know that your clients needs need this specific interactivity that is more single page application you don't want to have to write all of that in something like Alpine what are your options when it comes to writing within view or react in Lille most people kind of already know this but if you don't you have inertia which is fantastic it's great I actually started learning Lille with inertia and
with View and I'm actually going to be uh on a on a panel tomorrow talking about View at uh the The View uh school conference online conference uh but inertia is great inertia 2.0 just released and there's so many Fantastic options and um things and features just easy ways to make a react or view or spelt application work fantastic in larabel
without having to write an API to connect the two and then you also have like nextjs or V or remix and you compare it with the larell backend where you say okay I'm just going to write all my front end in next Jaz or V or remix and then I'm just going to just pair it with laravel when I need it maybe I need cues or maybe I need a a background job or maybe I need I don't know a mailing system and you can do all of that it works great for that there's a bunch of
people building in this maybe you're one of them so you have those options but what happens when you need something more what happens if you want to dive in to a Livewire app that has react or View mingled together and that's where mingle JS comes in because a lot of times if you're if you're like me most of the
times you're you're reaching for those other options when you know that you're going to need a react component or a view component or a specific Library maybe something like Shad Cen or maybe something like uh Tremor which is a graphing and charting Library specific for react and while there's so many things that are slowly moving to like vanilla JavaScript even like react or
frame or motion that is now just motion. JS a lot of the times they are moving to something like vanilla JavaScript but it's still tricky to implement and it might be better developer experience if you're working in something like react and that is where mingle JS comes in because if you're like me you're someone who wants to build and move quickly so I'm building like a new project a new um
a new application something to just test the waters and I need to get something up and running usually that's why I reach for Livewire but now if I need that specific package do I rewrite my whole application or do I mingle it together so this is mingle JS I'm going to jump out and kind of show the the homepage right here this is mingle JS and this is like I said written by uh or
created by Patricio I believe he's still in chat as well um so again this is not something that that I created um I'm just a fan of it and something that I actually learned about probably a year or so ago when he when he first first released it but there's some there's some great options there there's some great opportunities within mingle JS and hopefully I get to show a little bit about why what makes it so special but
make sure you check out um the website that's uh mingle js. United by code. but again uh this is uh if I'm not mistaken it's not production ready yet I I've I've used it in some of my production applications but it's not necessarily production ready it's still a very early release just as a disclaimer but there's a reason why
mingle JS works the way it does so of course we could go through all this if we really wanted to but why don't we actually jump into some code and I can show you specifically itself too so let me open up my code editor real quick all right and we're going to go to
uh this application and we're going to open it up all right so this is a standard LEL application right everyone's familiar with this you have you know you have your routes um and let's just say that I have a route
that I want a live wire uh component on maybe we're doing something where we need to send something to a CU job so maybe I want to say like this is going to be route View and we're just going to say like uh send message um and then we can like send that message okay great well I'm using the lay of LVS code application so now I
can just go ahead and create um this quick uh blade I'm just going to use the uh guest layout here and I just want to go ahead and just create a new button and in this button um I want to just or I I just want to create a new Live Wire component so this is all very relatively familiar if you've been working with in
Live Wire um but we're just going to go ahead and make a new Live Wire component and I want to call this I don't know uh send message there we go and then I can go ahead and put this in here right we can go Livewire send oops send message perfect now I'm going to go ahead and open this up in our browser so this is
all you know fairly standard in the sense that we're we're running the Live Wire component now and if we go to send message uh we have nothing yet let's see did I uh send message we have the view of send message and we probably don't have
anything in the actual send message Live Wire component so we'll go ahead and say um hi there larvo worldwide perfect and there we go hi there at larvo worldwide so this is this is great this works perfect but let's go ahead
and wire this up what if we needed something like react to use in this Livewire application because of course yeah we could do something like you know a button and we could send this message and then um you know we could have in our send message Live Wire component we could say uh we want this to send
message and we'll just go ahead and die and dump this so now we have all of our Live Wire functionality hooked up of course right we're not touching anything else besides Live Wire we send a message we D this is great if you're using just plain Livewire but like I said a lot of the times if you're using an application maybe it's too tedious to write something that is more client side stuff that it would be just great to ship a
specific component library or something that is in react for example there's things like motion JS that would be um while they do have a JS specific library for it uh it it means you're hooking it up to maybe Alpine within a liveo application and so there's a react version that just makes it a little bit cleaner or there's something like Tremor where you have these dashboard components and charts that to be be
honest if I was to build this from scratch it would take a little bit of time especially if I was to build this within um something like Alpine JS of course there's there's some great options already out there for something like Alpine JS but again react has and Vu has that seniority in the same way that larabel has its seniority as an ecosystem as a whole so what happens if
we take this Livewire application again super basic we're not going to get into the The Styling aspect of it as well just the functionality what happens if we wanted to actually connect this to a react component and the good thing is Bingle JS makes that happen I've already installed mingle JS there's a there's a whole section on the website for installation and setting it up but this
is what this would look like if I wanted to create a new react component within my larel uh Live Wire application it's as simple as saying PHP artisan make and then we'll actually uh is it mingle I think it's make mingle sorry make mingle and then we want to do uh a react component and I'm just going to
call this uh maybe we'll maybe we'll say maybe we'll say send me uh we'll call this um let's do this send react message all right and now I have this send react message. PHP that was created and you you look at this um send react message. PHP that was created and you look at this and this looks fairly
similar because this looks like a Livewire class uh we have a class that extends a component and that component is still a live wi component but then it implements this has mingles directed so we're going to dive into the code specifically just so we know what's going on and then we're going to see like what that actually looks like implementing that in the react component itself what it does is we just have a
component that returns a specific JavaScript implementation and the cool thing is we can send that component any specific data so if I wanted to say our our specific message would be um hello laravel worldwide all of a sudden we're not just it's similar to inertia where we're pushing props to our component but we're
doing it all within a Livewire class so now in our send react message. jsx we can accept anything that we're sending from that Livewire class so not only do we have the ability to grab specific messages like in our mingle data but then we could uh also display those messages because we're already accepting them so if I wanted to say um like this is the
message or maybe I'll just go like this this is the uh message and then there we go and the good thing about this is that I'm not I am not um kind of like put pushing this react component and then I'm I have to call like an API and then I'm pushing that into the Dom element for react all of that's handled for us within mingle JS so if I wanted
to hook this up to this send message. blade. PHP or actually I'll probably do in the uh I'll probably go in um I'll probably go for this in [Music] the send message uh blade file that we have and now I can call uh Livewire and
then we're going to send react message um this is something that I I think we have to do currently uh I could be wrong on that but uh then we're going to go send react message to bring this in for v as well so what this is doing is bringing that Livewire component you'll notice we're not saying like this is a PHP component or anything like that this
is a lifewire component that I'm displaying on the page as well as my original Livewire send message component so I go back all of a sudden now we have this separate uh let me go ahead and even just clear out this original live wi component now we have a react component this is something that is built specifically in react I can do any
react stuff in this component because it is it is uh react first and foremost you can see here that we have our send react message with um a console L that was in our original JavaScript send react message as well where we are console logging that specific uh message but then we're also displaying it too and that's the neat
thing about mingle JS is yes you can use Live Wire just as you're normally used to using Live Wire but you can also use a react component and mingle it in together so let's do some crazy stuff let's say uh we wanted to do the same exact thing of where we wanted to uh
send a start a job um and so what if I wanted to in a button I wanted to say um you know we're going to wire call and then I want to call um let's go ahead and call uh send server message okay this isn't hooked up anywhere right we don't have the send server message but
because we're passing this wire prop into our react component now in our send react message Live Wire PHP class all of a sudden I can just create a new public function send server message and I can go ahead and do whatever I want here maybe I could create a new job or I wanted to just go ahead and die dump and
this is a server message now neat thing about this um I don't know why I left it this is what I get for letting co-pilot write my code but I left um the message as double it so we'll say send server message right here all right so if we go back send server message
now that's pretty crazy right we we wrote react code but we're talking to our Livewire application and we are sending a server message without having to write an API to do anything else this is hitting our server it's hitting our Live Wire class and it's actually running this die and dump function we we're talking to the
server okay that's pretty crazy that's great again this is the reason why I started using Live Wire um is because I I didn't I wasn't smart enough or I didn't know enough things about I didn't like writing uh controllers it wasn't something that I was used to writing react or view or spell because I wasn't used to like that model view controller imperative but this means I could re write a react component and then just
call a public function a method just like I would within Live Wire so great this is working this is working good but again we we passed in some data okay that's great um we are calling specific methods on the server that's pretty much that's 90% of what most people might need within a react component because now we can write our react we can return
all this we can do all this client side but at the same the first moment that I need to touch the server we can just use this wire. call and whatever method is available in that live wire method that live wire class is now available in the server now that's all great but what if we wanted to go one step f further for example what happens if I want to uh maybe I have a live wire Live Wire
component that I want to actually interact with a react component okay I've already kind of set this up but we have this uh I have this let me go into my uh web rout here I have this um I have this listen. PHP component actually looks like I didn't I didn't set it up in this application so we'll
set it up together uh so I have what what I want to do is I want to I want to connect to a we'll go ahead and we'll probably keep this and we have a listen. PHP class what I want to do is in a let's let's go ahead and create a new Live Wire component so in a let's see PHP Artisan we're going to make a
new line wi component and let's go ahead and say we want we want to uh interact with react so we'll just go ahead and say this is um declare declare react there we go so in our declare react we'll go ahead and create a new web page for this we'll go ahead and say that this is we'll say
route View and this is a declare and so we can call the declare react or we'll just call the declare view okay I'm go go going to go ahead and create this so declare create the missing View and we're going to say that this is the X uh the guest layout and I'm just going to say that
this is uh X or actually I'll go ahead and say that this is the Livewire declare react that's what I called it right yeah we have declare react oops declare blade. PHP perfect so in our web routes we have the declare route we're going to declare
blade. PHP and what we want to do in our Livewire declare to react uh blade. PHP is we just want a simple let's say we're working in a a very complex dashboard and most dashboard is in Livewire but for some specific purpose we need a live wire or a react component that's I don't
know maybe this is a a loading component or maybe this is a uh a specific client side component that we might need maybe this is our actual charting Dash but we need it so that when a user clicks a button we want to do something within that react component you know in Livewire you have the ability to send events and thinking okay this could be complicated because I want to send an event to a a react component that is
rendered by a live wire class I don't know how I would do that well actually it's fairly simple because if I was going to say wire click equals declare in our declare react Livewire view you might think yeah what you would do is declare and then we might do something like uh this dispatch and I want to say um maybe like
declare okay because if I was writing a new Livewire component I would then listen uh on the Clare I want to do something whether that's on the server side or there's ways to do it within like Alpine JS or something within the client side as well and the good thing within mingle JS is it makes that incredibly easy too because if I was to go ahead and create a new mingle JS
component I'll go ahead and say make mingle and I'm going to say um listen listen here there we go uh listen here and we'll go ahead oops it's probably because I accidentally added this here so go ahead and do that we'll call it a react and we'll say listen
here Oops I messed it up because I didn't actually do like the react piece there we go okay we'll create a react component listen here all right there we go so now in our listen listen here Library component this is our mingle JS component that we're pushing to our react component and
again all of this can be done within view as well I'm just using react for this particular application but now I can say uh public public function maybe I'll just say we'll go ahead and um do something because now you're like oh yes on declare I want to do something I'll bring this in so on declare this is standard Livewire
attribute I want to do something in this case maybe I'll uh die and dump and we say we did something okay that's all great and that that probably would work uh at you might expect because if uh now in my declare react liar component we have this button in our declare blade we're already pushing it in uh so this should work as you expect but I guess
one of the thing that we might want to do also do because uh we are pushing this within uh Live Wire is we also want to dispatch to a specific component so I'm just going to say to and then I want to say the listen here class this is just uh helpful within live art if you wanted to dispatch an event to a specific class that you know is going to
be listening for it and in our use case if we're pushing this to a specific react component because we knew we wanted to do something with it that would be what we would want to reach for okay so if I want to go ahead and go to declare we don't have a react component on this page at all if I was to declare it nothing's going to happen right we're dispatching to a specific class that is not actually initiated on
this page so why don't we go ahead and do that in our declare blade. PHP we'll go ahead and say um I think Patricio on code mentioned that I probably have something mes uh Missing for my specific setup I I try to get it right but I might have something specific I am not doing properly but now I want to go and in my Live Wire I want to say listen
here here again that's Rea that's that component that we did for react and now I'm refreshing I'm going to declare and we have that dying dump okay that's working great because we're not actually using an react right this is just technically two Live Wire components talking uh from one to another we did something we declared it we did something we're talking to the server in another component again two Livewire
components talking together not super flat actually not super uh exciting in a lot of ways but can we do something even better well we can so in our listen here JavaScript this is our react component H maybe we want to do something on the client because that's what we're all here for so what we could do is
wire.on deare and then we're just going to do something in the console instead again this is now the server talking to our server Live Wire component and then pushing into the client does this work let's see because now we have uh declare and I probably messed something up let's
see wire on declare and am I actually calling the okay we have Live Wire listen here here I think that's proper um let's see Live Wire listen here we have our declare Rea oh that's why we're not
actually declaring react we need our JavaScript of listen here so that is going to be the listen here. JS there we go there we go now declare and now all a sudden we [Music] have I probably am still missing something here so live demos on everyone
this is uh this is this is what happens so we're going to take a look at the documentation because that is exactly what you do I probably missed the uh the spelling one so in events we have the ability to read it from um from the JavaScript as well where we can say props . wire.on I think I was doing that but maybe I I messed something up let's see we have listen here. JX we have our props already destructured so we have
wire on declare did I I might not have called it declare that's probably why naming is important um if on declare do something uhuh it's probably because we don't want it to talk to the server anymore because we're only wanting to re uh interact on the client so now if I click declare we still aren't doing anything okay well I
probably am missing something there but the cool thing is when we talk to or when we use events within Livewire you can also use those events um within your react mingle component as well so for example I can now talk from one component to another from a live wire component to a react component even though there's still two PHP Live Wire classes not only can we do
something on the server but we can do something on the client as well and the the docs are going to be like the the setting stone for that where not only can we emit things from the from back end to backend but we can also dispatch things from the client as well and last but not least I want to talk about one new thing that just kind of shipped there actually are docs for I was talking to Patricio before about how you
because most of the time within your react component you want all the niceties of Livewire like those methods that we can talk to from client to server and you want the ability to be able to right react that's usually if you're reaching for something like mingle JS you just want the ability to write react but without having to redo your whole application or somehow work your way into transpiling a an inertia application but only for a certain set of pages because what if you only wanted
a component on one page again the reasons why are fairly standard but you also want those niceties as well so we're going to go back into my code I already set this up where we have uh the this mingle demo uh view what we're doing here is bringing in this to-do manager I have a
list of to-dos in my back end and I want to then push those to-dos into the front and this is this works just like you how you would expect if you're pushing any props from your backend to your front end you have todu and now you have to- do get I only want to grab the ID and the title and then I want to push those to an array to the front end well now
that we have our to-do manager react component um we'll just say hi there larvo worldwide but now we have exactly what we would expect we're already initiating the to-dos because there are prop from the front end props mingled dat. todos and now we can just map over them okay this works great
but let's go ahead and what what happens if we have actual server expenses because in this a lot of times if you're sending this kind of data to your front end even if it's a Livewire app if it's a nura app most of the times you need something that is going to be it's expensive it might take a couple of seconds and here in my to-do manager I've actually said in our Mount function
I want to just sleep for two seconds well I already have this set up but uh Mingo JS has the ability to do lazy components just like you would expect within a um within a live bar application and even with an inertia JS now that there are um kind of like these placeholder components that you can wait and defer those loading until you
actually have that information in and it's as simple as putting a placeholder just like you would in a live wire class and um then at the top we just bring in this lazy attribute so now if I was to go to this mingle demo page right here we're we're expecting this to wait for two seconds because it's sleeping we have this little spinner and
then we get the information that we need all of those to-dos that we're pushing to the server That We're looping through all of a sudden we have the ability to have this lazy component you can see how this could be very useful if you had a full server rendered application maybe one Live Wire component needed to to do something but now you needed a react component on your page now all of a sudden you don't have to uh just have that component be blank or have that component wait for all of the other
components to load now you can just that one in single component be lazy there's so much other stuff that mingle JS makes easy but most of most of the times I'm using something like a specific react component a specific react library or just something that I know would be easier in react than trying to find a way to do it in vanilla JavaScript and that's where I think mingle JS actually shines letting your Livewire application
still be a Livewire application still be able to have the ability to write specific uh you know functions or being able to pass data or even methods that now I can call from my react component or review component but now I don't have to choose one or the other I don't have to choose the DX nicity of Live Wire and also uh miss out on things like react or
I don't have to choose uh the awesome abilities of inertia and react but then then I have to make sure I have to have a controller for everything and a route for everything to make sure that all that's working properly and again there's a time and place for all of that but if you're wanting to move fast mingle JS works great for that because now we can take our Livewire application maybe our existing Livewire application maybe you have a Live Wire application like I do that's in production that's
thousands upon thousands of lines of code but I haven't refactored it because I just need that one specific piece to be a react component and that's where mingle JS comes in because now you can take your live wi component and you can actually mingle it and that's where I think mingle JS Works fantastic uh so thanks so much for um for letting me share it with you again Patricia Eno has been in the in the chat putting it
together uh but uh he's the real Mastermind and the brains behind all of this as well but I'm excited that I get to show a little bit as well so uh I think right now we'll move into probably taking some uh some questions a all right thank you I I got a little sound effect I hope comes through
here big shout out I mean giving giving a presentation of any kind in front of an audience is is a daunting task but a live coding presentation is is even more daunting and you crushed it man I know you ran into maybe a little bit of an issue there with but um you know minor and all things being said so fantastic job with the with the live demo trash that was great thank you thank you cool yeah um I think uh first off the I think one of the first comments you made kind
of um resonated with me and it was I had a similar thought to uh leading into this talk and I was uh looking over some documentation and stuff and it's it's the kind of it's a kind of tool you're not going to need all the time but I think when when you when you may need it when you're in that situation knowing that it's there is is really nice right and it may be the kind of thing that you could reach for and be really helpful right so I think that that is definitely true right it's like you kind of think in some ways oh it's as you know as you kind of understand the philosophy of of
live wires are going to help you kind of stay in PHP stay away from getting getting having into JavaScript right so why would you want a tool that allows you to use JavaScript in Livewire you wouldn't be using Livewire but I think the one one of the things I've encountered uh in working in in software for a long time now is like there are lots of reasons why the code is in a certain spot and you may be needing a certain thing at a certain time who cares what those are the fact you need them you need them right so I think yeah yeah totally having knowing that tool is
on the shelf and knowing that you can reach for it when you need it is is huge exactly and that's that's really what it comes down to right knowing the tools on the Shelf because I think that's uh you know when you're building an application most of the time you reach for familiarity that's a lot of times why now I reach for live wire a lot because I just I just know it I know if I look at an application this is how I would build this in Live Wire but now I also know that I'm not limited to um a lot of times if I'm if I want to do you know
connect to the server but but not have but not write a whole bunch of clientside JavaScript while Al PJs is great A lot of times there's things that have already been solved for me and if I could just pull in a react component for that one thing then it makes great 100% yeah yeah a couple things potentially I was kind of brainstorming like you know where where could I you know find myself reaching for this right um and I think that even the documentation speaks to it uh one could be it could be sort of a I think of a transitionary tool almost
right and I say that in like you could maybe be potentially have a view a react heavy application and want to move to Livewire long term or vice versa and I can see a tool like this being really handy being able to bring it in and start introducing things you know kind of Peace meal as you go along uh as opposed to having to make a full transition another one that that struck me again you know a bit of a contrived scenario but you could find yourself in it is like maybe you're you're in an organization has multiple applications different text Stacks across applications and there could be
components that are used in another application that are mostly do what you need them to do being able to pull those in and not having to to to rebuild them so to speak uh in JavaScript might be really helpful as well right yeah exactly because I think uh I think what helps there is um and even like there there's a lot of people who are moving to Livewire applications but they still have like a Vue SBA or maybe they're using just view in line with blade um for specific interactions and now you're
you okay maybe you're not fully even moving into Live Wire but you still want to have that the niceties of Live Wire maybe have you know you're just incremental moving to Live art now you don't have to give up those view interactions that you have as well if you didn't want to fully move into inertia yeah yeah totally yeah go ahead Marg no I just had to com about that too because I was wondering how to make components feel native when you're kind of going from like reac View and using liar app so I
feel like I kind of answered a little bit of that so thank you um and also just kind of like sorry I didn't mean to cut you off Josh we're gonna say something there oh no no I was yeah I was just going to say that uh be yeah being native feels is the more important part because a lot of times you'd reach for developer experience when you're looking for a new tool rather than just the functionality of what that tool provides so I think the ability to say okay I have my full blade component but now I just need that one thing just like
you would within Live Wire now you can just do it within react too yeah for sure um and it was really cool seeing in the comments like there's there's somebody um I think Carlos mentioned that he's actually learning live wire for the first time this week and so learning all the different components and gu different things that you could do um I guess just general question for you what was your kind of like onboarding like rampup process integrating mingle JS into the ecosystem that's kind of already built in there do
you mind speaking a little bit more on that yeah yeah the process of of of in like installing Mingo JS is is actually like fairly straightforward because uh even for my fairly heavy Livewire applications because one um you can use view or react within mingle JS and it doesn't you don't have to choose one of the other you can use both view or react maybe even both within a single application but two it's it's incremental in the same way that
Livewire is incremental so a lot of times I don't do this as well as I should but usually most people recommend hey if you're building an application uh start with blade and when you need a form or you need something like that then you can just pop in a live wire component um usually I'm the officite and I start with like a full page Live Wire component so it's not what I should be doing but uh the good thing within
mingle JS is once you have it installed then I can just pop in um a a mingle JS a react live F component uh wherever I might need it it doesn't have to affect the rest of my application it just lives in its own little containerized State cool thank you thank you let's a few questions in the chat here so I think you've got touched on already but we'll throw it up here so man asks uh
does mingle uh I think work with both react and View at kind of at the same time in a single app yep it does it does uh you do have to have both react and view installed and like in if you want to use like hot modu loing like put them in uh View and react within like your V config and everything but yes you could have in one page uh have a view react and Live Wire component all together and they would be talking to the same you know database
have different Live Wire classes that's push to those components you can't have one Live Wire class that pushes to a view or react View at the same time but you can definitely have them working in the same application together for sure cool cool yeah again probably an odd scenario you'd find yourself using both react and view at the same time never know never know right the Tool's there if you need it on a similar uh similar
vein we have a question here um if I wanted to use an npm package in my mingle component do I Define that in my package Json at the root level and import it as usual yep yep so uh I I can probably actually share my screen again because I forgot to talk about um this uh I have motion JS installed here so if I was to go into my motion. PHP I'm not doing
anything other than having in my compo or my uh uh package.json I have um react or I have motion installed so I mpm installed motion but now in my uh motion. jsx I can just import that at the top and it works as you would expect so this is nothing it's not talking to the server at all but I'm just pushing this into a react component that's
containerized in my laral application um all those niceties work great so yeah you can definitely um you can definitely use this any any JavaScript component rack component View Library that you're wanting to bring in you would just use that as normal in your jsx orvw file yeah that's that sounds great uh question here I mean this is very generic but what about performance I
don't know what about performance what about performance uh I I I I need to I am not the best at talking about how great it is I so Patricio on goat and also there's a page on the um the uh um it's called Uh I believe it's called why mingle JS or maybe it's just what is mingle JS or something like that but it's talking a little bit about how it
actually works behind the scenes in the documentation um and I think the performance is exactly what you would expect from putting a react component if you were to push what it's doing is essentially taking your react Dom or your view Dom and placing it on the stage and then just using um using Ajax request to push or pull information so I think the performance is exactly what you would
expect from if you were using a vew spa um or even just like a view component on your page and you're kind of rendering that to a specific root element so I don't think the the performance is any much different than if you're using those react or view in those situations I think the per usually where performance comes down to within applications like this is are you talking to the ser when you should be or
you keeping things on the client and usually that's tough within Livewire because you think oh if I want a counter I want to make sure I have a a add count uh public method but you're talking to the server there so performance is going to take a hit but within reactive View kind of makes it easier because you're used to doing all that on the client anyways yeah oh okay so Josh would you say this is a good resource for like maybe anyone else who's maybe hesitant that might like over complicate their
libr our apps like going to look this documentation would be able to solve a lot because we just put that in the link description below as well and then people can check that out there too yep yep I I I think the the documentation does a great job and looking at some of like the the demos and demo source code to see exactly what um that is showing but I think it shows a lot and there's there's specific pages on how to use it within like something like filament or something like that as well but yeah I think it's if you think about it as
being containerized within your application uh it kind of helps at least in my mind it helps me think okay I'm I'm not necessarily bringing react and it's leaking into my application but in this one uh specific frame I have a react component okay cool awesome yeah I mean any chance to kind of see how you work how you like think about things I think is super great for the audience even just for myself and uh yeah even in parts of your uh um talk just kind of
seeing how you think through things it's very enlighting so thank you awesome thank you I think and again too like the uh so so many different possibilities the more I think about it of like different ways you could do things with the tool right and some of them are probably better ideas than others but uh again you know know knowing that that it's there and those are possible is is is pretty cool um the uh one thing that or actually a question I had was um do you have in in in you're using mingle JS
and and and actually you know integrating into some applications do you have any tips or um advice for people in terms of implementation and I say that thinking along the lines of let's say I had this component I was that maybe that I owned already that I was pulling in that you know wraps some npm package and maybe it's you know by Nature has to hit the server with some data right um if I pulled that application or that that component in
rather and buried in that component that existed it was making you know xhr calls to the server right that wouldn't be ideal if I'm trying to bring that into a Livewire app right I'd almost want to structure things I would think to have like those inner components just submit events up and then you know I can pull that in and whatever the thing is pulling that in can decide what to do with those events right so that was one thing that acrossed my mind but anything in that in that realm Josh you've run into of like hey keep this in mind maybe you might have an easier time with
things yeah I think that that's a that's a great point I think what has helped me in the uh so I've uh I have two kind of production applications SAS products that I've that I've implemented Mingo JS in because I needed one was a chart Library um that I needed to kind of display to my users and then uh second was um Mo mostly because I wanted to use react motion which is now just motion JS
and so I think the things that I would kind of reach for mingle JS for or kind of like keep in mind is usually the what I was thinking through of when I actually create a mingle JS component is when I would otherwise be reaching for like an at script tag on my um in my Livewire component or maybe like using a bunch of Alpine JS for some very like
client side stuff uh a lot of times that is when I would okay let me just push this to react that way I know okay everything is on the client and I'm I'm writing code or maybe like bringing in libraries that is meant for that one thing to keep in mind through that all is you still have the uh the nature of these are still separate components so just like you would have two Livewire components and if you haven't worked
within Live Wire extensively for some of this need it can be tricky when you think okay I have this one component that needs to talk to two components and one's lower down and one's higher up in the architecture of things um I always opt for personally using that dispatch 2 method because most of the time I know the specific component that I need to do something with when something happens um
but then Live Wire the good thing within mingle Js is the the server side part is all all live wire so all of the elements that you would expect within Live Wire maybe I need to talk to all child components or all uh parent components then um then that's where I would kind of opt for that but I think one thing to keep in mind within mingle JS it's kind of similar to a um maybe like an an inertia app where you have U most of the
time you're thinking if it can be done in reactor view or spelt it can be done in inertia inertia is just the glue together where Mingo JS is kind of like the glue between Live Wire and now you just have a reactor view front end and so uh yes it's Live Wire can be a little bit tricky or sticky once you get I have you know thousands of nested components and so I would think to always keep in mind of um when does a component
actually need to be a component versus when can this be multiple components pushed into one or maybe that's just a blade uh a blade file then I have a specific component as well so components can be can be tricky within within Live Wire but I think within mingle JS one of the thing one of the things to always keep in mind is when do I actually need this to be specific client side and then that helps me at
least realize okay now this is where I could use that instead of liar yeah and I I do think too probably one of those things that uh there's no substitute for just trying it out and playing around with different patterns and seeing what you do right absolutely uh again another kind of general question here from the chat but how does mingled JS affect the scalability of laral applications are there any
limitations or considerations for high traffic applications and there probably always are but is there anything specific that comes to mind for mingle JS specifically for you Josh yeah I don't I don't think so other than um any any options that you would think within a traditional Wire application so um you know again a mingle JS component is a
Javas is a react view pushed into a Livewire Island uh if you if you will and so I think the the thing to keep in mind when it comes to scalability of Lille applications or or considerations for high traffic is what actually needs to go from server to client versus what can just stay on the client I think that's actually what mingle Jess and in a lot of ways might be uh more
helpful to add to a liveo application where you can kind of bottleneck yourself within a liveo application of maybe doing too much stuff on the the server and not enough stuff on the client and while yes you can do all that within vanilla JavaScript and a and a live wire component I think that's what MJS might be if if you're used to um if you're used to doing client side stuff or you have an app that has high
interact client side interactivity um I think mingle JS can almost help with limitations or considerations for hight trffic applications because now you're instead of having to have um all your users hit the server to get uh you know to get a progress bar um well maybe we're maybe you're pushing the progress bar and then just incrementally updating
it um and pinging and pulling the server within mingle JS as well and so I think I think there's uh I think there's fantastic options to make the scalability aspect even easier with the Mingo JS because you have that more distinct separation I think between server and client side yeah I guess like used used responsibly it allows you to uh when needed push push more things to the to the user's browser let the the
browser do more work and and leave it off server right I guess sense yeah where like within a live application if you know if uh if I didn't rendero out you know um everything for that's maybe I'm like for a to-dos maybe if I didn't render the users to-dos and I wasn't pushing that out it's not going to actually be pushed to
the to that page but with a mingle now I have to actually think okay um now I want to send all the information at once and then kind of uh maybe maybe this would be a great opportunity for um like a table component for example where now I'm doing all that heavy filtering and rendering and even maybe searching on the client side if it's not too long of a too long of a
list yeah cool all right uh any other questions uh from you Margaret no I guess um or just thanks Josh for being able to I don't know lower the barrier or just get people more excited about using mogle JS and then also understanding like how supported everyone in the community is like Patricia is here too answering questions in the chat I was just goes to show how close it every everything is and how well connected the community is so yeah
thank you so much yeah actually sorry to piggy back on that uh patrici I saw you in the chat as well so yeah thank you for joining us thank you for uh thank you for mingle JS um I was also thinking too um you know the one thing you mentioned Josh earlier was that uh it's it's mingle Jess is not at 1.0 yet right so I'm sure there's lot lots of work going into it and has g into it uh so I'm sure uh Patricio would would love some assistance from the community even just you know pulling the package down trying it out reporting bugs uh contributing fixes that sort of thing so
I'm sure if there's anything else you can add in the chat there Patricio but I'm sure the community would love to help you out if people are interested in this tool yep yeah hopefully it doesn't get too too bombarded with everything now but uh but yeah yeah definitely I think uh it's it's been beneficial for me to see what P has been kind of putting out and just like I said that those that lazy component isn't even something that's document yet but I think you pushed that out last week and that was excited to look into it very cool all right um well thank you again
for joining us Josh and kicking off our 2025 year here at the Lal worldwide meet up uh before uh we let you go here was there anything else for you that you wanted to share no yeah I I don't think so other than um I'm going to be talking at LaRon India as well in uh in in March in uh March 8 and 9th and alad Dead uh I hopefully I said that right but uh um yeah super excited my first time to India so for those who are here super
excited to be there with everyone who might be going to LaRon India uh but yeah be be on the lookout if you're not able to go to LaRon EU be on the lookout for what's uh happening in this next week at Lon EU because there's a lot of uh awesome announcements Taylor has already kind of posted that the uh release date for Lille cloud is going to be announced at LaRon EU so so be on the lookout for that very cool yeah there were actually some other questions in
the in the chat about what's coming in Lille version 12 and Lille Cloud which understandably people are excited about so stay tuned I think that's the best advice check out lar next week and probably some of some of all of those answer or questions will be answered it will be live streamed awesome cool all right Josh well thanks again we're just gonna uh let you go backstage and then marget and I just have a couple of housekeeping items to to wrap things up here for this month so thanks again thanks so much Josh all right and there
we go marget so just uh like I said before we uh we head out uh a couple things we want to touch on before uh for next month yeah for sure thanks so much Dan so again big thanks to Josh H for our next meet up you can join us on February 25th 2025 at 12m we have another core larabel member joining us Joe Dixon so I saw some questions in the chat about larel Cloud if you'd like to tune into our next Meetup there'll be a lot of um conversation about that so please join us then and if you haven't
joined our jet brains giveaway rules you can please scan this QR code to to have the form to fill your information to be eligible to win one of our prizes so just put this on here if anyone wants some time to read the rules just leave that QR code up for a moment again if you haven't followed us on X yet you can follow our official channel laral WW Meetup and you can stay up to dat with all the upcoming events
and never miss a single one and again you can check us out on our official website meet up. lal.com to sign up for Emil reminders about what we got going on um over the next month so you can do so there and then again thanks for watching us on YouTube uh make sure to hit that subscribe button um and hit that Bell for any notifications and this is where you can find all of our other meetups from last year we did 12 last year and we're trying to do once one a month so please
join us on the laravel YouTube channel there it is and and with that uh that concludes our January 2025 edition of the Lille worldwide Meetup thanks everybody for tuning in thanks once again Josh for joining us and uh taking us on a dive into mingle JS uh anything for you Margaret before we sign off uh more so if anyone else wants to contact us on X about any future talks or speakers they'd like to hear from we'd love to hear from you and thanks again
for supporting this Meetup and watching us and giving us comments and feedback um love hearing it all so thank you so much for everybody absolutely thank you everybody uh have a great day and we'll see everyone at the end of February bye now [Music]