Skip to content

Commit

Permalink
node_modules: switch from deep_equal to dequal
Browse files Browse the repository at this point in the history
  • Loading branch information
jelly committed Jun 26, 2024
1 parent d3b0671 commit 82ebbc6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion node_modules
Submodule node_modules updated 1197 files
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions pkg/lib/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -140,7 +140,7 @@ export function useLoggedInUser() {

export function useDeepEqualMemo<T>(value: T): T {
const ref = useRef(value);
if (!deep_equal(ref.current, value))
if (!dequal(ref.current, value))
ref.current = value;
return ref.current;
}
Expand Down Expand Up @@ -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])
*
* ...
* }
Expand All @@ -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).
*
Expand Down
4 changes: 2 additions & 2 deletions pkg/lib/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Usage:
*/

import cockpit from "cockpit";
import deep_equal from "deep-equal";
import { dequal } from 'dequal/lite';

class PageStatus {
constructor() {
Expand Down Expand Up @@ -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 });
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/storaged/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 82ebbc6

Please sign in to comment.