Live data from Hacker News

Matestack – Reactive UIs in pure Ruby

matestack.io

41–50 of 120 posts

Re: Matestack – Reactive UIs in pure Ruby

#41
post #29

Love the idea of it, even if it's not for me. Ruby needs new blood infused into it. I realized recently that Rails started losing its popularity because it just didn't quite keep up as the web evolved. Where the framework and its community resources (guides/tutorials) should have started promoting REST APIs and out-of-the-box no-friction compatibility with modern tooling like npm/webpack/react/whatever, instead it st…

I’m actually quite bullish about Rails for the fitst time in a while due to StimulusRelex[1]. It’s a similar approach to Elixir’s Liveview and provides reactive, diff’d partial updates streamed over a websocket. This seems a very “now” approach to building webapps. 1. https://docs.stimulusreflex.com/

> streamed over a websocket

That's my problem with this approach, I wonder what the penalty is (performance and complexity wise) for going that route. What is it using for websockets btw, Action Cable?

Re: Matestack – Reactive UIs in pure Ruby

#42
post #31

Earlier quoted context omitted.

the whole trend though is that the server side is mostly a very tiny crud layer & a little bit of business operations. yeah tools like django are amazing packages. node is shockingly hardly any more tamed than it was 5 years ago, still rag tag Express for the most part. with who knows what for the data layer. but it just doesn't matter. alas! the actual application has been heavily front end biased, & all the real in…

> mostly a very tiny crud layer & a little bit of business operations. Even if you have a SPA, which isn't a given (yes, trends. I know. They come and go), the API, data migrations and background workers can easily be 50% of your code and effort.

Yea, I have switched to Django with the intent of continuing to develop primarily SPAs.

Like I said in other comments I'd only build an API in Express if I needed its particular performance characteristics.

I've checked other tools in the JS ecosystem that serve as "low-code" API layers, but upon close inspection they always seem to have some limitations on the business logic you can write, and some of them lock you in to products. No thanks.

I'm finding Django REST gives me a sweet middle ground between dev speed backed by great abstraction "magic" and freedom to customize as the app grows.

Re: Matestack – Reactive UIs in pure Ruby

#43

Love the idea of it, even if it's not for me. Ruby needs new blood infused into it. I realized recently that Rails started losing its popularity because it just didn't quite keep up as the web evolved. Where the framework and its community resources (guides/tutorials) should have started promoting REST APIs and out-of-the-box no-friction compatibility with modern tooling like npm/webpack/react/whatever, instead it st…

I used Rails for a lot of projects starting ~10 years ago, but slowly gravitated towards a stack based on Sinatra (for a lean REST API), Middleman (static site generator), and webpack/react/etc - for mostly the reasons you describe. In hindsight, I can't blame Rails for the direction it took; JavaScript's path (the language itself, as well as the tools) has been extremely volatile in that time. Rails is opinionated,…

You can try out Turbolinks, the Rails equivalent for LiveView.

Re: Matestack – Reactive UIs in pure Ruby

#44

Love the idea of it, even if it's not for me. Ruby needs new blood infused into it. I realized recently that Rails started losing its popularity because it just didn't quite keep up as the web evolved. Where the framework and its community resources (guides/tutorials) should have started promoting REST APIs and out-of-the-box no-friction compatibility with modern tooling like npm/webpack/react/whatever, instead it st…

I think it's quite the contrary. Rails integrated Webpack a long time ago in it's basic installation so if you do `rails new my_cool_app` you have Webpack ready(and preconfigured with React/Vue/Elm etc.) right out of the box. Also it moved away from Coffeescript and jQuery.

And for the full page reloads, which you think is weird, there are Turbolinks(again preconfigured in the basic install) since like 2012. I'm not sure React or other reactivity foos already existed at this time. And now we have things like Stimulus and Stimulus Reflex and others so the development ain't stoping now either.

So the feeling that Rails are stuck or out of date is really only a feeling.

Re: Matestack – Reactive UIs in pure Ruby

#45
Even if this was a good idea, the push on commercialisation puts me off. And as other commenters have said, the DSL feels like it would end up being a hinderance. Stimulus (and perhaps StimulusReflex) feel like the safer bets for the dynamic rails future.

Re: Matestack – Reactive UIs in pure Ruby

#46

The crazy idea that Ruby "DSLs" are neat is one of the worst things to come out of Ruby. This code is Ruby, and yet you're encouraged to think of it as a different language that's "intuitive" and "expressive" when you can't even tell what is executing and when. It's a nightmare for anything except the samples.

