Comparing version 4.3.2 to 4.3.3
@@ -22,4 +22,4 @@ 'use strict'; | ||
function createContext() { | ||
if (process.env.NODE_ENV !== "production") { | ||
console.warn('[DEPRECATED] zustand/context will be removed in the future version. Please use `import { createStore, useStore } from "zustand"` for context usage. See: https://github.com/pmndrs/zustand/discussions/1180'); | ||
if (process.env.NODE_ENV !== 'production') { | ||
console.warn("[DEPRECATED] `context` will be removed in a future version. Instead use `import { createStore, useStore } from 'zustand'`. See: https://github.com/pmndrs/zustand/discussions/1180."); | ||
} | ||
@@ -26,0 +26,0 @@ var ZustandContext = react.createContext(undefined); |
@@ -7,3 +7,3 @@ import { createContext as createContext$1, useRef, createElement, useContext, useMemo } from 'react'; | ||
console.warn( | ||
'[DEPRECATED] zustand/context will be removed in the future version. Please use `import { createStore, useStore } from "zustand"` for context usage. See: https://github.com/pmndrs/zustand/discussions/1180' | ||
"[DEPRECATED] `context` will be removed in a future version. Instead use `import { createStore, useStore } from 'zustand'`. See: https://github.com/pmndrs/zustand/discussions/1180." | ||
); | ||
@@ -10,0 +10,0 @@ } |
@@ -21,3 +21,3 @@ import { createStore } from 'zustand/vanilla'; | ||
console.warn( | ||
'[DEPRECATED] Passing a vanilla store will be unsupported in the future version. Please use `import { useStore } from "zustand"` to use the vanilla store in React.' | ||
"[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`." | ||
); | ||
@@ -34,3 +34,3 @@ } | ||
console.warn( | ||
"[DEPRECATED] default export is deprecated, instead import { create } from'zustand'" | ||
"[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand'`." | ||
); | ||
@@ -37,0 +37,0 @@ } |
@@ -565,3 +565,3 @@ const reduxImpl = (reducer, initial) => (set, _get, api) => { | ||
console.warn( | ||
"[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Please use `storage` option instead." | ||
"[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead." | ||
); | ||
@@ -568,0 +568,0 @@ } |
@@ -42,3 +42,3 @@ function shallow(objA, objB) { | ||
console.warn( | ||
"[DEPRECATED] default export is deprecated, instead import { shallow } from'zustand/shallow'" | ||
"[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand/shallow'`." | ||
); | ||
@@ -45,0 +45,0 @@ } |
@@ -29,3 +29,3 @@ type SetStateInternal<T> = { | ||
/** | ||
* @deprecated Use `import { createStore } from ...` | ||
* @deprecated Use `import { createStore } from 'zustand/vanilla'` | ||
*/ | ||
@@ -32,0 +32,0 @@ declare const _default: CreateStore; |
@@ -20,3 +20,3 @@ const createStoreImpl = (createState) => { | ||
console.warn( | ||
"[DEPRECATED] The destroy method will be unsupported in the future version. You should use unsubscribe function returned by subscribe. Everything will be garbage collected if store is garbage collected." | ||
"[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected." | ||
); | ||
@@ -34,3 +34,3 @@ } | ||
console.warn( | ||
"[DEPRECATED] default export is deprecated, instead import { createStore } ..." | ||
"[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'." | ||
); | ||
@@ -37,0 +37,0 @@ } |
@@ -17,4 +17,4 @@ 'use strict'; | ||
var createImpl = function createImpl(createState) { | ||
if (process.env.NODE_ENV !== "production" && typeof createState !== 'function') { | ||
console.warn('[DEPRECATED] Passing a vanilla store will be unsupported in the future version. Please use `import { useStore } from "zustand"` to use the vanilla store in React.'); | ||
if (process.env.NODE_ENV !== 'production' && typeof createState !== 'function') { | ||
console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`."); | ||
} | ||
@@ -32,4 +32,4 @@ var api = typeof createState === 'function' ? vanilla.createStore(createState) : createState; | ||
var react = (function (createState) { | ||
if (process.env.NODE_ENV !== "production") { | ||
console.warn("[DEPRECATED] default export is deprecated, instead import { create } from'zustand'"); | ||
if (process.env.NODE_ENV !== 'production') { | ||
console.warn("[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand'`."); | ||
} | ||
@@ -36,0 +36,0 @@ return create(createState); |
@@ -97,6 +97,6 @@ 'use strict'; | ||
try { | ||
extensionConnector = (enabled != null ? enabled : process.env.NODE_ENV !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__; | ||
extensionConnector = (enabled != null ? enabled : process.env.NODE_ENV !== 'production') && window.__REDUX_DEVTOOLS_EXTENSION__; | ||
} catch (e) {} | ||
if (!extensionConnector) { | ||
if (process.env.NODE_ENV !== "production" && enabled) { | ||
if (process.env.NODE_ENV !== 'production' && enabled) { | ||
console.warn('[zustand devtools middleware] Please install/enable Redux devtools extension'); | ||
@@ -152,3 +152,3 @@ } | ||
} | ||
if (process.env.NODE_ENV !== "production" && a[0].type === '__setState' && !didWarnAboutReservedActionType) { | ||
if (process.env.NODE_ENV !== 'production' && a[0].type === '__setState' && !didWarnAboutReservedActionType) { | ||
console.warn('[zustand devtools middleware] "__setState" action type is reserved ' + 'to set state from the devtools. Avoid using it.'); | ||
@@ -592,4 +592,4 @@ didWarnAboutReservedActionType = true; | ||
if ('getStorage' in baseOptions || 'serialize' in baseOptions || 'deserialize' in baseOptions) { | ||
if (process.env.NODE_ENV !== "production") { | ||
console.warn('[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Please use `storage` option instead.'); | ||
if (process.env.NODE_ENV !== 'production') { | ||
console.warn('[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead.'); | ||
} | ||
@@ -596,0 +596,0 @@ return oldImpl(config, baseOptions); |
{ | ||
"name": "zustand", | ||
"private": false, | ||
"version": "4.3.2", | ||
"version": "4.3.3", | ||
"description": "🐻 Bear necessities for state management in React", | ||
@@ -24,2 +24,3 @@ "main": "./index.js", | ||
".": { | ||
"types": "./index.d.ts", | ||
"import": { | ||
@@ -29,3 +30,2 @@ "types": "./esm/index.d.mts", | ||
}, | ||
"types": "./index.d.ts", | ||
"module": "./esm/index.js", | ||
@@ -35,2 +35,3 @@ "default": "./index.js" | ||
"./vanilla": { | ||
"types": "./vanilla.d.ts", | ||
"import": { | ||
@@ -40,3 +41,2 @@ "types": "./esm/vanilla.d.mts", | ||
}, | ||
"types": "./vanilla.d.ts", | ||
"module": "./esm/vanilla.js", | ||
@@ -46,2 +46,3 @@ "default": "./vanilla.js" | ||
"./middleware": { | ||
"types": "./middleware.d.ts", | ||
"import": { | ||
@@ -51,3 +52,2 @@ "types": "./esm/middleware.d.mts", | ||
}, | ||
"types": "./middleware.d.ts", | ||
"module": "./esm/middleware.js", | ||
@@ -57,2 +57,3 @@ "default": "./middleware.js" | ||
"./middleware/immer": { | ||
"types": "./middleware/immer.d.ts", | ||
"import": { | ||
@@ -62,3 +63,2 @@ "types": "./esm/middleware/immer.d.mts", | ||
}, | ||
"types": "./middleware/immer.d.ts", | ||
"module": "./esm/middleware/immer.js", | ||
@@ -68,2 +68,3 @@ "default": "./middleware/immer.js" | ||
"./shallow": { | ||
"types": "./shallow.d.ts", | ||
"import": { | ||
@@ -73,3 +74,2 @@ "types": "./esm/shallow.d.mts", | ||
}, | ||
"types": "./shallow.d.ts", | ||
"module": "./esm/shallow.js", | ||
@@ -79,2 +79,3 @@ "default": "./shallow.js" | ||
"./context": { | ||
"types": "./context.d.ts", | ||
"import": { | ||
@@ -84,3 +85,2 @@ "types": "./esm/context.d.mts", | ||
}, | ||
"types": "./context.d.ts", | ||
"module": "./esm/context.js", | ||
@@ -119,5 +119,2 @@ "default": "./context.js" | ||
}, | ||
"resolutions": { | ||
"date-fns": "2.27.0" | ||
}, | ||
"peerDependencies": { | ||
@@ -124,0 +121,0 @@ "immer": ">=9.0", |
@@ -76,4 +76,4 @@ 'use strict'; | ||
var shallow$1 = (function (objA, objB) { | ||
if (process.env.NODE_ENV !== "production") { | ||
console.warn("[DEPRECATED] default export is deprecated, instead import { shallow } from'zustand/shallow'"); | ||
if (process.env.NODE_ENV !== 'production') { | ||
console.warn("[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand/shallow'`."); | ||
} | ||
@@ -80,0 +80,0 @@ return shallow(objA, objB); |
@@ -21,3 +21,3 @@ System.register(['react', 'zustand'], (function (exports) { | ||
console.warn( | ||
'[DEPRECATED] zustand/context will be removed in the future version. Please use `import { createStore, useStore } from "zustand"` for context usage. See: https://github.com/pmndrs/zustand/discussions/1180' | ||
"[DEPRECATED] `context` will be removed in a future version. Instead use `import { createStore, useStore } from 'zustand'`. See: https://github.com/pmndrs/zustand/discussions/1180." | ||
); | ||
@@ -24,0 +24,0 @@ } |
@@ -41,3 +41,3 @@ System.register(['zustand/vanilla', 'react', 'use-sync-external-store/shim/with-selector'], (function (exports) { | ||
console.warn( | ||
'[DEPRECATED] Passing a vanilla store will be unsupported in the future version. Please use `import { useStore } from "zustand"` to use the vanilla store in React.' | ||
"[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`." | ||
); | ||
@@ -54,3 +54,3 @@ } | ||
console.warn( | ||
"[DEPRECATED] default export is deprecated, instead import { create } from'zustand'" | ||
"[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand'`." | ||
); | ||
@@ -57,0 +57,0 @@ } |
@@ -1,1 +0,1 @@ | ||
System.register(["zustand/vanilla","react","use-sync-external-store/shim/with-selector"],function(n){"use strict";var f={create:1,default:1,useStore:1},o,i,S;return{setters:[function(t){o=t.createStore;var c={};for(var r in t)f[r]||(c[r]=t[r]);n(c)},function(t){i=t.useDebugValue},function(t){S=t.default}],execute:function(){n("useStore",c);const{useSyncExternalStoreWithSelector:t}=S;function c(e,s=e.getState,u){const a=t(e.subscribe,e.getState,e.getServerState||e.getState,s,u);return i(a),a}const r=e=>{const s=typeof e=="function"?o(e):e,u=(a,g)=>c(s,a,g);return Object.assign(u,s),u},l=n("create",e=>e?r(e):r);var v=n("default",e=>l(e))}}}); | ||
System.register(["zustand/vanilla","react","use-sync-external-store/shim/with-selector"],function(c){"use strict";var f={create:1,default:1,useStore:1},o,i,S;return{setters:[function(t){o=t.createStore;var n={};for(var r in t)f[r]||(n[r]=t[r]);c(n)},function(t){i=t.useDebugValue},function(t){S=t.default}],execute:function(){c("useStore",n);const{useSyncExternalStoreWithSelector:t}=S;function n(e,u=e.getState,s){const a=t(e.subscribe,e.getState,e.getServerState||e.getState,u,s);return i(a),a}const r=e=>{const u=typeof e=="function"?o(e):e,s=(a,g)=>n(u,a,g);return Object.assign(s,u),s},l=c("create",e=>e?r(e):r);var v=c("default",e=>l(e))}}}); |
@@ -572,3 +572,3 @@ System.register([], (function (exports) { | ||
console.warn( | ||
"[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Please use `storage` option instead." | ||
"[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead." | ||
); | ||
@@ -575,0 +575,0 @@ } |
@@ -49,3 +49,3 @@ System.register([], (function (exports) { | ||
console.warn( | ||
"[DEPRECATED] default export is deprecated, instead import { shallow } from'zustand/shallow'" | ||
"[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand/shallow'`." | ||
); | ||
@@ -52,0 +52,0 @@ } |
@@ -1,1 +0,1 @@ | ||
System.register([],function(f){"use strict";return{execute:function(){f("shallow",i);function i(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[r,s]of t)if(!Object.is(s,e.get(r)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(e,n[r])||!Object.is(t[n[r]],e[n[r]]))return!1;return!0}var o=f("default",(t,e)=>i(t,e))}}}); | ||
System.register([],function(i){"use strict";return{execute:function(){i("shallow",f);function f(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[n,s]of t)if(!Object.is(s,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(e,r[n])||!Object.is(t[r[n]],e[r[n]]))return!1;return!0}var o=i("default",(t,e)=>f(t,e))}}}); |
@@ -25,3 +25,3 @@ System.register([], (function (exports) { | ||
console.warn( | ||
"[DEPRECATED] The destroy method will be unsupported in the future version. You should use unsubscribe function returned by subscribe. Everything will be garbage collected if store is garbage collected." | ||
"[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected." | ||
); | ||
@@ -39,3 +39,3 @@ } | ||
console.warn( | ||
"[DEPRECATED] default export is deprecated, instead import { createStore } ..." | ||
"[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'." | ||
); | ||
@@ -42,0 +42,0 @@ } |
@@ -54,3 +54,3 @@ type SetStateInternal<T> = { | ||
/** | ||
* @deprecated Use `import { createStore } from ...` | ||
* @deprecated Use `import { createStore } from 'zustand/vanilla'` | ||
*/ | ||
@@ -57,0 +57,0 @@ declare const _default: CreateStore; |
@@ -54,3 +54,3 @@ type SetStateInternal<T> = { | ||
/** | ||
* @deprecated Use `import { createStore } from ...` | ||
* @deprecated Use `import { createStore } from 'zustand/vanilla'` | ||
*/ | ||
@@ -57,0 +57,0 @@ declare const _default: CreateStore; |
@@ -24,3 +24,3 @@ (function (global, factory) { | ||
{ | ||
console.warn('[DEPRECATED] zustand/context will be removed in the future version. Please use `import { createStore, useStore } from "zustand"` for context usage. See: https://github.com/pmndrs/zustand/discussions/1180'); | ||
console.warn("[DEPRECATED] `context` will be removed in a future version. Instead use `import { createStore, useStore } from 'zustand'`. See: https://github.com/pmndrs/zustand/discussions/1180."); | ||
} | ||
@@ -27,0 +27,0 @@ var ZustandContext = react.createContext(undefined); |
@@ -18,3 +18,3 @@ (function (global, factory) { | ||
if (typeof createState !== 'function') { | ||
console.warn('[DEPRECATED] Passing a vanilla store will be unsupported in the future version. Please use `import { useStore } from "zustand"` to use the vanilla store in React.'); | ||
console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`."); | ||
} | ||
@@ -33,3 +33,3 @@ var api = typeof createState === 'function' ? vanilla.createStore(createState) : createState; | ||
{ | ||
console.warn("[DEPRECATED] default export is deprecated, instead import { create } from'zustand'"); | ||
console.warn("[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand'`."); | ||
} | ||
@@ -36,0 +36,0 @@ return create(createState); |
@@ -101,3 +101,3 @@ (function (global, factory) { | ||
try { | ||
extensionConnector = (enabled != null ? enabled : true) && window.__REDUX_DEVTOOLS_EXTENSION__; | ||
extensionConnector = (enabled != null ? enabled : "development" !== 'production') && window.__REDUX_DEVTOOLS_EXTENSION__; | ||
} catch (e) {} | ||
@@ -596,3 +596,3 @@ if (!extensionConnector) { | ||
{ | ||
console.warn('[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Please use `storage` option instead.'); | ||
console.warn('[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead.'); | ||
} | ||
@@ -599,0 +599,0 @@ return oldImpl(config, baseOptions); |
@@ -81,3 +81,3 @@ (function (global, factory) { | ||
{ | ||
console.warn("[DEPRECATED] default export is deprecated, instead import { shallow } from'zustand/shallow'"); | ||
console.warn("[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand/shallow'`."); | ||
} | ||
@@ -84,0 +84,0 @@ return shallow(objA, objB); |
@@ -31,3 +31,3 @@ (function (global, factory) { | ||
{ | ||
console.warn('[DEPRECATED] The destroy method will be unsupported in the future version. You should use unsubscribe function returned by subscribe. Everything will be garbage collected if store is garbage collected.'); | ||
console.warn('[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.'); | ||
} | ||
@@ -50,3 +50,3 @@ listeners.clear(); | ||
{ | ||
console.warn('[DEPRECATED] default export is deprecated, instead import { createStore } ...'); | ||
console.warn("[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'."); | ||
} | ||
@@ -53,0 +53,0 @@ return createStore(createState); |
@@ -29,3 +29,3 @@ type SetStateInternal<T> = { | ||
/** | ||
* @deprecated Use `import { createStore } from ...` | ||
* @deprecated Use `import { createStore } from 'zustand/vanilla'` | ||
*/ | ||
@@ -32,0 +32,0 @@ declare const _default: CreateStore; |
@@ -26,4 +26,4 @@ 'use strict'; | ||
var destroy = function destroy() { | ||
if (process.env.NODE_ENV !== "production") { | ||
console.warn('[DEPRECATED] The destroy method will be unsupported in the future version. You should use unsubscribe function returned by subscribe. Everything will be garbage collected if store is garbage collected.'); | ||
if (process.env.NODE_ENV !== 'production') { | ||
console.warn('[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.'); | ||
} | ||
@@ -45,4 +45,4 @@ listeners.clear(); | ||
var vanilla = (function (createState) { | ||
if (process.env.NODE_ENV !== "production") { | ||
console.warn('[DEPRECATED] default export is deprecated, instead import { createStore } ...'); | ||
if (process.env.NODE_ENV !== 'production') { | ||
console.warn("[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'."); | ||
} | ||
@@ -49,0 +49,0 @@ return createStore(createState); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
278666
6225