microsoft / microsoft/vscode-documentdb

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

Open
#626 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dependencies
Dominant language
TypeScript
Stars
31
Forks
22
Avg merge
2d 20h
Merged PRs (30d)
21

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Update the dependency in api/package.json and the root package.json, then inspect the listed runtime and sub-path imports for compatibility with v4. Start with the package changes and run npm run build and npx jest --no-coverage. Done means both projects use v4, the build and tests pass, and the listed Azure Resources, migration, wizard, CRUD, and shell flows work without runtime errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
desktop, developer-experience, devtools, testing
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.