question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

please highlight breaking changes when migrating from v2 to v3 (( thank you )).

See original GitHub issue

so far I was able to identify 1 breaking change in the lib api.

const [useStore, storeApi] = create(...)
storeApi.setState(...)
const useStore = create(...)
useStore.setState(...)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
uzairfaisalcommented, Oct 14, 2020

Actually, I’d like to highlight a breaking change. When using devtools, the set function which saves the partial object to the state would previously accept the name of the action as the 2nd param. Now, the 2nd param is changed to whether the partial object should overwrite the state or not - and any previous name param being passed to the set(...) would result in the state being overwritten in 3.x whereas this was not the behaviour in 2.x.

This is highlighted here: https://github.com/pmndrs/zustand/blob/master/src/middleware.ts#L33

Compared to what was there for 2.x: https://github.com/pmndrs/zustand/blob/f87534e444f2f48a1af89459d141660ffda855c6/src/middleware.ts

Unless I missed something already mentioned before, please highlight this as a breaking change from 2 -> 3 so it’s clear for all. This tripped our upgrade to 3.x.

1reaction
dai-shicommented, Oct 14, 2020

That was a huge misunderstanding of mine. Thanks for noting. I added a note in v3.0.2 release which has the change. Please suggest better description if you have any. https://github.com/pmndrs/zustand/releases/tag/v3.0.2

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating from v2 to v3 - Gatsby
This section explains breaking changes that were made for Gatsby v3. Most, if not all, of those changes had a deprecation message in...
Read more >
Migrating from 3.x to 4.0 - Socket.IO
Please note that these breaking changes only impact the API on the server side. The Socket.IO protocol itself was not updated, so a...
Read more >
Migrating to SQLAlchemy 2.0
2.0 Migration - ORM Extension and Recipe Changes. Dogpile cache recipe and Horizontal Sharding uses new Session API; Baked Query Extension Superseded by ......
Read more >
Changelog - Cypress Documentation
Breaking Changes : Please run cypress open to go through our interactive migration which will guide you in updating your files and configuration...
Read more >
How To Migrate From v2 to v3 Mail Send | Twilio
With a few quick changes you will be able to take advantage of the improvements and added features provided by the v3 mail...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found