8 ms·
Progressive React
- seph-reed 7y agoI know this is a low quality comment, but given I was once the guy at my last company who's job it was to make React do things it didn't want to, I really dislike React. It's a dead end for interactive UIs, and the closer you can stay to native html elements with encapsulation, the better off you'll be later down the road.
- foota 7y agoHow do you figure?
- WrtCdEvrydy 7y agoI call this the 'Rails Paradox'... a lot of people invested into Rails and wrote a lot of software that powers small businesses. As people exited Rails, the cost of maintenance has gone up... since you have to pay a lot to get someone writing Rails now.
- foota 7y agoWrong thread?
- rriepe 7y agoBigger parade, bigger cleanup.
- benbristow 7y agoIf it weren't for Rails then maybe those small businesses would not be as successful as they are and wouldn't be around now. Rails is definitely more niche but it's still a great framework IMHO and it's not dead. Still gets feature updates to this day.
- wolco 7y agoHope it is not dead. I still haven't taken the time to learn it yet.
- WrtCdEvrydy 7y agoIt's not bad, the ecosystem makes it good.
- btown 7y agoI do think that React has a chance at beating this trend though. As Rails became more and more esoteric with DSLs, utility functions, and `method_missing` hacks that make complex existing monolith codebases nearly inscrutable, and microservices became a preferred way to "throw bodies" at similarly complex codebases, it's not surprising that people started moving away. React's ecosystem, on the other hand, has embraced strong typing (and alongside it, tooling that lets you drill deep into any method you see on the screen), and it's fully compatible with teams working on discrete backend and frontend components. It's not likely to disappear any time soon, the same way jQuery hasn't disappeared. Yes, it adds a performance cost, but so long as Zawinski's Law holds [0], functional state-to-display-object transformations will continue to be the paradigm, and React continues to lead the pack there. And if new display object abstractions come into play (say, React Native in-browser rendering widgets on the GPU directly via webasm or new browser-specific APIs), React can and will adapt. Just my 2c. [0] https://medium.com/programming-philosophy/zawinskis-law-2090dfb94d91 https://medium.com/programming-philosophy/zawinskis-law-2090...
- quickthrower2 7y agoRails salaries are lower than .net where I live. Where do they command $$$?
- friedman23 7y agoYou can use native html elements with react. I'm curious what it is you were trying to do since I'm sure you could do anything native html supports with react.
- hesarenu 7y agoReact is best suited for interactive ui. For static sites just html/css should be fine.
- friedman23 7y agoI actually like to use react for static sites too but mostly because my main work is in react and I like to maintain one mental model for everything.
- singlow 7y agoStart by making your blog not crash android chrome.
- maverick2007 7y agoCrashes mobile Firefox too. Very ironic given the small portion of the article I read before it crashed.
- duxup 7y agoSeriously it kills chrome on Android for me like nothing I've seen since those pop ups that you couldn't escape were popular.
- ahartmetz 7y agoIt's funny because scrolling in this article is a stuttery mess (Firefox on Linux).
- 725686 7y agoIt is a stuttery mess in Firefox + Windows 10 also.
- deleted 7y ago[deleted]
- LeftHandPath 7y agoYeah, this made my whole browser lag (buttons-shading-five-seconds-after-hover-level lag). FireFox Quantum on Windows 10 with a pretty badass CPU. Also slow in Opera. Also slow in Vivaldi. And it crashed Chrome Canary. For a web-tech post, this is pretty fucking bad.
- airstrike 7y agoWorks fine in Firefox in iOS...
- 7y ago
- timw4mail 7y agoThe more I deal with it, the more I hate React, and the very idea that websites must require Javascript to just show HTML.
- sombremesa 7y agoFear is the path to the dark side. Fear leads to anger. Anger leads to hate. Hate leads to suffering. Jokes aside, everything has its place. You're still allowed to hate it though. For example, I hate Redux because everyone uses it for every React app and it's got boilerplate up the wazoo. Just know that if you "hate" things, though, you won't learn as much in life, like I won't learn how to use time travel debugging. Almost anything that gets this popular has at least a few core ideas we should probably learn, or learn from.
- wolco 7y agoIs there a way to cutdown the bloat?
- munchbunny 7y agoNot in a substantial way. The boilerplate is a consequence of the functional “workaround”: representing a mutation as the result of applying a state transition to a complex state, and then computing what to display as a function of both the current and previous states. The way to reduce the boilerplate is to use a mutable paradigm, but then you lose the simplifications that the immutable paradigm gives you.
- rictic 7y agoCheck out lit-html. You write functional style code, but the library does efficient minimal mutations of the dom with no virtual dom, and no dom diffing.
- acemarke 7y agoThere's a fantastic library called Immer [0] that uses ES6 Proxies to let you write "mutative" update logic that is tracked and turned into a safe immutable update. We recommend using Immer as the best way to write immutable logic with Redux [1], and our new Redux Toolkit package [2] automatically uses Immer internally to let you write reducers like this: const reducer = createReducer(initialState, { updateItem(state, action) { state.first.second[action.payload.id].fourth = action.payload.value } }) [0] https://immerjs.github.io/immer/ https://immerjs.github.io/immer/ [1] https://redux.js.org/style-guide/style-guide/#use-immer-for-writing-immutable-updates https://redux.js.org/style-guide/style-guide/#use-immer-for-... [2] https://redux-toolkit.js.org https://redux-toolkit.js.org
- jingw222 7y agoSo progressive that the minute I open the page, it crashes. Have no idea why that is.
- ggregoire 7y agoGreat write up, going deep into the topic. This comments section tho.
- duxup 7y agoIs that site crashing anyone else's browser? I'm using chrome on Android and it kills my browser every time.
- skept 7y agoIt's crashing Samsung Internet on my Pixel 3.
- adatavizguy 7y agoAs someone who has web apps in production written in backbone.js, Angular, and React, I can say selectors with Reselect to transform all the data being passed into props, Sagas to manage all async workflows, and Ramda with Redux reducers is pure fire. There is no business logic in components or containers unless it is tied directly to the view and layout, not for the data. It is such an easy way to reason about huge amounts of data coming into the system from lots of different places. For performance, everything gets memoized based on object references. Using the immutable data structures in the store, Reselect keeps the transformed data cached with memoization until the object reference is changed in the store.
- michaelchisari 7y agoI've had good experiences using a simple combination of lit-html and the sam pattern. I'm not an evangelist yet, I want to try and throw some more complex edge cases at it first but so far, I've had no complaints. 1. https://lit-html.polymer-project.org https://lit-html.polymer-project.org 2. https://sam.js.org https://sam.js.org
- sickcodebruh 7y agoI’m mostly with you there but I’ve found saga to be a double-edged sword. The library offers some KILLER features and when you’ve got the right use case, it’s perfect, but it’s so easy to abuse. Because it does so much, I found myself putting more and more responsibilities on it and wound up with some very magical feeling, hard to troubleshoot code. What changed everything for me was adding GraphQL and getting the majority of my API communication and data storage out of redux. Now, sagas and redux are further down the list of tools I reach for, complexity is way down across the board, and the sagas and reducers that’s remain are more narrowly scoped and easier to reason about and maintain.
- mikewhy 7y ago> I found myself putting more and more responsibilities on it and wound up with some very magical feeling, hard to troubleshoot code Agreed. There's a simplicity to React / Redux that I absolutely adore. There's very little magic going on: things happen because you've explicitly told them to. Side-effects in Redux seem to throw this out the window.
- qbaqbaqba 7y agoCrashes mobile Chrome.
- mhd 7y ago"Performance advocate" is a thing now? Things like that or "growth hacker" make me long for the peaceful days of "ruby rockstars" and "javascript ninjas"... Never mind the fact that we're plowing the depths of functional programming, complex data structures and asynchronous wizardry just to make sure that displaying a few bytes of text and flat-shaded borders isn't too slow. I don't remember GUI programming being that hard in the years before this. At least for these rather simple results. Getting a full DTP platform out on a 20 mhz machine with 4 MB of RAM required some advanced pattern wizardry, but most web UI patterns aren't that complicated. They just aren't helped by the client-server nature and Javascript being Javascript, as much as you wrap it up in the Emperor's new C# clothes. > Sites have become bigger, more interactive and more complex and this number is still gradually increasing in an upward trend year after year. Yeah, but is it useful complexity? The whole frontend scene often reeks of "bullshit job" syndrome. To get results customers could live without in a framework not re ally suited for it, we're developing complex tools, even more complex tools to package and deploy them and then have more coaches, trainers, video walkthrough creators and premature optimization providers than ever before.
- 5Qn8mNbc2FNCiVV 7y agoVisiting that page on the Pixel 3aXL and it literally crashed while scrolling. I've never had that happen once in the last few years. Damn.