Skip to content

Releases: pmndrs/valtio

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

v.1.2.4

01 Oct 13:55
Compare
Choose a tag to compare

v1.2.3 accidentally requires newer node.js versions. v1.2.4 fixes it by reverting exports format.

  • #247 fix(package): avoid subpath pattern in exports

v1.2.3

18 Sep 11:57
Compare
Choose a tag to compare

鈿狅笍 Minimum Node.js requirements (for server-side usage like Next.js): v14.13.0, v12.20.0

This improves devtools in valtio/utils.

  • #223 refactor: stricter tsconfig
  • #232 fix(utils): remove useless internal info in devtools
  • #236 chore(build): simplify exports and support nested subpath

v1.2.2

29 Aug 09:42
Compare
Choose a tag to compare

This fixes ESM exports for some environments. Some utils are also improved.

  • #215 fix(utils): fixing subscribeKey typing
  • #221 refactor(core): eliminate any with new useMutableSource emulation
  • #216 fix(build): use .mjs for import condition in exports
  • #227 fix(utils): Adds skipSubscribe option to proxyWithHistory

v1.2.1

13 Aug 09:20
Compare
Choose a tag to compare

As reported in #210, there was an issue with ESM build. This version fixes it by updating the dependency.

  • #211 fix: update proxy-compare