From cdc9c30c48c0358e3262047ebd06f3d05b66bb13 Mon Sep 17 00:00:00 2001 From: daishi Date: Mon, 6 Nov 2023 13:33:17 +0900 Subject: [PATCH 01/35] prepare for the next major version --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 81169769..acd29c98 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,9 @@ "name": "valtio", "private": true, "version": "1.12.0", + "publishConfig": { + "tag": "next" + }, "description": "💊 Valtio makes proxy-state simple for React and Vanilla", "main": "./index.js", "types": "./index.d.ts", From 2c3375205ed70099f68643ad3afeafffe76ce8db Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Sun, 12 Nov 2023 20:38:14 +0900 Subject: [PATCH 02/35] [v2] breaking: do not throw promises (#813) * [v2] breaking: do not throw promises * use use * fix CI hopefully * fix CI hopefully 2 * fix CI hopefully 3 * fix CI hopefully 4 * fix CI hopefully 5 * any type for simplicity --- package.json | 4 +- src/react.ts | 15 ++---- src/vanilla.ts | 47 ++----------------- tests/async.test.tsx | 100 ++++++++++++++++++++++------------------ tests/computed.test.tsx | 11 +++-- tests/derive.test.tsx | 11 +++-- tests/snapshot.test.ts | 31 ------------- yarn.lock | 26 +++++------ 8 files changed, 93 insertions(+), 152 deletions(-) diff --git a/package.json b/package.json index acd29c98..443c9676 100644 --- a/package.json +++ b/package.json @@ -158,8 +158,8 @@ "postinstall-postinstall": "^2.1.0", "prettier": "^3.0.3", "proxy-memoize": "^2.0.4", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "18.3.0-canary-c47c306a7-20231109", + "react-dom": "18.3.0-canary-c47c306a7-20231109", "redux": "^4.2.1", "rollup": "^4.2.0", "rollup-plugin-esbuild": "^6.1.0", diff --git a/src/react.ts b/src/react.ts index ec8dc009..7f529fb6 100644 --- a/src/react.ts +++ b/src/react.ts @@ -1,12 +1,4 @@ -/// - -import ReactExports, { - useCallback, - useDebugValue, - useEffect, - useMemo, - useRef, -} from 'react' +import { useCallback, useDebugValue, useEffect, useMemo, useRef } from 'react' import { affectedToPathList, createProxy as createProxyToCompare, @@ -21,7 +13,6 @@ import useSyncExternalStoreExports from 'use-sync-external-store/shim' import { snapshot, subscribe } from './vanilla.ts' import type { INTERNAL_Snapshot as Snapshot } from './vanilla.ts' -const { use } = ReactExports const { useSyncExternalStore } = useSyncExternalStoreExports const useAffectedDebugValue = ( @@ -133,7 +124,7 @@ export function useSnapshot( [proxyObject, notifyInSync] ), () => { - const nextSnapshot = snapshot(proxyObject, use) + const nextSnapshot = snapshot(proxyObject) try { if ( !inRender && @@ -154,7 +145,7 @@ export function useSnapshot( } return nextSnapshot }, - () => snapshot(proxyObject, use) + () => snapshot(proxyObject) ) inRender = false const currAffected = new WeakMap() diff --git a/src/vanilla.ts b/src/vanilla.ts index 2685c7d7..0c829ef5 100644 --- a/src/vanilla.ts +++ b/src/vanilla.ts @@ -33,8 +33,6 @@ type SnapshotIgnore = type Snapshot = T extends SnapshotIgnore ? T - : T extends Promise - ? Awaited : T extends object ? { readonly [K in keyof T]: Snapshot } : T @@ -45,13 +43,7 @@ type Snapshot = T extends SnapshotIgnore */ export type INTERNAL_Snapshot = Snapshot -type HandlePromise =

>(promise: P) => Awaited

- -type CreateSnapshot = ( - target: T, - version: number, - handlePromise?: HandlePromise -) => T +type CreateSnapshot = (target: T, version: number) => T type RemoveListener = () => void type AddListener = (listener: Listener) => RemoveListener @@ -86,29 +78,11 @@ const buildProxyFunction = ( !(x instanceof RegExp) && !(x instanceof ArrayBuffer), - defaultHandlePromise =

>( - promise: P & { - status?: 'pending' | 'fulfilled' | 'rejected' - value?: Awaited

- reason?: unknown - } - ) => { - switch (promise.status) { - case 'fulfilled': - return promise.value as Awaited

- case 'rejected': - throw promise.reason - default: - throw promise - } - }, - snapCache = new WeakMap(), createSnapshot: CreateSnapshot = ( target: T, - version: number, - handlePromise: HandlePromise = defaultHandlePromise + version: number ): T => { const cache = snapCache.get(target) if (cache?.[0] === version) { @@ -138,18 +112,11 @@ const buildProxyFunction = ( } if (refSet.has(value as object)) { markToTrack(value as object, false) // mark not to track - } else if (value instanceof Promise) { - delete desc.value - desc.get = () => handlePromise(value) } else if (proxyStateMap.has(value as object)) { const [target, ensureVersion] = proxyStateMap.get( value as object ) as ProxyState - desc.value = createSnapshot( - target, - ensureVersion(), - handlePromise - ) as Snapshot + desc.value = createSnapshot(target, ensureVersion()) as Snapshot } Object.defineProperty(snap, key, desc) }) @@ -337,7 +304,6 @@ const buildProxyFunction = ( objectIs, newProxy, canProxy, - defaultHandlePromise, snapCache, createSnapshot, proxyCache, @@ -391,16 +357,13 @@ export function subscribe( } } -export function snapshot( - proxyObject: T, - handlePromise?: HandlePromise -): Snapshot { +export function snapshot(proxyObject: T): Snapshot { const proxyState = proxyStateMap.get(proxyObject as object) if (import.meta.env?.MODE !== 'production' && !proxyState) { console.warn('Please use proxy object') } const [target, ensureVersion, createSnapshot] = proxyState as ProxyState - return createSnapshot(target, ensureVersion(), handlePromise) as Snapshot + return createSnapshot(target, ensureVersion()) as Snapshot } export function ref(obj: T): T & AsRef { diff --git a/tests/async.test.tsx b/tests/async.test.tsx index ef4ef888..0c101d61 100644 --- a/tests/async.test.tsx +++ b/tests/async.test.tsx @@ -1,4 +1,6 @@ -import { StrictMode, Suspense } from 'react' +/// + +import ReactExports, { StrictMode, Suspense } from 'react' import { fireEvent, render, waitFor } from '@testing-library/react' import { it } from 'vitest' import { proxy, useSnapshot } from 'valtio' @@ -8,7 +10,10 @@ const sleep = (ms: number) => setTimeout(resolve, ms) }) -it('delayed increment', async () => { +const { use } = ReactExports as any // for TS < 4.3 FIXME later +const use2 = (x: any) => (x instanceof Promise ? use(x) : x) + +it.skipIf(typeof use === 'undefined')('delayed increment', async () => { const state = proxy({ count: 0 }) const delayedIncrement = () => { const nextCount = state.count + 1 @@ -19,7 +24,7 @@ it('delayed increment', async () => { const snap = useSnapshot(state) return ( <> -

count: {snap.count}
+
count: {use2(snap.count)}
) @@ -40,7 +45,7 @@ it('delayed increment', async () => { await findByText('count: 1') }) -it('delayed object', async () => { +it.skipIf(typeof use === 'undefined')('delayed object', async () => { const state = proxy({ object: { text: 'none' } }) const delayedObject = () => { state.object = sleep(300).then(() => ({ text: 'hello' })) @@ -50,7 +55,7 @@ it('delayed object', async () => { const snap = useSnapshot(state) return ( <> -
text: {snap.object.text}
+
text: {use2(snap.object).text}
) @@ -71,51 +76,54 @@ it('delayed object', async () => { await findByText('text: hello') }) -it('delayed object update fulfilled', async () => { - const state = proxy({ - object: sleep(300).then(() => ({ text: 'counter', count: 0 })), - }) - const updateObject = () => { - state.object = state.object.then((v: any) => - sleep(300).then(() => ({ ...v, count: v.count + 1 })) +it.skipIf(typeof use === 'undefined')( + 'delayed object update fulfilled', + async () => { + const state = proxy({ + object: sleep(300).then(() => ({ text: 'counter', count: 0 })), + }) + const updateObject = () => { + state.object = state.object.then((v: any) => + sleep(300).then(() => ({ ...v, count: v.count + 1 })) + ) + } + + const Counter = () => { + const snap = useSnapshot(state) + return ( + <> +
text: {use2(snap.object).text}
+
count: {use2(snap.object).count}
+ + + ) + } + + const { getByText, findByText } = render( + + + + + ) - } - const Counter = () => { - const snap = useSnapshot(state) - return ( - <> -
text: {snap.object.text}
-
count: {snap.object.count}
- - - ) - } + await findByText('loading') + await waitFor(() => { + getByText('text: counter') + getByText('count: 0') + }) - const { getByText, findByText } = render( - - - - - - ) - - await findByText('loading') - await waitFor(() => { - getByText('text: counter') - getByText('count: 0') - }) + fireEvent.click(getByText('button')) - fireEvent.click(getByText('button')) - - await findByText('loading') - await waitFor(() => { - getByText('text: counter') - getByText('count: 1') - }) -}) + await findByText('loading') + await waitFor(() => { + getByText('text: counter') + getByText('count: 1') + }) + } +) -it('delayed falsy value', async () => { +it.skipIf(typeof use === 'undefined')('delayed falsy value', async () => { const state = proxy({ value: true }) const delayedValue = () => { state.value = sleep(300).then(() => null) @@ -125,7 +133,7 @@ it('delayed falsy value', async () => { const snap = useSnapshot(state) return ( <> -
value: {String(snap.value)}
+
value: {String(use2(snap.value))}
) diff --git a/tests/computed.test.tsx b/tests/computed.test.tsx index 1d0e61c1..2644dffa 100644 --- a/tests/computed.test.tsx +++ b/tests/computed.test.tsx @@ -1,10 +1,15 @@ -import { StrictMode, Suspense } from 'react' +/// + +import ReactExports, { StrictMode, Suspense } from 'react' import { fireEvent, render } from '@testing-library/react' import { memoize } from 'proxy-memoize' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { proxy, snapshot, subscribe, useSnapshot } from 'valtio' import { addComputed, proxyWithComputed, subscribeKey } from 'valtio/utils' +const { use } = ReactExports as any // for TS < 4.3 FIXME later +const use2 = (x: any) => (x instanceof Promise ? use(x) : x) + const consoleWarn = console.warn beforeEach(() => { console.warn = vi.fn((message: string) => { @@ -201,7 +206,7 @@ describe('DEPRECATED addComputed', () => { expect(callback).toBeCalledTimes(2) }) - it('async addComputed', async () => { + it.skipIf(typeof use === 'undefined')('async addComputed', async () => { const state = proxy({ count: 0 }) addComputed(state, { delayedCount: async (snap) => { @@ -217,7 +222,7 @@ describe('DEPRECATED addComputed', () => { return ( <>
- count: {snap.count}, delayedCount: {snap.delayedCount} + count: {snap.count}, delayedCount: {use2(snap.delayedCount)}
diff --git a/tests/derive.test.tsx b/tests/derive.test.tsx index 89a01951..ea0f9d74 100644 --- a/tests/derive.test.tsx +++ b/tests/derive.test.tsx @@ -1,4 +1,6 @@ -import { StrictMode, Suspense, useEffect, useRef } from 'react' +/// + +import ReactExports, { StrictMode, Suspense, useEffect, useRef } from 'react' import { fireEvent, render } from '@testing-library/react' import { describe, expect, it, vi } from 'vitest' import { proxy, snapshot, subscribe, useSnapshot } from 'valtio' @@ -11,6 +13,9 @@ const sleep = (ms: number) => setTimeout(resolve, ms) }) +const { use } = ReactExports as any // for TS < 4.3 FIXME later +const use2 = (x: any) => (x instanceof Promise ? use(x) : x) + it('basic derive', async () => { const computeDouble = vi.fn((x: number) => x * 2) const state = proxy({ @@ -149,7 +154,7 @@ it('derive with two dependencies', async () => { expect(callback).toBeCalledTimes(2) }) -it('async derive', async () => { +it.skipIf(typeof use === 'undefined')('async derive', async () => { const state = proxy({ count: 0 }) derive( { @@ -168,7 +173,7 @@ it('async derive', async () => { return ( <>
- count: {snap.count}, delayedCount: {snap.delayedCount} + count: {snap.count}, delayedCount: {use2(snap.delayedCount)}
diff --git a/tests/snapshot.test.ts b/tests/snapshot.test.ts index 6a6494d9..57f4e091 100644 --- a/tests/snapshot.test.ts +++ b/tests/snapshot.test.ts @@ -3,28 +3,6 @@ import { TypeEqual, expectType } from 'ts-expect' import { describe, expect, it } from 'vitest' import { INTERNAL_Snapshot as Snapshot, proxy, snapshot } from 'valtio' -const sleep = (ms: number) => - new Promise((resolve) => { - setTimeout(resolve, ms) - }) - -it('getter returns value after promise is resolved', async () => { - const state = proxy({ status: sleep(10).then(() => 'done') }) - const snap = snapshot(state) - - await new Promise((resolve) => { - resolve(snap.status) - }) - .catch((thrown) => { - expect(thrown).toBeInstanceOf(Promise) - return thrown - }) - .then((value) => { - expect(value).toBe('done') - expect(snap.status).toBe('done') - }) -}) - it('should return correct snapshots without subscribe', async () => { const child = proxy({ count: 0 }) const state = proxy({ child }) @@ -119,15 +97,6 @@ describe('snapsoht typings', () => { >(true) }) - it('infers Promise result from property value', () => { - expectType< - TypeEqual< - Snapshot<{ promise: Promise }>, - { readonly promise: string } - > - >(true) - }) - it('converts arrays to readonly arrays', () => { expectType, readonly number[]>>(true) }) diff --git a/yarn.lock b/yarn.lock index 70e6fa51..a4a7addd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4259,13 +4259,13 @@ randombytes@^2.1.0: dependencies: safe-buffer "^5.1.0" -react-dom@^18.2.0: - version "18.2.0" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" - integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g== +react-dom@18.3.0-canary-c47c306a7-20231109: + version "18.3.0-canary-c47c306a7-20231109" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.0-canary-c47c306a7-20231109.tgz#a5b881218f760a44e09469f7c1d38c8354b6e0b9" + integrity sha512-COjHi7Ve6fCDStLinhvKxUpAVRDwkHIXtH9m8crIc0d3KjE+PMTmmIwQQj3ceypDAARQ1VFwHOhMQgXcdRAxlA== dependencies: loose-envify "^1.1.0" - scheduler "^0.23.0" + scheduler "0.24.0-canary-c47c306a7-20231109" react-is@^16.13.1: version "16.13.1" @@ -4282,10 +4282,10 @@ react-is@^18.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== -react@^18.2.0: - version "18.2.0" - resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" - integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== +react@18.3.0-canary-c47c306a7-20231109: + version "18.3.0-canary-c47c306a7-20231109" + resolved "https://registry.yarnpkg.com/react/-/react-18.3.0-canary-c47c306a7-20231109.tgz#53878c332f829d5b25f6df6c8c3746cd12a3b922" + integrity sha512-LtL67Bc+Mkuhwud559dUCU+QXL6mmtgKTGEyT41m5bDiEQdGAyYCxXo5/pigAx4p8mQb+KIT2AvCWlEDKut+PQ== dependencies: loose-envify "^1.1.0" @@ -4522,10 +4522,10 @@ saxes@^6.0.0: dependencies: xmlchars "^2.2.0" -scheduler@^0.23.0: - version "0.23.0" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" - integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw== +scheduler@0.24.0-canary-c47c306a7-20231109: + version "0.24.0-canary-c47c306a7-20231109" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.24.0-canary-c47c306a7-20231109.tgz#9d2f0329d603279093b38999f78eac04bf64f8a0" + integrity sha512-VGLhOyPt1EIAsoGqu7DMxnVPdGAoxTmSjNJlGX31exX0stiZsvb3QuK5bKT1BaTpDOJD4VnNFoonMRN7BNh3Cg== dependencies: loose-envify "^1.1.0" From e91b0cbaa9916d3f6cea796f425b99f9b6fed183 Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Mon, 13 Nov 2023 16:56:08 +0900 Subject: [PATCH 03/35] [v2] breaking: do not copy initial objects (#815) * [v2] breaking: do not copy initial objects * fix deepClone * refactor * ah we need it * deep clone * minor fix --- src/vanilla.ts | 67 +++++++++++++-------------- src/vanilla/utils.ts | 1 + src/vanilla/utils/deepClone.ts | 25 ++++++++++ src/vanilla/utils/proxyWithHistory.ts | 30 +----------- 4 files changed, 59 insertions(+), 64 deletions(-) create mode 100644 src/vanilla/utils/deepClone.ts diff --git a/src/vanilla.ts b/src/vanilla.ts index 0c829ef5..bff2b11f 100644 --- a/src/vanilla.ts +++ b/src/vanilla.ts @@ -127,11 +127,11 @@ const buildProxyFunction = ( versionHolder = [1, 1] as [number, number], - proxyFunction = (initialObject: T): T => { - if (!isObject(initialObject)) { + proxyFunction = (baseObject: T): T => { + if (!isObject(baseObject)) { throw new Error('object required') } - const found = proxyCache.get(initialObject) as T | undefined + const found = proxyCache.get(baseObject) as T | undefined if (found) { return found } @@ -167,18 +167,23 @@ const buildProxyFunction = ( string | symbol, readonly [ProxyState, RemoveListener?] >() - const addPropListener = ( - prop: string | symbol, - propProxyState: ProxyState - ) => { - if (import.meta.env?.MODE !== 'production' && propProxyStates.has(prop)) { - throw new Error('prop listener already exists') - } - if (listeners.size) { - const remove = propProxyState[3](createPropListener(prop)) - propProxyStates.set(prop, [propProxyState, remove]) - } else { - propProxyStates.set(prop, [propProxyState]) + const addPropListener = (prop: string | symbol, propValue: unknown) => { + const propProxyState = + !refSet.has(propValue as object) && + proxyStateMap.get(propValue as object) + if (propProxyState) { + if ( + import.meta.env?.MODE !== 'production' && + propProxyStates.has(prop) + ) { + throw new Error('prop listener already exists') + } + if (listeners.size) { + const remove = propProxyState[3](createPropListener(prop)) + propProxyStates.set(prop, [propProxyState, remove]) + } else { + propProxyStates.set(prop, [propProxyState]) + } } } const removePropListener = (prop: string | symbol) => { @@ -212,9 +217,7 @@ const buildProxyFunction = ( } return removeListener } - const baseObject = Array.isArray(initialObject) - ? [] - : Object.create(Object.getPrototypeOf(initialObject)) + let initializing = true const handler: ProxyHandler = { deleteProperty(target: T, prop: string | symbol) { const prevValue = Reflect.get(target, prop) @@ -226,7 +229,7 @@ const buildProxyFunction = ( return deleted }, set(target: T, prop: string | symbol, value: any, receiver: object) { - const hasPrevValue = Reflect.has(target, prop) + const hasPrevValue = !initializing && Reflect.has(target, prop) const prevValue = Reflect.get(target, prop, receiver) if ( hasPrevValue && @@ -257,11 +260,7 @@ const buildProxyFunction = ( if (!proxyStateMap.has(value) && canProxy(value)) { nextValue = proxyFunction(value) } - const childProxyState = - !refSet.has(nextValue) && proxyStateMap.get(nextValue) - if (childProxyState) { - addPropListener(prop, childProxyState) - } + addPropListener(prop, nextValue) } Reflect.set(target, prop, nextValue, receiver) notifyUpdate(['set', [prop], value, prevValue]) @@ -269,7 +268,7 @@ const buildProxyFunction = ( }, } const proxyObject = newProxy(baseObject, handler) - proxyCache.set(initialObject, proxyObject) + proxyCache.set(baseObject, proxyObject) const proxyState: ProxyState = [ baseObject, ensureVersion, @@ -277,20 +276,16 @@ const buildProxyFunction = ( addListener, ] proxyStateMap.set(proxyObject, proxyState) - Reflect.ownKeys(initialObject).forEach((key) => { + Reflect.ownKeys(baseObject).forEach((key) => { const desc = Object.getOwnPropertyDescriptor( - initialObject, + baseObject, key ) as PropertyDescriptor - if ('value' in desc) { - proxyObject[key as keyof T] = initialObject[key as keyof T] - // We need to delete desc.value because we already set it, - // and delete desc.writable because we want to write it again. - delete desc.value - delete desc.writable + if ('value' in desc && desc.writable) { + proxyObject[key as keyof T] = baseObject[key as keyof T] } - Object.defineProperty(baseObject, key, desc) }) + initializing = false return proxyObject } ) => @@ -312,8 +307,8 @@ const buildProxyFunction = ( const [defaultProxyFunction] = buildProxyFunction() -export function proxy(initialObject: T = {} as T): T { - return defaultProxyFunction(initialObject) +export function proxy(baseObject: T = {} as T): T { + return defaultProxyFunction(baseObject) } export function getVersion(proxyObject: unknown): number | undefined { diff --git a/src/vanilla/utils.ts b/src/vanilla/utils.ts index 69285a3a..5063b8ba 100644 --- a/src/vanilla/utils.ts +++ b/src/vanilla/utils.ts @@ -4,6 +4,7 @@ export { devtools } from './utils/devtools.ts' export { derive, underive, unstable_deriveSubscriptions } from 'derive-valtio' export { addComputed_DEPRECATED as addComputed } from './utils/addComputed.ts' export { proxyWithComputed_DEPRECATED as proxyWithComputed } from './utils/proxyWithComputed.ts' +export { deepClone } from './utils/deepClone.ts' export { proxyWithHistory } from './utils/proxyWithHistory.ts' export { proxySet } from './utils/proxySet.ts' export { proxyMap } from './utils/proxyMap.ts' diff --git a/src/vanilla/utils/deepClone.ts b/src/vanilla/utils/deepClone.ts new file mode 100644 index 00000000..8e6b22d2 --- /dev/null +++ b/src/vanilla/utils/deepClone.ts @@ -0,0 +1,25 @@ +import { unstable_buildProxyFunction as buildProxyFunction } from '../../vanilla.ts' + +const isObject = (x: unknown): x is object => + typeof x === 'object' && x !== null + +let defaultRefSet: WeakSet | undefined +const getDefaultRefSet = (): WeakSet => { + if (!defaultRefSet) { + defaultRefSet = buildProxyFunction()[2] + } + return defaultRefSet +} + +export const deepClone = (obj: T, getRefSet = getDefaultRefSet): T => { + if (!isObject(obj) || getRefSet().has(obj)) { + return obj + } + const baseObject: T = Array.isArray(obj) + ? [] + : Object.create(Object.getPrototypeOf(obj)) + Reflect.ownKeys(obj).forEach((key) => { + baseObject[key as keyof T] = deepClone(obj[key as keyof T], getRefSet) + }) + return baseObject +} diff --git a/src/vanilla/utils/proxyWithHistory.ts b/src/vanilla/utils/proxyWithHistory.ts index 592cf896..1a6ad801 100644 --- a/src/vanilla/utils/proxyWithHistory.ts +++ b/src/vanilla/utils/proxyWithHistory.ts @@ -1,36 +1,10 @@ -import { - unstable_buildProxyFunction as buildProxyFunction, - proxy, - ref, - snapshot, - subscribe, -} from '../../vanilla.ts' +import { proxy, ref, snapshot, subscribe } from '../../vanilla.ts' import type { INTERNAL_Snapshot as Snapshot } from '../../vanilla.ts' +import { deepClone } from './deepClone.ts' type SnapshotOrUndefined = Snapshot | undefined type Snapshots = Snapshot[] -const isObject = (x: unknown): x is object => - typeof x === 'object' && x !== null - -let refSet: WeakSet | undefined - -const deepClone = (obj: T): T => { - if (!refSet) { - refSet = buildProxyFunction()[2] - } - if (!isObject(obj) || refSet.has(obj)) { - return obj - } - const baseObject: T = Array.isArray(obj) - ? [] - : Object.create(Object.getPrototypeOf(obj)) - Reflect.ownKeys(obj).forEach((key) => { - baseObject[key as keyof T] = deepClone(obj[key as keyof T]) - }) - return baseObject -} - /** * proxyWithHistory * From 9101ee52033e1c8f2d5f87451d44c7b2b8c0e05e Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Mon, 13 Nov 2023 21:01:14 +0900 Subject: [PATCH 04/35] breaking: require TS 4.5 at least (#817) * TS minimal requirement v4.5 * wip: test old ts * remove downlevel-dts * simplify test * simplify test 2 * simplify test 3 * wip: useMaybePromise * wip: useMaybePromise 2 * wip: useMaybePromise 3 * rename back --- .github/workflows/test-old-typescript.yml | 34 ++--------------------- package.json | 23 +++++++++------ tests/async.test.tsx | 4 +-- tests/computed.test.tsx | 4 +-- tests/derive.test.tsx | 4 +-- yarn.lock | 18 ++---------- 6 files changed, 26 insertions(+), 61 deletions(-) diff --git a/.github/workflows/test-old-typescript.yml b/.github/workflows/test-old-typescript.yml index e0c74602..1ff61868 100644 --- a/.github/workflows/test-old-typescript.yml +++ b/.github/workflows/test-old-typescript.yml @@ -13,6 +13,7 @@ jobs: fail-fast: false matrix: typescript: + - 5.2.2 - 5.1.6 - 5.0.4 - 4.9.5 @@ -20,14 +21,6 @@ jobs: - 4.7.4 - 4.6.4 - 4.5.5 - - 4.4.4 - - 4.3.5 - - 4.2.3 - - 4.1.5 - - 4.0.5 - - 3.9.7 - - 3.8.3 - - 3.7.5 steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 @@ -40,35 +33,14 @@ jobs: - name: Patch for Old TS run: | sed -i~ 's/\/\/ @ts-expect-error.*\[LATEST-TS-ONLY\]//' tests/*.tsx - sed -i~ 's/"target":/"skipLibCheck":true,"target":/' tsconfig.json - sed -i~ 's/"exactOptionalPropertyTypes": true,//' tsconfig.json sed -i~ 's/"moduleResolution": "bundler",/"moduleResolution": "node",/' tsconfig.json sed -i~ 's/"allowImportingTsExtensions": true,//' tsconfig.json - sed -i~ 's/"valtio": \["\.\/src\/index\.ts"\],/"valtio": [".\/dist\/ts3.4\/index.d.ts"],/' tsconfig.json - sed -i~ 's/"valtio\/\*": \["\.\/src\/\*\.ts"\]/"valtio\/*": [".\/dist\/ts3.4\/*.d.ts"]/' tsconfig.json + sed -i~ 's/"valtio": \["\.\/src\/index\.ts"\],/"valtio": [".\/dist\/index.d.ts"],/' tsconfig.json + sed -i~ 's/"valtio\/\*": \["\.\/src\/\*\.ts"\]/"valtio\/*": [".\/dist\/*.d.ts"]/' tsconfig.json sed -i~ 's/"include": .*/"include": ["src\/types.d.ts", "dist\/**\/*", "tests\/**\/*"],/' tsconfig.json - - name: Patch for Older TS - if: ${{ matrix.typescript == '4.2.3' || matrix.typescript == '4.1.5' || matrix.typescript == '4.0.5' || startsWith(matrix.typescript, '3.') }} - run: | - sed -i~ 's/import\.meta\.env/(import.meta.env as any)/' tests/*.tsx - sed -i~ '1s/^/import React from "react";/' tests/*.tsx - sed -i~ 's/"jsx": "react-jsx"/"jsx": "react"/' tsconfig.json - sed -i~ 's/"noUncheckedIndexedAccess": true,//' tsconfig.json - yarn json -I -f package.json -e "this.resolutions={}; this.resolutions['pretty-format']='25.5.0'; this.resolutions['@types/prettier']='2.4.2'; this.resolutions['@types/yargs']='17.0.13'; this.resolutions['@types/node']='18.11.18';" - yarn add -D pretty-format@25.5.0 @types/prettier@2.4.2 @types/yargs@17.0.13 @types/node@18.11.18 @types/babel__traverse@7.18.2 - rm -r tests/macro-vite.* - name: Install old TypeScript run: | yarn add -D typescript@${{ matrix.typescript }} - rm node_modules/parse5/dist/*.d.ts - - name: Patch testing setup for older TS - if: ${{ matrix.typescript == '4.0.5' || startsWith(matrix.typescript, '3.') }} - run: | - yarn add -D @testing-library/user-event@12.1.7 @testing-library/react@11.0.4 - rm node_modules/vitest/dist/*.d.ts - rm node_modules/parse5/dist/*.d.ts - echo "declare module 'vitest'" >> ./src/types.d.ts - name: Test ${{ matrix.typescript }} run: | - rm -r node_modules/@types/babel__core/node_modules yarn tsc --noEmit diff --git a/package.json b/package.json index 443c9676..291ed859 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,20 @@ "main": "./index.js", "types": "./index.d.ts", "typesVersions": { - "<4.5": { + ">=4.5": { "esm/*": [ - "ts3.4/*" + "esm/*" ], "*": [ - "ts3.4/*" + "*" + ] + }, + "*": { + "esm/*": [ + "ts_version_4.5_and_above_is_required.d.ts" + ], + "*": [ + "ts_version_4.5_and_above_is_required.d.ts" ] } }, @@ -65,7 +73,7 @@ "build:react_utils": "rollup -c --config-react_utils", "build:macro": "rollup -c --config-macro", "build:macro_vite": "rollup -c --config-macro_vite", - "postbuild": "yarn patch-d-ts && yarn copy && yarn patch-macro-vite && yarn patch-ts3.4 && yarn patch-esm-ts", + "postbuild": "yarn patch-d-ts && yarn copy && yarn patch-macro-vite && yarn patch-old-ts && yarn patch-esm-ts", "prettier": "prettier '*.{js,json,md}' '{src,tests,docs}/**/*.{ts,tsx,md,mdx}' --write", "prettier:ci": "prettier '*.{js,json,md}' '{src,tests,docs}/**/*.{ts,tsx,md,mdx}' --list-different", "eslint": "eslint --no-eslintrc --c .eslintrc.json --fix '*.{js,json,ts}' '{src,tests}/**/*.{ts,tsx}'", @@ -74,9 +82,9 @@ "test": "vitest --ui --coverage", "test:ci": "vitest", "patch-d-ts": "node -e \"var {entries}=require('./rollup.config.js');require('shelljs').find('dist/**/*.d.ts').forEach(f=>{entries.forEach(({find,replacement})=>require('shelljs').sed('-i',new RegExp(' from \\''+find.source.slice(0,-1)+'\\';$'),' from \\''+replacement+'\\';',f));require('shelljs').sed('-i',/ from '(\\.[^']+)\\.ts';$/,' from \\'\\$1\\';',f)})\"", - "copy": "shx cp -r dist/src/* dist/esm && shx cp -r dist/src/* dist && shx rm -rf dist/{src,tests} && downlevel-dts dist dist/ts3.4 && shx cp package.json readme.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.prettier=undefined;\"", - "patch-macro-vite": "shx cp dist/esm/macro/vite.d.ts dist/macro/ && shx cp dist/ts3.4/esm/macro/vite.d.ts dist/ts3.4/macro/", - "patch-ts3.4": "node -e \"require('shelljs').find('dist/ts3.4/**/*.d.ts').forEach(f=>{require('fs').appendFileSync(f,'declare type Awaited = T extends Promise ? V : T;');require('shelljs').sed('-i',/^declare type Snapshot =/,'declare type Snapshot = T extends SnapshotIgnore ? T : T extends Promise ? Awaited : T extends object ? { readonly [K in keyof T]: Snapshot2 } : T; declare type Snapshot2 = T extends SnapshotIgnore ? T : T extends Promise ? Awaited : T extends object ? { readonly [K in keyof T]: T[K] } : T;;declare type _Snapshot =',f)})\"", + "copy": "shx cp -r dist/src/* dist/esm && shx cp -r dist/src/* dist && shx rm -rf dist/{src,tests} && shx cp package.json readme.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.prettier=undefined;\"", + "patch-macro-vite": "shx cp dist/esm/macro/vite.d.ts dist/macro/", + "patch-old-ts": "shx touch dist/ts_version_4.5_and_above_is_required.d.ts", "patch-esm-ts": "node -e \"require('shelljs').find('dist/esm/**/*.d.ts').forEach(f=>{var f2=f.replace(/\\.ts$/,'.mts');require('fs').copyFileSync(f,f2);require('shelljs').sed('-i',/ from '(\\.[^']+)';$/,' from \\'\\$1.mjs\\';',f2);require('shelljs').sed('-i',/^declare module '(\\.[^']+)'/,'declare module \\'\\$1.mjs\\'',f2)})\"" }, "engines": { @@ -143,7 +151,6 @@ "babel-plugin-macros": "^3.1.0", "babel-plugin-tester": "10.1.0", "concurrently": "^8.2.2", - "downlevel-dts": "^0.11.0", "esbuild": "^0.19.5", "eslint": "^8.52.0", "eslint-config-prettier": "^9.0.0", diff --git a/tests/async.test.tsx b/tests/async.test.tsx index 0c101d61..b7c39e07 100644 --- a/tests/async.test.tsx +++ b/tests/async.test.tsx @@ -10,8 +10,8 @@ const sleep = (ms: number) => setTimeout(resolve, ms) }) -const { use } = ReactExports as any // for TS < 4.3 FIXME later -const use2 = (x: any) => (x instanceof Promise ? use(x) : x) +const { use } = ReactExports +const use2 = (x: T): Awaited => (x instanceof Promise ? use(x) : x) it.skipIf(typeof use === 'undefined')('delayed increment', async () => { const state = proxy({ count: 0 }) diff --git a/tests/computed.test.tsx b/tests/computed.test.tsx index 2644dffa..7eed717d 100644 --- a/tests/computed.test.tsx +++ b/tests/computed.test.tsx @@ -7,8 +7,8 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { proxy, snapshot, subscribe, useSnapshot } from 'valtio' import { addComputed, proxyWithComputed, subscribeKey } from 'valtio/utils' -const { use } = ReactExports as any // for TS < 4.3 FIXME later -const use2 = (x: any) => (x instanceof Promise ? use(x) : x) +const { use } = ReactExports +const use2 = (x: T): Awaited => (x instanceof Promise ? use(x) : x) const consoleWarn = console.warn beforeEach(() => { diff --git a/tests/derive.test.tsx b/tests/derive.test.tsx index ea0f9d74..0ec5b054 100644 --- a/tests/derive.test.tsx +++ b/tests/derive.test.tsx @@ -13,8 +13,8 @@ const sleep = (ms: number) => setTimeout(resolve, ms) }) -const { use } = ReactExports as any // for TS < 4.3 FIXME later -const use2 = (x: any) => (x instanceof Promise ? use(x) : x) +const { use } = ReactExports +const use2 = (x: T): Awaited => (x instanceof Promise ? use(x) : x) it('basic derive', async () => { const computeDouble = vi.fn((x: number) => x * 2) diff --git a/yarn.lock b/yarn.lock index a4a7addd..1126ecf6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2508,15 +2508,6 @@ domexception@^4.0.0: dependencies: webidl-conversions "^7.0.0" -downlevel-dts@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/downlevel-dts/-/downlevel-dts-0.11.0.tgz#514a2d723009c5845730c1db6c994484c596ed9c" - integrity sha512-vo835pntK7kzYStk7xUHDifiYJvXxVhUapt85uk2AI94gUUAQX9HNRtrcMHNSc3YHJUEHGbYIGsM99uIbgAtxw== - dependencies: - semver "^7.3.2" - shelljs "^0.8.3" - typescript next - electron-to-chromium@^1.4.535: version "1.4.575" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.575.tgz#7c0b87eb2c6214a993699792abd704de41255c39" @@ -4534,7 +4525,7 @@ semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.3.2, semver@^7.5.3, semver@^7.5.4: +semver@^7.5.3, semver@^7.5.4: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== @@ -4584,7 +4575,7 @@ shell-quote@^1.8.1: resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680" integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA== -shelljs@^0.8.3, shelljs@^0.8.5: +shelljs@^0.8.5: version "0.8.5" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c" integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow== @@ -4984,11 +4975,6 @@ typescript@^5.2.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w== -typescript@next: - version "5.3.0-dev.20231102" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.0-dev.20231102.tgz#2baa0540e57ce8a4fbf283b17c194b6ea2ffc412" - integrity sha512-M1maLdHyAvE+y4w27IBplkqekR5Lzf2B7XualvF3lXJUC2165swvSmpThFdfHcXxP/+/SYmLI9z2CVvN7pEK+g== - ufo@^1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.3.1.tgz#e085842f4627c41d4c1b60ebea1f75cdab4ce86b" From 3aabd0ca51567240b2dced82191765c5f968aa93 Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Mon, 13 Nov 2023 21:20:55 +0900 Subject: [PATCH 05/35] [v2] breaking: drop "module" condition (#818) --- package.json | 10 +--------- rollup.config.js | 1 - 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/package.json b/package.json index 291ed859..58f1a92c 100644 --- a/package.json +++ b/package.json @@ -33,10 +33,6 @@ "types": "./esm/index.d.mts", "default": "./esm/index.mjs" }, - "module": { - "types": "./esm/index.d.ts", - "default": "./esm/index.js" - }, "default": { "types": "./index.d.ts", "default": "./index.js" @@ -47,10 +43,6 @@ "types": "./esm/*.d.mts", "default": "./esm/*.mjs" }, - "module": { - "types": "./esm/*.d.ts", - "default": "./esm/*.js" - }, "default": { "types": "./*.d.ts", "default": "./*.js" @@ -85,7 +77,7 @@ "copy": "shx cp -r dist/src/* dist/esm && shx cp -r dist/src/* dist && shx rm -rf dist/{src,tests} && shx cp package.json readme.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.prettier=undefined;\"", "patch-macro-vite": "shx cp dist/esm/macro/vite.d.ts dist/macro/", "patch-old-ts": "shx touch dist/ts_version_4.5_and_above_is_required.d.ts", - "patch-esm-ts": "node -e \"require('shelljs').find('dist/esm/**/*.d.ts').forEach(f=>{var f2=f.replace(/\\.ts$/,'.mts');require('fs').copyFileSync(f,f2);require('shelljs').sed('-i',/ from '(\\.[^']+)';$/,' from \\'\\$1.mjs\\';',f2);require('shelljs').sed('-i',/^declare module '(\\.[^']+)'/,'declare module \\'\\$1.mjs\\'',f2)})\"" + "patch-esm-ts": "node -e \"require('shelljs').find('dist/esm/**/*.d.ts').forEach(f=>{var f2=f.replace(/\\.ts$/,'.mts');require('fs').renameSync(f,f2);require('shelljs').sed('-i',/ from '(\\.[^']+)';$/,' from \\'\\$1.mjs\\';',f2);require('shelljs').sed('-i',/^declare module '(\\.[^']+)'/,'declare module \\'\\$1.mjs\\'',f2)})\"" }, "engines": { "node": ">=12.20.0" diff --git a/rollup.config.js b/rollup.config.js index d6837b82..12e5e5c5 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -168,7 +168,6 @@ module.exports = function (args) { return [ ...(c === 'index' ? [createDeclarationConfig(`src/${c}.ts`, 'dist')] : []), createCommonJSConfig(`src/${c}.ts`, `dist/${c}`), - createESMConfig(`src/${c}.ts`, `dist/esm/${c}.js`), createESMConfig(`src/${c}.ts`, `dist/esm/${c}.mjs`), createUMDConfig(`src/${c}.ts`, `dist/umd/${c}`, 'development'), createUMDConfig(`src/${c}.ts`, `dist/umd/${c}`, 'production'), From 204e073bc21f7b2fe1765a81589de53639b0b468 Mon Sep 17 00:00:00 2001 From: daishi Date: Mon, 13 Nov 2023 21:46:57 +0900 Subject: [PATCH 06/35] run prettier --- src/react.ts | 12 ++++++------ src/vanilla.ts | 12 ++++++------ tests/async.test.tsx | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/react.ts b/src/react.ts index 7f529fb6..5f3fe1b7 100644 --- a/src/react.ts +++ b/src/react.ts @@ -17,7 +17,7 @@ const { useSyncExternalStore } = useSyncExternalStoreExports const useAffectedDebugValue = ( state: object, - affected: WeakMap + affected: WeakMap, ) => { const pathList = useRef<(string | number | symbol)[][]>() useEffect(() => { @@ -108,7 +108,7 @@ type Options = { */ export function useSnapshot( proxyObject: T, - options?: Options + options?: Options, ): Snapshot { const notifyInSync = options?.sync const lastSnapshot = useRef>() @@ -121,7 +121,7 @@ export function useSnapshot( callback() // Note: do we really need this? return unsub }, - [proxyObject, notifyInSync] + [proxyObject, notifyInSync], ), () => { const nextSnapshot = snapshot(proxyObject) @@ -134,7 +134,7 @@ export function useSnapshot( lastSnapshot.current, nextSnapshot, lastAffected.current, - new WeakMap() + new WeakMap(), ) ) { // not changed @@ -145,7 +145,7 @@ export function useSnapshot( } return nextSnapshot }, - () => snapshot(proxyObject) + () => snapshot(proxyObject), ) inRender = false const currAffected = new WeakMap() @@ -162,6 +162,6 @@ export function useSnapshot( currSnapshot, currAffected, proxyCache, - targetCache + targetCache, ) } diff --git a/src/vanilla.ts b/src/vanilla.ts index bff2b11f..2ff50cc9 100644 --- a/src/vanilla.ts +++ b/src/vanilla.ts @@ -82,7 +82,7 @@ const buildProxyFunction = ( createSnapshot: CreateSnapshot = ( target: T, - version: number + version: number, ): T => { const cache = snapCache.get(target) if (cache?.[0] === version) { @@ -101,7 +101,7 @@ const buildProxyFunction = ( const value = Reflect.get(target, key) const { enumerable } = Reflect.getOwnPropertyDescriptor( target, - key + key, ) as PropertyDescriptor const desc: PropertyDescriptor = { value, @@ -114,7 +114,7 @@ const buildProxyFunction = ( markToTrack(value as object, false) // mark not to track } else if (proxyStateMap.has(value as object)) { const [target, ensureVersion] = proxyStateMap.get( - value as object + value as object, ) as ProxyState desc.value = createSnapshot(target, ensureVersion()) as Snapshot } @@ -279,7 +279,7 @@ const buildProxyFunction = ( Reflect.ownKeys(baseObject).forEach((key) => { const desc = Object.getOwnPropertyDescriptor( baseObject, - key + key, ) as PropertyDescriptor if ('value' in desc && desc.writable) { proxyObject[key as keyof T] = baseObject[key as keyof T] @@ -287,7 +287,7 @@ const buildProxyFunction = ( }) initializing = false return proxyObject - } + }, ) => [ // public functions @@ -319,7 +319,7 @@ export function getVersion(proxyObject: unknown): number | undefined { export function subscribe( proxyObject: T, callback: (ops: Op[]) => void, - notifyInSync?: boolean + notifyInSync?: boolean, ): () => void { const proxyState = proxyStateMap.get(proxyObject as object) if (import.meta.env?.MODE !== 'production' && !proxyState) { diff --git a/tests/async.test.tsx b/tests/async.test.tsx index b7c39e07..47554f2c 100644 --- a/tests/async.test.tsx +++ b/tests/async.test.tsx @@ -35,7 +35,7 @@ it.skipIf(typeof use === 'undefined')('delayed increment', async () => { - + , ) await findByText('count: 0') @@ -66,7 +66,7 @@ it.skipIf(typeof use === 'undefined')('delayed object', async () => { - + , ) await findByText('text: none') @@ -84,7 +84,7 @@ it.skipIf(typeof use === 'undefined')( }) const updateObject = () => { state.object = state.object.then((v: any) => - sleep(300).then(() => ({ ...v, count: v.count + 1 })) + sleep(300).then(() => ({ ...v, count: v.count + 1 })), ) } @@ -104,7 +104,7 @@ it.skipIf(typeof use === 'undefined')( - + , ) await findByText('loading') @@ -120,7 +120,7 @@ it.skipIf(typeof use === 'undefined')( getByText('text: counter') getByText('count: 1') }) - } + }, ) it.skipIf(typeof use === 'undefined')('delayed falsy value', async () => { @@ -144,7 +144,7 @@ it.skipIf(typeof use === 'undefined')('delayed falsy value', async () => { - + , ) await findByText('value: true') From 615df9c847fc25ba8ddf123367868638bb2b606c Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Mon, 13 Nov 2023 22:08:38 +0900 Subject: [PATCH 07/35] [v2] breaking: require react 18 and drop use-sync-external-store (#819) * [v2] breaking: require react 18 and drop use-sync-external-store * drop tests pre react 18 * wip: cannot use react 17 for prd test * drop production test which is impossible * esm? * fix regex * fix sed --- .github/workflows/test-multiple-builds.yml | 12 ++++-------- .github/workflows/test-multiple-versions.yml | 3 --- package.json | 8 +++----- rollup.config.js | 2 -- src/react.ts | 17 ++++++++--------- yarn.lock | 10 ---------- 6 files changed, 15 insertions(+), 37 deletions(-) diff --git a/.github/workflows/test-multiple-builds.yml b/.github/workflows/test-multiple-builds.yml index ea5e80e8..404b1687 100644 --- a/.github/workflows/test-multiple-builds.yml +++ b/.github/workflows/test-multiple-builds.yml @@ -12,8 +12,8 @@ jobs: strategy: fail-fast: false matrix: - build: [cjs, umd] # [cjs, esm, umd, system] - env: [development, production] + build: [cjs, esm, umd] # [cjs, esm, umd, system] + env: [development] # [development, production] steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 @@ -23,10 +23,6 @@ jobs: - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - run: yarn install --frozen-lockfile --check-files - run: yarn build - - name: Use React 17 for production test - if: ${{ matrix.env == 'production' }} - run: | - yarn add -D react@17.0.2 react-dom@17.0.2 @testing-library/react@12.1.4 - name: Patch for DEV-ONLY if: ${{ matrix.env == 'development' }} run: | @@ -44,8 +40,8 @@ jobs: - name: Patch for ESM if: ${{ matrix.build == 'esm' }} run: | - sed -i~ "s/\/src\(.*\)\.ts/\/dist\/esm\1.js" package.json - sed -i~ "1s/^/import.meta.env=import.meta.env||{};import.meta.env.MODE='${NODE_ENV}';/" tests.ts tests/*.tsx + sed -i~ "s/\/src\(.*\)\.ts/\/dist\/esm\1.js/" package.json + sed -i~ "1s/^/import.meta.env=import.meta.env||{};import.meta.env.MODE='${NODE_ENV}';/" tests/*.ts tests/*.tsx env: NODE_ENV: ${{ matrix.env }} - name: Patch for UMD diff --git a/.github/workflows/test-multiple-versions.yml b/.github/workflows/test-multiple-versions.yml index 70b471fb..6881207d 100644 --- a/.github/workflows/test-multiple-versions.yml +++ b/.github/workflows/test-multiple-versions.yml @@ -27,9 +27,6 @@ jobs: fail-fast: false matrix: react: - - 16.8.0 - - 16.9.0 - - 17.0.0 - 18.0.0 - 18.1.0 - 18.2.0 diff --git a/package.json b/package.json index b5accad7..b93283d0 100644 --- a/package.json +++ b/package.json @@ -108,8 +108,7 @@ "homepage": "https://github.com/pmndrs/valtio", "dependencies": { "proxy-compare": "2.5.1", - "derive-valtio": "0.1.0", - "use-sync-external-store": "1.2.0" + "derive-valtio": "0.1.0" }, "devDependencies": { "@babel/core": "^7.23.2", @@ -130,7 +129,6 @@ "@types/jsdom": "^21.1.4", "@types/react": "^18.2.34", "@types/react-dom": "^18.2.14", - "@types/use-sync-external-store": "^0.0.5", "@typescript-eslint/eslint-plugin": "^6.9.1", "@typescript-eslint/parser": "^6.9.1", "@vitest/coverage-v8": "0.33.0", @@ -166,8 +164,8 @@ "vitest": "0.33.0" }, "peerDependencies": { - "@types/react": ">=16.8", - "react": ">=16.8" + "@types/react": ">=18.0", + "react": ">=18.0" }, "peerDependenciesMeta": { "@types/react": { diff --git a/rollup.config.js b/rollup.config.js index 12e5e5c5..9d12aee4 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -72,8 +72,6 @@ function createESMConfig(input, output) { 'import.meta.env?.MODE': '(import.meta.env ? import.meta.env.MODE : undefined)', }), - // a workround for #410 - 'use-sync-external-store/shim': 'use-sync-external-store/shim/index.js', delimiters: ['\\b', '\\b(?!(\\.|/))'], preventAssignment: true, }), diff --git a/src/react.ts b/src/react.ts index 5f3fe1b7..cb5a83f3 100644 --- a/src/react.ts +++ b/src/react.ts @@ -1,20 +1,19 @@ -import { useCallback, useDebugValue, useEffect, useMemo, useRef } from 'react' +import { + useCallback, + useDebugValue, + useEffect, + useMemo, + useRef, + useSyncExternalStore, +} from 'react' import { affectedToPathList, createProxy as createProxyToCompare, isChanged, } from 'proxy-compare' -// import { useSyncExternalStore } from 'use-sync-external-store/shim' -// This doesn't work in ESM, because use-sync-external-store only exposes CJS. -// See: https://github.com/pmndrs/valtio/issues/452 -// The following is a workaround until ESM is supported. -// eslint-disable-next-line import/extensions -import useSyncExternalStoreExports from 'use-sync-external-store/shim' import { snapshot, subscribe } from './vanilla.ts' import type { INTERNAL_Snapshot as Snapshot } from './vanilla.ts' -const { useSyncExternalStore } = useSyncExternalStoreExports - const useAffectedDebugValue = ( state: object, affected: WeakMap, diff --git a/yarn.lock b/yarn.lock index 1126ecf6..8c99ae3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1691,11 +1691,6 @@ resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.4.tgz#cf2f0c7c51b985b6afecea73eb2cd65421ecb717" integrity sha512-95Sfz4nvMAb0Nl9DTxN3j64adfwfbBPEYq14VN7zT5J5O2M9V6iZMIIQU1U+pJyl9agHYHNCqhCXgyEtIRRa5A== -"@types/use-sync-external-store@^0.0.5": - version "0.0.5" - resolved "https://registry.yarnpkg.com/@types/use-sync-external-store/-/use-sync-external-store-0.0.5.tgz#a4416edea87d78115c8339f668775c5ba102653d" - integrity sha512-+fHc7rdrgMIng29ISUqNjsbPl1EMo1PCDh/+16HNlTOJeQzs6c9Om23rVizETd3dDx4YM+aWGbyF/KP4FUwZyg== - "@typescript-eslint/eslint-plugin@^6.9.1": version "6.9.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.9.1.tgz#d8ce497dc0ed42066e195c8ecc40d45c7b1254f4" @@ -5051,11 +5046,6 @@ url-parse@^1.5.3: querystringify "^2.1.1" requires-port "^1.0.0" -use-sync-external-store@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" - integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== - v8-to-istanbul@^9.1.0: version "9.1.3" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz#ea456604101cd18005ac2cae3cdd1aa058a6306b" From 580dcde0f5e94dfd2255d713395fe032a3468f91 Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Tue, 14 Nov 2023 13:44:46 +0900 Subject: [PATCH 08/35] [v2] breaking: remove deprecated features (#820) * remove depreacated useProxy macro * revert plugin-transform * remove two more babel packages * revert babel core * remove proxyWithComputed * remove addComputed * remove devtools deprecated option --- package.json | 11 +- src/macro.ts | 50 --- src/macro/vite.ts | 73 ----- src/vanilla/utils.ts | 2 - src/vanilla/utils/addComputed.ts | 27 -- src/vanilla/utils/devtools.ts | 23 +- src/vanilla/utils/proxyWithComputed.ts | 48 --- tests/__snapshots__/macro-vite.test.ts.snap | 34 -- tests/__snapshots__/macro.test.ts.snap | 71 ---- tests/computed.test.tsx | 327 ------------------ tests/macro-vite.test.ts | 65 ---- tests/macro.test.ts | 54 --- yarn.lock | 346 ++++---------------- 13 files changed, 68 insertions(+), 1063 deletions(-) delete mode 100644 src/macro.ts delete mode 100644 src/macro/vite.ts delete mode 100644 src/vanilla/utils/addComputed.ts delete mode 100644 src/vanilla/utils/proxyWithComputed.ts delete mode 100644 tests/__snapshots__/macro-vite.test.ts.snap delete mode 100644 tests/__snapshots__/macro.test.ts.snap delete mode 100644 tests/computed.test.tsx delete mode 100644 tests/macro-vite.test.ts delete mode 100644 tests/macro.test.ts diff --git a/package.json b/package.json index b93283d0..24373260 100644 --- a/package.json +++ b/package.json @@ -63,9 +63,7 @@ "build:vanilla_utils": "rollup -c --config-vanilla_utils", "build:react": "rollup -c --config-react", "build:react_utils": "rollup -c --config-react_utils", - "build:macro": "rollup -c --config-macro", - "build:macro_vite": "rollup -c --config-macro_vite", - "postbuild": "yarn patch-d-ts && yarn copy && yarn patch-macro-vite && yarn patch-old-ts && yarn patch-esm-ts", + "postbuild": "yarn patch-d-ts && yarn copy && yarn patch-old-ts && yarn patch-esm-ts", "prettier": "prettier '*.{js,json,md}' '{src,tests,docs}/**/*.{ts,tsx,md,mdx}' --write", "prettier:ci": "prettier '*.{js,json,md}' '{src,tests,docs}/**/*.{ts,tsx,md,mdx}' --list-different", "eslint": "eslint --no-eslintrc --c .eslintrc.json --fix '*.{js,json,ts}' '{src,tests}/**/*.{ts,tsx}'", @@ -75,7 +73,6 @@ "test:ci": "vitest", "patch-d-ts": "node -e \"var {entries}=require('./rollup.config.js');require('shelljs').find('dist/**/*.d.ts').forEach(f=>{entries.forEach(({find,replacement})=>require('shelljs').sed('-i',new RegExp(' from \\''+find.source.slice(0,-1)+'\\';$'),' from \\''+replacement+'\\';',f));require('shelljs').sed('-i',/ from '(\\.[^']+)\\.ts';$/,' from \\'\\$1\\';',f)})\"", "copy": "shx cp -r dist/src/* dist/esm && shx cp -r dist/src/* dist && shx rm -rf dist/{src,tests} && shx cp package.json readme.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.prettier=undefined;\"", - "patch-macro-vite": "shx cp dist/esm/macro/vite.d.ts dist/macro/", "patch-old-ts": "shx touch dist/ts_version_4.5_and_above_is_required.d.ts", "patch-esm-ts": "node -e \"require('shelljs').find('dist/esm/**/*.d.ts').forEach(f=>{var f2=f.replace(/\\.ts$/,'.mts');require('fs').renameSync(f,f2);require('shelljs').sed('-i',/ from '(\\.[^']+)';$/,' from \\'\\$1.mjs\\';',f2);require('shelljs').sed('-i',/^declare module '(\\.[^']+)'/,'declare module \\'\\$1.mjs\\'',f2)})\"" }, @@ -112,11 +109,9 @@ }, "devDependencies": { "@babel/core": "^7.23.2", - "@babel/helper-module-imports": "^7.22.15", "@babel/plugin-transform-react-jsx": "^7.22.15", "@babel/plugin-transform-typescript": "^7.22.15", "@babel/preset-env": "^7.23.2", - "@babel/types": "^7.23.0", "@redux-devtools/extension": "^3.2.5", "@rollup/plugin-alias": "^5.0.1", "@rollup/plugin-babel": "^6.0.4", @@ -125,7 +120,6 @@ "@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-typescript": "^11.1.5", "@testing-library/react": "^14.0.0", - "@types/babel-plugin-macros": "^3.1.2", "@types/jsdom": "^21.1.4", "@types/react": "^18.2.34", "@types/react-dom": "^18.2.14", @@ -133,9 +127,6 @@ "@typescript-eslint/parser": "^6.9.1", "@vitest/coverage-v8": "0.33.0", "@vitest/ui": "0.33.0", - "aslemammad-vite-plugin-macro": "^1.0.0", - "babel-plugin-macros": "^3.1.0", - "babel-plugin-tester": "10.1.0", "concurrently": "^8.2.2", "esbuild": "^0.19.5", "eslint": "^8.52.0", diff --git a/src/macro.ts b/src/macro.ts deleted file mode 100644 index f6801e60..00000000 --- a/src/macro.ts +++ /dev/null @@ -1,50 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore -import { addNamed } from '@babel/helper-module-imports' -import type { NodePath } from '@babel/traverse' -import * as t from '@babel/types' -import { MacroError, createMacro } from 'babel-plugin-macros' - -const macro = ({ references }: any) => { - if (import.meta.env?.MODE !== 'production') { - console.warn('[DEPRECATED] Use useProxy hook instead.') - } - references.useProxy?.forEach((path: NodePath) => { - const hook = addNamed(path, 'useSnapshot', 'valtio') - const proxy = (path.parentPath?.get('arguments.0') as any)?.node - if (!t.isIdentifier(proxy)) throw new MacroError('no proxy object') - const snap = t.identifier(`valtio_macro_snap_${proxy.name}`) - path.parentPath?.parentPath?.replaceWith( - t.variableDeclaration('const', [ - t.variableDeclarator(snap, t.callExpression(hook, [proxy])), - ]), - ) - let inFunction = 0 - path.parentPath?.getFunctionParent()?.traverse({ - Identifier(p) { - if ( - inFunction === 0 && // in render - p.node !== proxy && - p.node.name === proxy.name - ) { - p.node.name = snap.name - } - }, - Function: { - enter() { - ++inFunction - }, - exit() { - --inFunction - }, - }, - }) - }) -} - -/** - * @deprecated Use useProxy hook instead. - */ -export declare function useProxy(proxyObject: T): void - -export default createMacro(macro, { configName: 'valtio' }) diff --git a/src/macro/vite.ts b/src/macro/vite.ts deleted file mode 100644 index d24bc5d4..00000000 --- a/src/macro/vite.ts +++ /dev/null @@ -1,73 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore -import * as babelModuleImports from '@babel/helper-module-imports' -import * as t from '@babel/types' -import * as plugin from 'aslemammad-vite-plugin-macro' -import * as babelMacro from 'babel-plugin-macros' - -const { defineMacro, defineMacroProvider, createMacroPlugin } = - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - ('default' in plugin ? plugin.default : plugin) as typeof plugin - -// const {} = plugin.default as typeof import('aslemammad-vite-plugin-macro') -export const valtioMacro = defineMacro(`useProxy`) - .withSignature(`(proxyObject: T): void`) - .withHandler((ctx) => { - const { path, args } = ctx - const hook = babelModuleImports.addNamed(path, 'useSnapshot', 'valtio') - const proxy = args[0]?.node - - if (!t.isIdentifier(proxy)) { - throw new babelMacro.MacroError('no proxy object') - } - - const snap = t.identifier(`valtio_macro_snap_${proxy.name}`) - path.parentPath?.replaceWith( - t.variableDeclaration('const', [ - t.variableDeclarator(snap, t.callExpression(hook, [proxy])), - ]), - ) - - let inFunction = 0 - path.parentPath?.getFunctionParent()?.traverse({ - Identifier(p) { - if ( - inFunction === 0 && // in render - p.node !== proxy && - p.node.name === proxy.name - ) { - p.node.name = snap.name - } - }, - Function: { - enter() { - ++inFunction - }, - exit() { - --inFunction - }, - }, - }) - }) - -export function provideValtioMacro() { - if (import.meta.env?.MODE !== 'production') { - console.warn('[DEPRECATED] Use useProxy hook instead.') - } - return defineMacroProvider({ - id: 'valtio/macro', - exports: { - 'valtio/macro': { - macros: [valtioMacro], - }, - }, - }) -} - -/** - * @deprecated Use useProxy hook instead. - */ -const macroPlugin = createMacroPlugin({}).use(provideValtioMacro()) - -export default macroPlugin diff --git a/src/vanilla/utils.ts b/src/vanilla/utils.ts index 5063b8ba..7c2c59b2 100644 --- a/src/vanilla/utils.ts +++ b/src/vanilla/utils.ts @@ -2,8 +2,6 @@ export { subscribeKey } from './utils/subscribeKey.ts' export { watch } from './utils/watch.ts' export { devtools } from './utils/devtools.ts' export { derive, underive, unstable_deriveSubscriptions } from 'derive-valtio' -export { addComputed_DEPRECATED as addComputed } from './utils/addComputed.ts' -export { proxyWithComputed_DEPRECATED as proxyWithComputed } from './utils/proxyWithComputed.ts' export { deepClone } from './utils/deepClone.ts' export { proxyWithHistory } from './utils/proxyWithHistory.ts' export { proxySet } from './utils/proxySet.ts' diff --git a/src/vanilla/utils/addComputed.ts b/src/vanilla/utils/addComputed.ts deleted file mode 100644 index 5cb5cad5..00000000 --- a/src/vanilla/utils/addComputed.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { derive } from 'derive-valtio' - -/** - * addComputed (DEPRECATED) - * - * @deprecated Please consider using `derive` or `proxyWithComputed` instead. - */ -export function addComputed_DEPRECATED( - proxyObject: T, - computedFns_FAKE: { - [K in keyof U]: (snap_FAKE: T) => U[K] - }, - targetObject: any = proxyObject, -) { - if (import.meta.env?.MODE !== 'production') { - console.warn( - 'addComputed is deprecated. Please consider using `derive`. Falling back to emulation with derive. https://github.com/pmndrs/valtio/pull/201', - ) - } - const derivedFns: { - [K in keyof U]: (get: any) => U[K] - } = {} as any - ;(Object.keys(computedFns_FAKE) as (keyof U)[]).forEach((key) => { - derivedFns[key] = (get) => computedFns_FAKE[key](get(proxyObject)) - }) - return derive(derivedFns, { proxy: targetObject }) -} diff --git a/src/vanilla/utils/devtools.ts b/src/vanilla/utils/devtools.ts index 026c8bdb..6eaf6f3c 100644 --- a/src/vanilla/utils/devtools.ts +++ b/src/vanilla/utils/devtools.ts @@ -21,19 +21,6 @@ type Options = { name?: string } & Config -export function devtools( - proxyObject: T, - options?: Options, -): (() => void) | undefined - -/** - * @deprecated Please use { name } option - */ -export function devtools( - proxyObject: T, - name?: string, -): (() => void) | undefined - /** * devtools * @@ -47,14 +34,8 @@ export function devtools( */ export function devtools( proxyObject: T, - options?: Options | string, -) { - if (typeof options === 'string') { - console.warn( - 'string name option is deprecated, use { name }. https://github.com/pmndrs/valtio/pull/400', - ) - options = { name: options } - } + options?: Options, +): (() => void) | undefined { const { enabled, name = '', ...rest } = options || {} let extension: (typeof window)['__REDUX_DEVTOOLS_EXTENSION__'] | false diff --git a/src/vanilla/utils/proxyWithComputed.ts b/src/vanilla/utils/proxyWithComputed.ts deleted file mode 100644 index a1f41dd4..00000000 --- a/src/vanilla/utils/proxyWithComputed.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { proxy, snapshot } from '../../vanilla.ts' -import type { INTERNAL_Snapshot as Snapshot } from '../../vanilla.ts' - -/** - * proxyWithComputed (DEPRECATED) - * - * @deprecated Please follow "Computed Properties" guide in docs. - */ -export function proxyWithComputed_DEPRECATED< - T extends object, - U extends object, ->( - initialObject: T, - computedFns: { - [K in keyof U]: - | ((snap: Snapshot) => U[K]) - | { - get: (snap: Snapshot) => U[K] - set?: (state: T, newValue: U[K]) => void - } - }, -) { - if (import.meta.env?.MODE !== 'production') { - console.warn( - 'proxyWithComputed is deprecated. Please follow "Computed Properties" guide in docs.', - ) - } - ;(Object.keys(computedFns) as (keyof U)[]).forEach((key) => { - if (Object.getOwnPropertyDescriptor(initialObject, key)) { - throw new Error('object property already defined') - } - const computedFn = computedFns[key] - const { get, set } = ( - typeof computedFn === 'function' ? { get: computedFn } : computedFn - ) as { - get: (snap: Snapshot) => U[typeof key] - set?: (state: T, newValue: U[typeof key]) => void - } - const desc: PropertyDescriptor = {} - desc.get = () => get(snapshot(proxyObject)) - if (set) { - desc.set = (newValue) => set(proxyObject, newValue) - } - Object.defineProperty(initialObject, key, desc) - }) - const proxyObject = proxy(initialObject) as T & U - return proxyObject -} diff --git a/tests/__snapshots__/macro-vite.test.ts.snap b/tests/__snapshots__/macro-vite.test.ts.snap deleted file mode 100644 index ab9d8265..00000000 --- a/tests/__snapshots__/macro-vite.test.ts.snap +++ /dev/null @@ -1,34 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`basic 1`] = ` -"import { useSnapshot as _useSnapshot } from \\"valtio\\"; - - -const Component = () => {const valtio_macro_snap_state = _useSnapshot( - state); - return ( -
- {valtio_macro_snap_state.count} - -
); - -};" -`; - -exports[`complex 1`] = ` -"import { useSnapshot as _useSnapshot } from \\"valtio\\"; - - -const Component = () => {const valtio_macro_snap_state = _useSnapshot( - state); - return ( -
- - {valtio_macro_snap_state.count} -
); - -};" -`; diff --git a/tests/__snapshots__/macro.test.ts.snap b/tests/__snapshots__/macro.test.ts.snap deleted file mode 100644 index 3ea4fd2a..00000000 --- a/tests/__snapshots__/macro.test.ts.snap +++ /dev/null @@ -1,71 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`valtio/macro > 1. valtio/macro > 1. valtio/macro 1`] = ` -" -import { useProxy } from '../dist/macro' - -const Component = () => { - useProxy(state) - return ( -
- {state.count} - -
- ) -} - - ↓ ↓ ↓ ↓ ↓ ↓ - -import { useSnapshot as _useSnapshot } from 'valtio' -const Component = () => { - const valtio_macro_snap_state = _useSnapshot(state) - return ( -
- {valtio_macro_snap_state.count} - -
- ) -} - -" -`; - -exports[`valtio/macro > 2. valtio/macro > 2. valtio/macro 1`] = ` -" -import { useProxy } from '../dist/macro' - -const Component = () => { - useProxy(state) - return ( -
- - {state.count} -
- ) -} - - ↓ ↓ ↓ ↓ ↓ ↓ - -import { useSnapshot as _useSnapshot } from 'valtio' -const Component = () => { - const valtio_macro_snap_state = _useSnapshot(state) - return ( -
- - {valtio_macro_snap_state.count} -
- ) -} - -" -`; diff --git a/tests/computed.test.tsx b/tests/computed.test.tsx deleted file mode 100644 index e223b7e9..00000000 --- a/tests/computed.test.tsx +++ /dev/null @@ -1,327 +0,0 @@ -/// - -import ReactExports, { StrictMode, Suspense } from 'react' -import { fireEvent, render } from '@testing-library/react' -import { memoize } from 'proxy-memoize' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { proxy, snapshot, subscribe, useSnapshot } from 'valtio' -import { addComputed, proxyWithComputed, subscribeKey } from 'valtio/utils' - -const { use } = ReactExports -const use2 = (x: T): Awaited => (x instanceof Promise ? use(x) : x) - -const consoleWarn = console.warn -beforeEach(() => { - console.warn = vi.fn((message: string) => { - if (message.startsWith('addComputed is deprecated.')) { - return - } - consoleWarn(message) - }) -}) -afterEach(() => { - console.warn = consoleWarn -}) - -const sleep = (ms: number) => - new Promise((resolve) => { - setTimeout(resolve, ms) - }) - -describe('proxyWithComputed', () => { - it('simple computed getters', async () => { - const computeDouble = vi.fn((x: number) => x * 2) - const state = proxyWithComputed( - { - text: '', - count: 0, - }, - { - doubled: { get: memoize((snap) => computeDouble(snap.count)) }, - }, - ) - - const callback = vi.fn() - subscribe(state, callback) - - expect(snapshot(state)).toMatchObject({ text: '', count: 0, doubled: 0 }) - expect(computeDouble).toBeCalledTimes(1) - expect(callback).toBeCalledTimes(0) - - state.count += 1 - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: '', count: 1, doubled: 2 }) - expect(computeDouble).toBeCalledTimes(2) - expect(callback).toBeCalledTimes(1) - - state.text = 'a' - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: 'a', count: 1, doubled: 2 }) - expect(computeDouble).toBeCalledTimes(2) - expect(callback).toBeCalledTimes(2) - }) - - it('computed getters and setters', async () => { - const computeDouble = vi.fn((x: number) => x * 2) - const state = proxyWithComputed( - { - text: '', - count: 0, - }, - { - doubled: { - get: memoize((snap) => computeDouble(snap.count)), - set: (state, newValue: number) => { - state.count = newValue / 2 - }, - }, - }, - ) - - expect(snapshot(state)).toMatchObject({ text: '', count: 0, doubled: 0 }) - expect(computeDouble).toBeCalledTimes(1) - - state.count += 1 - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: '', count: 1, doubled: 2 }) - expect(computeDouble).toBeCalledTimes(2) - - state.doubled = 1 - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: '', count: 0.5, doubled: 1 }) - expect(computeDouble).toBeCalledTimes(3) - - state.text = 'a' - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: 'a', count: 0.5, doubled: 1 }) - expect(computeDouble).toBeCalledTimes(3) - }) - - it('computed setters with object and array', async () => { - const state = proxyWithComputed( - { - obj: { a: 1 }, - arr: [2], - }, - { - object: { - get: memoize((snap) => snap.obj), - set: (state, newValue: any) => { - state.obj = newValue - }, - }, - array: { - get: (snap) => snap.arr, - set: (state, newValue: any) => { - state.arr = newValue - }, - }, - }, - ) - - expect(snapshot(state)).toMatchObject({ - obj: { a: 1 }, - arr: [2], - object: { a: 1 }, - array: [2], - }) - - state.object = { a: 2 } - state.array = [3] - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ - obj: { a: 2 }, - arr: [3], - object: { a: 2 }, - array: [3], - }) - }) - - it('render computed getter with condition (#435)', async () => { - const state = proxyWithComputed( - { - texts: [] as string[], - filter: '', - }, - { - filtered: memoize((snap) => { - if (!snap.filter) return snap.texts - return snap.texts.filter((text) => !text.includes(snap.filter)) - }), - }, - ) - - const Component = () => { - const snap = useSnapshot(state) - return ( - <> -
filtered: [{snap.filtered.join(',')}]
- - - ) - } - - const { getByText, findByText } = render( - - - , - ) - - await findByText('filtered: []') - - fireEvent.click(getByText('button')) - await findByText('filtered: [foo]') - }) -}) - -describe('DEPRECATED addComputed', () => { - it('simple addComputed', async () => { - const computeDouble = vi.fn((x: number) => x * 2) - const state = proxy({ - text: '', - count: 0, - }) - addComputed(state, { - doubled: (snap) => computeDouble(snap.count), - }) - - const callback = vi.fn() - subscribe(state, callback) - - expect(snapshot(state)).toMatchObject({ text: '', count: 0, doubled: 0 }) - expect(computeDouble).toBeCalledTimes(1) - expect(callback).toBeCalledTimes(0) - - state.count += 1 - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: '', count: 1, doubled: 2 }) - expect(computeDouble).toBeCalledTimes(2) - await Promise.resolve() - expect(callback).toBeCalledTimes(1) - - state.text = 'a' - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: 'a', count: 1, doubled: 2 }) - // This can't pass with derive emulation: expect(computeDouble).toBeCalledTimes(2) - expect(callback).toBeCalledTimes(2) - }) - - it.skipIf(typeof use === 'undefined')('async addComputed', async () => { - const state = proxy({ count: 0 }) - addComputed(state, { - delayedCount: async (snap) => { - await sleep(300) - return snap.count + 1 - }, - }) - - const Counter = () => { - const snap = useSnapshot( - state as { count: number; delayedCount: Promise }, - ) - return ( - <> -
- count: {snap.count}, delayedCount: {use2(snap.delayedCount)} -
- - - ) - } - - const { getByText, findByText } = render( - - - - - , - ) - - await findByText('loading') - await findByText('count: 0, delayedCount: 1') - - fireEvent.click(getByText('button')) - await findByText('loading') - await findByText('count: 1, delayedCount: 2') - }) - - it('nested emulation with addComputed', async () => { - const computeDouble = vi.fn((x: number) => x * 2) - const state = proxy({ text: '', math: { count: 0 } }) - addComputed( - state, - { - doubled: (snap) => computeDouble(snap.math.count), - }, - state.math, - ) - - const callback = vi.fn() - subscribe(state, callback) - - expect(snapshot(state)).toMatchObject({ - text: '', - math: { count: 0, doubled: 0 }, - }) - expect(computeDouble).toBeCalledTimes(1) - expect(callback).toBeCalledTimes(0) - - state.math.count += 1 - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ - text: '', - math: { count: 1, doubled: 2 }, - }) - expect(computeDouble).toBeCalledTimes(2) - await Promise.resolve() - expect(callback).toBeCalledTimes(1) - - state.text = 'a' - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ - text: 'a', - math: { count: 1, doubled: 2 }, - }) - // This can't pass with derive emulation: expect(computeDouble).toBeCalledTimes(2) - expect(callback).toBeCalledTimes(2) - }) - - it('addComputed with array.pop (#124)', async () => { - const state = proxy({ - arr: [{ n: 1 }, { n: 2 }, { n: 3 }], - }) - addComputed(state, { - nums: (snap) => snap.arr.map((item) => item.n), - }) - - expect(snapshot(state)).toMatchObject({ - arr: [{ n: 1 }, { n: 2 }, { n: 3 }], - nums: [1, 2, 3], - }) - - state.arr.pop() - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ - arr: [{ n: 1 }, { n: 2 }], - nums: [1, 2], - }) - }) -}) - -describe('proxyWithComputed and subscribeKey', () => { - it('should call subscribeKey subscription when computed value changes?', async () => { - const state = proxyWithComputed( - { - count: 1, - }, - { - doubled: (snap) => snap.count * 2, - }, - ) - const handler = vi.fn() - subscribeKey(state, 'doubled', handler) - state.count = 2 - await Promise.resolve() - expect(handler).toBeCalledTimes(1) - }) -}) diff --git a/tests/macro-vite.test.ts b/tests/macro-vite.test.ts deleted file mode 100644 index a89c97c3..00000000 --- a/tests/macro-vite.test.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { EnvContext } from '@typed-macro/core' -import { createTransformer } from '@typed-macro/runtime' -import { expect, it } from 'vitest' -import { valtioMacro } from 'valtio/macro/vite' - -const env: EnvContext = { - host: 'test', - packageManager: 'test', - projectPath: [''], - dev: true, - ssr: false, -} - -it('basic', async () => { - const transform = createTransformer({}) - transform.appendMacros('valtio/macro', [valtioMacro]) - - expect( - transform.transform( - ` -import { useProxy } from 'valtio/macro' - -const Component = () => { - useProxy(state) - return ( -
- {state.count} - -
- ) -} -`, - 'test.ts', - env, - ), - ).toMatchSnapshot() -}) - -it('complex', async () => { - const transform = createTransformer({}) - transform.appendMacros('valtio/macro', [valtioMacro]) - - expect( - transform.transform( - ` -import { useProxy } from 'valtio/macro' - -const Component = () => { - useProxy(state) - return ( -
- - {state.count} -
- ) -} -`, - 'test.ts', - env, - ), - ).toMatchSnapshot() -}) diff --git a/tests/macro.test.ts b/tests/macro.test.ts deleted file mode 100644 index 34ddbf4c..00000000 --- a/tests/macro.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -import plugin from 'babel-plugin-macros' -import BabelPluginTester from 'babel-plugin-tester' -import { describe, expect, it } from 'vitest' - -// @ts-ignore -globalThis.describe = describe -// @ts-ignore -globalThis.it = it -// @ts-ignore -globalThis.expect = expect - -const pluginTester = (BabelPluginTester as any).default || BabelPluginTester - -pluginTester({ - pluginName: 'valtio/macro', - plugin, - snapshot: true, - babelOptions: { - filename: './valtio/tests', - parserOpts: { plugins: ['jsx'] }, - }, - tests: [ - ` -import { useProxy } from '../dist/macro' - -const Component = () => { - useProxy(state) - return ( -
- {state.count} - -
- ) -} -`, - ` -import { useProxy } from '../dist/macro' - -const Component = () => { - useProxy(state) - return ( -
- - {state.count} -
- ) -} -`, - ], -}) diff --git a/yarn.lock b/yarn.lock index 8c99ae3c..425392e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15,7 +15,7 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.22.13": +"@babel/code-frame@^7.10.4", "@babel/code-frame@^7.22.13": version "7.22.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w== @@ -29,32 +29,32 @@ integrity sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ== "@babel/core@^7.23.2": - version "7.23.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.2.tgz#ed10df0d580fff67c5f3ee70fd22e2e4c90a9f94" - integrity sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.3.tgz#5ec09c8803b91f51cc887dedc2654a35852849c9" + integrity sha512-Jg+msLuNuCJDyBvFv5+OKOUjWMZgd85bKjbICd3zWrKAo+bJ49HJufi7CQE0q0uR8NGyO6xkCACScNqyjHSZew== dependencies: "@ampproject/remapping" "^2.2.0" "@babel/code-frame" "^7.22.13" - "@babel/generator" "^7.23.0" + "@babel/generator" "^7.23.3" "@babel/helper-compilation-targets" "^7.22.15" - "@babel/helper-module-transforms" "^7.23.0" + "@babel/helper-module-transforms" "^7.23.3" "@babel/helpers" "^7.23.2" - "@babel/parser" "^7.23.0" + "@babel/parser" "^7.23.3" "@babel/template" "^7.22.15" - "@babel/traverse" "^7.23.2" - "@babel/types" "^7.23.0" + "@babel/traverse" "^7.23.3" + "@babel/types" "^7.23.3" convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.15.8", "@babel/generator@^7.23.0": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.0.tgz#df5c386e2218be505b34837acbcb874d7a983420" - integrity sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g== +"@babel/generator@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.3.tgz#86e6e83d95903fbe7613f448613b8b319f330a8e" + integrity sha512-keeZWAV4LU3tW0qRi19HRpabC/ilM0HRBBzf9/k8FFiG4KVpiv0FIy4hHfLfFQZNhziCTPTmd59zoyv6DNISzg== dependencies: - "@babel/types" "^7.23.0" + "@babel/types" "^7.23.3" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" @@ -164,6 +164,17 @@ "@babel/helper-split-export-declaration" "^7.22.6" "@babel/helper-validator-identifier" "^7.22.20" +"@babel/helper-module-transforms@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" + integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== + dependencies: + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-module-imports" "^7.22.15" + "@babel/helper-simple-access" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/helper-validator-identifier" "^7.22.20" + "@babel/helper-optimise-call-expression@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" @@ -257,11 +268,16 @@ chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.15.8", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.0": +"@babel/parser@^7.22.15": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719" integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw== +"@babel/parser@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.3.tgz#0ce0be31a4ca4f1884b5786057cadcb6c3be58f9" + integrity sha512-uVsWNvlVsIninV2prNz/3lHCb+5CJ+e+IUBfbjToAHODtfGYLfCFuY4AU7TskI+dAKk+njsPiBjq1gKTvZOBaw== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.15": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.15.tgz#02dc8a03f613ed5fdc29fb2f728397c78146c962" @@ -347,9 +363,9 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918" - integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz#8f2e4f8a9b5f9aa16067e142c1ac9cd9f810f473" + integrity sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg== dependencies: "@babel/helper-plugin-utils" "^7.22.5" @@ -409,10 +425,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz#aac8d383b062c5072c647a31ef990c1d0af90272" - integrity sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ== +"@babel/plugin-syntax-typescript@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz#24f460c85dbbc983cd2b9c4994178bcc01df958f" + integrity sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" @@ -793,14 +809,14 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-transform-typescript@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.22.15.tgz#15adef906451d86349eb4b8764865c960eb54127" - integrity sha512-1uirS0TnijxvQLnlv5wQBwOX3E1wCFX7ITv+9pBV2wKEk4K+M5tqDaoNXnTH8tjEIYHLO98MwiTWO04Ggz4XuA== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.23.3.tgz#ce806e6cb485d468c48c4f717696719678ab0138" + integrity sha512-ogV0yWnq38CFwH20l2Afz0dfKuZBx9o/Y2Rmh5vuSS0YD1hswgEgTfyTzuSrT2q9btmHRSqYoSfwFUVaC1M1Jw== dependencies: "@babel/helper-annotate-as-pure" "^7.22.5" "@babel/helper-create-class-features-plugin" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-typescript" "^7.22.5" + "@babel/plugin-syntax-typescript" "^7.23.3" "@babel/plugin-transform-unicode-escapes@^7.22.10": version "7.22.10" @@ -940,7 +956,7 @@ dependencies: regenerator-runtime "^0.14.0" -"@babel/template@^7.15.4", "@babel/template@^7.22.15", "@babel/template@^7.22.5": +"@babel/template@^7.22.15", "@babel/template@^7.22.5": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== @@ -949,23 +965,23 @@ "@babel/parser" "^7.22.15" "@babel/types" "^7.22.15" -"@babel/traverse@^7.15.4", "@babel/traverse@^7.23.2": - version "7.23.2" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.2.tgz#329c7a06735e144a506bdb2cad0268b7f46f4ad8" - integrity sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw== +"@babel/traverse@^7.23.2", "@babel/traverse@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.3.tgz#26ee5f252e725aa7aca3474aa5b324eaf7908b5b" + integrity sha512-+K0yF1/9yR0oHdE0StHuEj3uTPzwwbrLGfNOndVJVV2TqA5+j3oljJUb4nmB954FLGjNem976+B+eDuLIjesiQ== dependencies: "@babel/code-frame" "^7.22.13" - "@babel/generator" "^7.23.0" + "@babel/generator" "^7.23.3" "@babel/helper-environment-visitor" "^7.22.20" "@babel/helper-function-name" "^7.23.0" "@babel/helper-hoist-variables" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.23.0" - "@babel/types" "^7.23.0" + "@babel/parser" "^7.23.3" + "@babel/types" "^7.23.3" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.15.6", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.4.4": +"@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.4.4": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb" integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg== @@ -974,6 +990,15 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" +"@babel/types@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.3.tgz#d5ea892c07f2ec371ac704420f4dcdb07b5f9598" + integrity sha512-OZnvoH2l8PK5eUvEcUyCt/sXgr/h+UWpVuBbOljwcrAgUl6lpchoQ++PHGyQy1AtYnVA6CEq3y5xeEI10brpXw== + dependencies: + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -1502,96 +1527,11 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== -"@typed-macro/core@1.0.0-alpha.1": - version "1.0.0-alpha.1" - resolved "https://registry.yarnpkg.com/@typed-macro/core/-/core-1.0.0-alpha.1.tgz#a1e53bda569e48e0d4d640606b0cd3563fbd9178" - integrity sha512-Io7F9hZVuj5UXBrJBYlEdOThxV0/S3jweJqKs936a4nnXxmePa91EFkSFdtAPMXo76Eyl0748WUPIF131dfciQ== - dependencies: - "@babel/generator" "^7.15.8" - "@babel/parser" "^7.15.8" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" - "@typed-macro/shared" "1.0.0-alpha.1" - "@types/babel__generator" "^7.6.3" - "@types/babel__template" "^7.4.1" - "@types/babel__traverse" "^7.14.2" - -"@typed-macro/runtime@1.0.0-alpha.1": - version "1.0.0-alpha.1" - resolved "https://registry.yarnpkg.com/@typed-macro/runtime/-/runtime-1.0.0-alpha.1.tgz#d5ba549be737c43e7c1a626798f938cdd5500ff6" - integrity sha512-u+4Wb909rzcTqGHWyisfmbkgDqGQr810hDt5WsIBHcLrEnJMw7CXlb70FQ41Ij2NJkGUzF4Ay25NLou6jYPlcg== - dependencies: - "@babel/generator" "^7.15.8" - "@babel/parser" "^7.15.8" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" - "@typed-macro/core" "1.0.0-alpha.1" - "@typed-macro/shared" "1.0.0-alpha.1" - "@types/babel__generator" "^7.6.3" - "@types/babel__template" "^7.4.1" - "@types/babel__traverse" "^7.14.2" - picomatch "^2.3.0" - -"@typed-macro/shared@1.0.0-alpha.1": - version "1.0.0-alpha.1" - resolved "https://registry.yarnpkg.com/@typed-macro/shared/-/shared-1.0.0-alpha.1.tgz#c00cdfd3c7dfd6365c6bccbad9b0c05c3aa47047" - integrity sha512-4qw1Dtfkzj/dkVut8oCkfRa5y0YZzmklK0GYMA3E6+JofqJSpZfX1SvM6+Iv40kiSZz74XgqUXet645vZh3X1A== - "@types/aria-query@^5.0.1": version "5.0.3" resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-5.0.3.tgz#07570ebd25f9b516c910a91f7244052c9b58eabc" integrity sha512-0Z6Tr7wjKJIk4OUEjVUQMtyunLDy339vcMaj38Kpj6jM2OE1p3S4kXExKZ7a3uXQAPCoy3sbrP1wibDKaf39oA== -"@types/babel-plugin-macros@^3.1.2": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@types/babel-plugin-macros/-/babel-plugin-macros-3.1.2.tgz#f0ff713d44a00b7c1c69b3aaffb53e39f80eff6c" - integrity sha512-reO/Op5+rVgMPajMQslgFtoBtUMkkVVUkcXmsz8hLEHq1A2gr3JyHmrs+s2rJjhPKJIi2S2p/fj0q6BYP111Uw== - dependencies: - "@types/babel__core" "*" - -"@types/babel-plugin-tester@^9.0.0": - version "9.0.8" - resolved "https://registry.yarnpkg.com/@types/babel-plugin-tester/-/babel-plugin-tester-9.0.8.tgz#7e392d7aebd171234c3f86c0bb346787f5976260" - integrity sha512-X7tIuDs4wKBaCtV62vofhCr7MexAFNTqqPGEirI3iU++WKcIlh6rdNfM/VWJK/4gk/nm9dwju5ymBy2ZWDFYDA== - dependencies: - "@types/babel__core" "*" - "@types/prettier" "^2.0.0" - -"@types/babel__core@*": - version "7.20.3" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.3.tgz#d5625a50b6f18244425a1359a858c73d70340778" - integrity sha512-54fjTSeSHwfan8AyHWrKbfBWiEUrNTZsUwPTDSNaaP1QDQIZbeNUg3a59E9D+375MzUw/x1vx2/0F5LBz+AeYA== - dependencies: - "@babel/parser" "^7.20.7" - "@babel/types" "^7.20.7" - "@types/babel__generator" "*" - "@types/babel__template" "*" - "@types/babel__traverse" "*" - -"@types/babel__generator@*", "@types/babel__generator@^7.6.3": - version "7.6.6" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.6.tgz#676f89f67dc8ddaae923f70ebc5f1fa800c031a8" - integrity sha512-66BXMKb/sUWbMdBNdMvajU7i/44RkrA3z/Yt1c7R5xejt8qh84iU54yUWCtm0QwGJlDcf/gg4zd/x4mpLAlb/w== - dependencies: - "@babel/types" "^7.0.0" - -"@types/babel__template@*", "@types/babel__template@^7.4.1": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.3.tgz#db9ac539a2fe05cfe9e168b24f360701bde41f5f" - integrity sha512-ciwyCLeuRfxboZ4isgdNZi/tkt06m8Tw6uGbBSBgWrnnZGNXiEyM27xc/PjXGQLqlZ6ylbgHMnm7ccF9tCkOeQ== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - -"@types/babel__traverse@*", "@types/babel__traverse@^7.14.2": - version "7.20.3" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.3.tgz#a971aa47441b28ef17884ff945d0551265a2d058" - integrity sha512-Lsh766rGEFbaxMIDH7Qa+Yha8cMVI3qAK6CHt3OR0YfxOIn5Z54iHiyDRycHrBqeIiqGa20Kpsv1cavfBKkRSw== - dependencies: - "@babel/types" "^7.20.7" - "@types/chai-subset@^1.3.3": version "1.3.4" resolved "https://registry.yarnpkg.com/@types/chai-subset/-/chai-subset-1.3.4.tgz#7938fa929dd12db451457e4d6faa27bcd599a729" @@ -1640,16 +1580,6 @@ dependencies: undici-types "~5.26.4" -"@types/parse-json@^4.0.0": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.1.tgz#27f7559836ad796cea31acb63163b203756a5b4e" - integrity sha512-3YmXzzPAdOTVljVMkTMBdBEvlOLg2cDQaDhnnhT3nT9uDbnJzjWhKlzb+desT12Y7tGqaN6d+AbozcKzyL36Ng== - -"@types/prettier@^2.0.0": - version "2.7.3" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" - integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== - "@types/prop-types@*": version "15.7.9" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.9.tgz#b6f785caa7ea1fe4414d9df42ee0ab67f23d8a6d" @@ -1915,14 +1845,6 @@ ansi-styles@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== -anymatch@~3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" - integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - argparse@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" @@ -2014,16 +1936,6 @@ arraybuffer.prototype.slice@^1.0.2: is-array-buffer "^3.0.2" is-shared-array-buffer "^1.0.2" -aslemammad-vite-plugin-macro@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/aslemammad-vite-plugin-macro/-/aslemammad-vite-plugin-macro-1.0.0.tgz#e19f018af4d3ca045a9c34e7245157670a244e78" - integrity sha512-PFxmuU34aHoA6yNSsV5apBUB06xL2d3raSeEhdjzsN514kWRSzpTTwGV3hYw2PsqUxy9SyXAFD9TIqg3Rj5zNg== - dependencies: - "@typed-macro/core" "1.0.0-alpha.1" - "@typed-macro/runtime" "1.0.0-alpha.1" - "@typed-macro/shared" "1.0.0-alpha.1" - chokidar "^3.5.2" - assertion-error@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" @@ -2046,15 +1958,6 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -babel-plugin-macros@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" - integrity sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg== - dependencies: - "@babel/runtime" "^7.12.5" - cosmiconfig "^7.0.0" - resolve "^1.19.0" - babel-plugin-polyfill-corejs2@^0.4.6: version "0.4.6" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.6.tgz#b2df0251d8e99f229a8e60fc4efa9a68b41c8313" @@ -2079,16 +1982,6 @@ babel-plugin-polyfill-regenerator@^0.5.3: dependencies: "@babel/helper-define-polyfill-provider" "^0.4.3" -babel-plugin-tester@10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-tester/-/babel-plugin-tester-10.1.0.tgz#e099ee1d8dec538439c427a7d12aad132885757b" - integrity sha512-4P2tNaM/Mtg6ytA9YAqmgONnMYqWvdbGDuwRTpIIC9yFZGQrEHoyvDPCx+X1QALAufVb5DKieOPGj5dffiEiNg== - dependencies: - "@types/babel-plugin-tester" "^9.0.0" - lodash.mergewith "^4.6.2" - prettier "^2.0.1" - strip-indent "^3.0.0" - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -2099,11 +1992,6 @@ big-integer@^1.6.44: resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== -binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - bplist-parser@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/bplist-parser/-/bplist-parser-0.2.0.tgz#43a9d183e5bf9d545200ceac3e712f79ebbe8d0e" @@ -2119,7 +2007,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^3.0.2, braces@~3.0.2: +braces@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -2214,21 +2102,6 @@ check-error@^1.0.3: dependencies: get-func-name "^2.0.2" -chokidar@^3.5.2: - version "3.5.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - cliui@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" @@ -2306,17 +2179,6 @@ core-js-compat@^3.31.0, core-js-compat@^3.33.1: dependencies: browserslist "^4.22.1" -cosmiconfig@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6" - integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA== - dependencies: - "@types/parse-json" "^4.0.0" - import-fresh "^3.2.1" - parse-json "^5.0.0" - path-type "^4.0.0" - yaml "^1.10.0" - cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -2518,13 +2380,6 @@ entities@^4.4.0: resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - es-abstract@^1.22.1: version "1.22.3" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.3.tgz#48e79f5573198de6dee3589195727f4f74bc4f32" @@ -3092,7 +2947,7 @@ get-tsconfig@^4.7.2: dependencies: resolve-pkg-maps "^1.0.0" -glob-parent@^5.1.2, glob-parent@~5.1.2: +glob-parent@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -3320,11 +3175,6 @@ is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: get-intrinsic "^1.2.0" is-typed-array "^1.1.10" -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== - is-async-function@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-async-function/-/is-async-function-2.0.0.tgz#8e4418efd3e5d3a6ebb0164c05ef5afb69aa9646" @@ -3339,13 +3189,6 @@ is-bigint@^1.0.1: dependencies: has-bigints "^1.0.1" -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - is-boolean-object@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" @@ -3414,7 +3257,7 @@ is-generator-function@^1.0.10: dependencies: has-tostringtag "^1.0.0" -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -3651,11 +3494,6 @@ json-buffer@3.0.1: resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -3713,11 +3551,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -lines-and-columns@^1.1.6: - version "1.2.4" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" - integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== - local-pkg@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.4.3.tgz#0ff361ab3ae7f1c19113d9bb97b98b905dbc4963" @@ -3740,11 +3573,6 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash.mergewith@^4.6.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz#617121f89ac55f59047c7aec1ccd6654c6590f55" - integrity sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ== - lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -3837,11 +3665,6 @@ mimic-fn@^4.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== -min-indent@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" - integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== - minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -3894,11 +3717,6 @@ node-releases@^2.0.13: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" @@ -4067,16 +3885,6 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-json@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - parse5@^7.0.0, parse5@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" @@ -4129,7 +3937,7 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.0, picomatch@^2.3.1: +picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -4169,11 +3977,6 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.0.1: - version "2.8.8" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" - integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== - prettier@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" @@ -4275,13 +4078,6 @@ react@18.3.0-canary-c47c306a7-20231109: dependencies: loose-envify "^1.1.0" -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -4380,7 +4176,7 @@ resolve-pkg-maps@^1.0.0: resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== -resolve@^1.1.6, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.22.1, resolve@^1.22.4: +resolve@^1.1.6, resolve@^1.14.2, resolve@^1.22.1, resolve@^1.22.4: version "1.22.8" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -4743,13 +4539,6 @@ strip-final-newline@^3.0.0: resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-3.0.0.tgz#52894c313fbff318835280aed60ff71ebf12b8fd" integrity sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw== -strip-indent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" - integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== - dependencies: - min-indent "^1.0.0" - strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -5249,11 +5038,6 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@^1.10.0: - version "1.10.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" - integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== - yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" From 8902c4cd83781043cae4a5f0688e3b803197e48c Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Tue, 14 Nov 2023 14:04:15 +0900 Subject: [PATCH 09/35] [v2] breaking: remove derive-valtio dependency (#821) --- package.json | 3 +- src/vanilla/utils.ts | 1 - tests/derive.test.tsx | 501 ------------------------------------------ yarn.lock | 5 - 4 files changed, 1 insertion(+), 509 deletions(-) delete mode 100644 tests/derive.test.tsx diff --git a/package.json b/package.json index 24373260..9c80940c 100644 --- a/package.json +++ b/package.json @@ -104,8 +104,7 @@ }, "homepage": "https://github.com/pmndrs/valtio", "dependencies": { - "proxy-compare": "2.5.1", - "derive-valtio": "0.1.0" + "proxy-compare": "2.5.1" }, "devDependencies": { "@babel/core": "^7.23.2", diff --git a/src/vanilla/utils.ts b/src/vanilla/utils.ts index 7c2c59b2..43b71f3a 100644 --- a/src/vanilla/utils.ts +++ b/src/vanilla/utils.ts @@ -1,7 +1,6 @@ export { subscribeKey } from './utils/subscribeKey.ts' export { watch } from './utils/watch.ts' export { devtools } from './utils/devtools.ts' -export { derive, underive, unstable_deriveSubscriptions } from 'derive-valtio' export { deepClone } from './utils/deepClone.ts' export { proxyWithHistory } from './utils/proxyWithHistory.ts' export { proxySet } from './utils/proxySet.ts' diff --git a/tests/derive.test.tsx b/tests/derive.test.tsx deleted file mode 100644 index b0610f23..00000000 --- a/tests/derive.test.tsx +++ /dev/null @@ -1,501 +0,0 @@ -/// - -import ReactExports, { StrictMode, Suspense, useEffect, useRef } from 'react' -import { fireEvent, render } from '@testing-library/react' -import { describe, expect, it, vi } from 'vitest' -import { proxy, snapshot, subscribe, useSnapshot } from 'valtio' -import { derive, underive } from 'valtio/utils' - -type DeriveGet = (proxyObject: T) => T - -const sleep = (ms: number) => - new Promise((resolve) => { - setTimeout(resolve, ms) - }) - -const { use } = ReactExports -const use2 = (x: T): Awaited => (x instanceof Promise ? use(x) : x) - -it('basic derive', async () => { - const computeDouble = vi.fn((x: number) => x * 2) - const state = proxy({ - text: '', - count: 0, - }) - const derived = derive({ - doubled: (get) => computeDouble(get(state).count), - }) - - const callback = vi.fn() - subscribe(derived, callback) - - expect(snapshot(derived)).toMatchObject({ doubled: 0 }) - expect(computeDouble).toBeCalledTimes(1) - expect(callback).toBeCalledTimes(0) - - state.count += 1 - await Promise.resolve() - expect(snapshot(derived)).toMatchObject({ doubled: 2 }) - expect(computeDouble).toBeCalledTimes(2) - await Promise.resolve() - expect(callback).toBeCalledTimes(1) - - state.text = 'a' - await Promise.resolve() - expect(snapshot(derived)).toMatchObject({ doubled: 2 }) - expect(computeDouble).toBeCalledTimes(3) - await Promise.resolve() - expect(callback).toBeCalledTimes(1) -}) - -it('derive another proxy', async () => { - const computeDouble = vi.fn((x: number) => x * 2) - const state = proxy({ - text: '', - count: 0, - }) - const anotherState = proxy({}) - derive( - { - doubled: (get) => computeDouble(get(state).count), - }, - { - proxy: anotherState, - }, - ) - - const callback = vi.fn() - subscribe(anotherState, callback) - - expect(snapshot(anotherState)).toMatchObject({ doubled: 0 }) - expect(computeDouble).toBeCalledTimes(1) - expect(callback).toBeCalledTimes(0) - - state.count += 1 - await Promise.resolve() - expect(snapshot(anotherState)).toMatchObject({ doubled: 2 }) - expect(computeDouble).toBeCalledTimes(2) - await Promise.resolve() - expect(callback).toBeCalledTimes(1) - - state.text = 'a' - await Promise.resolve() - expect(snapshot(anotherState)).toMatchObject({ doubled: 2 }) - expect(computeDouble).toBeCalledTimes(3) - await Promise.resolve() - expect(callback).toBeCalledTimes(1) -}) - -it('derive with self', async () => { - const computeDouble = vi.fn((x: number) => x * 2) - const state = proxy({ - text: '', - count: 0, - }) - derive( - { - doubled: (get) => computeDouble(get(state).count), - }, - { - proxy: state, - }, - ) - - const callback = vi.fn() - subscribe(state, callback) - - expect(snapshot(state)).toMatchObject({ text: '', count: 0, doubled: 0 }) - expect(computeDouble).toBeCalledTimes(1) - expect(callback).toBeCalledTimes(0) - - state.count += 1 - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: '', count: 1, doubled: 2 }) - expect(computeDouble).toBeCalledTimes(2) - await Promise.resolve() - expect(callback).toBeCalledTimes(1) - - state.text = 'a' - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: 'a', count: 1, doubled: 2 }) - expect(computeDouble).toBeCalledTimes(3) - await Promise.resolve() - expect(callback).toBeCalledTimes(2) -}) - -it('derive with two dependencies', async () => { - const computeSum = vi.fn((x: number, y: number) => x + y) - const state1 = proxy({ count: 1 }) - const state2 = proxy({ count: 10 }) - const derived = derive({ - sum: (get) => computeSum(get(state1).count, get(state2).count), - }) - - const callback = vi.fn() - subscribe(derived, callback) - - expect(snapshot(derived)).toMatchObject({ sum: 11 }) - expect(computeSum).toBeCalledTimes(1) - expect(callback).toBeCalledTimes(0) - - state1.count += 1 - await Promise.resolve() - expect(snapshot(derived)).toMatchObject({ sum: 12 }) - expect(computeSum).toBeCalledTimes(2) - await Promise.resolve() - expect(callback).toBeCalledTimes(1) - - state1.count += 1 - state2.count += 10 - await Promise.resolve() - expect(snapshot(derived)).toMatchObject({ sum: 23 }) - expect(computeSum).toBeCalledTimes(3) - await Promise.resolve() - expect(callback).toBeCalledTimes(2) -}) - -it.skipIf(typeof use === 'undefined')('async derive', async () => { - const state = proxy({ count: 0 }) - derive( - { - delayedCount: async (get) => { - await sleep(300) - return get(state).count + 1 - }, - }, - { proxy: state }, - ) - - const Counter = () => { - const snap = useSnapshot( - state as { count: number; delayedCount: Promise }, - ) - return ( - <> -
- count: {snap.count}, delayedCount: {use2(snap.delayedCount)} -
- - - ) - } - - const { getByText, findByText } = render( - - - - - , - ) - - await findByText('loading') - await findByText('count: 0, delayedCount: 1') - - fireEvent.click(getByText('button')) - await findByText('loading') - await findByText('count: 1, delayedCount: 2') -}) - -it('nested emulation with derive', async () => { - const computeDouble = vi.fn((x: number) => x * 2) - const state = proxy({ text: '', math: { count: 0 } }) - derive( - { - doubled: (get) => computeDouble(get(state.math).count), - }, - { proxy: state.math, sync: true }, - ) - - const callback = vi.fn() - subscribe(state, callback) - - expect(snapshot(state)).toMatchObject({ - text: '', - math: { count: 0, doubled: 0 }, - }) - expect(computeDouble).toBeCalledTimes(1) - expect(callback).toBeCalledTimes(0) - - state.math.count += 1 - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ - text: '', - math: { count: 1, doubled: 2 }, - }) - expect(computeDouble).toBeCalledTimes(2) - await Promise.resolve() - expect(callback).toBeCalledTimes(1) - - state.text = 'a' - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ - text: 'a', - math: { count: 1, doubled: 2 }, - }) - expect(computeDouble).toBeCalledTimes(2) - await Promise.resolve() - expect(callback).toBeCalledTimes(2) -}) - -it('derive with array.pop', async () => { - const state = proxy({ - arr: [{ n: 1 }, { n: 2 }, { n: 3 }], - }) - derive( - { - nums: (get) => get(state.arr).map((item) => item.n), - }, - { proxy: state }, - ) - - expect(snapshot(state)).toMatchObject({ - arr: [{ n: 1 }, { n: 2 }, { n: 3 }], - nums: [1, 2, 3], - }) - - state.arr.pop() - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ - arr: [{ n: 1 }, { n: 2 }], - nums: [1, 2], - }) -}) - -it('basic underive', async () => { - const computeDouble = vi.fn((x: number) => x * 2) - const state = proxy({ count: 0 }) - const derived = derive({ - doubled: (get) => computeDouble(get(state).count), - }) - - const callback = vi.fn() - subscribe(derived, callback) - - expect(snapshot(derived)).toMatchObject({ doubled: 0 }) - expect(computeDouble).toBeCalledTimes(1) - expect(callback).toBeCalledTimes(0) - - state.count += 1 - await Promise.resolve() - expect(snapshot(derived)).toMatchObject({ doubled: 2 }) - expect(computeDouble).toBeCalledTimes(2) - await Promise.resolve() - expect(callback).toBeCalledTimes(1) - - underive(derived) - - state.count += 1 - await Promise.resolve() - expect(snapshot(derived)).toMatchObject({ doubled: 2 }) - expect(computeDouble).toBeCalledTimes(2) - await Promise.resolve() - expect(callback).toBeCalledTimes(1) -}) - -describe('glitch free', () => { - it('basic (#296)', async () => { - const state = proxy({ value: 0 }) - const derived1 = derive({ value: (get) => get(state).value }) - const derived2 = derive({ value: (get) => get(derived1).value }) - const computeValue = vi.fn((get: DeriveGet) => { - const v0 = get(state).value - const v1 = get(derived1).value - const v2 = get(derived2).value - return `v0: ${v0}, v1: ${v1}, v2: ${v2}` - }) - const derived3 = derive({ value: computeValue }) - - const App = () => { - const snap = useSnapshot(derived3) - const commitsRef = useRef(1) - useEffect(() => { - commitsRef.current += 1 - }) - return ( - <> - value: {snap.value} (commits: {commitsRef.current}) - - - ) - } - - const { getByText, findByText } = render( - <> - - , - ) - - await findByText('value: v0: 0, v1: 0, v2: 0 (commits: 1)') - expect(computeValue).toBeCalledTimes(1) - - fireEvent.click(getByText('button')) - await findByText('value: v0: 1, v1: 1, v2: 1 (commits: 2)') - expect(computeValue).toBeCalledTimes(2) - }) - - it('same value', async () => { - const state = proxy({ value: 0 }) - const derived1 = derive({ - value: (get) => get(state).value * 0, - }) - const derived2 = derive({ - value: (get) => get(derived1).value * 0, - }) - const computeValue = vi.fn((get: DeriveGet) => { - const v0 = get(state).value - const v1 = get(derived1).value - const v2 = get(derived2).value - return v0 + (v1 - v2) - }) - const derived3 = derive({ - value: (get) => computeValue(get), - }) - - const App = () => { - const snap = useSnapshot(derived3) - return ( -
- value: {snap.value} - -
- ) - } - - const { getByText, findByText } = render( - - - , - ) - - await findByText('value: 0') - expect(computeValue).toBeCalledTimes(1) - - fireEvent.click(getByText('button')) - await findByText('value: 1') - expect(computeValue).toBeCalledTimes(2) - }) - - it('double chain', async () => { - const state = proxy({ value: 0 }) - const derived1 = derive({ - value: (get) => get(state).value, - }) - const derived2 = derive({ - value: (get) => get(derived1).value, - }) - const derived3 = derive({ - value: (get) => get(derived2).value, - }) - const computeValue = vi.fn((get: DeriveGet) => { - const v0 = get(state).value - const v1 = get(derived1).value - const v2 = get(derived2).value - const v3 = get(derived3).value - return v0 + (v1 - v2) + v3 * 0 - }) - const derived4 = derive({ - value: (get) => computeValue(get), - }) - - const App = () => { - const snap = useSnapshot(derived4) - return ( -
- value: {snap.value} - -
- ) - } - - const { getByText, findByText } = render( - - - , - ) - - await findByText('value: 0') - expect(computeValue).toBeCalledTimes(1) - - fireEvent.click(getByText('button')) - await findByText('value: 1') - expect(computeValue).toBeCalledTimes(2) - }) -}) - -describe('two derived properties', () => { - type State = { - a: number - derived1?: unknown - derived2?: unknown - } - - it('two derived properties both returning primitive values (#349)', async () => { - const state: State = proxy({ a: 1 }) - derive( - { - derived1: (get) => { - get(state).a - return 1 - }, - }, - { proxy: state }, - ) - derive( - { - derived2: (get) => { - get(state).a - return 1 - }, - }, - { proxy: state }, - ) - await Promise.resolve() - expect(state.derived1).toBeDefined() - expect(state.derived2).toBeDefined() - }) - - it('two derived properties both returning non primitive values, defined at the same time (#349)', async () => { - const state: State = proxy({ a: 1 }) - derive( - { - derived1: (get) => { - get(state).a - return {} - }, - derived2: (get) => { - get(state).a - return {} - }, - }, - { proxy: state }, - ) - await Promise.resolve() - expect(state.derived1).toBeDefined() - expect(state.derived2).toBeDefined() - }) - - it('two derived properties both returning non primitive values (#349)', async () => { - const state: State = proxy({ a: 1 }) - derive( - { - derived1: (get) => { - get(state).a - return {} - }, - }, - { proxy: state }, - ) - derive( - { - derived2: (get) => { - get(state).a - return {} - }, - }, - { proxy: state }, - ) - await Promise.resolve() - expect(state.derived1).toBeDefined() - expect(state.derived2).toBeDefined() - }) -}) diff --git a/yarn.lock b/yarn.lock index 425392e3..f4f5899a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2322,11 +2322,6 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== -derive-valtio@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/derive-valtio/-/derive-valtio-0.1.0.tgz#4b9fb393dfefccfef15fcbbddd745dd22d5d63d7" - integrity sha512-OCg2UsLbXK7GmmpzMXhYkdO64vhJ1ROUUGaTFyHjVwEdMEcTTRj7W1TxLbSBxdY8QLBPCcp66MTyaSy0RpO17A== - diff-sequences@^29.4.3: version "29.6.3" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" From 5e400344e86cceb26fc7b5b916735263ebb63552 Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Tue, 14 Nov 2023 21:35:13 +0900 Subject: [PATCH 10/35] [v2] breaking: drop UMD/SystemJS builds and simplify babel config (#822) * [v2] breaking: drop UMD/SystemJS builds and simplify babel config * format --- .github/workflows/test-multiple-builds.yml | 14 +---- babel.config.js | 28 --------- package.json | 1 - rollup.config.js | 72 +++------------------- 4 files changed, 8 insertions(+), 107 deletions(-) delete mode 100644 babel.config.js diff --git a/.github/workflows/test-multiple-builds.yml b/.github/workflows/test-multiple-builds.yml index 404b1687..20ed0ed5 100644 --- a/.github/workflows/test-multiple-builds.yml +++ b/.github/workflows/test-multiple-builds.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - build: [cjs, esm, umd] # [cjs, esm, umd, system] + build: [cjs, esm] env: [development] # [development, production] steps: - uses: actions/checkout@v2 @@ -44,18 +44,6 @@ jobs: sed -i~ "1s/^/import.meta.env=import.meta.env||{};import.meta.env.MODE='${NODE_ENV}';/" tests/*.ts tests/*.tsx env: NODE_ENV: ${{ matrix.env }} - - name: Patch for UMD - if: ${{ matrix.build == 'umd' }} - run: | - sed -i~ "s/\/src\(.*\)\.ts/\/dist\/umd\1.${NODE_ENV}.js/" package.json - env: - NODE_ENV: ${{ matrix.env }} - - name: Patch for SystemJS - if: ${{ matrix.build == 'system' }} - run: | - sed -i~ "s/\/src\(.*\)\.ts/\/dist\/system\1.${NODE_ENV}.js/" package.json - env: - NODE_ENV: ${{ matrix.env }} - name: Test ${{ matrix.build }} ${{ matrix.env }} run: | yarn test:ci diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index fa15c8a7..00000000 --- a/babel.config.js +++ /dev/null @@ -1,28 +0,0 @@ -module.exports = (api, targets) => { - // https://babeljs.io/docs/en/config-files#config-function-api - const isTestEnv = api.env('test') - - return { - babelrc: false, - ignore: ['./node_modules'], - presets: [ - [ - '@babel/preset-env', - { - loose: true, - modules: isTestEnv ? 'commonjs' : false, - targets: isTestEnv ? { node: 'current' } : targets, - }, - ], - ], - plugins: [ - [ - '@babel/plugin-transform-react-jsx', - { - runtime: 'automatic', - }, - ], - ['@babel/plugin-transform-typescript', { isTSX: true }], - ], - } -} diff --git a/package.json b/package.json index 9c80940c..08df6eb7 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,6 @@ "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-replace": "^5.0.5", - "@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-typescript": "^11.1.5", "@testing-library/react": "^14.0.0", "@types/jsdom": "^21.1.4", diff --git a/rollup.config.js b/rollup.config.js index 9d12aee4..1534ddad 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,10 +3,8 @@ const alias = require('@rollup/plugin-alias') const babelPlugin = require('@rollup/plugin-babel') const resolve = require('@rollup/plugin-node-resolve') const replace = require('@rollup/plugin-replace') -const terser = require('@rollup/plugin-terser') const typescript = require('@rollup/plugin-typescript') const { default: esbuild } = require('rollup-plugin-esbuild') -const createBabelConfig = require('./babel.config.js') const extensions = ['.js', '.ts', '.tsx'] const { root } = path.parse(process.cwd()) @@ -23,7 +21,13 @@ function external(id) { function getBabelOptions(targets) { return { - ...createBabelConfig({ env: (env) => env === 'build' }, targets), + babelrc: false, + ignore: ['./node_modules'], + presets: [['@babel/preset-env', { loose: true, modules: false, targets }]], + plugins: [ + ['@babel/plugin-transform-react-jsx', { runtime: 'automatic' }], + ['@babel/plugin-transform-typescript', { isTSX: true }], + ], extensions, comments: false, babelHelpers: 'bundled', @@ -98,64 +102,6 @@ function createCommonJSConfig(input, output) { } } -function createUMDConfig(input, output, env) { - let name = 'valtio' - const fileName = output.slice('dist/umd/'.length) - const capitalize = (s) => s.slice(0, 1).toUpperCase() + s.slice(1) - if (fileName !== 'index') { - name += fileName.replace(/(\w+)\W*/g, (_, p) => capitalize(p)) - } - return { - input, - output: { - file: `${output}.${env}.js`, - format: 'umd', - name, - globals: { - react: 'React', - 'valtio/vanilla': 'valtioVanilla', - 'valtio/utils': 'valtioUtils', - 'valtio/react': 'valtioReact', - 'valtio/vanilla/utils': 'valtioVanillaUtils', - 'valtio/react/utils': 'valtioReactUtils', - }, - }, - external, - plugins: [ - alias({ entries: entries.filter((e) => !e.find.test(input)) }), - resolve({ extensions }), - replace({ - 'import.meta.env?.MODE': JSON.stringify(env), - delimiters: ['\\b', '\\b(?!(\\.|/))'], - preventAssignment: true, - }), - babelPlugin(getBabelOptions({ ie: 11 })), - ...(env === 'production' ? [terser()] : []), - ], - } -} - -function createSystemConfig(input, output, env) { - return { - input, - output: { - file: `${output}.${env}.js`, - format: 'system', - }, - external, - plugins: [ - alias({ entries: entries.filter((e) => !e.find.test(input)) }), - resolve({ extensions }), - replace({ - 'import.meta.env?.MODE': JSON.stringify(env), - delimiters: ['\\b', '\\b(?!(\\.|/))'], - preventAssignment: true, - }), - getEsbuild('node12', env), - ], - } -} - module.exports = function (args) { let c = Object.keys(args).find((key) => key.startsWith('config-')) if (c) { @@ -167,10 +113,6 @@ module.exports = function (args) { ...(c === 'index' ? [createDeclarationConfig(`src/${c}.ts`, 'dist')] : []), createCommonJSConfig(`src/${c}.ts`, `dist/${c}`), createESMConfig(`src/${c}.ts`, `dist/esm/${c}.mjs`), - createUMDConfig(`src/${c}.ts`, `dist/umd/${c}`, 'development'), - createUMDConfig(`src/${c}.ts`, `dist/umd/${c}`, 'production'), - createSystemConfig(`src/${c}.ts`, `dist/system/${c}`, 'development'), - createSystemConfig(`src/${c}.ts`, `dist/system/${c}`, 'production'), ] } From 2e01d729efd5cb39aad743e28ec0a2ebe5699c02 Mon Sep 17 00:00:00 2001 From: daishi Date: Tue, 14 Nov 2023 21:39:43 +0900 Subject: [PATCH 11/35] 2.0.0-alpha.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 08df6eb7..ca091806 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "valtio", "private": true, - "version": "1.12.0", + "version": "2.0.0-alpha.0", "publishConfig": { "tag": "next" }, From 01cdc2967693bbe159f8f6fb6cff1640a7cb0d42 Mon Sep 17 00:00:00 2001 From: daishi Date: Tue, 28 Nov 2023 10:49:43 +0900 Subject: [PATCH 12/35] run prettier --- src/vanilla.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vanilla.ts b/src/vanilla.ts index 2ff50cc9..c3208a22 100644 --- a/src/vanilla.ts +++ b/src/vanilla.ts @@ -34,8 +34,8 @@ type SnapshotIgnore = type Snapshot = T extends SnapshotIgnore ? T : T extends object - ? { readonly [K in keyof T]: Snapshot } - : T + ? { readonly [K in keyof T]: Snapshot } + : T /** * This is not a public API. From f8216c59c7aee4cdd097deb3ec38d4e5b1b013c1 Mon Sep 17 00:00:00 2001 From: daishi Date: Tue, 28 Nov 2023 10:56:35 +0900 Subject: [PATCH 13/35] 2.0.0-alpha.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 975d159f..dcaa1f87 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "valtio", "private": true, - "version": "2.0.0-alpha.0", + "version": "2.0.0-alpha.1", "publishConfig": { "tag": "next" }, From 83aebbb6974c80c4e929ce847886741c1bdad6b6 Mon Sep 17 00:00:00 2001 From: daishi Date: Mon, 18 Dec 2023 08:44:58 +0900 Subject: [PATCH 14/35] simplify ts test script --- .github/workflows/test-old-typescript.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test-old-typescript.yml b/.github/workflows/test-old-typescript.yml index bb0d28cc..16e8ec25 100644 --- a/.github/workflows/test-old-typescript.yml +++ b/.github/workflows/test-old-typescript.yml @@ -33,15 +33,12 @@ jobs: - run: yarn build - name: Patch for Old TS run: | - sed -i~ 's/\/\/ @ts-expect-error.*\[LATEST-TS-ONLY\]//' tests/*.tsx sed -i~ 's/"moduleResolution": "bundler",/"moduleResolution": "node",/' tsconfig.json sed -i~ 's/"allowImportingTsExtensions": true,//' tsconfig.json sed -i~ 's/"valtio": \["\.\/src\/index\.ts"\],/"valtio": [".\/dist\/index.d.ts"],/' tsconfig.json sed -i~ 's/"valtio\/\*": \["\.\/src\/\*\.ts"\]/"valtio\/*": [".\/dist\/*.d.ts"]/' tsconfig.json sed -i~ 's/"include": .*/"include": ["src\/types.d.ts", "dist\/**\/*", "tests\/**\/*"],/' tsconfig.json - - name: Install old TypeScript - run: | - yarn add -D typescript@${{ matrix.typescript }} - name: Test ${{ matrix.typescript }} run: | + yarn add -D typescript@${{ matrix.typescript }} yarn tsc --noEmit From fe448613304d6da3721d1a1b4342529949bfc7bc Mon Sep 17 00:00:00 2001 From: daishi Date: Sat, 6 Jan 2024 12:18:03 +0900 Subject: [PATCH 15/35] update react canary version --- package.json | 4 ++-- yarn.lock | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index c64a19ec..d67e2642 100644 --- a/package.json +++ b/package.json @@ -140,8 +140,8 @@ "postinstall-postinstall": "^2.1.0", "prettier": "^3.1.1", "proxy-memoize": "^2.0.4", - "react": "18.3.0-canary-c47c306a7-20231109", - "react-dom": "18.3.0-canary-c47c306a7-20231109", + "react": "18.3.0-canary-1d5667a12-20240102", + "react-dom": "18.3.0-canary-1d5667a12-20240102", "redux": "^5.0.1", "rollup": "^4.9.3", "rollup-plugin-esbuild": "^6.1.0", diff --git a/yarn.lock b/yarn.lock index 7395d2f7..824d20e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3812,13 +3812,13 @@ queue-microtask@^1.2.2: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -react-dom@18.3.0-canary-c47c306a7-20231109: - version "18.3.0-canary-c47c306a7-20231109" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.0-canary-c47c306a7-20231109.tgz#a5b881218f760a44e09469f7c1d38c8354b6e0b9" - integrity sha512-COjHi7Ve6fCDStLinhvKxUpAVRDwkHIXtH9m8crIc0d3KjE+PMTmmIwQQj3ceypDAARQ1VFwHOhMQgXcdRAxlA== +react-dom@18.3.0-canary-1d5667a12-20240102: + version "18.3.0-canary-1d5667a12-20240102" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.0-canary-1d5667a12-20240102.tgz#5a8ce2968a9ba8f9bfd6591f6043188354b3e4e9" + integrity sha512-ixKWuDTumxBTJTciS/dt68MlRQVotqsA9jmCraEfjpPdcT9otROP1Cojc7ngJW1QHeJILpPBxnD3tAqDUTJrzQ== dependencies: loose-envify "^1.1.0" - scheduler "0.24.0-canary-c47c306a7-20231109" + scheduler "0.24.0-canary-1d5667a12-20240102" react-is@^16.13.1: version "16.13.1" @@ -3835,10 +3835,10 @@ react-is@^18.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== -react@18.3.0-canary-c47c306a7-20231109: - version "18.3.0-canary-c47c306a7-20231109" - resolved "https://registry.yarnpkg.com/react/-/react-18.3.0-canary-c47c306a7-20231109.tgz#53878c332f829d5b25f6df6c8c3746cd12a3b922" - integrity sha512-LtL67Bc+Mkuhwud559dUCU+QXL6mmtgKTGEyT41m5bDiEQdGAyYCxXo5/pigAx4p8mQb+KIT2AvCWlEDKut+PQ== +react@18.3.0-canary-1d5667a12-20240102: + version "18.3.0-canary-1d5667a12-20240102" + resolved "https://registry.yarnpkg.com/react/-/react-18.3.0-canary-1d5667a12-20240102.tgz#9d7f28aa49f3b0923b9b05fb40462938ec508dee" + integrity sha512-luErMzExiPt9LGO2xDTdspTCK0PEJIWU5vh9kgXWm3bGQ1WWndLPIyfijrqjvxBIESiGtMPthbuAaYC3LSKdLw== dependencies: loose-envify "^1.1.0" @@ -4057,10 +4057,10 @@ saxes@^6.0.0: dependencies: xmlchars "^2.2.0" -scheduler@0.24.0-canary-c47c306a7-20231109: - version "0.24.0-canary-c47c306a7-20231109" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.24.0-canary-c47c306a7-20231109.tgz#9d2f0329d603279093b38999f78eac04bf64f8a0" - integrity sha512-VGLhOyPt1EIAsoGqu7DMxnVPdGAoxTmSjNJlGX31exX0stiZsvb3QuK5bKT1BaTpDOJD4VnNFoonMRN7BNh3Cg== +scheduler@0.24.0-canary-1d5667a12-20240102: + version "0.24.0-canary-1d5667a12-20240102" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.24.0-canary-1d5667a12-20240102.tgz#960b8a098f950dd6063f9b7331e88e9f004857cb" + integrity sha512-jA44VizQkad/Waf3AmFKnYe0sPKNaJ6CdMEgLtMe3lVCvx8kDNSnF5rKsDHikWnyWWoDLrdIsSJ33HXFGI1HeA== dependencies: loose-envify "^1.1.0" From 9bffaf6a03c6abc565b3836ea068f66be7b6c7e2 Mon Sep 17 00:00:00 2001 From: daishi Date: Sat, 6 Jan 2024 12:22:22 +0900 Subject: [PATCH 16/35] remove depreacated proxyWithHistory --- src/vanilla/utils.ts | 1 - src/vanilla/utils/proxyWithHistory.ts | 91 -------- tests/history.test.tsx | 311 -------------------------- 3 files changed, 403 deletions(-) delete mode 100644 src/vanilla/utils/proxyWithHistory.ts delete mode 100644 tests/history.test.tsx diff --git a/src/vanilla/utils.ts b/src/vanilla/utils.ts index d5118ded..0e45446c 100644 --- a/src/vanilla/utils.ts +++ b/src/vanilla/utils.ts @@ -2,6 +2,5 @@ export { subscribeKey } from './utils/subscribeKey.ts' export { watch } from './utils/watch.ts' export { devtools } from './utils/devtools.ts' export { deepClone } from './utils/deepClone.ts' -export { proxyWithHistory_DEPRECATED as proxyWithHistory } from './utils/proxyWithHistory.ts' export { proxySet } from './utils/proxySet.ts' export { proxyMap } from './utils/proxyMap.ts' diff --git a/src/vanilla/utils/proxyWithHistory.ts b/src/vanilla/utils/proxyWithHistory.ts deleted file mode 100644 index fd69a902..00000000 --- a/src/vanilla/utils/proxyWithHistory.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { proxy, ref, snapshot, subscribe } from '../../vanilla.ts' -import type { INTERNAL_Snapshot as Snapshot } from '../../vanilla.ts' -import { deepClone } from './deepClone.ts' - -type SnapshotOrUndefined = Snapshot | undefined -type Snapshots = Snapshot[] - -/** - * proxyWithHistory - * - * This creates a new proxy with history support. - * It includes following properties: - * - value: any value (does not have to be an object) - * - history: an array holding the history of snapshots - * - historyIndex: the history index to the current snapshot - * - canUndo: a function to return true if undo is available - * - undo: a function to go back history - * - canRedo: a function to return true if redo is available - * - redo: a function to go forward history - * - saveHistory: a function to save history - * - * [Notes] - * Suspense/promise is not supported. - * - * @example - * import { proxyWithHistory } from 'valtio/utils' - * const state = proxyWithHistory({ - * count: 1, - * }) - * - * @deprecated Please use the `valtio-history` package. eg. - * import { proxyWithHistory } from 'valtio-history' - */ -export function proxyWithHistory_DEPRECATED( - initialValue: V, - skipSubscribe = false, -) { - if (import.meta.env?.MODE !== 'production') { - console.warn( - 'proxyWithHistory is deprecated. Please use the "valtio-history" package; refer to the docs', - ) - } - const proxyObject = proxy({ - value: initialValue, - history: ref({ - wip: undefined as SnapshotOrUndefined, // to avoid infinite loop - snapshots: [] as Snapshots, - index: -1, - }), - clone: deepClone, - canUndo: () => proxyObject.history.index > 0, - undo: () => { - if (proxyObject.canUndo()) { - proxyObject.value = (proxyObject.history.wip = proxyObject.clone( - proxyObject.history.snapshots[--proxyObject.history.index], - ) as Snapshot) as V - } - }, - canRedo: () => - proxyObject.history.index < proxyObject.history.snapshots.length - 1, - redo: () => { - if (proxyObject.canRedo()) { - proxyObject.value = (proxyObject.history.wip = proxyObject.clone( - proxyObject.history.snapshots[++proxyObject.history.index], - ) as Snapshot) as V - } - }, - saveHistory: () => { - proxyObject.history.snapshots.splice(proxyObject.history.index + 1) - proxyObject.history.snapshots.push(snapshot(proxyObject).value) - ++proxyObject.history.index - }, - subscribe: () => - subscribe(proxyObject, (ops) => { - if ( - ops.every( - (op) => - op[1][0] === 'value' && - (op[0] !== 'set' || op[2] !== proxyObject.history.wip), - ) - ) { - proxyObject.saveHistory() - } - }), - }) - proxyObject.saveHistory() - if (!skipSubscribe) { - proxyObject.subscribe() - } - return proxyObject -} diff --git a/tests/history.test.tsx b/tests/history.test.tsx deleted file mode 100644 index cc2ffe99..00000000 --- a/tests/history.test.tsx +++ /dev/null @@ -1,311 +0,0 @@ -import { StrictMode } from 'react' -import { fireEvent, render } from '@testing-library/react' -import { it } from 'vitest' -import { useSnapshot } from 'valtio' -import { proxyWithHistory } from 'valtio/utils' - -it('simple count', async () => { - const state = proxyWithHistory(0) - - const Counter = () => { - const snap = useSnapshot(state) - return ( - <> -
count: {snap.value}
- - - - - ) - } - - const { getByText, findByText } = render( - - - , - ) - - await findByText('count: 0') - - fireEvent.click(getByText('inc')) - await findByText('count: 1') - - fireEvent.click(getByText('inc')) - await findByText('count: 2') - - fireEvent.click(getByText('inc')) - await findByText('count: 3') - - fireEvent.click(getByText('undo')) - await findByText('count: 2') - - fireEvent.click(getByText('redo')) - await findByText('count: 3') - - fireEvent.click(getByText('undo')) - await findByText('count: 2') - - fireEvent.click(getByText('undo')) - await findByText('count: 1') - - fireEvent.click(getByText('undo')) - await findByText('count: 0') - - fireEvent.click(getByText('inc')) - await findByText('count: 1') - - fireEvent.click(getByText('undo')) - await findByText('count: 0') -}) - -it('count in object', async () => { - const state = proxyWithHistory({ count: 0 }) - - const Counter = () => { - const snap = useSnapshot(state) - return ( - <> -
count: {snap.value.count}
- - - - - ) - } - - const { getByText, findByText } = render( - - - , - ) - - await findByText('count: 0') - - fireEvent.click(getByText('inc')) - await findByText('count: 1') - - fireEvent.click(getByText('inc')) - await findByText('count: 2') - - fireEvent.click(getByText('inc')) - await findByText('count: 3') - - fireEvent.click(getByText('undo')) - await findByText('count: 2') - - fireEvent.click(getByText('redo')) - await findByText('count: 3') - - fireEvent.click(getByText('undo')) - await findByText('count: 2') - - fireEvent.click(getByText('undo')) - await findByText('count: 1') - - fireEvent.click(getByText('undo')) - await findByText('count: 0') - - fireEvent.click(getByText('inc')) - await findByText('count: 1') - - fireEvent.click(getByText('undo')) - await findByText('count: 0') -}) - -it('count in nested object', async () => { - const state = proxyWithHistory({ nested: { count: 0 } }) - - const Counter = () => { - const snap = useSnapshot(state) - return ( - <> -
count: {snap.value.nested.count}
- - - - - ) - } - - const { getByText, findByText } = render( - - - , - ) - - await findByText('count: 0') - - fireEvent.click(getByText('inc')) - await findByText('count: 1') - - fireEvent.click(getByText('inc')) - await findByText('count: 2') - - fireEvent.click(getByText('inc')) - await findByText('count: 3') - - fireEvent.click(getByText('undo')) - await findByText('count: 2') - - fireEvent.click(getByText('redo')) - await findByText('count: 3') - - fireEvent.click(getByText('undo')) - await findByText('count: 2') - - fireEvent.click(getByText('undo')) - await findByText('count: 1') - - fireEvent.click(getByText('undo')) - await findByText('count: 0') - - fireEvent.click(getByText('inc')) - await findByText('count: 1') - - fireEvent.click(getByText('undo')) - await findByText('count: 0') -}) - -it('multiple redos at once (#323)', async () => { - const state = proxyWithHistory({ nested: { count: 0 } }) - - const Counter = () => { - const snap = useSnapshot(state) - return ( - <> -
count: {snap.value.nested.count}
- - - - - ) - } - - const { getByText, findByText } = render( - - - , - ) - - await findByText('count: 0') - - fireEvent.click(getByText('inc')) - await findByText('count: 1') - fireEvent.click(getByText('inc')) - await findByText('count: 2') - - fireEvent.click(getByText('undo twice')) - await findByText('count: 0') - - fireEvent.click(getByText('redo twice')) - await findByText('count: 2') -}) - -it('nested array (#516)', async () => { - interface Level1Interface { - level1Values: number[] - } - interface Level0Interface { - level0Values: Level1Interface[] - } - const state = proxyWithHistory({ - level0Values: [{ level1Values: [0, 1] }, { level1Values: [2, 3] }], - }) - - const NestedArray = () => { - const snap = useSnapshot(state) - return ( - <> -
values: {JSON.stringify(snap.value)}
- - - - - - ) - } - - const { getByText, findByText } = render( - - - , - ) - - await findByText( - 'values: {"level0Values":[{"level1Values":[0,1]},{"level1Values":[2,3]}]}', - ) - - fireEvent.click(getByText('change 2 to 10')) - await findByText( - 'values: {"level0Values":[{"level1Values":[0,1]},{"level1Values":[10,3]}]}', - ) - - fireEvent.click(getByText('change 10 to 11')) - await findByText( - 'values: {"level0Values":[{"level1Values":[0,1]},{"level1Values":[11,3]}]}', - ) - - fireEvent.click(getByText('undo')) // => 11 back to 10 - await findByText( - 'values: {"level0Values":[{"level1Values":[0,1]},{"level1Values":[10,3]}]}', - ) - - fireEvent.click(getByText('change 0 to 12')) - await findByText( - 'values: {"level0Values":[{"level1Values":[12,1]},{"level1Values":[10,3]}]}', - ) - - fireEvent.click(getByText('undo')) // => 12 back to 0 - await findByText( - 'values: {"level0Values":[{"level1Values":[0,1]},{"level1Values":[10,3]}]}', - ) - - fireEvent.click(getByText('undo')) // => 10 back to 2 - await findByText( - 'values: {"level0Values":[{"level1Values":[0,1]},{"level1Values":[2,3]}]}', - ) -}) From 9e8bcff4d4f7f86ef9b5281452d7e337c0d22fc2 Mon Sep 17 00:00:00 2001 From: daishi Date: Sat, 6 Jan 2024 12:24:30 +0900 Subject: [PATCH 17/35] 2.0.0-alpha.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d67e2642..816e9ef8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "valtio", "private": true, - "version": "2.0.0-alpha.1", + "version": "2.0.0-alpha.2", "publishConfig": { "tag": "next" }, From 4162033ae4c8054a09dbec60f6fdbbae03b6c928 Mon Sep 17 00:00:00 2001 From: daishi Date: Fri, 9 Feb 2024 11:00:44 +0900 Subject: [PATCH 18/35] update react canary --- package.json | 4 ++-- yarn.lock | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 3b43c45f..7a4300b7 100644 --- a/package.json +++ b/package.json @@ -140,8 +140,8 @@ "postinstall-postinstall": "^2.1.0", "prettier": "^3.2.5", "proxy-memoize": "^2.0.5", - "react": "18.3.0-canary-1d5667a12-20240102", - "react-dom": "18.3.0-canary-1d5667a12-20240102", + "react": "18.3.0-canary-ba5e6a832-20240208", + "react-dom": "18.3.0-canary-ba5e6a832-20240208", "redux": "^5.0.1", "rollup": "^4.9.6", "rollup-plugin-esbuild": "^6.1.1", diff --git a/yarn.lock b/yarn.lock index 48829b9e..8df9b410 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3981,13 +3981,13 @@ queue-microtask@^1.2.2: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -react-dom@18.3.0-canary-1d5667a12-20240102: - version "18.3.0-canary-1d5667a12-20240102" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.0-canary-1d5667a12-20240102.tgz#5a8ce2968a9ba8f9bfd6591f6043188354b3e4e9" - integrity sha512-ixKWuDTumxBTJTciS/dt68MlRQVotqsA9jmCraEfjpPdcT9otROP1Cojc7ngJW1QHeJILpPBxnD3tAqDUTJrzQ== +react-dom@18.3.0-canary-ba5e6a832-20240208: + version "18.3.0-canary-ba5e6a832-20240208" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.0-canary-ba5e6a832-20240208.tgz#fb6f50a06604471be032955bba126edacc5b353d" + integrity sha512-3dpBZi5Lx+4xN/C05hJlN/Phqt11cSJYMYxG3r0WN3R+XpzeyUeeForbdYco0IIQRPGS+7tuAr3Nce3KW8f2KQ== dependencies: loose-envify "^1.1.0" - scheduler "0.24.0-canary-1d5667a12-20240102" + scheduler "0.24.0-canary-ba5e6a832-20240208" react-is@^16.13.1: version "16.13.1" @@ -4004,10 +4004,10 @@ react-is@^18.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== -react@18.3.0-canary-1d5667a12-20240102: - version "18.3.0-canary-1d5667a12-20240102" - resolved "https://registry.yarnpkg.com/react/-/react-18.3.0-canary-1d5667a12-20240102.tgz#9d7f28aa49f3b0923b9b05fb40462938ec508dee" - integrity sha512-luErMzExiPt9LGO2xDTdspTCK0PEJIWU5vh9kgXWm3bGQ1WWndLPIyfijrqjvxBIESiGtMPthbuAaYC3LSKdLw== +react@18.3.0-canary-ba5e6a832-20240208: + version "18.3.0-canary-ba5e6a832-20240208" + resolved "https://registry.yarnpkg.com/react/-/react-18.3.0-canary-ba5e6a832-20240208.tgz#f292bdd347bf2489aa96357be7b85b63d8ab8484" + integrity sha512-4LxODieOAtk45+1NkxnLqx7IsPUkN2+bgiX6H4MtioKQ/AemuRWxwy5rQFxpKHcb2VhKYwXpXkWSYprvhy7sfw== dependencies: loose-envify "^1.1.0" @@ -4227,10 +4227,10 @@ saxes@^6.0.0: dependencies: xmlchars "^2.2.0" -scheduler@0.24.0-canary-1d5667a12-20240102: - version "0.24.0-canary-1d5667a12-20240102" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.24.0-canary-1d5667a12-20240102.tgz#960b8a098f950dd6063f9b7331e88e9f004857cb" - integrity sha512-jA44VizQkad/Waf3AmFKnYe0sPKNaJ6CdMEgLtMe3lVCvx8kDNSnF5rKsDHikWnyWWoDLrdIsSJ33HXFGI1HeA== +scheduler@0.24.0-canary-ba5e6a832-20240208: + version "0.24.0-canary-ba5e6a832-20240208" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.24.0-canary-ba5e6a832-20240208.tgz#b14123f93eb736a69d966c08e7b6d568c5eb5ac0" + integrity sha512-9JV5F8f0c5mUFeGQ3gGEyjmYaoNIHn5RiGp/eaag0EHxMl0f9kMBtxT9b/H4tuI7o3OTtd/qRUNXm7krIrH+6w== dependencies: loose-envify "^1.1.0" From fae36c9f5b794f255aca7abe0b94e079ebea586d Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Fri, 9 Feb 2024 11:15:22 +0900 Subject: [PATCH 19/35] [v2] export Snapshot type (#856) --- src/react.ts | 2 +- src/vanilla.ts | 8 +------- tests/snapshot.test.ts | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/react.ts b/src/react.ts index cb5a83f3..91cf9e8c 100644 --- a/src/react.ts +++ b/src/react.ts @@ -12,7 +12,7 @@ import { isChanged, } from 'proxy-compare' import { snapshot, subscribe } from './vanilla.ts' -import type { INTERNAL_Snapshot as Snapshot } from './vanilla.ts' +import type { Snapshot } from './vanilla.ts' const useAffectedDebugValue = ( state: object, diff --git a/src/vanilla.ts b/src/vanilla.ts index 99bd87a2..6601700d 100644 --- a/src/vanilla.ts +++ b/src/vanilla.ts @@ -28,7 +28,7 @@ type SnapshotIgnore = | AnyFunction | Primitive -type Snapshot = T extends { $$valtioSnapshot: infer S } +export type Snapshot = T extends { $$valtioSnapshot: infer S } ? S : T extends SnapshotIgnore ? T @@ -36,12 +36,6 @@ type Snapshot = T extends { $$valtioSnapshot: infer S } ? { readonly [K in keyof T]: Snapshot } : T -/** - * This is not a public API. - * It can be changed without any notice. - */ -export type INTERNAL_Snapshot = Snapshot - type CreateSnapshot = (target: T, version: number) => T type RemoveListener = () => void diff --git a/tests/snapshot.test.ts b/tests/snapshot.test.ts index ffaa85d0..3f492f24 100644 --- a/tests/snapshot.test.ts +++ b/tests/snapshot.test.ts @@ -1,7 +1,7 @@ import { createProxy, getUntracked } from 'proxy-compare' import { TypeEqual, expectType } from 'ts-expect' import { describe, expect, it } from 'vitest' -import { INTERNAL_Snapshot as Snapshot, proxy, snapshot } from 'valtio' +import { Snapshot, proxy, snapshot } from 'valtio' it('should return correct snapshots without subscribe', async () => { const child = proxy({ count: 0 }) From 990fb1a545c68275e95fd675b7864d319fe7292e Mon Sep 17 00:00:00 2001 From: daishi Date: Fri, 9 Feb 2024 11:17:04 +0900 Subject: [PATCH 20/35] 2.0.0-beta.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7a4300b7..eda779cc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "valtio", "private": true, - "version": "2.0.0-alpha.2", + "version": "2.0.0-beta.0", "publishConfig": { "tag": "next" }, From 9d0dc69d70a6d7f5ff836b2b000238012c601ffd Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Sat, 2 Mar 2024 23:18:37 +0900 Subject: [PATCH 21/35] [v2] drop es5 (#865) --- package.json | 5 ----- rollup.config.js | 28 ++++++---------------------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 2b278427..04c8ab7b 100644 --- a/package.json +++ b/package.json @@ -107,13 +107,8 @@ "proxy-compare": "2.6.0" }, "devDependencies": { - "@babel/core": "^7.24.0", - "@babel/plugin-transform-react-jsx": "^7.23.4", - "@babel/plugin-transform-typescript": "^7.23.6", - "@babel/preset-env": "^7.24.0", "@redux-devtools/extension": "^3.3.0", "@rollup/plugin-alias": "^5.1.0", - "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-replace": "^5.0.5", "@rollup/plugin-typescript": "^11.1.6", diff --git a/rollup.config.js b/rollup.config.js index ba464207..c1020cc6 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,5 @@ const path = require('path') const alias = require('@rollup/plugin-alias') -const babelPlugin = require('@rollup/plugin-babel') const resolve = require('@rollup/plugin-node-resolve') const replace = require('@rollup/plugin-replace') const typescript = require('@rollup/plugin-typescript') @@ -19,24 +18,9 @@ function external(id) { return !id.startsWith('.') && !id.startsWith(root) } -function getBabelOptions(targets) { - return { - babelrc: false, - ignore: ['./node_modules'], - presets: [['@babel/preset-env', { loose: true, modules: false, targets }]], - plugins: [ - ['@babel/plugin-transform-react-jsx', { runtime: 'automatic' }], - ['@babel/plugin-transform-typescript', { isTSX: true }], - ], - extensions, - comments: false, - babelHelpers: 'bundled', - } -} - -function getEsbuild(env = 'development') { +function getEsbuild(format) { return esbuild({ - minify: env === 'production', + format, target: 'es2018', supported: { 'import-meta': true }, tsconfig: path.resolve('./tsconfig.json'), @@ -80,7 +64,7 @@ function createESMConfig(input, output) { delimiters: ['\\b', '\\b(?!(\\.|/))'], preventAssignment: true, }), - getEsbuild(), + getEsbuild('esm'), ], } } @@ -88,7 +72,7 @@ function createESMConfig(input, output) { function createCommonJSConfig(input, output) { return { input, - output: { file: `${output}.js`, format: 'cjs' }, + output: { file: output, format: 'cjs' }, external, plugins: [ alias({ entries: entries.filter((e) => !e.find.test(input)) }), @@ -98,7 +82,7 @@ function createCommonJSConfig(input, output) { delimiters: ['\\b', '\\b(?!(\\.|/))'], preventAssignment: true, }), - babelPlugin(getBabelOptions({ ie: 11 })), + getEsbuild('cjs'), ], } } @@ -112,7 +96,7 @@ module.exports = function (args) { } return [ ...(c === 'index' ? [createDeclarationConfig(`src/${c}.ts`, 'dist')] : []), - createCommonJSConfig(`src/${c}.ts`, `dist/${c}`), + createCommonJSConfig(`src/${c}.ts`, `dist/${c}.js`), createESMConfig(`src/${c}.ts`, `dist/esm/${c}.mjs`), ] } From 2fc4b82e9cb6f23eadefa53bc61fcd009156f947 Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Sat, 2 Mar 2024 23:31:02 +0900 Subject: [PATCH 22/35] breaking: compatibility with memo (#866) --- src/react.ts | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/react.ts b/src/react.ts index 91cf9e8c..ec7077ca 100644 --- a/src/react.ts +++ b/src/react.ts @@ -110,8 +110,9 @@ export function useSnapshot( options?: Options, ): Snapshot { const notifyInSync = options?.sync + // per-hook affected, it's not ideal but memo compatible + const affected = useMemo(() => new WeakMap(), []) const lastSnapshot = useRef>() - const lastAffected = useRef>() let inRender = true const currSnapshot = useSyncExternalStore( useCallback( @@ -128,11 +129,10 @@ export function useSnapshot( if ( !inRender && lastSnapshot.current && - lastAffected.current && !isChanged( lastSnapshot.current, nextSnapshot, - lastAffected.current, + affected, new WeakMap(), ) ) { @@ -147,20 +147,13 @@ export function useSnapshot( () => snapshot(proxyObject), ) inRender = false - const currAffected = new WeakMap() useEffect(() => { lastSnapshot.current = currSnapshot - lastAffected.current = currAffected }) if (import.meta.env?.MODE !== 'production') { // eslint-disable-next-line react-hooks/rules-of-hooks - useAffectedDebugValue(currSnapshot, currAffected) + useAffectedDebugValue(currSnapshot, affected) } const proxyCache = useMemo(() => new WeakMap(), []) // per-hook proxyCache - return createProxyToCompare( - currSnapshot, - currAffected, - proxyCache, - targetCache, - ) + return createProxyToCompare(currSnapshot, affected, proxyCache, targetCache) } From c91a6bf7ab617e2b8cf3d57038520ac48f7a0e2b Mon Sep 17 00:00:00 2001 From: daishi Date: Sat, 2 Mar 2024 23:31:51 +0900 Subject: [PATCH 23/35] update yarn lock --- yarn.lock | 1132 +---------------------------------------------------- 1 file changed, 7 insertions(+), 1125 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7c180f19..089db9c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,7 +7,7 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== -"@ampproject/remapping@^2.2.0", "@ampproject/remapping@^2.2.1": +"@ampproject/remapping@^2.2.1": version "2.3.0" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.3.0.tgz#ed441b6fa600072520ce18b43d2c8cc8caecc7f4" integrity sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw== @@ -15,7 +15,7 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" -"@babel/code-frame@^7.10.4", "@babel/code-frame@^7.23.5": +"@babel/code-frame@^7.10.4": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== @@ -23,231 +23,11 @@ "@babel/highlight" "^7.23.4" chalk "^2.4.2" -"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.23.5": - version "7.23.5" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.5.tgz#ffb878728bb6bdcb6f4510aa51b1be9afb8cfd98" - integrity sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw== - -"@babel/core@^7.24.0": - version "7.24.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.24.0.tgz#56cbda6b185ae9d9bed369816a8f4423c5f2ff1b" - integrity sha512-fQfkg0Gjkza3nf0c7/w6Xf34BW4YvzNfACRLmmb7XRLa6XHdR+K9AlJlxneFfWYf6uhOzuzZVTjF/8KfndZANw== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.23.5" - "@babel/generator" "^7.23.6" - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helpers" "^7.24.0" - "@babel/parser" "^7.24.0" - "@babel/template" "^7.24.0" - "@babel/traverse" "^7.24.0" - "@babel/types" "^7.24.0" - convert-source-map "^2.0.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.3" - semver "^6.3.1" - -"@babel/generator@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" - integrity sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== - dependencies: - "@babel/types" "^7.23.6" - "@jridgewell/gen-mapping" "^0.3.2" - "@jridgewell/trace-mapping" "^0.3.17" - jsesc "^2.5.1" - -"@babel/helper-annotate-as-pure@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" - integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-builder-binary-assignment-operator-visitor@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.15.tgz#5426b109cf3ad47b91120f8328d8ab1be8b0b956" - integrity sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw== - dependencies: - "@babel/types" "^7.22.15" - -"@babel/helper-compilation-targets@^7.22.15", "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz#4d79069b16cbcf1461289eccfbbd81501ae39991" - integrity sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ== - dependencies: - "@babel/compat-data" "^7.23.5" - "@babel/helper-validator-option" "^7.23.5" - browserslist "^4.22.2" - lru-cache "^5.1.1" - semver "^6.3.1" - -"@babel/helper-create-class-features-plugin@^7.22.15", "@babel/helper-create-class-features-plugin@^7.23.6": - version "7.24.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.0.tgz#fc7554141bdbfa2d17f7b4b80153b9b090e5d158" - integrity sha512-QAH+vfvts51BCsNZ2PhY6HAggnlS6omLLFTsIpeqZk/MmJ6cW7tgz5yRv0fMJThcr6FmbMrENh1RgrWPTYA76g== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-member-expression-to-functions" "^7.23.0" - "@babel/helper-optimise-call-expression" "^7.22.5" - "@babel/helper-replace-supers" "^7.22.20" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - semver "^6.3.1" - -"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.22.15", "@babel/helper-create-regexp-features-plugin@^7.22.5": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz#5ee90093914ea09639b01c711db0d6775e558be1" - integrity sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - regexpu-core "^5.3.1" - semver "^6.3.1" - -"@babel/helper-define-polyfill-provider@^0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.5.0.tgz#465805b7361f461e86c680f1de21eaf88c25901b" - integrity sha512-NovQquuQLAQ5HuyjCz7WQP9MjRj7dx++yspwiyUiGl9ZyadHRSql1HZh5ogRd8W8w6YM6EQ/NTB8rgjLt5W65Q== - dependencies: - "@babel/helper-compilation-targets" "^7.22.6" - "@babel/helper-plugin-utils" "^7.22.5" - debug "^4.1.1" - lodash.debounce "^4.0.8" - resolve "^1.14.2" - -"@babel/helper-environment-visitor@^7.22.20": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" - integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== - -"@babel/helper-function-name@^7.22.5", "@babel/helper-function-name@^7.23.0": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" - integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== - dependencies: - "@babel/template" "^7.22.15" - "@babel/types" "^7.23.0" - -"@babel/helper-hoist-variables@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" - integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-member-expression-to-functions@^7.22.15", "@babel/helper-member-expression-to-functions@^7.23.0": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz#9263e88cc5e41d39ec18c9a3e0eced59a3e7d366" - integrity sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA== - dependencies: - "@babel/types" "^7.23.0" - -"@babel/helper-module-imports@^7.18.6", "@babel/helper-module-imports@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" - integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== - dependencies: - "@babel/types" "^7.22.15" - -"@babel/helper-module-transforms@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" - integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== - dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-module-imports" "^7.22.15" - "@babel/helper-simple-access" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/helper-validator-identifier" "^7.22.20" - -"@babel/helper-optimise-call-expression@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" - integrity sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.24.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.24.0" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz#945681931a52f15ce879fd5b86ce2dae6d3d7f2a" - integrity sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w== - -"@babel/helper-remap-async-to-generator@^7.22.20": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz#7b68e1cb4fa964d2996fd063723fb48eca8498e0" - integrity sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-wrap-function" "^7.22.20" - -"@babel/helper-replace-supers@^7.22.20": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.20.tgz#e37d367123ca98fe455a9887734ed2e16eb7a793" - integrity sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw== - dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-member-expression-to-functions" "^7.22.15" - "@babel/helper-optimise-call-expression" "^7.22.5" - -"@babel/helper-simple-access@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" - integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-skip-transparent-expression-wrappers@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" - integrity sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-split-export-declaration@^7.22.6": - version "7.22.6" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" - integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-string-parser@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" - integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== - "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== -"@babel/helper-validator-option@^7.23.5": - version "7.23.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" - integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== - -"@babel/helper-wrap-function@^7.22.20": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz#15352b0b9bfb10fc9c76f79f6342c00e3411a569" - integrity sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw== - dependencies: - "@babel/helper-function-name" "^7.22.5" - "@babel/template" "^7.22.15" - "@babel/types" "^7.22.19" - -"@babel/helpers@^7.24.0": - version "7.24.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.24.0.tgz#a3dd462b41769c95db8091e49cfe019389a9409b" - integrity sha512-ulDZdc0Aj5uLc5nETsa7EPx2L7rM0YJM8r7ck7U73AXi7qOV44IHHRAYZHY6iU1rr3C5N4NtTmMRUJP6kwCWeA== - dependencies: - "@babel/template" "^7.24.0" - "@babel/traverse" "^7.24.0" - "@babel/types" "^7.24.0" - "@babel/highlight@^7.23.4": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" @@ -257,731 +37,13 @@ chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@^7.24.0": - version "7.24.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.0.tgz#26a3d1ff49031c53a97d03b604375f028746a9ac" - integrity sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg== - -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.23.3.tgz#5cd1c87ba9380d0afb78469292c954fee5d2411a" - integrity sha512-iRkKcCqb7iGnq9+3G6rZ+Ciz5VywC4XNRHe57lKM+jOeYAoR0lVqdeeDRfh0tQcTfw/+vBhHn926FmQhLtlFLQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.23.3.tgz#f6652bb16b94f8f9c20c50941e16e9756898dc5d" - integrity sha512-WwlxbfMNdVEpQjZmK5mhm7oSwD3dS6eU+Iwsi4Knl9wAletWem7kaRsGOG+8UEbRyqxY4SS5zvtfXwX+jMxUwQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/plugin-transform-optional-chaining" "^7.23.3" - -"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.23.7": - version "7.23.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.23.7.tgz#516462a95d10a9618f197d39ad291a9b47ae1d7b" - integrity sha512-LlRT7HgaifEpQA1ZgLVOIJZZFVPWN5iReq/7/JixwBtwcoeVGDBD53ZV28rrsLYOZs1Y/EHhA8N/Z6aazHR8cw== - dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2": - version "7.21.0-placeholder-for-preset-env.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz#7844f9289546efa9febac2de4cfe358a050bd703" - integrity sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== - -"@babel/plugin-syntax-async-generators@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" - integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-class-properties@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" - integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-syntax-class-static-block@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" - integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-dynamic-import@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" - integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-export-namespace-from@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" - integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - -"@babel/plugin-syntax-import-assertions@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.23.3.tgz#9c05a7f592982aff1a2768260ad84bcd3f0c77fc" - integrity sha512-lPgDSU+SJLK3xmFDTV2ZRQAiM7UuUjGidwBywFavObCiZc1BeAAcMtHJKUya92hPHO+at63JJPLygilZard8jw== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-syntax-import-attributes@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.23.3.tgz#992aee922cf04512461d7dae3ff6951b90a2dc06" - integrity sha512-pawnE0P9g10xgoP7yKr6CK63K2FMsTE+FZidZO/1PwRdzmAPVs+HS1mAURUsgaoxammTJvULUdIkEK0gOcU2tA== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-syntax-import-meta@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" - integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-json-strings@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" - integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-jsx@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz#8f2e4f8a9b5f9aa16067e142c1ac9cd9f810f473" - integrity sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" - integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" - integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-numeric-separator@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" - integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-object-rest-spread@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" - integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-catch-binding@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" - integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-chaining@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" - integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-private-property-in-object@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" - integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-top-level-await@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" - integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-typescript@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz#24f460c85dbbc983cd2b9c4994178bcc01df958f" - integrity sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-syntax-unicode-sets-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz#d49a3b3e6b52e5be6740022317580234a6a47357" - integrity sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-arrow-functions@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.23.3.tgz#94c6dcfd731af90f27a79509f9ab7fb2120fc38b" - integrity sha512-NzQcQrzaQPkaEwoTm4Mhyl8jI1huEL/WWIEvudjTCMJ9aBZNpsJbMASx7EQECtQQPS/DcnFpo0FIh3LvEO9cxQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-async-generator-functions@^7.23.9": - version "7.23.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.23.9.tgz#9adaeb66fc9634a586c5df139c6240d41ed801ce" - integrity sha512-8Q3veQEDGe14dTYuwagbRtwxQDnytyg1JFu4/HwEMETeofocrB0U0ejBJIXoeG/t2oXZ8kzCyI0ZZfbT80VFNQ== - dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-remap-async-to-generator" "^7.22.20" - "@babel/plugin-syntax-async-generators" "^7.8.4" - -"@babel/plugin-transform-async-to-generator@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.23.3.tgz#d1f513c7a8a506d43f47df2bf25f9254b0b051fa" - integrity sha512-A7LFsKi4U4fomjqXJlZg/u0ft/n8/7n7lpffUP/ZULx/DtV9SGlNKZolHH6PE8Xl1ngCc0M11OaeZptXVkfKSw== - dependencies: - "@babel/helper-module-imports" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-remap-async-to-generator" "^7.22.20" - -"@babel/plugin-transform-block-scoped-functions@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.23.3.tgz#fe1177d715fb569663095e04f3598525d98e8c77" - integrity sha512-vI+0sIaPIO6CNuM9Kk5VmXcMVRiOpDh7w2zZt9GXzmE/9KD70CUEVhvPR/etAeNK/FAEkhxQtXOzVF3EuRL41A== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-block-scoping@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.4.tgz#b2d38589531c6c80fbe25e6b58e763622d2d3cf5" - integrity sha512-0QqbP6B6HOh7/8iNR4CQU2Th/bbRtBp4KS9vcaZd1fZ0wSh5Fyssg0UCIHwxh+ka+pNDREbVLQnHCMHKZfPwfw== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-class-properties@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.23.3.tgz#35c377db11ca92a785a718b6aa4e3ed1eb65dc48" - integrity sha512-uM+AN8yCIjDPccsKGlw271xjJtGii+xQIF/uMPS8H15L12jZTsLfF4o5vNO7d/oUguOyfdikHGc/yi9ge4SGIg== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-class-static-block@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.23.4.tgz#2a202c8787a8964dd11dfcedf994d36bfc844ab5" - integrity sha512-nsWu/1M+ggti1SOALj3hfx5FXzAY06fwPJsUZD4/A5e1bWi46VUIWtD+kOX6/IdhXGsXBWllLFDSnqSCdUNydQ== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - -"@babel/plugin-transform-classes@^7.23.8": - version "7.23.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.8.tgz#d08ae096c240347badd68cdf1b6d1624a6435d92" - integrity sha512-yAYslGsY1bX6Knmg46RjiCiNSwJKv2IUC8qOdYKqMMr0491SXFhcHqOdRDeCRohOOIzwN/90C6mQ9qAKgrP7dg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-replace-supers" "^7.22.20" - "@babel/helper-split-export-declaration" "^7.22.6" - globals "^11.1.0" - -"@babel/plugin-transform-computed-properties@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.23.3.tgz#652e69561fcc9d2b50ba4f7ac7f60dcf65e86474" - integrity sha512-dTj83UVTLw/+nbiHqQSFdwO9CbTtwq1DsDqm3CUEtDrZNET5rT5E6bIdTlOftDTDLMYxvxHNEYO4B9SLl8SLZw== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/template" "^7.22.15" - -"@babel/plugin-transform-destructuring@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.23.3.tgz#8c9ee68228b12ae3dff986e56ed1ba4f3c446311" - integrity sha512-n225npDqjDIr967cMScVKHXJs7rout1q+tt50inyBCPkyZ8KxeI6d+GIbSBTT/w/9WdlWDOej3V9HE5Lgk57gw== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-dotall-regex@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.23.3.tgz#3f7af6054882ede89c378d0cf889b854a993da50" - integrity sha512-vgnFYDHAKzFaTVp+mneDsIEbnJ2Np/9ng9iviHw3P/KVcgONxpNULEW/51Z/BaFojG2GI2GwwXck5uV1+1NOYQ== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-duplicate-keys@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.23.3.tgz#664706ca0a5dfe8d066537f99032fc1dc8b720ce" - integrity sha512-RrqQ+BQmU3Oyav3J+7/myfvRCq7Tbz+kKLLshUmMwNlDHExbGL7ARhajvoBJEvc+fCguPPu887N+3RRXBVKZUA== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-dynamic-import@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.23.4.tgz#c7629e7254011ac3630d47d7f34ddd40ca535143" - integrity sha512-V6jIbLhdJK86MaLh4Jpghi8ho5fGzt3imHOBu/x0jlBaPYqDoWz4RDXjmMOfnh+JWNaQleEAByZLV0QzBT4YQQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - -"@babel/plugin-transform-exponentiation-operator@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.23.3.tgz#ea0d978f6b9232ba4722f3dbecdd18f450babd18" - integrity sha512-5fhCsl1odX96u7ILKHBj4/Y8vipoqwsJMh4csSA8qFfxrZDEA4Ssku2DyNvMJSmZNOEBT750LfFPbtrnTP90BQ== - dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-export-namespace-from@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.23.4.tgz#084c7b25e9a5c8271e987a08cf85807b80283191" - integrity sha512-GzuSBcKkx62dGzZI1WVgTWvkkz84FZO5TC5T8dl/Tht/rAla6Dg/Mz9Yhypg+ezVACf/rgDuQt3kbWEv7LdUDQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - -"@babel/plugin-transform-for-of@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.23.6.tgz#81c37e24171b37b370ba6aaffa7ac86bcb46f94e" - integrity sha512-aYH4ytZ0qSuBbpfhuofbg/e96oQ7U2w1Aw/UQmKT+1l39uEhUPoFS3fHevDc1G0OvewyDudfMKY1OulczHzWIw== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - -"@babel/plugin-transform-function-name@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.23.3.tgz#8f424fcd862bf84cb9a1a6b42bc2f47ed630f8dc" - integrity sha512-I1QXp1LxIvt8yLaib49dRW5Okt7Q4oaxao6tFVKS/anCdEOMtYwWVKoiOA1p34GOWIZjUK0E+zCp7+l1pfQyiw== - dependencies: - "@babel/helper-compilation-targets" "^7.22.15" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-json-strings@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.23.4.tgz#a871d9b6bd171976efad2e43e694c961ffa3714d" - integrity sha512-81nTOqM1dMwZ/aRXQ59zVubN9wHGqk6UtqRK+/q+ciXmRy8fSolhGVvG09HHRGo4l6fr/c4ZhXUQH0uFW7PZbg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-json-strings" "^7.8.3" - -"@babel/plugin-transform-literals@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.23.3.tgz#8214665f00506ead73de157eba233e7381f3beb4" - integrity sha512-wZ0PIXRxnwZvl9AYpqNUxpZ5BiTGrYt7kueGQ+N5FiQ7RCOD4cm8iShd6S6ggfVIWaJf2EMk8eRzAh52RfP4rQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-logical-assignment-operators@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.23.4.tgz#e599f82c51d55fac725f62ce55d3a0886279ecb5" - integrity sha512-Mc/ALf1rmZTP4JKKEhUwiORU+vcfarFVLfcFiolKUo6sewoxSEgl36ak5t+4WamRsNr6nzjZXQjM35WsU+9vbg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - -"@babel/plugin-transform-member-expression-literals@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.23.3.tgz#e37b3f0502289f477ac0e776b05a833d853cabcc" - integrity sha512-sC3LdDBDi5x96LA+Ytekz2ZPk8i/Ck+DEuDbRAll5rknJ5XRTSaPKEYwomLcs1AA8wg9b3KjIQRsnApj+q51Ag== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-modules-amd@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.23.3.tgz#e19b55436a1416829df0a1afc495deedfae17f7d" - integrity sha512-vJYQGxeKM4t8hYCKVBlZX/gtIY2I7mRGFNcm85sgXGMTBcoV3QdVtdpbcWEbzbfUIUZKwvgFT82mRvaQIebZzw== - dependencies: - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-modules-commonjs@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.3.tgz#661ae831b9577e52be57dd8356b734f9700b53b4" - integrity sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA== - dependencies: - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-simple-access" "^7.22.5" - -"@babel/plugin-transform-modules-systemjs@^7.23.9": - version "7.23.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.9.tgz#105d3ed46e4a21d257f83a2f9e2ee4203ceda6be" - integrity sha512-KDlPRM6sLo4o1FkiSlXoAa8edLXFsKKIda779fbLrvmeuc3itnjCtaO6RrtoaANsIJANj+Vk1zqbZIMhkCAHVw== - dependencies: - "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-validator-identifier" "^7.22.20" - -"@babel/plugin-transform-modules-umd@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.23.3.tgz#5d4395fccd071dfefe6585a4411aa7d6b7d769e9" - integrity sha512-zHsy9iXX2nIsCBFPud3jKn1IRPWg3Ing1qOZgeKV39m1ZgIdpJqvlWVeiHBZC6ITRG0MfskhYe9cLgntfSFPIg== - dependencies: - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-named-capturing-groups-regex@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz#67fe18ee8ce02d57c855185e27e3dc959b2e991f" - integrity sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.22.5" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-new-target@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.23.3.tgz#5491bb78ed6ac87e990957cea367eab781c4d980" - integrity sha512-YJ3xKqtJMAT5/TIZnpAR3I+K+WaDowYbN3xyxI8zxx/Gsypwf9B9h0VB+1Nh6ACAAPRS5NSRje0uVv5i79HYGQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-nullish-coalescing-operator@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.23.4.tgz#45556aad123fc6e52189ea749e33ce090637346e" - integrity sha512-jHE9EVVqHKAQx+VePv5LLGHjmHSJR76vawFPTdlxR/LVJPfOEGxREQwQfjuZEOPTwG92X3LINSh3M40Rv4zpVA== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - -"@babel/plugin-transform-numeric-separator@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.23.4.tgz#03d08e3691e405804ecdd19dd278a40cca531f29" - integrity sha512-mps6auzgwjRrwKEZA05cOwuDc9FAzoyFS4ZsG/8F43bTLf/TgkJg7QXOrPO1JO599iA3qgK9MXdMGOEC8O1h6Q== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - -"@babel/plugin-transform-object-rest-spread@^7.24.0": - version "7.24.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.24.0.tgz#7b836ad0088fdded2420ce96d4e1d3ed78b71df1" - integrity sha512-y/yKMm7buHpFFXfxVFS4Vk1ToRJDilIa6fKRioB9Vjichv58TDGXTvqV0dN7plobAmTW5eSEGXDngE+Mm+uO+w== - dependencies: - "@babel/compat-data" "^7.23.5" - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.23.3" - -"@babel/plugin-transform-object-super@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.23.3.tgz#81fdb636dcb306dd2e4e8fd80db5b2362ed2ebcd" - integrity sha512-BwQ8q0x2JG+3lxCVFohg+KbQM7plfpBwThdW9A6TMtWwLsbDA01Ek2Zb/AgDN39BiZsExm4qrXxjk+P1/fzGrA== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-replace-supers" "^7.22.20" - -"@babel/plugin-transform-optional-catch-binding@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.23.4.tgz#318066de6dacce7d92fa244ae475aa8d91778017" - integrity sha512-XIq8t0rJPHf6Wvmbn9nFxU6ao4c7WhghTR5WyV8SrJfUFzyxhCm4nhC+iAp3HFhbAKLfYpgzhJ6t4XCtVwqO5A== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - -"@babel/plugin-transform-optional-chaining@^7.23.3", "@babel/plugin-transform-optional-chaining@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.4.tgz#6acf61203bdfc4de9d4e52e64490aeb3e52bd017" - integrity sha512-ZU8y5zWOfjM5vZ+asjgAPwDaBjJzgufjES89Rs4Lpq63O300R/kOz30WCLo6BxxX6QVEilwSlpClnG5cZaikTA== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - -"@babel/plugin-transform-parameters@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.23.3.tgz#83ef5d1baf4b1072fa6e54b2b0999a7b2527e2af" - integrity sha512-09lMt6UsUb3/34BbECKVbVwrT9bO6lILWln237z7sLaWnMsTi7Yc9fhX5DLpkJzAGfaReXI22wP41SZmnAA3Vw== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-private-methods@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.23.3.tgz#b2d7a3c97e278bfe59137a978d53b2c2e038c0e4" - integrity sha512-UzqRcRtWsDMTLrRWFvUBDwmw06tCQH9Rl1uAjfh6ijMSmGYQ+fpdB+cnqRC8EMh5tuuxSv0/TejGL+7vyj+50g== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-private-property-in-object@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.23.4.tgz#3ec711d05d6608fd173d9b8de39872d8dbf68bf5" - integrity sha512-9G3K1YqTq3F4Vt88Djx1UZ79PDyj+yKRnUy7cZGSMe+a7jkwD259uKKuUzQlPkGam7R+8RJwh5z4xO27fA1o2A== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-create-class-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - -"@babel/plugin-transform-property-literals@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.23.3.tgz#54518f14ac4755d22b92162e4a852d308a560875" - integrity sha512-jR3Jn3y7cZp4oEWPFAlRsSWjxKe4PZILGBSd4nis1TsC5qeSpb+nrtihJuDhNI7QHiVbUaiXa0X2RZY3/TI6Nw== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-react-jsx@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.23.4.tgz#393f99185110cea87184ea47bcb4a7b0c2e39312" - integrity sha512-5xOpoPguCZCRbo/JeHlloSkTA8Bld1J/E1/kLfD1nsuiW1m8tduTA1ERCgIZokDflX/IBzKcqR3l7VlRgiIfHA== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-module-imports" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-jsx" "^7.23.3" - "@babel/types" "^7.23.4" - -"@babel/plugin-transform-regenerator@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.23.3.tgz#141afd4a2057298602069fce7f2dc5173e6c561c" - integrity sha512-KP+75h0KghBMcVpuKisx3XTu9Ncut8Q8TuvGO4IhY+9D5DFEckQefOuIsB/gQ2tG71lCke4NMrtIPS8pOj18BQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - regenerator-transform "^0.15.2" - -"@babel/plugin-transform-reserved-words@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.23.3.tgz#4130dcee12bd3dd5705c587947eb715da12efac8" - integrity sha512-QnNTazY54YqgGxwIexMZva9gqbPa15t/x9VS+0fsEFWplwVpXYZivtgl43Z1vMpc1bdPP2PP8siFeVcnFvA3Cg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-shorthand-properties@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.23.3.tgz#97d82a39b0e0c24f8a981568a8ed851745f59210" - integrity sha512-ED2fgqZLmexWiN+YNFX26fx4gh5qHDhn1O2gvEhreLW2iI63Sqm4llRLCXALKrCnbN4Jy0VcMQZl/SAzqug/jg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-spread@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.23.3.tgz#41d17aacb12bde55168403c6f2d6bdca563d362c" - integrity sha512-VvfVYlrlBVu+77xVTOAoxQ6mZbnIq5FM0aGBSFEcIh03qHf+zNqA4DC/3XMUozTg7bZV3e3mZQ0i13VB6v5yUg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - -"@babel/plugin-transform-sticky-regex@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.23.3.tgz#dec45588ab4a723cb579c609b294a3d1bd22ff04" - integrity sha512-HZOyN9g+rtvnOU3Yh7kSxXrKbzgrm5X4GncPY1QOquu7epga5MxKHVpYu2hvQnry/H+JjckSYRb93iNfsioAGg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-template-literals@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.23.3.tgz#5f0f028eb14e50b5d0f76be57f90045757539d07" - integrity sha512-Flok06AYNp7GV2oJPZZcP9vZdszev6vPBkHLwxwSpaIqx75wn6mUd3UFWsSsA0l8nXAKkyCmL/sR02m8RYGeHg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-typeof-symbol@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.23.3.tgz#9dfab97acc87495c0c449014eb9c547d8966bca4" - integrity sha512-4t15ViVnaFdrPC74be1gXBSMzXk3B4Us9lP7uLRQHTFpV5Dvt33pn+2MyyNxmN3VTTm3oTrZVMUmuw3oBnQ2oQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-typescript@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.23.6.tgz#aa36a94e5da8d94339ae3a4e22d40ed287feb34c" - integrity sha512-6cBG5mBvUu4VUD04OHKnYzbuHNP8huDsD3EDqqpIpsswTDoqHCjLoHb6+QgsV1WsT2nipRqCPgxD3LXnEO7XfA== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-create-class-features-plugin" "^7.23.6" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-typescript" "^7.23.3" - -"@babel/plugin-transform-unicode-escapes@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.23.3.tgz#1f66d16cab01fab98d784867d24f70c1ca65b925" - integrity sha512-OMCUx/bU6ChE3r4+ZdylEqAjaQgHAgipgW8nsCfu5pGqDcFytVd91AwRvUJSBZDz0exPGgnjoqhgRYLRjFZc9Q== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-unicode-property-regex@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.23.3.tgz#19e234129e5ffa7205010feec0d94c251083d7ad" - integrity sha512-KcLIm+pDZkWZQAFJ9pdfmh89EwVfmNovFBcXko8szpBeF8z68kWIPeKlmSOkT9BXJxs2C0uk+5LxoxIv62MROA== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-unicode-regex@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.23.3.tgz#26897708d8f42654ca4ce1b73e96140fbad879dc" - integrity sha512-wMHpNA4x2cIA32b/ci3AfwNgheiva2W0WUKWTK7vBHBhDKfPsc5cFGNWm69WBqpwd86u1qwZ9PWevKqm1A3yAw== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-unicode-sets-regex@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.23.3.tgz#4fb6f0a719c2c5859d11f6b55a050cc987f3799e" - integrity sha512-W7lliA/v9bNR83Qc3q1ip9CQMZ09CcHDbHfbLRDNuAhn1Mvkr1ZNF7hPmztMQvtTGVLJ9m8IZqWsTkXOml8dbw== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.22.15" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/preset-env@^7.24.0": - version "7.24.0" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.24.0.tgz#11536a7f4b977294f0bdfad780f01a8ac8e183fc" - integrity sha512-ZxPEzV9IgvGn73iK0E6VB9/95Nd7aMFpbE0l8KQFDG70cOV9IxRP7Y2FUPmlK0v6ImlLqYX50iuZ3ZTVhOF2lA== - dependencies: - "@babel/compat-data" "^7.23.5" - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-plugin-utils" "^7.24.0" - "@babel/helper-validator-option" "^7.23.5" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.23.3" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.23.3" - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly" "^7.23.7" - "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.23.3" - "@babel/plugin-syntax-import-attributes" "^7.23.3" - "@babel/plugin-syntax-import-meta" "^7.10.4" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" - "@babel/plugin-transform-arrow-functions" "^7.23.3" - "@babel/plugin-transform-async-generator-functions" "^7.23.9" - "@babel/plugin-transform-async-to-generator" "^7.23.3" - "@babel/plugin-transform-block-scoped-functions" "^7.23.3" - "@babel/plugin-transform-block-scoping" "^7.23.4" - "@babel/plugin-transform-class-properties" "^7.23.3" - "@babel/plugin-transform-class-static-block" "^7.23.4" - "@babel/plugin-transform-classes" "^7.23.8" - "@babel/plugin-transform-computed-properties" "^7.23.3" - "@babel/plugin-transform-destructuring" "^7.23.3" - "@babel/plugin-transform-dotall-regex" "^7.23.3" - "@babel/plugin-transform-duplicate-keys" "^7.23.3" - "@babel/plugin-transform-dynamic-import" "^7.23.4" - "@babel/plugin-transform-exponentiation-operator" "^7.23.3" - "@babel/plugin-transform-export-namespace-from" "^7.23.4" - "@babel/plugin-transform-for-of" "^7.23.6" - "@babel/plugin-transform-function-name" "^7.23.3" - "@babel/plugin-transform-json-strings" "^7.23.4" - "@babel/plugin-transform-literals" "^7.23.3" - "@babel/plugin-transform-logical-assignment-operators" "^7.23.4" - "@babel/plugin-transform-member-expression-literals" "^7.23.3" - "@babel/plugin-transform-modules-amd" "^7.23.3" - "@babel/plugin-transform-modules-commonjs" "^7.23.3" - "@babel/plugin-transform-modules-systemjs" "^7.23.9" - "@babel/plugin-transform-modules-umd" "^7.23.3" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.22.5" - "@babel/plugin-transform-new-target" "^7.23.3" - "@babel/plugin-transform-nullish-coalescing-operator" "^7.23.4" - "@babel/plugin-transform-numeric-separator" "^7.23.4" - "@babel/plugin-transform-object-rest-spread" "^7.24.0" - "@babel/plugin-transform-object-super" "^7.23.3" - "@babel/plugin-transform-optional-catch-binding" "^7.23.4" - "@babel/plugin-transform-optional-chaining" "^7.23.4" - "@babel/plugin-transform-parameters" "^7.23.3" - "@babel/plugin-transform-private-methods" "^7.23.3" - "@babel/plugin-transform-private-property-in-object" "^7.23.4" - "@babel/plugin-transform-property-literals" "^7.23.3" - "@babel/plugin-transform-regenerator" "^7.23.3" - "@babel/plugin-transform-reserved-words" "^7.23.3" - "@babel/plugin-transform-shorthand-properties" "^7.23.3" - "@babel/plugin-transform-spread" "^7.23.3" - "@babel/plugin-transform-sticky-regex" "^7.23.3" - "@babel/plugin-transform-template-literals" "^7.23.3" - "@babel/plugin-transform-typeof-symbol" "^7.23.3" - "@babel/plugin-transform-unicode-escapes" "^7.23.3" - "@babel/plugin-transform-unicode-property-regex" "^7.23.3" - "@babel/plugin-transform-unicode-regex" "^7.23.3" - "@babel/plugin-transform-unicode-sets-regex" "^7.23.3" - "@babel/preset-modules" "0.1.6-no-external-plugins" - babel-plugin-polyfill-corejs2 "^0.4.8" - babel-plugin-polyfill-corejs3 "^0.9.0" - babel-plugin-polyfill-regenerator "^0.5.5" - core-js-compat "^3.31.0" - semver "^6.3.1" - -"@babel/preset-modules@0.1.6-no-external-plugins": - version "0.1.6-no-external-plugins" - resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz#ccb88a2c49c817236861fee7826080573b8a923a" - integrity sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/types" "^7.4.4" - esutils "^2.0.2" - -"@babel/regjsgen@^0.8.0": - version "0.8.0" - resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" - integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== - -"@babel/runtime@^7.12.5", "@babel/runtime@^7.21.0", "@babel/runtime@^7.23.2", "@babel/runtime@^7.8.4": +"@babel/runtime@^7.12.5", "@babel/runtime@^7.21.0", "@babel/runtime@^7.23.2": version "7.24.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.0.tgz#584c450063ffda59697021430cb47101b085951e" integrity sha512-Chk32uHMg6TnQdvw2e9IlqPpFX/6NLuK0Ys2PqLb7/gL5uFn9mXvK715FGLlOLQrcO4qIkNHkvPGktzzXexsFw== dependencies: regenerator-runtime "^0.14.0" -"@babel/template@^7.22.15", "@babel/template@^7.24.0": - version "7.24.0" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.24.0.tgz#c6a524aa93a4a05d66aaf31654258fae69d87d50" - integrity sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA== - dependencies: - "@babel/code-frame" "^7.23.5" - "@babel/parser" "^7.24.0" - "@babel/types" "^7.24.0" - -"@babel/traverse@^7.24.0": - version "7.24.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.24.0.tgz#4a408fbf364ff73135c714a2ab46a5eab2831b1e" - integrity sha512-HfuJlI8qq3dEDmNU5ChzzpZRWq+oxCZQyMzIMEqLho+AQnhMnKQUzH6ydo3RBl/YjPCuk68Y6s0Gx0AeyULiWw== - dependencies: - "@babel/code-frame" "^7.23.5" - "@babel/generator" "^7.23.6" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.24.0" - "@babel/types" "^7.24.0" - debug "^4.3.1" - globals "^11.1.0" - -"@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.4", "@babel/types@^7.23.6", "@babel/types@^7.24.0", "@babel/types@^7.4.4": - version "7.24.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.0.tgz#3b951f435a92e7333eba05b7566fd297960ea1bf" - integrity sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w== - dependencies: - "@babel/helper-string-parser" "^7.23.4" - "@babel/helper-validator-identifier" "^7.22.20" - to-fast-properties "^2.0.0" - "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -1390,7 +452,7 @@ dependencies: "@sinclair/typebox" "^0.27.8" -"@jridgewell/gen-mapping@^0.3.2", "@jridgewell/gen-mapping@^0.3.5": +"@jridgewell/gen-mapping@^0.3.5": version "0.3.5" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== @@ -1414,7 +476,7 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.24": +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.24": version "0.3.24" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.24.tgz#e5640be1cab4085e4012a94c132ae86138f90f48" integrity sha512-+VaWXDa6+l6MhflBvVXjIEAzb59nQ2JUK3bwRp2zRpPtU+8TFRy9Gg/5oIcNlkEL5PGlBFGfemUVvIgLnTzq7Q== @@ -1468,14 +530,6 @@ dependencies: slash "^4.0.0" -"@rollup/plugin-babel@^6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-6.0.4.tgz#bd698e351fa9aa9619fcae780aea2a603d98e4c4" - integrity sha512-YF7Y52kFdFT/xVSuVdjkV5ZdX/3YtmX0QulG+x0taQOtJdHYzVU61aSSkAgVJ7NOv6qPkIYiJSgSWWN/DM5sGw== - dependencies: - "@babel/helper-module-imports" "^7.18.6" - "@rollup/pluginutils" "^5.0.1" - "@rollup/plugin-node-resolve@^15.2.3": version "15.2.3" resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.3.tgz#e5e0b059bd85ca57489492f295ce88c2d4b0daf9" @@ -2095,30 +1149,6 @@ available-typed-arrays@^1.0.6, available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -babel-plugin-polyfill-corejs2@^0.4.8: - version "0.4.8" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.8.tgz#dbcc3c8ca758a290d47c3c6a490d59429b0d2269" - integrity sha512-OtIuQfafSzpo/LhnJaykc0R/MMnuLSSVjVYy9mHArIZ9qTCSZ6TpWCuEKZYVoN//t8HqBNScHrOtCrIK5IaGLg== - dependencies: - "@babel/compat-data" "^7.22.6" - "@babel/helper-define-polyfill-provider" "^0.5.0" - semver "^6.3.1" - -babel-plugin-polyfill-corejs3@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.9.0.tgz#9eea32349d94556c2ad3ab9b82ebb27d4bf04a81" - integrity sha512-7nZPG1uzK2Ymhy/NbaOWTg3uibM2BmGASS4vHS4szRZAIR8R6GwA/xAujpdrXU5iyklrimWnLWU+BLF9suPTqg== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.5.0" - core-js-compat "^3.34.0" - -babel-plugin-polyfill-regenerator@^0.5.5: - version "0.5.5" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.5.tgz#8b0c8fc6434239e5d7b8a9d1f832bb2b0310f06a" - integrity sha512-OJGYZlhLqBh2DDHeqAxWB1XIvr49CxiJ2gIt61/PU55CQK4Z58OzMqjDe1zwQdQk+rBYsRc+1rJmdajM3gimHg== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.5.0" - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -2146,16 +1176,6 @@ braces@^3.0.2: dependencies: fill-range "^7.0.1" -browserslist@^4.22.2, browserslist@^4.22.3: - version "4.23.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.0.tgz#8f3acc2bbe73af7213399430890f86c63a5674ab" - integrity sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ== - dependencies: - caniuse-lite "^1.0.30001587" - electron-to-chromium "^1.4.668" - node-releases "^2.0.14" - update-browserslist-db "^1.0.13" - builtin-modules@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" @@ -2182,11 +1202,6 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -caniuse-lite@^1.0.30001587: - version "1.0.30001591" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001591.tgz#16745e50263edc9f395895a7cd468b9f3767cf33" - integrity sha512-PCzRMei/vXjJyL5mJtzNiUCKP59dm8Apqc3PH8gJkMnMXZGox93RbE76jHsmLwmIo6/3nsYIpJtx0O7u5PqFuQ== - chai@^4.3.7: version "4.4.1" resolved "https://registry.yarnpkg.com/chai/-/chai-4.4.1.tgz#3603fa6eba35425b0f2ac91a009fe924106e50d1" @@ -2289,13 +1304,6 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -core-js-compat@^3.31.0, core-js-compat@^3.34.0: - version "3.36.0" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.36.0.tgz#087679119bc2fdbdefad0d45d8e5d307d45ba190" - integrity sha512-iV9Pd/PsgjNWBXeq8XRtWVSgz2tKAfhfvBs7qxYty+RlRd+OCksaWmOnc4JKrTc1cToXL1N0s3l/vwlxPtdElw== - dependencies: - browserslist "^4.22.3" - cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -2332,7 +1340,7 @@ date-fns@^2.30.0: dependencies: "@babel/runtime" "^7.21.0" -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: +debug@4, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -2446,11 +1454,6 @@ dom-accessibility-api@^0.5.9: resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz#5a7429e6066eb3664d911e33fb0e45de8eb08453" integrity sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg== -electron-to-chromium@^1.4.668: - version "1.4.690" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.690.tgz#dd5145d45c49c08a9a6f7454127e660bdf9a3fa7" - integrity sha512-+2OAGjUx68xElQhydpcbqH50hE8Vs2K6TkAeLhICYfndb67CVH0UsZaijmRUE3rHlIxU1u0jxwhgVe6fK3YANA== - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -3003,11 +2006,6 @@ functions-have-names@^1.2.3: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== -gensync@^1.0.0-beta.2: - version "1.0.0-beta.2" - resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" - integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== - get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" @@ -3071,11 +2069,6 @@ glob@^7.0.0, glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.1.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - globals@^13.19.0: version "13.24.0" resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171" @@ -3529,16 +2522,6 @@ jsdom@^24.0.0: ws "^8.16.0" xml-name-validator "^5.0.0" -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== - -jsesc@~0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== - json-buffer@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" @@ -3561,11 +2544,6 @@ json5@^1.0.2: dependencies: minimist "^1.2.0" -json5@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" - integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== - json@^11.0.0: version "11.0.0" resolved "https://registry.yarnpkg.com/json/-/json-11.0.0.tgz#2e84493134e2f42c131165aa22a124df38b3a3ee" @@ -3613,11 +2591,6 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" -lodash.debounce@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" - integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== - lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" @@ -3642,13 +2615,6 @@ loupe@^2.3.6: dependencies: get-func-name "^2.0.1" -lru-cache@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" - integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== - dependencies: - yallist "^3.0.2" - lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -3754,11 +2720,6 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== -node-releases@^2.0.14: - version "2.0.14" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" - integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== - nwsapi@^2.2.7: version "2.2.7" resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.7.tgz#738e0707d3128cb750dddcfe90e4610482df0f30" @@ -4101,30 +3062,11 @@ reflect.getprototypeof@^1.0.4: globalthis "^1.0.3" which-builtin-type "^1.1.3" -regenerate-unicode-properties@^10.1.0: - version "10.1.1" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz#6b0e05489d9076b04c436f318d9b067bba459480" - integrity sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q== - dependencies: - regenerate "^1.4.2" - -regenerate@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" - integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== - regenerator-runtime@^0.14.0: version "0.14.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== -regenerator-transform@^0.15.2: - version "0.15.2" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.2.tgz#5bbae58b522098ebdf09bca2f83838929001c7a4" - integrity sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== - dependencies: - "@babel/runtime" "^7.8.4" - regexp.prototype.flags@^1.5.0, regexp.prototype.flags@^1.5.1, regexp.prototype.flags@^1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz#138f644a3350f981a858c44f6bb1a61ff59be334" @@ -4135,25 +3077,6 @@ regexp.prototype.flags@^1.5.0, regexp.prototype.flags@^1.5.1, regexp.prototype.f es-errors "^1.3.0" set-function-name "^2.0.1" -regexpu-core@^5.3.1: - version "5.3.2" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.3.2.tgz#11a2b06884f3527aec3e93dbbf4a3b958a95546b" - integrity sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ== - dependencies: - "@babel/regjsgen" "^0.8.0" - regenerate "^1.4.2" - regenerate-unicode-properties "^10.1.0" - regjsparser "^0.9.1" - unicode-match-property-ecmascript "^2.0.0" - unicode-match-property-value-ecmascript "^2.1.0" - -regjsparser@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709" - integrity sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ== - dependencies: - jsesc "~0.5.0" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -4174,7 +3097,7 @@ resolve-pkg-maps@^1.0.0: resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== -resolve@^1.1.6, resolve@^1.14.2, resolve@^1.22.1, resolve@^1.22.4: +resolve@^1.1.6, resolve@^1.22.1, resolve@^1.22.4: version "1.22.8" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -4577,11 +3500,6 @@ tinyspy@^2.1.1: resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-2.2.1.tgz#117b2342f1f38a0dbdcc73a50a454883adf861d1" integrity sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A== -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -4727,42 +3645,11 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -unicode-canonical-property-names-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" - integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== - -unicode-match-property-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3" - integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== - dependencies: - unicode-canonical-property-names-ecmascript "^2.0.0" - unicode-property-aliases-ecmascript "^2.0.0" - -unicode-match-property-value-ecmascript@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0" - integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== - -unicode-property-aliases-ecmascript@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" - integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== - universalify@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== -update-browserslist-db@^1.0.13: - version "1.0.13" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" - integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== - dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" - uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -4982,11 +3869,6 @@ y18n@^5.0.5: resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== -yallist@^3.0.2: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" From a8e4452e72698db78602151dc03d234143b65ac6 Mon Sep 17 00:00:00 2001 From: daishi Date: Sat, 2 Mar 2024 23:34:22 +0900 Subject: [PATCH 24/35] 2.0.0-beta.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 04c8ab7b..1ad11e6e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "valtio", "private": true, - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "publishConfig": { "tag": "next" }, From c04346db4e662cfa1ace02ef44db9825af78c104 Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Fri, 15 Mar 2024 12:08:07 +0900 Subject: [PATCH 25/35] [v2] fix: make affected per proxy (#868) --- src/react.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/react.ts b/src/react.ts index ec7077ca..c219da16 100644 --- a/src/react.ts +++ b/src/react.ts @@ -110,8 +110,9 @@ export function useSnapshot( options?: Options, ): Snapshot { const notifyInSync = options?.sync - // per-hook affected, it's not ideal but memo compatible - const affected = useMemo(() => new WeakMap(), []) + // per-proxy & per-hook affected, it's not ideal but memo compatible + // eslint-disable-next-line react-hooks/exhaustive-deps + const affected = useMemo(() => new WeakMap(), [proxyObject]) const lastSnapshot = useRef>() let inRender = true const currSnapshot = useSyncExternalStore( From d7d4a14266f0575d864034feee34bcbfaefcf290 Mon Sep 17 00:00:00 2001 From: daishi Date: Fri, 15 Mar 2024 12:18:59 +0900 Subject: [PATCH 26/35] 2.0.0-beta.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1ad11e6e..ca9bee97 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "valtio", "private": true, - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "publishConfig": { "tag": "next" }, From 69505caac03a3bb7dd9c74eb6fa4bf8a7ff0a9b5 Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Sat, 23 Mar 2024 13:02:10 +0900 Subject: [PATCH 27/35] [v2] fix rollup config for cjs (#873) --- rollup.config.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index c1020cc6..b0dc7d3d 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -18,9 +18,8 @@ function external(id) { return !id.startsWith('.') && !id.startsWith(root) } -function getEsbuild(format) { +function getEsbuild() { return esbuild({ - format, target: 'es2018', supported: { 'import-meta': true }, tsconfig: path.resolve('./tsconfig.json'), @@ -64,7 +63,7 @@ function createESMConfig(input, output) { delimiters: ['\\b', '\\b(?!(\\.|/))'], preventAssignment: true, }), - getEsbuild('esm'), + getEsbuild(), ], } } @@ -82,7 +81,7 @@ function createCommonJSConfig(input, output) { delimiters: ['\\b', '\\b(?!(\\.|/))'], preventAssignment: true, }), - getEsbuild('cjs'), + getEsbuild(), ], } } From 9431e8a4d8de3465fa4bdf5c949cc76f2dfde865 Mon Sep 17 00:00:00 2001 From: daishi Date: Sat, 23 Mar 2024 13:19:11 +0900 Subject: [PATCH 28/35] 2.0.0-beta.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ca9bee97..1d61c4d6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "valtio", "private": true, - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "publishConfig": { "tag": "next" }, From 182702f100493013ab5f9436f80411dd6324ee3f Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Fri, 5 Apr 2024 13:07:49 +0900 Subject: [PATCH 29/35] [v2] migration guide (#878) --- docs/guides/migrating-to-v2.mdx | 83 +++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 docs/guides/migrating-to-v2.mdx diff --git a/docs/guides/migrating-to-v2.mdx b/docs/guides/migrating-to-v2.mdx new file mode 100644 index 00000000..9de5f6c1 --- /dev/null +++ b/docs/guides/migrating-to-v2.mdx @@ -0,0 +1,83 @@ +--- +title: 'How to Migrate to v2 from v1' +--- + +# How to Migrate to v2 from v1 + +## Changes in v2 + +React 19 officially introduces the `use` hook to handle promises. +Valtio v1 internally handled promises, which is no longer recommended. +In Valtio v2, promises are not handled internally, +and developers should explicitly use the `use` hook to manage promises. + +Valtio v2 also introduces several changes in its design choices: + +First, the behavior of `proxy(obj)` has changed. In v1, it was a pure function and deeply copied `obj`. In v2, it is an impure function and deeply modifies `obj`. Generally, reusing `obj` is not recommended, and if you have followed this convention, nothing will break. + +Second, the behavior of `useSnapshot()` has been altered. Although it is a subtle change, it is less optimized to ensure compatibility with `useMemo` and the upcoming React compiler. The change may lead to extra re-renders in some edge cases, but it might not be noticeable. + +Other notable changes to keep things updated and fresh include: + +- Removal of all deprecated features +- Requirement of React version 18 and above +- Requirement of TypeScript version 4.5 and above +- The build target updated to ES2018 + +## Migration for breaking changes + +### Resolving promises + +```js +// v1 +import { proxy, useSnapshot } from 'valtio' + +const state = proxy({ data: fetch(...).then((res) => res.json()) }) + +const Component = () => { + const snap = useSnapshot(state) + return <>{JSON.stringify(snap.data)} +} +``` + +```js +// v2 +import { use } from 'react' +import { proxy, useSnapshot } from 'valtio' + +const state = proxy({ data: fetch(...).then((res) => res.json()) }) + +const Component = () => { + const snap = useSnapshot(state) + return <>{JSON.stringify(use(snap.data))} + // If `data` is not an object, you can directly embed it in JSX. + // return <>{snap.data} +} +``` + +### Impure `proxy(obj)` + +```js +// v1 +import { proxy } from 'valtio' + +const state = proxy({ count: 1, obj: { text: 'hi' } }) +state.obj = { text: 'hello' } +``` + +```js +// v2 +import { proxy } from 'valtio' +import { deepClone } from 'valtio/utils' + +const state = proxy(deepClone({ count: 1, obj: { text: 'hi' } })) +state.obj = deepClone({ text: 'hello' }) +``` + +Note that `deepClone` is unnecessary unless you are reusing the object. +It is generally recommended to avoid reusing the object. + +## Links + +- https://github.com/pmndrs/valtio/discussions/703 +- https://github.com/pmndrs/valtio/pull/810 From 32a63be729adc35d53e01dd2a427281118a075a7 Mon Sep 17 00:00:00 2001 From: daishi Date: Sat, 6 Apr 2024 21:37:13 +0900 Subject: [PATCH 30/35] fix workflow file --- .github/workflows/test-multiple-builds.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-multiple-builds.yml b/.github/workflows/test-multiple-builds.yml index 27845a63..17ce31c6 100644 --- a/.github/workflows/test-multiple-builds.yml +++ b/.github/workflows/test-multiple-builds.yml @@ -38,7 +38,6 @@ jobs: if: ${{ matrix.build == 'cjs' }} run: | sed -i~ "s/resolve('\.\/src\(.*\)\.ts')/resolve('\.\/dist\1.js')/" vitest.config.ts - sed -i~ "s/\"valtio\/vanilla\"/\"..\/..\/..\/dist\/vanilla.js\"/" node_modules/derive-valtio/dist/index.umd.js - name: Patch for ESM if: ${{ matrix.build == 'esm' }} run: | From db2f40d409a31ca4833c49917f5e26079e53ff8e Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Mon, 8 Apr 2024 09:58:53 +0900 Subject: [PATCH 31/35] fix: explicit package.json type field (#882) --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index ba03b953..82e2b635 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "valtio", "private": true, + "type": "commonjs", "version": "2.0.0-beta.3", "publishConfig": { "tag": "next" From 05af9f64a4b0cf7676b012fb99416349279def1f Mon Sep 17 00:00:00 2001 From: daishi Date: Mon, 29 Apr 2024 11:34:09 +0900 Subject: [PATCH 32/35] 2.0.0-beta.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4972c436..cc1037c5 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "valtio", "private": true, "type": "commonjs", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "publishConfig": { "tag": "next" }, From 7c71869d99ca3d78b40cba3521c09afdbc115b05 Mon Sep 17 00:00:00 2001 From: Christopher Swasey Date: Fri, 3 May 2024 19:59:22 -0400 Subject: [PATCH 33/35] fix(react): Change to useLayoutEffect in useSnapshot (#891) * Address spurious consistency check re-renders by using useLayoutEffect inside useSnapshot instead of useEffect * Move regression tests for useSnapshot perf improvement to optimization test file * Update tests/optimization.test.tsx --------- Co-authored-by: Daishi Kato --- src/react.ts | 3 +- tests/optimization.test.tsx | 116 ++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 tests/optimization.test.tsx diff --git a/src/react.ts b/src/react.ts index 34632cfc..ce078e67 100644 --- a/src/react.ts +++ b/src/react.ts @@ -2,6 +2,7 @@ import { useCallback, useDebugValue, useEffect, + useLayoutEffect, useMemo, useRef, useSyncExternalStore, @@ -148,7 +149,7 @@ export function useSnapshot( () => snapshot(proxyObject), ) inRender = false - useEffect(() => { + useLayoutEffect(() => { lastSnapshot.current = currSnapshot }) if (import.meta.env?.MODE !== 'production') { diff --git a/tests/optimization.test.tsx b/tests/optimization.test.tsx new file mode 100644 index 00000000..47c5e725 --- /dev/null +++ b/tests/optimization.test.tsx @@ -0,0 +1,116 @@ +import { useState } from 'react' +import { fireEvent, render, waitFor } from '@testing-library/react' +import { expect, it, vi } from 'vitest' +import { proxy, useSnapshot } from 'valtio' + +it('regression: useSnapshot renders should not fail consistency check with extra render (nested useSnapshot)', async () => { + const obj = proxy({ childCount: 0, parentCount: 0 }) + + const childRenderFn = vi.fn() + const Child = () => { + const snap = useSnapshot(obj) + childRenderFn(snap.childCount) + return ( + <> +
childCount: {snap.childCount}
+ + + ) + } + + const parentRenderFn = vi.fn() + const Parent = () => { + const snap = useSnapshot(obj) + parentRenderFn(snap.parentCount) + return ( + <> +
parentCount: {snap.parentCount}
+ + + + ) + } + + const { getByText } = render() + + await waitFor(() => { + getByText('childCount: 0') + getByText('parentCount: 0') + }) + + expect(childRenderFn).toBeCalledTimes(1) + expect(childRenderFn).lastCalledWith(0) + expect(parentRenderFn).toBeCalledTimes(1) + expect(parentRenderFn).lastCalledWith(0) + + obj.parentCount += 1 + + await waitFor(() => { + getByText('childCount: 0') + getByText('parentCount: 1') + }) + + expect(childRenderFn).toBeCalledTimes(2) + expect(childRenderFn).lastCalledWith(0) + expect(parentRenderFn).toBeCalledTimes(2) + expect(parentRenderFn).lastCalledWith(1) +}) + +it('regression: useSnapshot renders should not fail consistency check with extra render', async () => { + const obj = proxy({ childCount: 0, anotherValue: 0 }) + + const childRenderFn = vi.fn() + const Child = () => { + const snap = useSnapshot(obj) + childRenderFn(snap.childCount) + return ( + <> +
childCount: {snap.childCount}
+ + + ) + } + + const parentRenderFn = vi.fn() + const Parent = () => { + const [parentCount, setParentCount] = useState(0) + + parentRenderFn(parentCount) + + return ( + <> +
parentCount: {parentCount}
+ + + + ) + } + + const { getByText } = render() + + await waitFor(() => { + getByText('childCount: 0') + getByText('parentCount: 0') + }) + + expect(childRenderFn).toBeCalledTimes(1) + expect(childRenderFn).lastCalledWith(0) + expect(parentRenderFn).toBeCalledTimes(1) + expect(parentRenderFn).lastCalledWith(0) + + obj.anotherValue += 1 + + fireEvent.click(getByText('parentButton')) + + await waitFor(() => { + getByText('childCount: 0') + getByText('parentCount: 1') + }) + + expect(childRenderFn).toBeCalledTimes(2) + expect(childRenderFn).lastCalledWith(0) + expect(parentRenderFn).toBeCalledTimes(2) + expect(parentRenderFn).lastCalledWith(1) +}) From 07a4fe74216c6a703921372fae53febff8bf28b5 Mon Sep 17 00:00:00 2001 From: daishi Date: Sat, 4 May 2024 09:23:01 +0900 Subject: [PATCH 34/35] 2.0.0-beta.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 057d0542..e9b82f95 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "valtio", "private": true, "type": "commonjs", - "version": "2.0.0-beta.4", + "version": "2.0.0-beta.5", "publishConfig": { "tag": "next" }, From a93605ff75f6c8c629e61b3cce2ceee59c43ef7c Mon Sep 17 00:00:00 2001 From: daishi Date: Sun, 12 May 2024 15:09:30 +0900 Subject: [PATCH 35/35] chore package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 961e5faf..d6544535 100644 --- a/package.json +++ b/package.json @@ -154,8 +154,8 @@ "@types/react": "18.2.56" }, "peerDependencies": { - "@types/react": ">=18.0", - "react": ">=18.0" + "@types/react": ">=18.0.0", + "react": ">=18.0.0" }, "peerDependenciesMeta": { "@types/react": {