Skip to content

Releases: pmndrs/valtio

v1.3.1

28 Feb 11:41
Compare
Choose a tag to compare

This fixes Maximum call stack size exceeded error in DEV.

What's Changed

  • fix(core): avoid Maximum call stack size exceeded error with circular structure by @dai-shi in #379

New Contributors

Full Changelog: v1.3.0...v1.3.1

v1.3.0

12 Feb 13:33
Compare
Choose a tag to compare

This fixes some build issues. UMD/SystemJS builds are completely renewed. Exported functions are refactored for TypeScript and we have an easier option to loosen useSnapshot typing (#357).

What's Changed

  • feat(build): use __DEV__ to control development mode by @dai-shi in #338
  • fix(utils): do not depend on react in build by @dai-shi in #358
  • refactor: prefer function declaration by @dai-shi in #359
  • breaking(core): drop deprecated types by @dai-shi in #364

Full Changelog: v1.2.12...v1.3.0

v1.2.12

08 Feb 12:12
Compare
Choose a tag to compare

This is just a small release to fix a bug in proxyWithHistory util.

What's Changed

  • fix(utils): multiple redos at once with proxyWithHistory by @dai-shi in #354

Full Changelog: v1.2.11...v1.2.12

v1.2.11

25 Jan 12:05
Compare
Choose a tag to compare

v1.2.10 has two serious issues: a) TS types for useSnapshot and proxyWithComputed are broken. b) derive has a bug. They should be fixed in v1.2.11, but there can still be some bugs. Please feel free to open issues.

What's Changed

  • fix(utils): re-implement derive to make glitch free (#335 was buggy) by @Noitidart in #341
  • fix(types): workaround for extracting types by @dai-shi in #342

New Contributors

Full Changelog: v1.2.10...v1.2.11

v1.2.10

24 Jan 12:09
Compare
Choose a tag to compare

⚠️ ⚠️ ⚠️ v1.2.10 turns out to have some bugs. Please use v1.2.11 instead. The Migration Guide below is still valid.


This adds new proxyMap and fixes derive, both in valtio/utils. The internal DeepResolveType type is deprecated, which might require migration.

Migration Guide (from v1.2.8 and v1.2.9)

In case you need to specify snapshot types, there are two options.

Assert mutable (let's lie)

type State = { foo?: string }
const state = proxy<State>({})

  const snap = useSnapshot(state) as State
  const handleSnap = (s: State) => {
    // ...
  }

as State can be as typeof state.

Wrap types with Readonly<>

type State = { foo?: string }
const state = proxy<State>({})

  const snap = useSnapshot(state)
  const handleSnap = (s: Readonly<State>) => {
    // ...
  }

Readonly<State> can be Readonly<typeof state>

If the state is deeply nested, please define DeepReadonly type util.

type DeepReadonly<T> = {
  readonly [P in keyof T]: DeepReadonly<T[P]>;
}

  const handleSnap = (s: DeepReadonly<State>) => {
    // ...
  }

What's Changed

Full Changelog: v1.2.9...v1.2.10

v1.2.9

17 Jan 11:38
Compare
Choose a tag to compare

This has small fixes in core, but most notably, it adds a new proxySet util in valtio/utils.

[Important Note] #324 change can be breaking in types if some types are explicitly typed without readonly. See #327 for discussions.

What's Changed

New Contributors

Full Changelog: v1.2.8...v1.2.9

v1.2.8

11 Jan 12:40
Compare
Choose a tag to compare

This adds unstable_getHandler api which is not documented. It includes some refactorings internally. Please report issues if something goes wrong. Also, this adds UMD and SystemJS builds for CDN.

What's Changed

  • fix(build): Generate umd and system files by @romulo94 in #312
  • feat(core): expose proxy handler experimentally by @dai-shi in #298

New Contributors

Full Changelog: v1.2.7...v1.2.8

v1.2.7

01 Dec 14:39
Compare
Choose a tag to compare

This should improve performance. 🚀

What's Changed

New Contributors

Full Changelog: v1.2.6...v1.2.7

v1.2.6

09 Nov 22:50
Compare
Choose a tag to compare

Improved devtools util.

What's Changed

Full Changelog: v1.2.5...v1.2.6

v1.2.5

18 Oct 12:18
Compare
Choose a tag to compare

Based on some feedbacks, this version includes some minor fixes.

What's Changed

  • fix(vanilla): console warn instead of throwing in DEV by @dai-shi in #249
  • feat(utils): jump state support in devtools by @Aslemammad in #257

Full Changelog: v1.2.4...v1.2.5