From f7e3bf4c9c474d6f5ee6a1d47465054d3fdea57a Mon Sep 17 00:00:00 2001 From: Markus Fichtner Date: Sun, 3 Nov 2024 00:23:29 +0100 Subject: [PATCH 1/2] Remove use-debounce package from cms-site --- .changeset/lazy-walls-teach.md | 5 +++++ packages/site/cms-site/package.json | 1 - .../site/cms-site/src/iframebridge/IFrameBridge.tsx | 4 ++-- pnpm-lock.yaml | 12 ------------ 4 files changed, 7 insertions(+), 15 deletions(-) create mode 100644 .changeset/lazy-walls-teach.md diff --git a/.changeset/lazy-walls-teach.md b/.changeset/lazy-walls-teach.md new file mode 100644 index 0000000000..01607d17f6 --- /dev/null +++ b/.changeset/lazy-walls-teach.md @@ -0,0 +1,5 @@ +--- +"@comet/cms-site": minor +--- + +Remove `use-debounce` package and change `useDebounceCallback` import diff --git a/packages/site/cms-site/package.json b/packages/site/cms-site/package.json index 548580a987..d4dac65320 100644 --- a/packages/site/cms-site/package.json +++ b/packages/site/cms-site/package.json @@ -30,7 +30,6 @@ "rimraf": "^3.0.0", "scroll-into-view-if-needed": "^2.0.0", "server-only": "^0.0.1", - "use-debounce": "^6.0.0", "usehooks-ts": "^3.1.0" }, "devDependencies": { diff --git a/packages/site/cms-site/src/iframebridge/IFrameBridge.tsx b/packages/site/cms-site/src/iframebridge/IFrameBridge.tsx index 2825764ad3..d62b0087f8 100644 --- a/packages/site/cms-site/src/iframebridge/IFrameBridge.tsx +++ b/packages/site/cms-site/src/iframebridge/IFrameBridge.tsx @@ -2,7 +2,7 @@ import { createContext, PropsWithChildren, useCallback, useEffect, useRef, useState } from "react"; import styled from "styled-components"; -import { useDebouncedCallback } from "use-debounce"; +import { useDebounceCallback } from "usehooks-ts"; import { AdminMessage, AdminMessageType, IFrameMessage, IFrameMessageType } from "./IFrameMessage"; import { PreviewOverlay } from "./PreviewOverlay"; @@ -140,7 +140,7 @@ export const IFrameBridgeProvider = ({ children }: PropsWithChildren) => { window.parent.postMessage(JSON.stringify(message), "*"); }; - const debounceDeactivateOutlines = useDebouncedCallback(() => { + const debounceDeactivateOutlines = useDebounceCallback(() => { setShowOutlines(false); }, 2500); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 982c989cd6..2d98f8e0ad 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2726,9 +2726,6 @@ importers: server-only: specifier: ^0.0.1 version: 0.0.1 - use-debounce: - specifier: ^6.0.0 - version: 6.0.1(react@18.3.1) usehooks-ts: specifier: ^3.1.0 version: 3.1.0(react@18.3.1) @@ -34457,15 +34454,6 @@ packages: react: 17.0.2 dev: false - /use-debounce@6.0.1(react@18.3.1): - resolution: {integrity: sha512-kpvIxpa0vOLz/2I2sfNJ72mUeaT2CMNCu5BT1f2HkV9qZK27UVSOFf1sSSu+wjJE4TcR2VTXS2SM569+m3TN7Q==} - engines: {node: '>= 10.0.0'} - peerDependencies: - react: '>=16.8.0' - dependencies: - react: 18.3.1 - dev: false - /use-isomorphic-layout-effect@1.1.2(@types/react@17.0.53)(react@17.0.2): resolution: {integrity: sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==} peerDependencies: From 08e43f506333f5c3e1acc46e00aeb4413e2c606d Mon Sep 17 00:00:00 2001 From: Markus Fichtner Date: Fri, 15 Nov 2024 15:38:08 +0100 Subject: [PATCH 2/2] Remove changeset --- .changeset/lazy-walls-teach.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .changeset/lazy-walls-teach.md diff --git a/.changeset/lazy-walls-teach.md b/.changeset/lazy-walls-teach.md deleted file mode 100644 index 01607d17f6..0000000000 --- a/.changeset/lazy-walls-teach.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@comet/cms-site": minor ---- - -Remove `use-debounce` package and change `useDebounceCallback` import