This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
fix(deps): update dependency zundo to v2.0.0 #2307
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.0.0-beta.25
->2.0.0
Release Notes
charkour/zundo (zundo)
v2.0.0
: - Smaller and more flexible 🎉Compare Source
v2.0.0 is a complete rewrite of zundo. It is smaller and more flexible. It also has a smaller bundle size and allows you to opt into specific performance trade-offs. The API has changed slightly. See the API section for more details. Below is a summary of the changes as well as steps to migrate from v1 to v2.
v2 introduces 8 new middleware options and is only ~800 bytes where v1 was a few KBs.
Community
zundo
is used by several projects and teams including Stability AI, Yext, KaotoIO, and NutSH.ai.If this library is useful to you, please consider sponsoring the project. Thank you!
PRs are welcome! pnpm is used as a package manager. Run
pnpm install
to install local dependencies. Thank you for contributing!Breaking Changes
Middleware Option Changes
include
andexclude
options are now handled by thepartialize
option.allowUnchanged
option is now handled by theequality
option. By default, all state changes are tracked. In v1, we bundledlodash.isequal
to handle equality checks. In v2, you are able to use any function.historyDepthLimit
option has been renamed tolimit
.coolOffDurationMs
option is now handled by thehandleSet
option by wrapping the setter function with a throttle or debounce function.Import changes
temporal
rather thanundoMiddleware
.New Features
New Options
partialize
option to omit or include specific fields. By default, the entire state object is tracked.limit
option to limit the number of previous and future states stored in history.equality
option to use a custom equality function to determine when a state change should be tracked. By default, all state changes are tracked.diff
option to store state delta rather than full object.onSave
option to call a function when the temporal store is updated.handleSet
option to throttle or debounce state changes.pastStates
andfutureStates
options to initialize the temporal store with past and future states.wrapTemporal
option to wrap the temporal store with middleware. Thetemporal
store is a vanilla zustand store.New
temporal.getState()
APIundo
,redo
, andclear
functions are now always defined. They can no longer beundefined
.undo()
andredo()
functions now accept an optionalsteps
parameter to go back or forward multiple states at once.isTracking
flag, andpause
, andresume
functions are now available on the temporal store.setOnSave
function is now available on the temporal store to change theonSave
behavior after the store has been created.Migration Steps
include
orexclude
, use the newpartialize
optionallowUnchanged
, use the newequality
optionhistoryDepthLimit
, use the newlimit
optioncoolOffDurationMs
, use the newhandleSet
optionWhat's Changed
8608dd9
by @charkour in https://github.com/charkour/zundo/pull/99diff
option to track state deltas by @charkour in https://github.com/charkour/zundo/pull/123New Contributors
Full Changelog: charkour/zundo@v1.6.0...v2.0.0
v2.0.0-experimental.0
Compare Source
Support zustand v4 with an updated API. This is an experimental release that will be similar to v2 of zundo.
BREAKING CHANGES
The methods
undo
,redo
,clear
,setIsUndoHistoryEnabled
, andgetState
are not accessed fromuseStore.temporal
instead ofuseStore()
.What's Changed
Full Changelog: charkour/zundo@v1.6.0...v2.0.0-experimental.0
Configuration
📅 Schedule: Branch creation - "before 6am" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.