From c5f986087a6500f855d8f70b4eef3b68a5fc1817 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 16:29:10 +0000 Subject: [PATCH 1/3] Initial plan From b92ec79fd7bee1b8fbf1ccd449c3a40d97387531 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 16:36:24 +0000 Subject: [PATCH 2/3] move imageUtils.ts from server/utils to utils/isomorphic Co-authored-by: pavelfeldman <883973+pavelfeldman@users.noreply.github.com> --- packages/playwright-core/src/mcp/browser/tools/screenshot.ts | 2 +- packages/playwright-core/src/server/utils/comparators.ts | 4 ++-- packages/playwright-core/src/utils.ts | 2 +- .../src/{server/utils => utils/isomorphic}/imageUtils.ts | 0 4 files changed, 4 insertions(+), 4 deletions(-) rename packages/playwright-core/src/{server/utils => utils/isomorphic}/imageUtils.ts (100%) diff --git a/packages/playwright-core/src/mcp/browser/tools/screenshot.ts b/packages/playwright-core/src/mcp/browser/tools/screenshot.ts index 4d090810520f2..0fefcd58903fe 100644 --- a/packages/playwright-core/src/mcp/browser/tools/screenshot.ts +++ b/packages/playwright-core/src/mcp/browser/tools/screenshot.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { scaleImageToSize } from '../../../server/utils/imageUtils'; +import { scaleImageToSize } from '../../../utils/isomorphic/imageUtils'; import { jpegjs, PNG } from '../../../utilsBundle'; import { formatObject } from '../../../utils/isomorphic/stringUtils'; diff --git a/packages/playwright-core/src/server/utils/comparators.ts b/packages/playwright-core/src/server/utils/comparators.ts index 77426a2d295e8..e7bf50ddd25ee 100644 --- a/packages/playwright-core/src/server/utils/comparators.ts +++ b/packages/playwright-core/src/server/utils/comparators.ts @@ -21,9 +21,9 @@ import pixelmatch from '../../third_party/pixelmatch'; import { jpegjs } from '../../utilsBundle'; import { colors, diff } from '../../utilsBundle'; import { PNG } from '../../utilsBundle'; -import { padImageToSize } from './imageUtils'; +import { padImageToSize } from '../../utils/isomorphic/imageUtils'; -import type { ImageData } from './imageUtils'; +import type { ImageData } from '../../utils/isomorphic/imageUtils'; export type ImageComparatorOptions = { threshold?: number, maxDiffPixels?: number, maxDiffPixelRatio?: number, comparator?: string }; export type ComparatorResult = { diff?: Buffer; errorMessage: string; } | null; diff --git a/packages/playwright-core/src/utils.ts b/packages/playwright-core/src/utils.ts index 2fbe8e3df067b..585017bbad5d8 100644 --- a/packages/playwright-core/src/utils.ts +++ b/packages/playwright-core/src/utils.ts @@ -44,7 +44,7 @@ export * from './server/utils/expectUtils'; export * from './server/utils/fileUtils'; export * from './server/utils/hostPlatform'; export * from './server/utils/httpServer'; -export * from './server/utils/imageUtils'; +export * from './utils/isomorphic/imageUtils'; export * from './server/utils/network'; export * from './server/utils/nodePlatform'; export * from './server/utils/processLauncher'; diff --git a/packages/playwright-core/src/server/utils/imageUtils.ts b/packages/playwright-core/src/utils/isomorphic/imageUtils.ts similarity index 100% rename from packages/playwright-core/src/server/utils/imageUtils.ts rename to packages/playwright-core/src/utils/isomorphic/imageUtils.ts From 68847d8e1ab85cd5b4dbc3290a439b3e01dcdded Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 17:39:09 +0000 Subject: [PATCH 3/3] Move imageUtils re-export to sorted position in isomorphic section Co-authored-by: pavelfeldman <883973+pavelfeldman@users.noreply.github.com> --- packages/playwright-core/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/playwright-core/src/utils.ts b/packages/playwright-core/src/utils.ts index 585017bbad5d8..a1ef2907198e4 100644 --- a/packages/playwright-core/src/utils.ts +++ b/packages/playwright-core/src/utils.ts @@ -18,6 +18,7 @@ export * from './utils/isomorphic/ariaSnapshot'; export * from './utils/isomorphic/assert'; export * from './utils/isomorphic/colors'; export * from './utils/isomorphic/headers'; +export * from './utils/isomorphic/imageUtils'; export * from './utils/isomorphic/locatorGenerators'; export * from './utils/isomorphic/manualPromise'; export * from './utils/isomorphic/mimeType'; @@ -44,7 +45,6 @@ export * from './server/utils/expectUtils'; export * from './server/utils/fileUtils'; export * from './server/utils/hostPlatform'; export * from './server/utils/httpServer'; -export * from './utils/isomorphic/imageUtils'; export * from './server/utils/network'; export * from './server/utils/nodePlatform'; export * from './server/utils/processLauncher';