Skip to content
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

chore(deps): upgrade Immer from 1.8.0 to 7.0.4 #796

Merged
merged 1 commit into from Sep 8, 2020

Conversation

adngdb
Copy link
Contributor

@adngdb adngdb commented Sep 8, 2020

Hey folks,

I noticed that the version of Immer used here was very outdated (almost 2 years old), and I was hoping to use a feature introduced in version 7 (current). I thus figured I could give upgrading Immer a try, and see if it broke anything. As far as tests are concerned, not much broke, and it was very easy to fix. So, here's a PR to upgrade it!

However, I am very unsure of this. I thought you might have reasons for not upgrading, and maybe I'm missing some very important details?

In order to help with this, I compiled below the list of all breaking changes in Immer since version 1.8.0:

7.0.0 (2020-06-10)

  • [BREAKING CHANGE] getters and setters are now handled consistently: own getters and setters will always by copied into fields (like Object.assign does), inherited getters and setters will be left as-is. This should allow using Immer directly on objects that trap their fields, like done in Vue or MobX. Fixes #584, #439, #593, #558
  • [BREAKING CHANGE] produce no longer accepts non-draftable objects as first argument
  • [BREAKING CHANGE] original can only be called on drafts and will throw otherwise (fixes #605)
  • [BREAKING CHANGE] non-enumerable and symbolic fields will never be frozen
  • [BREAKING CHANGE] the patches for arrays are now computed differently to fix some scenarios in which they were incorrect. In some cases they will be more optimal now, in other cases less. Especially splicing / unshifting items into an existing array might result in a lot of patches. Fixes #468

6.0.0 (2020-03-03)

5.0.0 (2019-10-30)

BREAKING CHANGE: Maps and Sets are treated differently now; they will no longer directly mutated when updated inside a draft

4.0.0 (2019-09-11)

  • any value returned from produce will be deeply frozen in DEV, even when it wasn't frozen before the producer started. Fixes #412 #363 #260 #230 #313 #229 through #417

3.0.0 (2019-04-17)

  • ts: typescript@3.4.0 is now the minimum required version
  • this in recipe is no longer the draft, but unbound (3f40298)
  • Dropped node 6 support (eecc773)

2.0.0 (2019-02-02)

  • added migration guide: Promises returned from producer will be evaluated

Checklist

  • Use a separate branch in your local repo (not master).
  • Test coverage is 100% (or you have a story for why it's ok).

@nicolodavis
Copy link
Member

Hi @adngdb, thanks a lot for this!

@nicolodavis nicolodavis merged commit fa28be0 into boardgameio:master Sep 8, 2020
@adngdb adngdb deleted the upgrade-immer branch September 8, 2020 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants