From 82ebbc6de5fbf74d3f703f27e87c146c89ca94a3 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Tue, 25 Jun 2024 21:56:01 +0200 Subject: [PATCH] node_modules: switch from deep_equal to dequal --- node_modules | 2 +- package.json | 3 +-- pkg/lib/hooks.ts | 8 ++++---- pkg/lib/notifications.js | 4 ++-- pkg/storaged/client.js | 8 ++++---- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/node_modules b/node_modules index 3f6bd1699e1e..d27176d4952a 160000 --- a/node_modules +++ b/node_modules @@ -1 +1 @@ -Subproject commit 3f6bd1699e1ef3414f34618838e6742c82cf3e1f +Subproject commit d27176d4952a015555515089c230f2e49017688b diff --git a/package.json b/package.json index a63559d614e4..e3ca2efad64b 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "@patternfly/react-styles": "5.3.1", "@patternfly/react-table": "5.3.3", "@patternfly/react-tokens": "5.3.1", - "deep-equal": "2.2.3", + "dequal": "2.0.3", "date-fns": "3.6.0", "js-sha1": "0.7.0", "js-sha256": "0.11.0", @@ -25,7 +25,6 @@ "xterm-addon-canvas": "0.5.0" }, "devDependencies": { - "@types/deep-equal": "1.0.4", "@types/qunit": "^2.19.10", "@types/react": "18.3.3", "@types/react-dom": "18.3.0", diff --git a/pkg/lib/hooks.ts b/pkg/lib/hooks.ts index 08fe577f8bcd..5b63840c2119 100644 --- a/pkg/lib/hooks.ts +++ b/pkg/lib/hooks.ts @@ -19,7 +19,7 @@ import cockpit from 'cockpit'; import { useState, useEffect, useRef, useReducer } from 'react'; -import deep_equal from "deep-equal"; +import { dequal } from 'dequal'; /* HOOKS * @@ -140,7 +140,7 @@ export function useLoggedInUser() { export function useDeepEqualMemo(value: T): T { const ref = useRef(value); - if (!deep_equal(ref.current, value)) + if (!dequal(ref.current, value)) ref.current = value; return ref.current; } @@ -213,7 +213,7 @@ export function useFile(path: string, options: cockpit.JsonObject) { * function Component(param) { * const obj = useObject(() => create_object(param), * obj => obj.close(), - * [param] as const, [deep_equal]) + * [param] as const, [dequal]) * * ... * } @@ -225,7 +225,7 @@ export function useFile(path: string, options: cockpit.JsonObject) { * call to useObject, i.e., at the very beginning of the first render. * * When "param" changes compared to the previous call to useObject - * (according to the deep_equal function in the example above), the + * (according to the dequal function in the example above), the * object will also be destroyed and a new one will be created for the * new value of "param" (as part of the call to useObject). * diff --git a/pkg/lib/notifications.js b/pkg/lib/notifications.js index 115f12b96307..424b9db3a078 100644 --- a/pkg/lib/notifications.js +++ b/pkg/lib/notifications.js @@ -116,7 +116,7 @@ Usage: */ import cockpit from "cockpit"; -import deep_equal from "deep-equal"; +import { dequal } from 'dequal/lite'; class PageStatus { constructor() { @@ -157,7 +157,7 @@ class PageStatus { } set_own(status) { - if (!deep_equal(status, this.cur_own)) { + if (!dequal(status, this.cur_own)) { this.cur_own = status; cockpit.transport.control("notify", { page_status: status }); } diff --git a/pkg/storaged/client.js b/pkg/storaged/client.js index 93d49d22c826..98d8c27afa9d 100644 --- a/pkg/storaged/client.js +++ b/pkg/storaged/client.js @@ -37,7 +37,7 @@ import { reset_pages } from "./pages.jsx"; import { make_overview_page } from "./overview/overview.jsx"; import { export_mount_point_mapping } from "./anaconda.jsx"; -import deep_equal from "deep-equal"; +import { dequal } from 'dequal/lite'; /* STORAGED CLIENT */ @@ -296,8 +296,8 @@ export async function btrfs_poll() { } } - if (!deep_equal(client.uuids_btrfs_subvols, uuids_subvols) || !deep_equal(client.uuids_btrfs_usage, uuids_usage) || - !deep_equal(client.uuids_btrfs_default_subvol, btrfs_default_subvol)) { + if (!dequal(client.uuids_btrfs_subvols, uuids_subvols) || !dequal(client.uuids_btrfs_usage, uuids_usage) || + !dequal(client.uuids_btrfs_default_subvol, btrfs_default_subvol)) { debug("btrfs_pol new subvols:", uuids_subvols); client.uuids_btrfs_subvols = uuids_subvols; client.uuids_btrfs_usage = uuids_usage; @@ -352,7 +352,7 @@ function btrfs_findmnt_poll() { } // Update client state - if (!deep_equal(client.btrfs_mounts, btrfs_mounts)) { + if (!dequal(client.btrfs_mounts, btrfs_mounts)) { client.btrfs_mounts = btrfs_mounts; debug("btrfs_findmnt_poll mounts:", client.btrfs_mounts); client.update();