猫的胡子有什么作用| 一只什么| 查心脏挂什么科| 吃阿胶有什么好处| 10月3号是什么星座| 阴虚便秘吃什么中成药| 黄瓜炒什么好吃| 健康证需要检查什么| 牛肉和什么不能一起吃| 喉咙干痒咳嗽吃什么药| 低血糖看什么科室| 手掌红是什么原因| 开胃菜都有什么| 双抗是什么药| 亚麻是什么| 枧水是什么| 思前想后是什么意思| 吃东西没有味道是什么原因| gb什么意思| 稻谷是什么| 蟑螂屎长什么样| 女人排卵期有什么反应| 什么树叶| 憋不住尿是什么原因| 什么生活| 3月31日是什么星座| 种植牙为什么那么贵| 光年是什么单位| 起床口苦是什么原因| 养生馆是干什么的| 兜兜转转是什么意思| 小孩下面痒用什么药| 咽炎吃什么药效果最好| 天秤座跟什么星座最配| 什么叫银屑病| 经警是做什么的| 地屈孕酮片什么时候吃| 爱出汗是什么原因女人| 衾怎么读什么意思| 矫枉过正是什么意思| 01年的属什么| 被毒蛇咬了有什么症状| 小鱼的尾巴有什么作用| 子宫发炎是什么原因引起的| 汐字五行属什么| 头上出汗是什么原因| 心室早复极是什么意思| 喜欢紫色代表什么| 火车无座是什么意思| 4月15日是什么日子| 口腔溃疡不能吃什么| naomi什么意思| 高血压高血糖挂什么科| 梦到抓鱼是什么意思| 什么是电子邮件地址| 小孩儿咳嗽有什么妙招| 徽音是什么意思| 虎牙长什么样子| 减肥头晕是什么原因| 职业年金是什么| 讨扰是什么意思| 血池是什么意思| slay是什么意思| 鸡为什么吃自己下的蛋| 宫颈纳氏腺囊肿是什么意思| 孕酮低有什么症状| 花洒不出水什么原因| 同人小说是什么| 2000年为什么叫千禧年| 窦炎是什么意思| 两侧肋骨疼是什么原因| 范仲淹世称什么| 补气血吃什么中成药最好| 阿尔兹海默症挂什么科| 睿字五行属什么| 手上长水泡是什么原因| 吃什么东西对眼睛好| 鸡蛋过敏什么症状| 黄豆芽炒什么好吃| 什么是月令| 免签国家是什么意思| 上窄下宽的脸型适合什么发型| noa是什么意思| 准备要孩子需要注意什么| 清江鱼又叫什么鱼| 巾帼不让须眉什么意思| 喉咙发炎咳嗽吃什么药好得快| 指甲脱层是什么原因| 脂肪燃烧是什么感觉| 阴茎进入阴道什么感觉| 建议随诊是什么意思| 日语亚麻跌是什么意思| 什么是法西斯主义| 大头虾是什么意思| 男生眉毛浓黑代表什么| 乳铁蛋白是什么| 什么孕妇容易怀脑瘫儿| tag什么意思| 试婚是什么意思啊| 韶关有什么特产| 尿路感染吃什么药最见效| 梦见奶奶去世预示什么| 疼痛科主要看什么病| 涤塔夫是什么面料| 热敷肚子有什么好处| 上火吃什么| 什么病才吃阿昔洛韦片| 前列腺在哪里男人的什么部位| 阴瑜伽是什么意思| 性欲是什么意思| 冬阴功汤是什么味道| 梦见月经血是什么预兆| 眼镜pd是什么意思| 做梦梦到理发是什么征兆| 干姜和生姜有什么区别| 胼胝体是什么意思| 掉头发严重吃什么东西可以改善| 个人送保是什么意思| 为什么长疣| ivd是什么意思| 聊表心意什么意思| 2段和3段奶粉有什么区别| 怀孕吃什么水果比较好| 羯羊是什么羊| 维c有什么功效和作用| 非食健字是什么意思| 息风止痉是什么意思| 肾阳虚吃什么食物| 仪态万方是什么意思| 眼睛肿胀是什么原因| 炖排骨放什么调料| 嘉靖为什么不杀海瑞| 梅毒病有什么症状| 声东击西是什么意思| 睡觉脚麻是什么原因| 缺铁性贫血有什么症状| 脑委缩有什么症状| ca代表什么病| 痛风用什么药治疗最好| 齁甜是什么意思| 贪小失大什么意思| 88什么意思| 为什么会手抖| 重庆市长是什么级别| 为什么喜欢春天| fa是什么| 什么样的白云| 黑猫警长叫什么名字| 窝是什么结构的字| 补气血喝什么口服液好| soldier是什么意思| 夺嫡是什么意思| 绿豆不能和什么同吃| 梦见被蛇追是什么意思| 什么是元素| 上热下寒吃什么食物好| 卵泡是什么东西| 为什么梦不到死去的亲人| 送人梳子的寓意是什么| 1905年属什么生肖| 紫苏有什么作用| 1037年属什么生肖| 检查幽门螺旋杆菌挂什么科| 开尔文是什么单位| 小腹痛吃什么药| 儿童贫血有什么症状表现| 红花泡脚有什么好处| 灵魂伴侣是什么意思| 结节影是什么意思| 猪咳嗽用什么药效果好| 五金是什么| 女生的胸长什么样子| 伍德氏灯检查什么| 牛肉不能和什么一起吃| 衔接班是什么意思| 艾灸肚脐有什么好处| 五行缺什么怎么算| 影射是什么意思| 幼小衔接班是什么意思| 什么好像什么一样| 为什么不能打死飞蛾| 1999是什么年| 失眠有什么办法解决| 时间的定义是什么| 雪五行属什么| 西药是什么药| 领衔是什么意思| 外阴炎是什么原因引起的| 朋友圈发女朋友照片配什么文字| 火山为什么会喷发| 床上什么虫子夜间咬人| 睡不着什么原因| 助力车是什么车| 镪水池是什么| 夏天适合种什么水果| 丧尽天良什么意思| 7.22是什么星座| 嗓子不舒服吃什么消炎药| 总是睡不着觉是什么原因| 长颈鹿的脖子像什么| 吃什么减脂肪最快最有效的方法| 37岁属什么的生肖| 鹅翅膀下垂是什么原因| 尿液中有血是什么原因| 什么呀| 痰中带血吃什么药| 高温天气喝什么茶解暑| 宝姿是什么档次的牌子| 什么情况下做心脏造影| 氧氟沙星和诺氟沙星有什么区别| 卡布奇诺是什么咖啡| 小孩感冒发烧吃什么药| 6月19什么星座| 在编是什么意思| 肛门塞什么东西最舒服| 玻璃什么时候传入中国| 焖子是什么| 爱迪生发明什么| 肠胃炎看什么科| 游坦之练的什么武功| 安乐死什么意思| 舌头长泡吃什么药| 沮丧是什么意思| 追随是什么意思| 容易水肿是什么原因| 戴帽子是什么意思| 医院规培生是什么意思| 不均质回声是什么意思| 女生的下体长什么样| 站桩对身体有什么好处和功效| 阴囊潮湿是什么症状| 静脉曲张挂什么号| 做乳腺彩超挂什么科| 黑色素痣看什么科| si是什么元素| 台风什么时候登陆| 一个金字旁一个川读什么| 嗓子疼吃什么药| 程五行属什么| 脾气是什么意思| 做梦梦见老婆出轨是什么意思| me是什么基团| 富氢水是什么| jeep衣服什么档次| w是什么单位| 手足口是什么病毒| 时至今日是什么意思| 梦见捡到钱是什么征兆| 淋巴细胞百分比低说明什么问题| 梦见自己大出血是什么征兆| 怀孕了胃不舒服是什么原因| 扁桃体发炎是什么原因引起的| 胆固醇偏高吃什么好| 湿疹有什么症状和图| 山字五行属什么| 为什么小孩子经常流鼻血| 头痛反胃想吐什么原因| 星星像什么比喻句| 工作效率是什么意思| 冲鸡蛋水喝有什么好处| 扒灰是什么意思| 额头发黑是什么原因| 雾化后为什么要漱口| 为什么叫五七干校| 百度

