4 ms·
Bravo to the React team for the work during the last few months! It's truly amazing, specially for the new users. Among other things: 1) Create-React-App[1]:
by ggregoire 10y ago
Bravo to the React team for the work during the last few months! It's truly amazing, specially for the new users.
Among other things:
1) Create-React-App[1]: Lets everyone starts a React app with Babel/Webpack (JSX, classes and import/export) without any knowledge about Babel/Webpack.
2) The new Contributing docs (Codebase Overview, Implementation Notes (discussed here) and Design Principles) offer a starting point to figure out how React works.
3) A revamp of the current documentation is going to be released soon[2]
4) "You might not need Redux"[3]
---
[1] https://github.com/facebookincubator/create-react-app https://github.com/facebookincubator/create-react-app
[2] https://github.com/facebook/react/pulls?q=is%3Apr+is%3Aopen+label%3A%22Component%3A+Documentation+%26+Website%22 https://github.com/facebook/react/pulls?q=is%3Apr+is%3Aopen+...
[3] https://medium.com/@dan_abramov/you-might-not-need-redux-be46360cf367#.f1q1ro20m https://medium.com/@dan_abramov/you-might-not-need-redux-be4...
- guscost 10y ago> 4) "You might not need Redux"[3] For some older projects I found a hand-built flux helper[0] of ~220 lines worked great and didn't require any toolchain modifications. The switching costs to some of the ES6 stuff was too high in that case, but it's also a potentially leaner app if you don't need the advanced features of Redux and ES6. The Redux architecture is so nice though. [0] https://github.com/guscost/simple-flux https://github.com/guscost/simple-flux
- Etheryte 10y agoRedux is just a fancy pubsub.
- chrislloyd 10y agoOr less fancy depending on how you look at it.
- cel1ne 10y agoI think redux got 50% right and 50% wrong. 1. good: having a sideeffect-free, serializable application state. That concept can also be used in mobile apps for easy pause/resume. 2. good: being able to render that state from one parent, because you don't need to manage two separate statemachines (the UI and the business logic) anymore. 3. bad: shoe-horning all state-transition into functions/reducers. Fp is awesome, but sometimes imperative constructs are more appropriate, especially in a mostly imperative language. Use fp where it feels natural, not everywhere. 4. bad: shoe-horning everything into immutable data-structures. Seriously, when did newName => { this.name = newName } become (state, newName) => { return state.set("name", newName) } ? Just change the state. If you want to prevent errors, freeze and seal your state. If you want time-travelling debugging, copy it via serialization. No need to slow down production code by copying and throwing away data all the time. 5. bad: using Immutable.js, thereby slowing your code down by two or three orders of magnitude. And I guess losing many GC and JIT optimizations by throwing out different types of objects and pressing everything into the generic map-structures, that immutable.js uses internally) I wrote multiple sites/apps using immutable and redux, but i'm back to pure react and lodash. Code is more concise, simpler and way faster, even though componentDidUpdate has to use lodash's _.isEqual instead of a simple comparison.
- talldan 10y agoUnless something has changed very recently, you don't have to use Immutable.js and redux together. Redux advises against mutating your state, but doesn't prescribe a way to do that.
- cel1ne 10y agoTrue, I did applications with redux and without immutable too, even wrote my own syntax magic for that: https://www.npmjs.com/package/babel-plugin-check-data-access https://www.npmjs.com/package/babel-plugin-check-data-access What redux misses as well are derived/computed properties, I think mobX has them: https://mobxjs.github.io/mobx/ https://mobxjs.github.io/mobx/
- 10y ago
- danabramov 10y agoRedux is about 100 lines if you remove some development warnings. ;-)
- redonkulus 10y agoThis is basically everything that Dan Abramov has contributed. Good work by him!
- caub 10y ago+1 for the 'not need redux'