5 ms·
React is Dead, Long live Reactive Rails
- obiefernandez 6y agoBeen a little while since posting one of my own pieces on here, but have been hoping to get some discussion going about these new techniques that are popping up inspired by Elixir Phoenix's LiveView. Freshness in a field that has been pretty stagnant lately (server-based web apps). Since writing the blog post I found out that there's another competing framework that might realize the design goals I'm describing in succint, self-contained fashion: https://github.com/unabridged/motion https://github.com/unabridged/motion
- kfk 6y agoI can’t read your article as Medium says I reached my quota. I manage an analytics team and I am pretty annoyed with most dashboard tool out there (Tableau, PowerBI, etc), so I have been extending our internal python grizly library with server side components built as python classes and rendered “reactively” using htmx. The idea being that my team could easily build scalable server rendered apps from Jupyter notebooks. Most analytics requires server anyway to for instance do Excel extracts or in memory data transformations. It’s been an amazing discovery of simple but powerful patterns and it’s working. My question is why is this not more popular? Maybe I am doing something wrong?
- recursivedoubts 6y ago>My question is why is this not more popular? I have no idea. > Maybe I am doing something wrong? You are doing nothing wrong.
- obiefernandez 6y agoYou can open any Medium article in an incognito window. It's not a very secure paywall.
- bdcravens 6y agoThat seems like a funky workaround for a problem that shouldn't exist. I have some stuff on Medium, but when I find time to port it over to Bridgetown or similar, I will.
- obiefernandez 6y agoWhy shouldn't I take some of the money that Medium has raised from their VCs?
- austinpena 6y agoAnd blocking cookies on Medium works.
- bdcravens 6y ago> My question is why is this not more popular? Resume driven development is a real problem in our industry.
- kfk 6y agoI was thinking 2 things could be better done with react: reactivity and server load due to more client requests to manage. Not sure what else. Server load is pretty high on Tableau too so not sure that’s a real problem.
- recursivedoubts 6y agoMy take: the fundamental problem is that HTML was never completed as a hypertext. - Why should only anchors and forms be able to make HTTP requests? - Why should only click and submit events trigger them? - Why should only GETs and sometimes POSTs be available? - Why should you have to replace the entire screen every time? htmx tries to complete HTML as a hypertext, removing each of these limitations, so you can write advanced interfaces using plain ol' markup: https://htmx.org https://htmx.org
- digitaltrees 6y agoI love it
- obiefernandez 6y agoThis looks super interesting, thanks for posting. Can't help but wonder how much cooler it would be if only the attributes were not hx- namespaced. Is that not done for some technical reason?
- recursivedoubts 6y agoI just followed other frameworks on it, feels a little presumptuous and dangerous to use unqualified top level attributes. I could make it pluggable so you could do away with the hx- if you wanted to. Most people want to go the other way and use data- prefixes (which is supported out of the box)
- imtringued 6y agoI always am irritated when people insist on disabling javascript. The fundamental problem is that HTML on its own is flawed and unusable. Even the most basic features that users expect will require a few lines of javascript. Half of the webapps I make are just digitalizing existing paper forms. There is barely any javascript but the javascript that is there is absolutely essential. If the noscript warriors actually thought about ways of making plain HTML good enough that a JS free site was possible then I'd have sympathy for them. As it is right now they are asking the impossible. They would even complain about htmx even though it is exactly what they want.
- chmaynard 6y agoI'm surprised that someone with your technical sophistication is hosting their blog on a platform like Medium. Yuck!
- chovy 6y agoI personally can't stand React.
- harrisonjackson 6y agoHaving never used ruby outside of some rough puppet scripts but using both react and react-native daily for years - this was an interesting read. Always great to see someone excited about the future of technology - especially if they've been a part of it for so many years. How does it handle connectivity problems in the SPA? Not that react does this out of the box - just wondering if there is some advantage to how the Reflexes do it. Also the names of ruby libs are hilarious. CableReady, ActionCable, TurboLinks, and StimulusReflex.
- bdcravens 6y agoActually those are some of the more sensible Ruby libraries names - you have a pretty good chance of running `gem install {some-random-noun}` and it being a valid command. An XML parser named after a Japanese saw? Why not. A testing library named after a giant rodent? Even better. Not that "redux" or "thunk" much better.
- imtringued 6y agoLast time I used redux it was basically just "reduce" for react. If that name doesn't make sense then no name will.
- bdcravens 6y agoRedux means "brought back", not "reduce".
- arkanciscan 6y agoIs this a joke? Are you just trolling? This article is just hype.
- jaredcwhite 6y agoCertainly the headline is clickbait-y, but the techniques described in the article are quite real.
- arkanciscan 6y agoThere are techniques? I gave up after the fourth or fifth paragraph of hype. I suppose there are enough Javascript haters here to take the bait, but I've learned that when someone has to tell you how great something is a dozen times before they tell you what it is, it probably isn't.
- bdcravens 6y agoI don't think the target is Javascript haters, as much as the developers who feel like Webpack'ing all the things is a bit much for most apps. The technique is delivering HTML partials over web sockets in response to events, optimized via DOM-diffing.
- digitaltrees 6y agoObie Fernandez is a bad ass. He is not hyping anything he is describing his journey. If you knew who he was you would know how much weight that should carry.
- bdcravens 6y agoI've been a fan of Obie's for some time, but I do agree that an article should stand on its own, with no appeal to authority needed.
- digitaltrees 6y agoIt’s not an appeal to authority to listen to an experts journey through new emergent technology and how that has shaped their own professional achievement. If anything that is the sole example of when expertise and authority is really valuable. And discounting most of the article because he says “mongodb was awesome” and “server less was awesome” and “stimulus is just as awesome” is losing the value he offers
- throwaway189262 6y agoFunny because you could probably say Ruby On Rails is dead for React developers
- bdcravens 6y agoThere are definitely more server-side options than front-end options. The approach here isn't necessarily just about React - the point is using web sockets and rendering HTML directly (sped up via DOM diffing) will replace heavy Javascript logic (whether React, Vue, etc) for most use cases.
- throwaway189262 6y agoI really doubt it. Loading HTML fragments was the norm with AJAX. Part of the DHTML days. It makes more sense to have UI logic in the client.
- bdcravens 6y agoIf your logic is complex enough, sure. (I mispoke - it won't replace "heavy" logic, but most UI needs aren't heavy) But for many the logic really isn't that complex; they just want reactivity. There's a frustration with needing to roll out a complex build process, JWTs, state management, etc, just to speed things up a bit. This is an alternative to that, in a way that really doesn't differ much from React in terms of speed or reactivity. For those truly complex UI logic cases, React components are still a tool you can use. The approaches aren't mutually exclusive.
- throwaway189262 6y agoI used to use MVC frameworks a lot. The problem I ran into was as soon as you have one thing on the page that can't survive the reload, you can never reload again. Cue 3k lines of JQuery and regret. I think of it this way, would you stream pre-rendered markup to a native iOS, Android, or Windows app? The thought of it is crazy, who would ever do that. I think most people agree that the web is getting closer to native all the time. I think we're reaching the pivot where you're better off using React and co for any kind of interactivity. Page reloads are already used in media to portray slow/old websites. I don't see that getting better
- AlexMuir 6y agoGood summary. One of the issues I find with Rails is that the 'old-way' of views, partials and a sprinkling of React is INSANELY productive. I've been trying hard to justify getting into Stimulus properly. DHH is on a four-month sabbatical at the moment and my hope is that he's working on open-sourcing the framework behind hey.com, which Basecamp are calling 'new magic'[0] There's something coming around object-oriented view components and client-size JS. I'm just not quite sure the perfect recipe has been found yet. https://twitter.com/dhh/status/1275901955995385856?lang=en https://twitter.com/dhh/status/1275901955995385856?lang=en
- bdcravens 6y agoKeep in mind that Stimulus Reflex leverages Stimulus, but you don't necessary have to get into Stimulus to get most of the advantages. I suspect that the framework DHH comes up with will be very similar to Stimulus Reflex, or they may even roll that project into Rails/Stimulus.
- jacquesc 6y agoWow, cool technology! But, I don't have any confidence that this gets adoption. And it has some major holes for when you want to add some rich user interface elements to your pages. And you lose out on a React ecosystem that's really hitting it's stride. I got sucked into RJS, Turbolinks, Sprockets, and several other "cool" frontend technologies coming out of the Rails world that made my life miserable until I finally dropped them. Developer beware
- bdcravens 6y agoThe technique has been validated elsewhere: LiveView in Phoenix, Blazor in dotnet, LiveWire in Laravel, etc. It's also not mutually exclusive. You can totally leverage React components when Stimulus Reflex isn't enough.
- bsaul 6y agooff topic, but is doing cocaine something you can officially brag about now in the US ??
- obiefernandez 6y agoHaving done cocaine in the past, sure, sure, why not?
- antfarm 6y agoAm I the only one who thinks the cocaine analogy is out of place in a technical article? Excited about the technology though, thanks for sharing!
- Snd_ 6y agoIt is indeed very much out of place. But if you regularly do cocaine it isn't, if you know what I mean.
- barry27 6y agochovy, i personally cant stand react either. what a shambles. i was disappointed these clowns had downvoted your comment to the extent that i couldnt reply.
- lucasmullens 6y ago> React is clearly not dead. > there is absolutely no technical need for Rails developers to use React anymore The article is about React on top of Rails, not React in general. Leaving that out of the title makes this just clickbait.
- hackerfromthefu 6y agoLooks similar to .NET's Blazor running in server render mode, which is awesome and super productive.