Idiomatic Redux: Redux Toolkit 1.0

This is a post in the Idiomatic Redux series.


A look at the motivations, design, and goals for Redux Toolkit

Today I am extremely excited to announce that:

Redux Toolkit 1.0 is now available!

Note: Redux Toolkit was formerly known as "Redux Starter Kit", but we renamed it to clarify the intended usage and audience.

As part of that, I'd like to look back at how Redux Toolkit came to be, talk about my goals and vision for the project, and look at how we've designed the API to fulfill those goals.

As a TL;DR, Redux Toolkit is designed to:

  • Make it easier to get started with Redux
  • Simplify common Redux tasks and code
  • Use opinionated defaults guiding towards "best practices"
  • Provide solutions to reduce or eliminate the "boilerplate" concerns with using Redux

I'm proud to say that we've accomplished all those goals!

Table of Contents ??︎

Origins ??︎

The Rise of Redux ??︎

Redux came out in the summer of 2015, at the tail end of the "Flux Wars". Within a year, it had swept aside all other Flux implementations, and became the de-facto standard state management tool for React applications.

Redux was deliberately designed to be extensible, and it succeeded brilliantly. The design led to a thriving ecosystem of addons and related libraries, ranging from action/reducer generation utilities to store persistence to dozens of immutable update utilities to middleware for manipulating dispatched actions. In particular, since Redux deliberately did not include a built-in solution for managing async behavior and side effects, dozens of side effect addons appeared.

In short, if you needed to do something with Redux, odds were an addon already existed for your use case, and it was possible to build something yourself otherwise.

Facing the Hype Cycle ??︎

Most major technologies go through the hype cycle. A new product comes out, and early adopters fall in love with it and tout it as the solution to every problem. As more people use it, they begin to run into limitations, and the negative feedback becomes noticeable. Eventually, enough people figure out the best ways to use it, and it settles down as a viable tool with known tradeoffs.

Redux is no exception to this. It quickly became associated with React, and many tutorials and discussions assumed that "if you're using React, you must be using Redux too". This became something of a self-fulfilling prophecy, as new learners would read those tutorials and assume they had to use Redux with React. Or, in many cases, senior devs might tell other devs that they had to.

As a result, many people began to learn Redux without understanding the context of why it was originally created, what problems it was meant to solve, and what the tradeoffs were. Blindly using any tool without understanding is a recipe for trouble. While many people were happy using Redux, many others began to complain about flaws, both actual and perceived.

Dealing with Complexity ??︎

There are several factors that combine to make it relatively harder to use Redux in comparison to other options:

  • Redux deliberately adds a level of indirection to the idea of updating state, in the form of actions. As Dan said early on:

[Redux] is not designed to be the most performant, or the most concise way of writing mutations. Its focus is on making the code predictable.

  • Common conventions around Redux add additional levels of indirection and code that "needs" to be written (action creators, action type constants, selectors, thunks, switch statements, immutable updates).
  • There's also a lot of "rules" around Redux that are described in written form, but not obviously enforced by Redux itself, particularly immutability, serializability, and avoiding side effects.
  • JS is a mutable language, and writing correct immutable code is hard, both in terms of avoiding accidental mutations and the amount of code that has to be written to handle updates immutably
  • Redux was always meant to be a small core supporting a larger ecosystem of addons. This means that the core is deliberately tiny, and it's up to the user to choose how to configure the store. This is great for flexibility, but means that even the most common tasks require multiple semi-complex lines (such as adding thunk middleware for async logic, and also setting up the DevTools Extension). It also means the user has to make decisions early on about which addons they want to use, even in a simple app.
  • Functional programming concepts are foreign to most people and hard to grok, especially if you're coming from an OOP background

Like most early adopters, many early Redux users were "power users". Configuration, customization, and "implementing things by hand so I know exactly what's happening" were key selling points. However, Redux took off across a larger userbase, those early selling points became weaknesses. Many people saw the patterns and practices as simply "boilerplate" that was a pain to deal with, and reasons to look for other options.

In addition to the minimum required complexity of dispatching actions and writing reducers, the incidental complexity became a problem. For example, the original Redux docs divided code up into files and folders by "actions", "constants", "reducers", and "containers". There are valid reasons to split your code into files by type. But, at the same time, there's no requirement that you must write actions, reducers, and constants in separate folders/files. Because it was in the docs, most people copied what they saw, and this did become the standard pattern.

Similarly, writing action types as constants like const ADD_TODO = "ADD_TODO", or the idea of having action creator functions for every single action type, are not required either. But, those were the recommended patterns, and users followed the examples in the docs.

