Elm in Rails: Use Elm in your Ruby on Rails Monolith

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello what's up everyone back again with mpj here now in this new video i want to share about elm in rails so imagine you are using elm a delightful language to build ui and combine it with the professiveness and the usefulness of rails so let's see right okay so in here i working on uh a project that i repeatedly share to my youtube video where i'm building like all the building blocks from the ci cd to the what else the of rage tdd and all that stuff and now to share to you my elm setup it is not complete yet it is just uh like initial architecture of i'm currently building and i want to like get your feedback and get your opinion and then see if it's working working out okay so i have this uh like typical rouse application so i'm using a mono repository and then i have a folder called backhand and in here it's basically a rails application right so initially i create a front-end like repository here folder in the monorepo where i creating an elm app using lmspa i forgot this msp or it is uh elm pages but the idea is i'm using uh spirit elm framework but uh i realized that it can be much much more easier if it's already in the rails application itself because uh there is not much engineer in my team so i need to be very very careful on like spiriting all that stuff i think that's maxim uh spreading the repository methods for android and ios but for the web because there is only two of my team me and other people i don't i don't think it is like makes sense to split everything into separate layer because we both working on the back and the front end so yeah just putting everything together and then when i'm trying to include the film in rails i'm thinking about whether i'm whether i need to create a like single page application within rails application or i need to create like multi-page application uh i end up using multi-page application because i think it is more makes sense in sales application so the idea is every time i visit a webpage like this it is uh a single page i mean like individual page it in here people can have their own like interaction but when when they click another link like this uh they end up in a different like application and we we inject uh different like elm app to the to the different paths on on the rails and then we'll see together so in here what i what i have is i have a javascript where i'm running my uh like alm application i have a main application because in elm the main one is called main and main is mapped to the uh pack index.js so in here what i'm doing is um i basically added even listener when the dom content loaded i just append elm uh and uh main modules to the to the dome right are using this uh helper function called uh append body right and then i'm doing the same for another page called upcoming events where i have this upcoming event modules and then i include it in here where i have under upcoming events right and then after that uh the idea is i want to have each individual pages have sharing the same structure and the same library so i create the like a generic message some messages coming from the messages.elm uh like in the future it can be something else like other than none it can be like uh new notification and things like that and then after that what i have in another page is uh i also want to share the um the headers so the headers i'm creating a new component where in here i have a component called header and then there is header.view which is the header component so it's it share the same uh header like this one right and for the setup what i'm doing is i have a profile which basically uh running the webpack every time i uh make changes if i were to make a changes here uh like house um event there will be some recompiling here and then falla is already compiled here pretty amazing like workflow right and another part i want to share here is regarding the setup uh in here if i take a look at the config folder i have the loaders a custom loader where i basically loading the elm js it is not uh made by me i think taking it out from the other project from the sp rocket and yeah it worked out and the other part i want to share here is let me see uh okay not here okay so the idea of having elm in rails is i want to take advantage of a very solid uh web framework which is rails and i want to have like delightful experience like programming in the uh in the front end world because you know in in javascript world you end up with a lot of like uh barrel right when you pick a framework like react or futures you pick cu jaz or react and then you you think again about how do i store data how do i manage state and then you think about redux mob x and things like that and then after that you need another additional uh like what is it uh javascript thing like lodas and everything but in elm everything is just elm right and in m i already know all the languages and i can write a powerful uh and like a complete app without taking much more time like learning in google or stack overflow because the language is basically is very very simple right yeah uh i hope you enjoy my little share here uh like today my time is uh spend like uh like spend a lot of time in in the learning action mail an active job but the last part is really the the elm setup because it used to be a react app but i'm deciding that my company will be mostly rails and elm so yeah just removing uh the react and including all the elm code here and it is pretty early in the code base but i will share again once i have more code and thank you
Info
Channel: YoKulGuy
Views: 42
Rating: undefined out of 5
Keywords: elm, ruby on rails, ruby, web framework, building in public
Id: FfFpiZdsz_0
Channel Id: undefined
Length: 7min 41sec (461 seconds)
Published: Sun Apr 04 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.