4 ms·
I suspect this is right. I've been with the JS world long enough that I've seen a lot of the major iterations – each solving the problems of the last. - Jquer
by fishtoaster 5y ago
I suspect this is right.
I've been with the JS world long enough that I've seen a lot of the major iterations – each solving the problems of the last.
- Jquery solved the browser inconsistencies and limitations of vanilla JS
- Backbone added MVC structure to large, disorganized soups of Jquery
- Angular + Ember gave you a more full-featured MVC so you didn't have to rebuild common logic on top of every backbone app.
- React switched to a component-oriented architecture as we realized that MVC wasn't a great fit for frontend.
I think the next big problem that will be solved by the next big JS change is that organizing and interacting with your data layer is a pain. Redux is complex* and is a ton of overhead for a lot of use cases. Tools like React-Query make handling one kind of global state easy, but do so by mixing it up with the view layer.
A strong contender for the next dominant frontend approach (whether that's a single framework, a data layer that works with react, or a new set of tools) will be one that really tackles the data layer well.
* Redux actually really simple at its core, but it's such an incredible ton of boilerplate that everyone inevitably builds their own complex and bespoke tools for dealing with it.
- acemarke 5y agoNote that we created our official Redux Toolkit package [0] specifically to solve the "boilerplate" concerns. It includes utilities to simplify several common Redux use cases, including store setup, defining reducers, immutable update logic, and even creating entire "slices" of state at once. The "Modern Redux with Redux Toolkit" docs page [1] shows how to migrate from hand-written Redux logic to use RTK's APIs. We've had a ton of very positive feedback from folks who love using RTK, and even from folks who didn't like Redux before. Also, we're currently finalizing a new "RTK Query" API for Redux Toolkit [2] that provides a purpose-built data fetching and caching abstraction layer, which basically eliminates having to write any of your own code to fetch data. That's available now in the RTK 1.6 alphas [3], and we hope to publish that live shortly. [0] https://redux-toolkit.js.org https://redux-toolkit.js.org [1] https://redux.js.org/tutorials/fundamentals/part-8-modern-redux https://redux.js.org/tutorials/fundamentals/part-8-modern-re... [2] https://deploy-preview-1016--redux-starter-kit-docs.netlify.app/tutorials/rtk-query https://deploy-preview-1016--redux-starter-kit-docs.netlify.... [3] https://github.com/reduxjs/redux-toolkit/releases/tag/v1.6.0-alpha.1 https://github.com/reduxjs/redux-toolkit/releases/tag/v1.6.0...
- kgwxd 5y agoOf everything I've used over the last 20 years, nothing has felt more simple than re-frame[0]. It's built on React but it's ClojureScript, so it probably wouldn't be an easy option where already invested in another ecosystem, but it's a real pleasure to work with if you can, especially if you buy into the tooling for your editor and browser. [0] https://day8.github.io/re-frame/re-frame/ https://day8.github.io/re-frame/re-frame/
- pogorniy 5y ago> one that really tackles the data layer well I believe this should be rxjs. It's composable: have a stream or streams create new derived streams easily. It's lazy: you can describe what to do with data before it's available. Handling state for the multi step or async operations (loading state, cancelling requests, retrying operations) is a breeze. "Wire" your application with rxjs and you'll never have trouble modelling state with it. Typescript-friendly. It allows be both sync access to the value (BehaviourSubject) and async (Observable). I work with it closely last year and there was no situation I could not model with rxjs. But people will stick to whatever is hyped by well-known-internet-company. Marketing wins, not quality.
- qudat 5y ago> Tools like React-Query make handling one kind of global state easy, *but do so by mixing it up with the view layer.* This is where I think `react-query` fits a very specific niche. I see a lot of new projects reaching for it and while I think for simple applications it can work fine, I have a serious problem with it for large applications: it's baked into react. React is a view layer that is slowly consuming the world and while I don't think react is going anywhere, people are starting to feel the burden of a black box system. As someone who's primary job has been building large scale web applications for the past 7 years and has weclomed the chaotic nature of the FE ecosystem, I'm starting to feel a little less optimistic about react's future. That's why the allure of something like redux is so strong for some of us. Redux is not that complicated and the boilerplate has mostly been reduced to a few lines of code. React is continuing to grow in complexity with hooks, suspense, async rendering, and now server components. I think for personal projects I'm probably going to reach for something else like Svelte.