Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah, we actually went through this with Redux itself.

When Redux was first released in 2015, it was deliberately designed to be minimal and extensible. Other Flux libraries at the time had various forms of async handling built in (support for dispatching actions via promises, etc). Dan and Andrew wanted to avoid locking users in to any single form of async handling [0], so the middleware API was designed to let users pick their preferred async approach and syntax.

Similarly, the store setup process was entirely left up to users to add whatever middleware, enhancers, and other configuration users felt was appropriate. The docs were also always unopinionated about preferred file structures, how to organize logic, etc.

Over time, it became very clear that users _wanted_ more specific guidance about how to structure their apps, and wanted Redux itself to build in default setup and configuration.

As a result, we wrote a "Style Guide" docs page [1] that lists our recommended best practices, and created our official Redux Toolkit package [2] as the standard way to write Redux logic. RTK was designed to solve the most common problems and use cases we saw in the ecosystem [3], including store setup, defining reducers, immutable update logic, and even creating entire "slices" of state at once.

RTK has been extremely successful - we routinely get users telling us how much they enjoy using RTK [4], even if they disliked "vanilla Redux" previously.

We also recently released a new "RTK Query" API [5] [6] in RTK 1.6, which is a built-in data fetching and caching API inspired by libraries like Apollo and React Query. Again, similar theme - we looked at what users were doing and what pain points they were running into, and built an official API to help address those use cases.

[0] https://blog.isquaredsoftware.com/2017/09/presentation-might...

[1] https://redux.js.org/style-guide/style-guide

[2] https://redux-toolkit.js.org

[3] https://blog.isquaredsoftware.com/2019/10/redux-starter-kit-...

[4] https://www.reddit.com/r/reactjs/comments/px6kxy/redux_toolk...

[5] https://redux-toolkit.js.org/rtk-query/overview

[6] https://redux.js.org/tutorials/essentials/part-7-rtk-query-b...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: