Skip to content

Releases: charkour/zundo

v2.0.0-beta.20 - Only copy when necessary

10 Jun 16:57
Compare
Choose a tag to compare

850 B --> 852 B

What's Changed

New Contributors

Full Changelog: v2.0.0-beta.19...v2.0.0-beta.20

v2.0.0-beta.19 - Smaller Bundle Size by 0.82%

05 Jun 00:22
Compare
Choose a tag to compare

857 B --> 850 B

What's Changed

Full Changelog: v2.0.0-beta.18...v2.0.0-beta.19

v2.0.0-beta.18 - Improve _handleSet, shave 20 bytes (2.3% smaller)

27 May 14:31
Compare
Choose a tag to compare

877 B --> 857 B (Shave 20 bytes)

What's Changed

Full Changelog: v2.0.0-beta.17...v2.0.0-beta.18

v2.0.0-beta.17 - Drop Node 14, Smaller Bundle by 1.2%

23 May 12:31
Compare
Choose a tag to compare

888 B --> 877 B (save 11 bytes)

Breaking

  • Node 14 is no longer supported
  • The internal types have been renamed

What's Changed

Full Changelog: v2.0.0-beta.16...v2.0.0-beta.17

v2.0.0-beta.16 - Temporal Middleware

04 May 01:10
Compare
Choose a tag to compare
Pre-release

New Feature!

Wrap temporal store from @SugarF0x

wrapTemporal?: (storeInitializer: StateCreator<TemporalStateWithInternals<TState>, [StoreMutatorIdentifier, unknown][], []>) => StateCreator<TemporalStateWithInternals<TState>, [StoreMutatorIdentifier, unknown][], [StoreMutatorIdentifier, unknown][]>

You can wrap the temporal store with your own middleware. This is useful if you want to add additional functionality to the temporal store. For example, you can add persist middleware to the temporal store to persist the past and future states to local storage.

Note: The temporal middleware can be added to the temporal store. This way, you could track the history of the history. 🤯

import { persist } from 'zustand/middleware'

const withTemporal = temporal<MyState>(
  (set) => ({ ... }),
  {
    wrapTemporal: (storeInitializer) => persist(storeInitializer, { name: 'temporal-persist' }),
  },
);

Size 865 B --> 888 B (increase 23 B)

What's Changed

Full Changelog: v2.0.0-beta.15...v2.0.0-beta.16

v2.0.0-beta.15 - Init states

23 Apr 03:55
Compare
Choose a tag to compare
Pre-release

New feature!

Initialize temporal store with past and future states

pastStates?: Partial<PartialTState>[]

futureStates?: Partial<PartialTState>[]

You can initialize the temporal store with past and future states. This is useful when you want to load a previous state from a database or initialize the store with a default state. By default, the temporal store is initialized with an empty array of past and future states.

Note: The pastStates and futureStates do not respect the limit set in the options. If you want to limit the number of past and future states, you must do so manually prior to initializing the store.

const withTemporal = temporal<MyState>(
  (set) => ({ ... }),
  {
    pastStates: [{ field1: 'value1' }, { field1: 'value2' }],
    futureStates: [{ field1: 'value3' }, { field1: 'value4' }],
  },
);

Related #75

847 B --> 865 B (increase 18 bytes)

What's Changed

Full Changelog: v2.0.0-beta.14...v2.0.0-beta.15

v2.0.0-beta.14 - 2.4% smaller

22 Apr 22:12
Compare
Choose a tag to compare
Pre-release

Reduce package size by 21 bytes.
868 B --> 847 B

What's Changed

  • switch config for better types and save bytes by @charkour in #83

Full Changelog: v2.0.0-beta.13...v2.0.0-beta.14

v2.0.0-beta.13 - 7.3% smaller bundle

22 Apr 21:45
Compare
Choose a tag to compare
Pre-release

7.3% smaller by shaving 69 bytes. Add better React tests
937 bytes --> 868 bytes

Breaking change

This a potentially breaking change for those who rely on internal properties.

// Before
myStore.temporal.getState().__interal.onSave

// After
myStore.temporal.getState().__onSave

// Before
myStore.temporal.getState().__interal.handleuserSet

// After
myStore.temporal.getState().__handleUserSet

What's Changed

  • restructure __internals to shave bytes; add react tests by @charkour in #82

Full Changelog: v2.0.0-beta.12...v2.0.0-beta.13

v2.0.0-beta.12 - Shave Bytes

15 Apr 21:32
Compare
Choose a tag to compare
Pre-release

962 B --> 937 B (25 bytes)

What's Changed

Full Changelog: v2.0.0-beta.11...v2.0.0-beta.12

v2.0.0-beta.11

13 Feb 16:08
cb9f88b
Compare
Choose a tag to compare
v2.0.0-beta.11 Pre-release
Pre-release

What's Changed

Full Changelog: v2.0.0-beta.10...v2.0.0-beta.11