Skip to content

Commit 5fd4587

Browse files
ChumpChiefclaude
andauthored
Replace @ungap/structured-clone with native structuredClone (#26890)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6c3baaf commit 5fd4587

File tree

10 files changed

+4
-32
lines changed

10 files changed

+4
-32
lines changed

examples/client-logger/app-insights-logger/jest.config.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = {
1919
Request: globalThis.Request,
2020
Response: globalThis.Response,
2121
Headers: globalThis.Headers,
22+
structuredClone: globalThis.structuredClone,
2223
},
2324
moduleNameMapper: {
2425
// Remove explicit .js from local paths to allow jest to find the .ts* files

packages/dds/tree/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@
178178
"@fluidframework/type-factory": "workspace:~",
179179
"@sinclair/typebox": "^0.34.13",
180180
"@tylerbu/sorted-btree-es6": "^2.1.1",
181-
"@ungap/structured-clone": "^1.2.0",
182181
"semver-ts": "^1.0.3",
183182
"uuid": "^11.1.0"
184183
},
@@ -204,7 +203,6 @@
204203
"@types/easy-table": "^0.0.32",
205204
"@types/mocha": "^10.0.10",
206205
"@types/node": "catalog:types",
207-
"@types/ungap__structured-clone": "^1.2.0",
208206
"ajv": "^8.17.1",
209207
"ajv-formats": "^3.0.1",
210208
"c8": "^10.1.3",

packages/dds/tree/src/test/shared-tree-core/edit-manager/editManagerScenario.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type { SessionId } from "@fluidframework/id-compressor";
1010

1111
import type { ChangeFamilyEditor, ChangeRebaser } from "../../../core/index.js";
1212
import type { Commit, EditManager, SeqNumber } from "../../../shared-tree-core/index.js";
13-
import { brand, clone } from "../../../util/index.js";
13+
import { brand } from "../../../util/index.js";
1414
import { TestChange, type TestChangeFamily, asDelta } from "../../testChange.js";
1515
import { mintRevisionTag } from "../../utils.js";
1616

@@ -470,7 +470,7 @@ export function runUnitTestScenario(
470470
rebaser,
471471
sessionId: `Join${joiners.length}` as SessionId,
472472
}).manager;
473-
const summary = clone(summarizer.getSummaryData());
473+
const summary = structuredClone(summarizer.getSummaryData());
474474
joiner.loadSummaryData(summary);
475475
joiners.push(joiner);
476476
}

packages/dds/tree/src/util/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export { StackyIterator } from "./stackyIterator.js";
6666
export {
6767
asMutable,
6868
balancedReduce,
69-
clone,
7069
compareSets,
7170
getOrAddEmptyToMap,
7271
getOrCreate,

packages/dds/tree/src/util/utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ export function asMutable<T>(readonly: T): Mutable<T> {
4444
return readonly as Mutable<T>;
4545
}
4646

47-
export { default as clone } from "@ungap/structured-clone";
48-
4947
/**
5048
* Checks whether or not the given object is a `readonly` array.
5149
*

packages/framework/client-logger/app-insights-logger/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@
8787
},
8888
"dependencies": {
8989
"@fluidframework/core-interfaces": "workspace:~",
90-
"@microsoft/applicationinsights-web": "^2.8.11",
91-
"@ungap/structured-clone": "^1.2.0"
90+
"@microsoft/applicationinsights-web": "^2.8.11"
9291
},
9392
"devDependencies": {
9493
"@arethetypeswrong/cli": "^0.18.2",
@@ -102,7 +101,6 @@
102101
"@types/mocha": "^10.0.10",
103102
"@types/node": "catalog:types",
104103
"@types/sinon": "^17.0.3",
105-
"@types/ungap__structured-clone": "^1.2.0",
106104
"concurrently": "^9.2.1",
107105
"copyfiles": "^2.4.1",
108106
"cross-env": "^10.1.0",

packages/framework/client-logger/app-insights-logger/src/fluidAppInsightsLogger.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type {
88
ITelemetryBaseLogger,
99
} from "@fluidframework/core-interfaces";
1010
import type { ApplicationInsights } from "@microsoft/applicationinsights-web";
11-
import structuredClone from "@ungap/structured-clone";
1211

1312
/**
1413
* The categories FF uses when instrumenting the code.

packages/loader/container-loader/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@
185185
"@fluidframework/driver-definitions": "workspace:~",
186186
"@fluidframework/driver-utils": "workspace:~",
187187
"@fluidframework/telemetry-utils": "workspace:~",
188-
"@ungap/structured-clone": "^1.2.0",
189188
"debug": "^4.3.4",
190189
"double-ended-queue": "^2.1.0-0",
191190
"events_pkg": "npm:events@^3.1.0",
@@ -209,7 +208,6 @@
209208
"@types/mocha": "^10.0.10",
210209
"@types/node": "catalog:types",
211210
"@types/sinon": "^17.0.3",
212-
"@types/ungap__structured-clone": "^1.2.0",
213211
"c8": "^10.1.3",
214212
"concurrently": "^9.2.1",
215213
"copyfiles": "^2.4.1",

packages/loader/container-loader/src/container.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ import {
101101
loggerToMonitoringContext,
102102
type ITelemetryErrorEventExt,
103103
} from "@fluidframework/telemetry-utils/internal";
104-
import structuredClone from "@ungap/structured-clone";
105104
import { v4 as uuid } from "uuid";
106105

107106
import {

pnpm-lock.yaml

Lines changed: 0 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)