From 2cf4599a87d66b5edfc687ac0afee7cfecfbd94a Mon Sep 17 00:00:00 2001 From: Zach Newton Date: Mon, 1 Dec 2025 10:52:12 -0800 Subject: [PATCH 1/2] Remove deprecated performance.now usages from common-utils --- .../memory-orderer/src/localOrdererConnection.ts | 2 +- .../api-report/server-services-client.api.md | 4 ++++ .../packages/services-client/src/index.ts | 1 + .../packages/services-client/src/performance.ts | 11 +++++++++++ .../packages/services-client/src/restWrapper.ts | 1 + .../packages/services-core/src/test/trace.spec.ts | 2 +- .../routerlicious/packages/services-core/src/trace.ts | 2 +- .../packages/services-shared/src/socketIoServer.ts | 6 +++--- 8 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 server/routerlicious/packages/services-client/src/performance.ts diff --git a/server/routerlicious/packages/memory-orderer/src/localOrdererConnection.ts b/server/routerlicious/packages/memory-orderer/src/localOrdererConnection.ts index d43522ad5240..b9c625b6c693 100644 --- a/server/routerlicious/packages/memory-orderer/src/localOrdererConnection.ts +++ b/server/routerlicious/packages/memory-orderer/src/localOrdererConnection.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. */ -import { performance } from "@fluidframework/common-utils"; +import { performance } from "@fluidframework/server-services-client"; import { type IClient, type IClientJoin, diff --git a/server/routerlicious/packages/services-client/api-report/server-services-client.api.md b/server/routerlicious/packages/services-client/api-report/server-services-client.api.md index 6cfd0d7ec790..59a56fcd266c 100644 --- a/server/routerlicious/packages/services-client/api-report/server-services-client.api.md +++ b/server/routerlicious/packages/services-client/api-report/server-services-client.api.md @@ -651,6 +651,10 @@ export class NetworkInformation { // @internal (undocumented) export function parseToken(tenantId: string, authorization: string | undefined): string | undefined; +// @internal +const performance_2: Performance; +export { performance_2 as performance } + // @internal (undocumented) export function promiseTimeout(mSec: number, promise: Promise): Promise; diff --git a/server/routerlicious/packages/services-client/src/index.ts b/server/routerlicious/packages/services-client/src/index.ts index 4b3882e667da..6a3294390fc1 100644 --- a/server/routerlicious/packages/services-client/src/index.ts +++ b/server/routerlicious/packages/services-client/src/index.ts @@ -41,6 +41,7 @@ export { parseToken, } from "./historian"; export type { IAlfredTenant, ISession } from "./interfaces"; +export { performance } from "./performance"; export { promiseTimeout } from "./promiseTimeout"; export { RestLessClient, RestLessFieldNames } from "./restLessClient"; export { diff --git a/server/routerlicious/packages/services-client/src/performance.ts b/server/routerlicious/packages/services-client/src/performance.ts new file mode 100644 index 000000000000..642923dc4474 --- /dev/null +++ b/server/routerlicious/packages/services-client/src/performance.ts @@ -0,0 +1,11 @@ +/*! + * Copyright (c) Microsoft Corporation and contributors. All rights reserved. + * Licensed under the MIT License. + */ + +/** + * Isomorphic access to the {@link https://developer.mozilla.org/en-US/docs/Web/API/Performance|Performance API}. + * + * @internal + */ +export const performance = globalThis.performance; diff --git a/server/routerlicious/packages/services-client/src/restWrapper.ts b/server/routerlicious/packages/services-client/src/restWrapper.ts index 8e30ca2bc617..b4e4fc253e70 100644 --- a/server/routerlicious/packages/services-client/src/restWrapper.ts +++ b/server/routerlicious/packages/services-client/src/restWrapper.ts @@ -13,6 +13,7 @@ import { } from "axios"; import safeStringify from "json-stringify-safe"; import { v4 as uuid } from "uuid"; +import { performance } from "./performance"; import { CallingServiceHeaderName, diff --git a/server/routerlicious/packages/services-core/src/test/trace.spec.ts b/server/routerlicious/packages/services-core/src/test/trace.spec.ts index 47a03baa90bf..a880273d64ad 100644 --- a/server/routerlicious/packages/services-core/src/test/trace.spec.ts +++ b/server/routerlicious/packages/services-core/src/test/trace.spec.ts @@ -5,8 +5,8 @@ import { strict as assert } from "assert"; import sinon from "sinon"; +import { performance } from "@fluidframework/server-services-client"; import { StageTrace } from "../trace"; -import { performance } from "@fluidframework/common-utils"; describe("StageTrace", () => { let clock: sinon.SinonFakeTimers; diff --git a/server/routerlicious/packages/services-core/src/trace.ts b/server/routerlicious/packages/services-core/src/trace.ts index 302ab0db5bf4..e0c561d3b234 100644 --- a/server/routerlicious/packages/services-core/src/trace.ts +++ b/server/routerlicious/packages/services-core/src/trace.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. */ -import { performance } from "@fluidframework/common-utils"; +import { performance } from "@fluidframework/server-services-client"; /** * @internal diff --git a/server/routerlicious/packages/services-shared/src/socketIoServer.ts b/server/routerlicious/packages/services-shared/src/socketIoServer.ts index 02e4283bd7c8..46db35613a40 100644 --- a/server/routerlicious/packages/services-shared/src/socketIoServer.ts +++ b/server/routerlicious/packages/services-shared/src/socketIoServer.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. */ -import { EventEmitter } from "events"; -import type * as http from "http"; -import { performance } from "perf_hooks"; +import { EventEmitter } from "node:events"; +import type * as http from "node:http"; +import { performance } from "@fluidframework/server-services-client"; import type * as core from "@fluidframework/server-services-core"; import { BaseTelemetryProperties, From 7d834cc4ec1af9fcf0046124c537202d9212f90a Mon Sep 17 00:00:00 2001 From: Zach Newton Date: Mon, 1 Dec 2025 10:57:05 -0800 Subject: [PATCH 2/2] Remove unused dependencies on common-utils --- server/routerlicious/packages/routerlicious/package.json | 1 - .../packages/services-telemetry/package.json | 1 - server/routerlicious/packages/services/package.json | 1 - server/routerlicious/pnpm-lock.yaml | 9 --------- 4 files changed, 12 deletions(-) diff --git a/server/routerlicious/packages/routerlicious/package.json b/server/routerlicious/packages/routerlicious/package.json index c71ee1b950b4..ebcf008a6523 100644 --- a/server/routerlicious/packages/routerlicious/package.json +++ b/server/routerlicious/packages/routerlicious/package.json @@ -38,7 +38,6 @@ "typetests:prepare": "flub typetests --dir . --reset --previous --normalize" }, "dependencies": { - "@fluidframework/common-utils": "^3.1.0", "@fluidframework/gitresources": "workspace:~", "@fluidframework/protocol-definitions": "^3.2.0", "@fluidframework/server-kafka-orderer": "workspace:~", diff --git a/server/routerlicious/packages/services-telemetry/package.json b/server/routerlicious/packages/services-telemetry/package.json index d27795ce1874..9936df60a628 100644 --- a/server/routerlicious/packages/services-telemetry/package.json +++ b/server/routerlicious/packages/services-telemetry/package.json @@ -52,7 +52,6 @@ "temp-directory": "nyc/.nyc_output" }, "dependencies": { - "@fluidframework/common-utils": "^3.1.0", "json-stringify-safe": "^5.0.1", "path-browserify": "^1.0.1", "serialize-error": "^8.1.0", diff --git a/server/routerlicious/packages/services/package.json b/server/routerlicious/packages/services/package.json index 0e3dac561b8e..9babd0af78b7 100644 --- a/server/routerlicious/packages/services/package.json +++ b/server/routerlicious/packages/services/package.json @@ -51,7 +51,6 @@ "temp-directory": "nyc/.nyc_output" }, "dependencies": { - "@fluidframework/common-utils": "^3.1.0", "@fluidframework/protocol-definitions": "^3.2.0", "@fluidframework/server-services-client": "workspace:~", "@fluidframework/server-services-core": "workspace:~", diff --git a/server/routerlicious/pnpm-lock.yaml b/server/routerlicious/pnpm-lock.yaml index 191ad74ac60b..3118fe68c9b8 100644 --- a/server/routerlicious/pnpm-lock.yaml +++ b/server/routerlicious/pnpm-lock.yaml @@ -666,9 +666,6 @@ importers: packages/routerlicious: dependencies: - '@fluidframework/common-utils': - specifier: ^3.1.0 - version: 3.1.0 '@fluidframework/gitresources': specifier: workspace:~ version: link:../gitresources @@ -971,9 +968,6 @@ importers: packages/services: dependencies: - '@fluidframework/common-utils': - specifier: ^3.1.0 - version: 3.1.0 '@fluidframework/protocol-definitions': specifier: ^3.2.0 version: 3.2.0 @@ -1650,9 +1644,6 @@ importers: packages/services-telemetry: dependencies: - '@fluidframework/common-utils': - specifier: ^3.1.0 - version: 3.1.0 json-stringify-safe: specifier: ^5.0.1 version: 5.0.1