On top of that, the need to make decisions about what addons to use has frequently resulted in decision fatigue. The plethora of side effects libs (each with their own terminology) has been a particular pain point. Even within a year of Redux's release, it was evident that the rapidly growing list of side effects libs was confusing.

While the ecosystem has largely settled on thunks, sagas, and observables as the standard approaches, the situation has made "how do I choose a side effects middleware?" one of the most frequently asked questions. (Ironically, thunks were originally built into the core, but removed to make things flexible and unopinionated). Clearly, there's a need for an official blessing on how to handle side effects.

In Search of a Solution ??︎

I got involved with Redux when I volunteered to write the Redux FAQ in early 2016. Dan handed over the maintainer keys to myself and Tim Dorr that summer, and I found myself answering Redux questions everywhere across the internet.

By spring 2017, I realized that the programming landscape had changed enough that most new Redux users didn't understand the context behind its creation or why the typical usage patterns existed. I attempted to remedy that by writing a pair of comprehensive blog posts: The Tao of Redux, Part 1: Implementation and Intent, and The Tao of Redux, Part 2: Practice and Philosophy, which covered how Redux was originally designed and how it was meant to be used.

Around the same time, I filed Redux issue #2295: Request for Discussion: Redux "boilerplate", learning curve, abstraction, and opinionatedness . In that issue, I asked:

  • What would idiomatic Redux usage with "less boilerplate" look like? How can we provide solutions to those complaints?
  • What possible abstractions could be created that simplify the process of learning and usage, but without actually hiding Redux (and would hopefully provide a migration/learning path to "base" Redux)?

The very first reply was from Justin Falcone (@modernserf), who suggested:

  • official redux-preset package containing redux, react-redux, redux-thunk already wired together
  • built-in jumpstate-style reducer creators, e.g. createReducer({[actionType]: (state, payload) => state}, initState)

That suggestion was the genesis for what would eventually become Redux Toolkit.

The thread continued on for over a hundred comments, eventually devolving into users just pasting links and advertisements for their own Redux abstraction libs. In the middle of the thread, Dan Abramov dropped by, and laid out his own wishlist for an opinionated layer on top of Redux:

If it were up to me I’d like to see this:

  • A Flow/TypeScript friendly subset that is easier to type than vanilla Redux.
  • Not emphasizing constants that much (just make using string literals safer).
  • Maintaining independence from React or other view libraries but making it easier to use existing bindings (e.g. providing mapStateToProps implementations).
  • Preserving Redux principles (serializable actions, time travel, and hot reloading should work, action log should make sense).
  • Supporting code splitting in a more straightforward way out of the box.
  • Encouraging colocation of reducers with selectors, and making them less awkward to write together (think reducer-selector bundles that are easy to write and compose).
  • Instead of colocating action creators with reducers, getting rid of action creators completely, and make many-to-many mapping of actions-to-reducers natural (rather than shy away from it like most libraries do).
  • Making sensible performance defaults so memoization via Reselect “just works” for common use cases without users writing that code.
  • Containing built-in helpers for indexing, normalization, collections, and optimistic updates.
  • Having built-in testable async flow support.

On top of core, of course, although it’s fine to brand it in as an official Redux thing.

The thread eventually fizzled out, but the discussion stayed in the back of my mind.

Jumpstarting the Process ??︎

In February 2018, Nick McCurdy filed an issue suggestion adding freezing of state in dev to avoid accidental mutations. In that thread, I commented:

This goes back to my comments in #2295 , about wanting to provide a "starter preset" of packages that would provide a Redux-team-recommended simplified store setup. I've seen dozens of variations on the theme, as well as "CRA + Redux" pieces out there already, but we haven't "blessed" any of them.

The real issue here is that the Redux core comes completely unconfigured out of the box. We make no assumptions about what middleware you might add in, or even if you're going to use middleware at all. So, we can't just add a dev middleware out of the box, because nothing is configured out of the box.

In response, Tim Dorr opened Redux issue #2859: RFC: Redux Starter Kit, and said:

Based on comments over in #2858 and earlier in #2295, it sounds like a preconfigured starter kit of Redux core + some common middleware + store enhancers + other tooling might be helpful to get started with the library.

As for what goes in a starter package, the short list in my mind includes one of the boilerplate reduction libraries (or something we build), popular middleware like thunks and sagas, and helpful dev tooling. We could have a subset package for React-specific users. In fact, I started a Twitter poll to find out if that's even necessary (please RT!).

I don't think we need to build a Create React App-like experience with a CLI tool and all that jazz. But something out of the box that gives a great dev experience with better debugging and less code.

Seeing the issue got me incredibly excited, and that led to a very long discussion on Reactiflux with Nick McCurdy and Harry Wolff, as we tossed around ideas for what this "starter kit" thing might look like. Afterwards, Harry summarized the ideas:

  • wrapper around createStore with better defaults, i.e. easier way to add middleware, redux dev tools
  • built in immutable helper (immer?)
  • createReducer built in (the standard "reducer lookup table" utility)
  • reselect built-in
  • action creator that adheres to FSA
  • async action support / side effect support (flux, saga, what?)

The discussion continued in the issue. I had some time free the next day, and put together a notional first sample implementation of configureStore and createReducer.

Two days later, I published @acemarke/redux-starter-kit as an experimental package, and Redux Starter Kit (the original name) was born!

Designing the Toolset ??︎

Early Implementation and Naming ??︎

Work on RSK advanced intermittently over the next few months. Nick filled out the build setup and initial unit tests, added CI integration, and enabled the Redux DevTools in configureStore. I added re-exports from Redux and the selectorator library, and oversaw discussion and improvements to middleware setup. But, after the initial burst of activity in March and April 2018, RSK just sort of sat around for the next few months.

I came close to burning out in the summer of 2018 due to too many self-assigned responsibilities, such as maintaining my links lists. After taking some time to evaluate, I decided I really needed to focus on "maintainer" responsibilities. As part of that, I decided it was time to start pushing RSK forward seriously.

The initial name of "Redux Starter Kit" was notional, and part of why I'd originally published it as a personal scoped package. In late August, I opened up an issue to bikeshed over what the final name should be. We debated various options, including using a @redux/ scoped prefix.

The discussion trailed off until early October, when someone suggested we just go with plain redux-starter-kit. The problem was that the unscoped redux-toolkit package name was already taken on NPM.Just for kicks, we tried pinging the original owner (@shotak) and asked if they would be willing to donate the redux-toolkit package name. To my surprise, they replied within a few hours and said yes. They transferred ownership of the NPM package, I moved the repo over to the reduxjs org, and published the first official version as v0.1.0.

Filling Out Functionality ??︎

The createReducer and createAction functions we'd already added were useful, but I wanted to find more ways to simplify things.

We'd already been discussing possibly bringing in helper functions from packages like redux-utilities.

I'd seen dozens of various similar libs. One that had stuck out to me was Eric Elliott's autodux package. In particular, autodux allowed users to auto-generate action creators and action types based on an object full of reducer functions and a "slice name" prefix.

I'd met Shawn Wang at ReactRally in August and told him about my ideas for RSK, and he wrote up an assessment of autodux and several other packages, concluding:

using autodux creates a fairly powerful set of creators and selectors and reducers out of the box, and you can further write actions for business logic easily. i like autodux.

Ultimately, autodux served as the direct inspiration for the most useful part of Redux Toolkit: the createSlice function.

Eric Bower (@neurosnap) was participating in those discussions, and made an initial attempt to port autodux into our own createSlice. The PR stalled a bit. Shortly thereafter, I saw someone on Reddit say they'd written a library called robodux that used Immer, and after some confusion, I realized that Eric had opted to try putting together his own version as a separate lib written in TypeScript.

After some further discussion, Eric agreed to contribute his code back to RSK in whatever form worked best for us. I ended up compiled his TS code to plain JS and porting that back over to RSK.

Defining a Roadmap and Clarifying the Vision ??︎

In early December, we set up a Docusaurus-based docs page for RSK as a testbed for converting the Redux docs.

Meanwhile, I added default dev middleware for detecting mutations and non-serializable values, and enabled the new Redux DevTools Extension "action stack trace" feature that I'd helped to implement.

In late January, I filed RSK issue #82: Roadmap to 1.0, and began adding the ability for slices to listen to other actions. In that PR, Denis Washington (@denisw) left a comment suggesting that createSlice be dropped entirely.

In response, I put together a very long comment, laying out My Vision for Redux Starter Kit. I'll skip quoting the entire thing (which is worth reading), but here's the key section:

Objectives ??︎

Per the README, other specific inspirations are Create-React-App and Apollo-Boost. Both are packages that offer opinionated defaults and abstractions over a more complex and configurable set of tools, with the goal of providing an easy way to get started and be meaningfully productive without needing to know all the details or make complicated decisions up front. At the same time, they don't lock you in to only using the "default" options. They're useful for new learners who don't know all the options available or what the "right" choices are, but also for experienced devs who just want a simpler tool without going through all the setup every time.

I want Redux Starter Kit to be the same kind of thing, for Redux.

Speed Up Getting Started ??︎

... I want to give people a way to get working Redux running as fast as possible.

Simplify Common Use Cases and Remove Boilerplate ??︎

I want to remove as many potential pain points from the equation as possible:

  • Reduce the amount of actual physical characters that need to be typed wherever possible
  • Provide functions that do some of the most obvious things you'd normally do by hand
  • Look at how people are using Redux and want to use Redux, and offer "official" solutions for what they're doing already

Opinionated Defaults for Best Practices ??︎

Redux Toolkit should set things up in ways that guide the user towards the right approach, and automatically prevent or detect+warn about common mistakes wherever possible.

No Lock-In / Add It Incrementally ??︎

If someone starts an app using Redux Toolkit, I don't want to prevent them from choosing to do some parts of the code by hand, now or later down the road.

On the flip side, someone should be able to add Redux Toolkit to an existing Redux application, and begin using it incrementally, either by adding new logic or replacing existing logic incrementally.

Become the "Obvious Default" Way to Use Redux ??︎

Long-term, I'd like to see RSK become the "obvious default" way for most people to use Redux, in the same way that Create-React-App is the "obvious default" way to start a React project.

Don't Solve Every Use Case, and Stay Visibly "Typical Redux" ??︎

Redux is used in lots of different ways. Because of that, and because the core is so minimal, there's thousands of different Redux addon libraries for a wide spectrum of use cases. We can't solve all those ourselves, and we won't solve all those ourselves.

Reasonable TypeScript Support ??︎

I want to support people using TypeScript, same as I want to support anyone else using Redux in specific ways. So, RSK should be reasonably well typed. At the same time, I don't want "perfect typing" to become the enemy of "good functionality". I'm fine with trying to shape things so they work well in TS, but I'm very willing to ship a feature that has less-than-ideal typing if that's what it takes to get it out the door.

Honing the API ??︎

Simultaneous with this discussion, Denis was busy converting the RSK codebase to TypeScript, based on a fork from @Dudeonyx. @Jessidhia also chimed in with several good pieces of TS advice.

The React-Redux v7 rewrite completely occupied my attention for the next couple months. The hooks API design process kept me mostly occupied after that.

Meanwhile, we had ongoing discussions on things like possible additions to createSlice, like maybe a special combineSlices() function, or whether the auto-generated selector functionality was really useful.

By summer 2019, the React-Redux work was finally done, and I was ready to turn my attention back to RSK. I began writing an actual set of tutorial docs pages, finishing in early September.

Meanwhile, Lenz Weber (@phryneas) had started contributing a number of key improvements, adding a prepare callback to createAction, and rewriting the TS type definitions for readability.

From there, I began nailing down the final API. This included new functionality like allowing customization of the default middleware and exporting the case reducers, and breaking changes such as removing selectors from createSlice and renaming the slice field to name.

There were still plenty of other ideas for more additions, but I concluded that anything else could be added post-1.0.

And that leads us up to the official release of Redux Toolkit 1.0!

Changing the Name ??︎

I've been going back and forth between the names "Redux Starter Kit" and "Redux Toolkit" in this post. We did call it "Redux Starter Kit" up through the actual 1.0 release. But, after the release, we began getting feedback that the word "Starter" was confusing people. They assumed that it was a CLI project creation tool, a cloneable boilerplate project, something that was only suitable for beginners, or something that you'd outgrow later in a project.

I didn't want to rename the package, but it was clear that this confusion was going to continue.

I opened up another thread to discuss naming and marketing. After some additional discussion, we concluded that "Redux Toolkit" was the best option, and that we should publish it as a scoped @reduxjs/toolkit package name.

