From ee339b4ce8f4593d28bb0cadd547c73265267d14 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:30:06 +0000 Subject: [PATCH] =?UTF-8?q?Update=20zustand=203.7.2=20=E2=86=92=204.5.0=20?= =?UTF-8?q?(major)=20(#3002)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update zustand to version 4.5.0 * feat: use create instead of createState --------- Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> Co-authored-by: Pavan Joshi <55848322+pavanjoshi914@users.noreply.github.com> Co-authored-by: pavanjoshi914 Co-authored-by: René Aaron <100827540+reneaaron@users.noreply.github.com> --- package.json | 2 +- src/extension/background-script/state.ts | 4 ++-- yarn.lock | 15 +++++++++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index cda46dba82..7103627380 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "tailwindcss": "^3.3.3", "uuid": "^9.0.0", "webextension-polyfill": "^0.10.0", - "zustand": "^3.7.2" + "zustand": "^4.5.0" }, "devDependencies": { "@commitlint/cli": "^17.8.0", diff --git a/src/extension/background-script/state.ts b/src/extension/background-script/state.ts index 0c994f1927..bee5ba93e0 100644 --- a/src/extension/background-script/state.ts +++ b/src/extension/background-script/state.ts @@ -1,7 +1,7 @@ import merge from "lodash.merge"; import pick from "lodash.pick"; import browser from "webextension-polyfill"; -import createState from "zustand"; +import { create } from "zustand"; import { decryptData } from "~/common/lib/crypto"; import { DEFAULT_SETTINGS } from "~/common/settings"; import { isManifestV3 } from "~/common/utils/mv3"; @@ -85,7 +85,7 @@ const getFreshState = () => ({ mv2Password: null, }); -const state = createState((set, get) => ({ +const state = create((set, get) => ({ ...getFreshState(), password: async (password) => { if (isManifestV3) { diff --git a/yarn.lock b/yarn.lock index 416e30b341..e1037bf964 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9737,6 +9737,11 @@ urlpattern-polyfill@9.0.0: resolved "https://registry.yarnpkg.com/urlpattern-polyfill/-/urlpattern-polyfill-9.0.0.tgz#bc7e386bb12fd7898b58d1509df21d3c29ab3460" integrity sha512-WHN8KDQblxd32odxeIgo83rdVDE2bvdkb86it7bMhYZwWKJz0+O0RK/eZiHYnM+zgt/U7hAHOlCQGfjjvSkw2g== +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== + util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" @@ -10308,7 +10313,9 @@ zip-stream@^4.1.0: compress-commons "^4.1.0" readable-stream "^3.6.0" -zustand@^3.7.2: - version "3.7.2" - resolved "https://registry.npmjs.org/zustand/-/zustand-3.7.2.tgz" - integrity sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA== +zustand@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.5.0.tgz#141354af56f91de378aa6c4b930032ab338f3ef0" + integrity sha512-zlVFqS5TQ21nwijjhJlx4f9iGrXSL0o/+Dpy4txAP22miJ8Ti6c1Ol1RLNN98BMib83lmDH/2KmLwaNXpjrO1A== + dependencies: + use-sync-external-store "1.2.0"