immerjs / immer

Create the next immutable state by mutating the current one
https://immerjs.github.io/immer/
MIT License
27.34k stars 844 forks source link

Object values of a `Map` are not frozen anymore #1119

Open alexlazau opened 3 months ago

alexlazau commented 3 months ago

🐛 Bug Report

Starting with Immer 10.0.4, enableMapSet() does not seem to work as expected as values (if objects) of a native Map aren't frozen anymore.

Link to repro

https://stackblitz.com/edit/immer-10-0-4-map-bug

To Reproduce

Create a Map with objects by using produce and check the values of the Map with Object.isFrozen(...).

Observed behavior

Objects inside a Map are not frozen.

Expected behavior

Objects inside a Map are frozen. The provided repo works if the Immer version is set to 10.0.3.

Environment

mweststrate commented 3 months ago

Note to self, see also #1069

mweststrate commented 3 months ago

Thanks for the detailed report, will investigate at a later point.