With that decision made, I was able to push through the rename process fairly quickly, and published the renamed package as Redux Toolkit v1.0.4.

The Future of Redux Toolkit ??︎

Review ??︎

Looking back at the original ideas and goals that came up in those early discussion issues, I think we've pretty much nailed a majority of the desired capabilities.

RTK is:

  • an official opinionated package, with our recommended best practices built in
  • that drastically simplifies Redux apps and reduces "boilerplate" for the most common use cases
  • while still remaining "visibly Redux" in the process
  • that can all be added to a new project on day 1, or used for incremental migration of an existing project
  • is useful for both new learners and experienced developers
  • and provides solid TypeScript support without requiring a painful amount of type declarations

I'd say we've hit the sweet spot with that list!

Reception ??︎

I've been actively advertising Redux Toolkit for the past year. It's linked on the front page of the Redux docs, it's recommended in the "Configuring Your Store" docs page, and I've been telling almost literally everyone I talk to that they should try out RTK :)

I've been excited to see that as a direct result of my efforts, Redux Toolkit has been picking up some actual adoption. Starting at effectively 0 a year ago, it's now at 100K NPM downloads a month and climbing at a solid pace. This is even more impressive given that it's been pre-1.0 until now.

I've also been thrilled at the reception for RTK. I've received numerous comments telling me things like:

I'll admit to a certain amount of pride, in that RSK has basically been my idea, I've driven it, and I've written a very large portion of the code. So, yeah, it feels great to hear all the compliments.

But, even more than that, I'm excited for how much this is going to help people learning and using Redux.

Next Steps ??︎

We're currently planning a major revamp of the Redux docs, and I'm hoping to finally begin working on that now that RTK 1.0 is out.

As part of that docs revamp, we plan to actually teach using RTK as part of the tutorial sequence, and emphasize that we recommend its use throughout the rest of the docs. We're also going to be reworking the tutorials and other docs sections to emphasize simpler patterns wherever possible, like avoiding use of action constants, dropping the emphasis on writing React "container components", and recommending the "ducks pattern" for organizing Redux logic.

Feature-wise, there's also plenty more we could consider adding, such as maybe having a built-in way to define async side effects in slices.

If you've got any feedback, I'm always interested. Ping me at @acemarke on Twitter and in the Reactiflux chat channels.

Further Information ??︎


This is a post in the Idiomatic Redux series. Other posts in this series:

湿热吃什么好 达泊西汀是什么药 鲁肃是一个什么样的人 肠梗阻是什么原因引起的 血压高呕吐是什么征兆
猪肚搭配什么煲汤最好 pwp是什么意思 竖起中指是什么意思 锁骨窝疼可能是什么病 什么人不怕冷
舌头有问题看什么科 手指关节肿痛用什么药 什么运动瘦肚子最快 运气是什么意思 为什么怀孕了就不来月经了
氨水对人体有什么危害 什么是节气 肚子疼吃什么消炎药 寻麻疹是什么原因引起的 r标是什么意思
今年26岁属什么生肖hcv8jop3ns8r.cn 年少轻狂下一句是什么hcv9jop1ns2r.cn 8月21日是什么星座hcv8jop5ns8r.cn 脊椎挂什么科hcv7jop7ns0r.cn 口是心非是什么生肖zhongyiyatai.com
皮炎吃什么药hcv8jop6ns5r.cn 什么是宫寒hcv9jop2ns2r.cn 不能吃辛辣是指什么hcv8jop8ns2r.cn 2.6号是什么星座520myf.com 双飞什么意思hcv9jop6ns3r.cn
蓝柑是什么水果hcv7jop9ns5r.cn 那天午后我站在你家门口什么歌hcv9jop5ns3r.cn 为什么身份证后面有个xjinxinzhichuang.com 晚上睡觉手麻是什么原因hcv8jop3ns9r.cn 千克又叫什么hcv9jop3ns1r.cn
会车是什么意思hcv8jop0ns1r.cn 肝不好挂什么科室hcv9jop5ns7r.cn 什么食物含硒hcv7jop5ns4r.cn 果丹皮是用什么做的hcv8jop5ns8r.cn 切口憩室是什么意思hcv7jop7ns3r.cn
百度