Skip to content

Upgrade @microsoft/vscode-azext-utils from v3 to v4 (coordinated across api/ and extension) #626

Description

@tnaum-ms

Upgrade @microsoft/vscode-azext-utils from v3 to v4

Context

Dependabot PR #608 attempted to bump @microsoft/vscode-azext-utils from ~3.3.1 to ~4.0.7 in the api/ sub-project only. This was closed because upgrading only api/ creates a version split — the main extension still depends on ~3.3.1, and other extensions consume our API package. A coordinated upgrade across both api/ and the root extension is needed.

Breaking changes in v4.0.0

The major version bump (v3 → v4) introduces:

  1. CJS → CJS+ESM dual build: The package now ships both CommonJS and ESM via a package.json exports map. v3 only had "main": "out/src/index.js" with no exports map. v4 uses dist/esm/ and dist/cjs/ paths resolved through exports.
  2. Adopted finalized auth challenges API: Internal API surface for auth challenges was finalized.
  3. Removed escape-string-regexp dependency: Regex escaping in masking.ts was rewritten.
  4. Dev/test classes moved: Some classes from @microsoft/vscode-azext-dev moved into @microsoft/vscode-azext-utils@4.0.1.
  5. Duplicate type declaration removed (v4.0.2): Could affect consumers relying on the duplicate.
  6. Telemetry package changes (v4.0.3–4.0.4): Moves to new engineering package, telemetry bundled separately.

Scope of work

1. Upgrade in both locations

  • api/package.json: ~3.3.1~4.0.7
  • Root package.json: ~3.3.1~4.0.7

2. Verify type compatibility

The extension uses the following APIs extensively (~25+ files):

Runtime APIs:

  • callWithTelemetryAndErrorHandling
  • registerCommand / registerCommandWithTreeNodeUnwrapping
  • AzureWizard / AzureWizardPromptStep
  • UserCancelledError / GoBackError
  • DialogResponses
  • parseError / appendExtensionUserAgent
  • createApiProvider / apiUtils
  • createAzExtLogOutputChannel
  • registerErrorHandler / registerUIExtensionVariables
  • TreeElementStateManager / createContextValue / createGenericElement
  • AzExtTreeFileSystem
  • createSubscriptionContext

Sub-path imports:

  • @microsoft/vscode-azext-utils/activityAzureResourcesExtensionApiWithActivity
  • @microsoft/vscode-azext-utils/hostapiAzureHostExtensionApi

3. Required integration testing

Azure Resources integration

  • Extension activates without errors
  • Tree views load correctly (Connections view, Azure Discovery view)
  • Azure subscription filtering works
  • Resource creation wizards complete successfully
  • AzureResourcesExtensionApiWithActivity activity reporting works

Migration extension integration

  • Migration extension (registered client in package.jsonx-documentdbApi.registeredClients) can activate and call getDocumentDBExtensionApi()
  • apiUtils.AzureExtensionApiProvider.getApi() returns a valid API object
  • Migration provider registration works end-to-end
  • Migration actions execute successfully

General regression

  • All wizard flows (Connect, Create database, Create collection) work
  • Shell/PTY operations work
  • Document CRUD operations work
  • npm run build passes
  • npx jest --no-coverage passes
  • No runtime errors in Output channel

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency file

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions