Andy Maleh
👤 PersonAppearances Over Time
Podcast Appearances
So meaning you just do a Rails asset precompile when you deploy production and it generates JavaScript files and that's it. Then you put the JavaScript files in a CDN. So then people will download them with instant like download speeds and the website will be very like high performance as a result of that. And locally on my machine, there's no bundler again. There's just Opal Rails, the gem.
So meaning you just do a Rails asset precompile when you deploy production and it generates JavaScript files and that's it. Then you put the JavaScript files in a CDN. So then people will download them with instant like download speeds and the website will be very like high performance as a result of that. And locally on my machine, there's no bundler again. There's just Opal Rails, the gem.
So what that means is every time I hit a webpage, the Opal code gets compiled on the spot in development. So that way, as I update the code and I refresh the webpage, it picks up the newer changes. That said, I heard from the Opal people that they are working on... like a way to integrate Opal with bundlers like Webpack.
So what that means is every time I hit a webpage, the Opal code gets compiled on the spot in development. So that way, as I update the code and I refresh the webpage, it picks up the newer changes. That said, I heard from the Opal people that they are working on... like a way to integrate Opal with bundlers like Webpack.
And they might already have, I believe they already have like proofs of concepts of it, or maybe even working versions, but I'm personally not interested in using them. In my mind, like a big benefit is avoiding Webpack is like my way of doing things, I would say with this is to not use a bundler. In any third-party libraries, I would link to their CDNs. That's fast enough and good enough.
And they might already have, I believe they already have like proofs of concepts of it, or maybe even working versions, but I'm personally not interested in using them. In my mind, like a big benefit is avoiding Webpack is like my way of doing things, I would say with this is to not use a bundler. In any third-party libraries, I would link to their CDNs. That's fast enough and good enough.
I realize that bundlers give you chunking and other features that people will say will give you even better performance, but like for most apps that are smaller startup Rails apps or mid-sized apps, which is what Rails is used for the most, I'd rather not use a bundler.
I realize that bundlers give you chunking and other features that people will say will give you even better performance, but like for most apps that are smaller startup Rails apps or mid-sized apps, which is what Rails is used for the most, I'd rather not use a bundler.
I'd rather just have things bundled with Rails asset pre-compile on deploy and locally would just compile live when I'm doing development.
I'd rather just have things bundled with Rails asset pre-compile on deploy and locally would just compile live when I'm doing development.
what are your feelings on turbo and like the html over the wire aspects of rails um so uh turbo is nice if i have a very simple business app and i need very very few like front end uh front end e interactions uh without writing front end code uh I can use Turbo for that, like where it would update certain parts of the screen automatically based on backend directives from a controller action.
what are your feelings on turbo and like the html over the wire aspects of rails um so uh turbo is nice if i have a very simple business app and i need very very few like front end uh front end e interactions uh without writing front end code uh I can use Turbo for that, like where it would update certain parts of the screen automatically based on backend directives from a controller action.
So I think for simpler apps, it works fine. For more sophisticated apps, it doesn't do everything. And that's the reason why a lot of Rubyists nowadays reach for React and other JavaScript libraries like Svelte and Vue.js is because they at one point hit a wall or feel like it's too complicated to manage turbo from controllers on the back end than to actually just write front-end code.
So I think for simpler apps, it works fine. For more sophisticated apps, it doesn't do everything. And that's the reason why a lot of Rubyists nowadays reach for React and other JavaScript libraries like Svelte and Vue.js is because they at one point hit a wall or feel like it's too complicated to manage turbo from controllers on the back end than to actually just write front-end code.
I think turbo in a way is a bit like written in with the approach of being a bit aversive to writing front-end JavaScript code because JavaScript code is not nice. But if we had the front-end language that was nice, and we do now in 2024, which is Ruby using Opal or Wasm, then there's no reason for me to consider Turbo in that case.
I think turbo in a way is a bit like written in with the approach of being a bit aversive to writing front-end JavaScript code because JavaScript code is not nice. But if we had the front-end language that was nice, and we do now in 2024, which is Ruby using Opal or Wasm, then there's no reason for me to consider Turbo in that case.
I would rather just write front-end Ruby code the normal way and following an MVC pattern, and that should be good enough. I can just make REST API calls. I mean, at my job, People do that anyways with React right now. They connect React to the backend with REST API calls. So, I mean, I feel like that's simple enough and a lot of people are comfortable with that model.
I would rather just write front-end Ruby code the normal way and following an MVC pattern, and that should be good enough. I can just make REST API calls. I mean, at my job, People do that anyways with React right now. They connect React to the backend with REST API calls. So, I mean, I feel like that's simple enough and a lot of people are comfortable with that model.
One thing about Turbo is it has a bit of a learning curve because its model is a bit like, out of the normal, out of the ordinary, the mental model. So people have to think a lot about IDs on elements in HTML. So in my experience, I feel like writing features in Glimmer DSL for web is simpler because I'm just writing basic Ruby code. I don't have to worry about IDs.
One thing about Turbo is it has a bit of a learning curve because its model is a bit like, out of the normal, out of the ordinary, the mental model. So people have to think a lot about IDs on elements in HTML. So in my experience, I feel like writing features in Glimmer DSL for web is simpler because I'm just writing basic Ruby code. I don't have to worry about IDs.