immerjs / immer

Create the next immutable state by mutating the current one

Home Page:https://immerjs.github.io/immer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Which browsers support immer?

krutoo opened this issue · comments

Hi, first of all, thanks for great library.

How can i know what browsers supports immer?

I have some issues in my projects when in action handler spread operator of state argument takes an empty object, but state is a Proxy:

builder.addCase((state, action) => ({
  ...state,
  someProp: action.payload,
}))

I know it is not a prefer way to write reducers but it is works in newer browsers but not work as example in Chrome 73

It is interesting, that is works fine in Chrome 74 and Chrome 72 =)

I also had my suspicions about how the code is transpiled, i use browserslist to tell webpack with babel loader which browsers is target, here is .browserslistrc:

last 3 version
not ie > 0
not ie_mob > 0
not op_mob > 0
not op_mini all
not baidu > 0
not kaios > 0
not dead

According to MDN it is supported since Chrome 49, and since it works in 72 as well, you probably did run into a regression bug of Chrome itself that was fixed afterwards.