immer icon indicating copy to clipboard operation
immer copied to clipboard

Proposed fix for #819

Open jdip opened this issue 3 years ago • 1 comments

As pointed out in #819 insertion order is not always preserved when adding to a Set, though according to MDN it should be.

We were already cloning and iterating over the cloned Set anyway in finalize.

If we take it a step further to clear the original Set after cloning and let finalizeProperty know it needs to re-add non-draftable children back to the target then we end up rebuilding the Set in it's original order.

We then no longer need to delete anything from the Set in set

jdip avatar Sep 09 '22 00:09 jdip

Deploy Preview for quizzical-lovelace-dcbd6a canceled.

Name Link
Latest commit ab864a675d1f4045411df0ba2bb8f21444a37d0b
Latest deploy log https://app.netlify.com/sites/quizzical-lovelace-dcbd6a/deploys/631a8c5ad5760200091410bc

netlify[bot] avatar Sep 09 '22 00:09 netlify[bot]

Sorry for the late follow up! Changes look legit, will include in the next minor.

mweststrate avatar Jan 15 '23 16:01 mweststrate

:tada: This PR is included in version 9.0.18 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Jan 15 '23 17:01 github-actions[bot]

Sorry for the late follow up! Changes look legit, will include in the next minor.

No worries. Thanks for taking the time to review/include it!

jdip avatar Jan 16 '23 17:01 jdip