From f9bae60357ec4c67d3cf96b5d53c6eee852569cb Mon Sep 17 00:00:00 2001 From: tamaina Date: Wed, 27 Apr 2022 23:06:40 +0900 Subject: remove deepcopy and broadcast-channel (=< Safari 15.4) --- packages/client/src/pizzax.ts | 5 +---- packages/client/src/scripts/unison-reload.ts | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'packages/client/src') diff --git a/packages/client/src/pizzax.ts b/packages/client/src/pizzax.ts index 11bf4f9c48..e71f139246 100644 --- a/packages/client/src/pizzax.ts +++ b/packages/client/src/pizzax.ts @@ -4,9 +4,6 @@ import { api } from './os'; import { get, set } from './scripts/idb-proxy'; import { defaultStore } from './store'; import { stream } from './stream'; -import * as deepcopy from 'deepcopy'; -// SafariがBroadcastChannel未実装なのでライブラリを使う -import { BroadcastChannel } from 'broadcast-channel'; type StateDef = Record { public set(key: K, value: T[K]['default']): Promise { // IndexedDBやBroadcastChannelで扱うために単純なオブジェクトにする // (JSON.parse(JSON.stringify(value))の代わり) - const rawValue = deepcopy(value); + const rawValue = structuredClone(value); if (_DEV_) console.log('set', key, rawValue, value); diff --git a/packages/client/src/scripts/unison-reload.ts b/packages/client/src/scripts/unison-reload.ts index 59af584c1b..0cd7eff38d 100644 --- a/packages/client/src/scripts/unison-reload.ts +++ b/packages/client/src/scripts/unison-reload.ts @@ -1,7 +1,4 @@ -// SafariがBroadcastChannel未実装なのでライブラリを使う -import { BroadcastChannel } from 'broadcast-channel'; - -export const reloadChannel = new BroadcastChannel('reload'); +export const reloadChannel = new BroadcastChannel('reload'); // string | null // BroadcastChannelを用いて、クライアントが一斉にreloadするようにします。 export function unisonReload(path?: string) { -- cgit v1.2.3-freya