I second this. In fact, it's the #1 reason I don't enjoy "Ruby" anymore. Ruby as a language is great if you stick to a small subset of its capabilities (meaning, largely skip the metaprogramming, and definitely skip the make-a-dsl route).

Basic procedural Ruby, with some thoughtful functional style collection operations, is very elegant and fun to use (because you can get a job done in few lines of code which aren't terribly hard to understand later).

But as soon as you start dipping into metaprogramming, you've lost your ability to see what's happening. You have to understand the system to... understand it. Defining methods on the fly, calling methods via send() and a string/symbol, and using method_missing as a dynamic dispatcher are some of the most abused and least easy to understand later without current documentation of their use in the system.

In general, there's too much magic in a lot of the Ruby ecosystem, and some of us are really pushing back against that.

Re: Matestack – Reactive UIs in pure Ruby

#47
The first to implement a pure-ruby HTML renderer was Markaby[1]. This was without the reactive bits. I remember it being quite enjoyable to use. The barrier between ruby logic and HTML rendering is much lowered.

The main downside is that rendering wasn't very efficient as it has to execute thousands of ruby functions per page. One per DOM node. This makes it harder to cache fragments as both the code and HTML is now inter-mingled.

[1]: https://rubygems.org/gems/markaby

Re: Matestack – Reactive UIs in pure Ruby

#49
post #33

Earlier quoted context omitted.

I still prefer the good old “build stuff in rails” (which change a lot, something you don’t really know) over build everything in JS. Which is mostly popularized by new kind of programmers breed who learned everything purely from YouTube. They don’t know their tooling, systems, how web apps works, make huge mistakes on each level. Just putting the one solutions they know in everything. Do they think about what they d…

Which is mostly popularized by new kind of programmers breed who learned everything purely from YouTube. They don’t know their tooling, systems, how web apps works, make huge mistakes on each level. Just putting the one solutions they know in everything. Or—bear with me here—it’s possible that everyone other than you actually isn’t an idiot and there are issues that you are neatly stepping over with this patronising…

Oh, wow a personal attack! I didn’t want to offend anyone, but you somehow feel attacked. Either way, have a good day. :)

Re: Matestack – Reactive UIs in pure Ruby

#50
post #18

Earlier quoted context omitted.

> Ruby needs new blood infused into it. yes, I strongly agree with this, specially when talking about Web tech. I am programming in Ruby (and Rails) for over 12 years and I think I had the same feeling up until a couple of years ago that it become a stable system where I could move quickly and create new products but did not have so much newness. But now I see at least two things which makes me love even more this ec…

Can't tell what your SPA experience has been, but in my experience React with a standard webpack configuration such as what you get with create-react-app provides an extremely detailed trace. Never felt like I've lost more time than I should there.

Probably nowadays React with webpack provides a stable experience.

It might be that my impression of SPA is also based on my resistance to dedicate time to learn the new tools. Usually I want to start doing stuff and then go back and read more.

This is why I say it felt that way and I did not say that the SPA is unstable.

Here is how my experience with SPA looked like:

- I started with jQuery, 10 years ago or so (actually with Scriptaculous :) ), replacing parts of the interface with Ajax calls. Worked a little for a while then got into very ugly code both on JS and on Ruby. This was not a full SPA, but it was moving into that direction.

- Then I moved to Backbone around 2013 I think. In the beginning it sounded very nice in the end again the code and mix with jQuery quickly become hard to organise. Also as it started to be slower to build MVPs in terms of moving fast and adding application features.

- So I tried Angular and my main problem there was debugging production issues. The errors I saw on browser console were mostly not giving any clue about what went wrong. Probably it was because of the whole compile JS pipeline to support various browsers ...

- Then I inherited a Webapp written in React (around 2014 or 2015) with backend in Rails which was a second-screen for a radio show. It provided various live interaction with listeners. There I saw the need for SPA but also is where SPA lost me as I spent a lot of time debugging simple things from someone could not be able to login to how long it took to add a new page to display some poll results. For sure a big part (or the most part) is on me and with my expectation about how things were working in Rails where if I wanted a page to display some poll results it meant to simply build a .html.erb and it was done. Of course later on came Action Cable and I started using it for any live thing.

Again I am not saying SPA is in general heavy or hard to use. I am saying that for the products I build SSR sprinkled with some small reactive things is enough and for me (when I am mostly the solo developer) it is fast to produce (from idea to deploy) and debug a feature for a web app.

That being told I am trying to learn Vue - and force myself to use so that I want to have experience with this kind of frameworks.

Post reply on HN