-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Immer 8 #809
Comments
I will try to migrate in my local fork, if it's working properly I will push it and make a PR (⌐■_■) |
My big questions here are:
|
|
Hmm.
We probably won't know that unless we see it :/
So, I've looked around a bit. Immer only freezes stuff that is export function isDraftable(value: any): boolean {
if (!value) return false
return (
isPlainObject(value) ||
Array.isArray(value) ||
!!value[DRAFTABLE] ||
!!value.constructor[DRAFTABLE] ||
isMap(value) ||
isSet(value)
)
} So it isn't just freezing everything in the case that someone goes against our advice and puts mutable/class/non-serializable stuff in there. My suggestion: we wait for the |
I don't think we have any specific perf test cases for Redux or RTK. There's a React-Redux benchmarks repo, but that's really oriented around triggering lots of dispatches to stress-test UI component updates. I'd say look at some of the Immer PRs to see what benchmarks they might have, and try creating some similar RTK code setups. Not immediately sure how to compare different versions of Immer with RTK here. And yeah, we're definitely coming up on an RTK 1.5 shortly. |
Fixed by #821 . |
Looks like Immer 8 just came out, and it switches to always auto-freezing in production.
It also looks like Immer 7 was slower than 6, but switching auto-freezing on actually improves perf.
We need to look into this and figure out when/how to upgrade. Can we do this in an RTK minor?
freeze
export immerjs/immer#687The text was updated successfully, but these errors were encountered: