Skip to content

Conversation

@jeremymeng
Copy link
Member

  • bump version to v4 and add @vitest/browser-playwright to dev deps per reference: https://github.com/vitest-dev/vitest/blob/main/docs/guide/migration.md

  • event-hubs & service-bus: fix export of Delivery and WebSocketImpl. We only ever import and use them as types

  • root tsconfig.browser.config.json workaround: need NodeJS types for browser typechecking because today

    • some of our packages have mix NodeJS/browser usage in same file
    • typeScript NodeNext module resolution uses ESM flavor of our built .d.ts files which may contain pattern of import { ... } from "node:xxx";
    • our build-test doesn't do platform file substitution yet, so ESM code files are included in the build.

    vitest v3 pulls in NodeJS types implicitly so it works now but it is no longer the same in vitest v4.

  • test-utils: remove unused multi version testing support

replace @vitest/browser with @vitest/browser-playwright
we only ever import and use them as types.
…onfig.json

- dev-tool: apply strip-json-comments to tsconfig file contents before parsing. Usually tsconfig.json files allow comments.
because today

- Some of our packages have mix NodeJS/browser usage in same file
- TypeScript `NodeNext` module resolution uses ESM version of built .d.ts files
  which may contain pattern of `import { ... } from "node:xxx";`
- Our build-test doesn't do platform file substitution yet so ESM version of
  files are included in the build.

Vitest v3 pulls in NodeJS types implicitly but it is no longer the case in
vitest v4.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the vitest development dependencies from v3 to v4 across the repository. The main changes include updating the @vitest/browser package to @vitest/browser-playwright to align with vitest v4's browser testing approach, and addressing type compatibility issues that arose from this upgrade.

Key changes:

  • Upgrade vitest and related packages to v4.0.0
  • Replace @vitest/browser with @vitest/browser-playwright across all packages
  • Fix type exports in event-hubs and service-bus packages to use type imports
  • Add JSON comment stripping support in dev-tool's TypeScript config resolver

Reviewed Changes

Copilot reviewed 299 out of 425 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pnpm-workspace.yaml Update vitest catalog versions from v3.2.3 to v4.0.0 and rename browser package
sdk/*/package.json (300+ files) Replace @vitest/browser with @vitest/browser-playwright in devDependencies
sdk/eventhub/event-hubs/src/index.ts Change WebSocketImpl export to type-only export
common/tools/dev-tool/src/util/resolveTsConfig.ts Add stripJsonComments import and usage for parsing TypeScript configs
eng/tools/ci-runner/package.json Update vitest dependencies to v4.0.0
eng/containers/turborepo-remote-cache/package.json Update vitest dependencies to v4.0.0
common/tools/eslint-plugin-azure-sdk/package.json Remove unused @vitest/browser dependency


export { EventData, ReceivedEventData } from "./eventData.js";
export { WebSocketImpl } from "rhea-promise";
export type { WebSocketImpl } from "rhea-promise";
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing from a value export to a type-only export is correct for types that are only used in type positions. However, ensure that all consumer code only uses WebSocketImpl as a type and not as a value. If any code attempts to use it as a constructor or value, this will cause runtime errors.

Suggested change
export type { WebSocketImpl } from "rhea-promise";
export { WebSocketImpl } from "rhea-promise";

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a breaking change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it is an interface, a re-export from rhea

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with that said, it appears to be a regression that vitest v4 is not able to strip this type-only import.

@jeremymeng jeremymeng requested a review from anannya03 October 28, 2025 19:05
"types": [],
// Workaround for browser build-test:
// - Some core and storage package have mixed usage of NodeJS and browser types in same file.
// - TypeScript resolves our types from ESM because of `"moduleResolution": "NodeNext"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we change module resolution to be bundler?

Copy link
Member Author

@jeremymeng jeremymeng Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That only affects whether .js extension is required for relative import

'bundler' for use with bundlers. Like node16 and nodenext, this mode supports package.json "imports" and "exports", but unlike the Node.js resolution modes, bundler never requires file extensions on relative paths in imports.

@github-actions
Copy link

API Change Check

APIView identified API level changes in this PR and created the following API reviews

@azure/arm-weightsandbiases
@azure/storage-internal-avro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Untriaged
Status: Untriaged

Development

Successfully merging this pull request may close these issues.

3 participants