Skip to content

docs(vscode-ext-webview): fix WithTelemetry documented entry point to ./host#787

Merged
tnaum-ms merged 7 commits into
mainfrom
copilot/devtnaumwebview-api-tweak
Jul 7, 2026
Merged

docs(vscode-ext-webview): fix WithTelemetry documented entry point to ./host#787
tnaum-ms merged 7 commits into
mainfrom
copilot/devtnaumwebview-api-tweak

Conversation

Copilot AI commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR supersedes and closes #786. It carries forward both publish-readiness
tweaks from #786 to @microsoft/vscode-ext-webview and adds one more fix
reported by an external consumer of the published package.

Changes

1. "sideEffects": false in package.json

The package is fully side-effect free (verified by scanning every non-test
source file — only pure declarations, a WeakMap allocation, and a pure
initTRPC().create() builder). This lets bundlers safely tree-shake unused
exports. engines was intentionally not added (optional for a bundler-consumed
library; risks spurious EBADENGINE warnings).

2. Clarify optional peer dependencies (README)

react and vscode-webview are already optional via peerDependenciesMeta,
but the README install prose omitted vscode-webview and didn't call out
which peers are optional, or that both are scoped only to the ./react
surface. Reconciled the install prose and peer-dependency table accordingly.

3. Fix WithTelemetry documented entry point (new in this PR)

An external consumer of @microsoft/vscode-ext-webview@0.9.0-preview (the
vscode-webview-starter-kit — its first real npm consumer) hit a
documentation/export-location mismatch: docs pointed to the shared . entry
point for WithTelemetry, but the shipped type declarations only export it
from ./host. Corrected the migration manual and README accordingly.
ADVANCED.md already imported it correctly — no change needed there.

Verification

  • npm run build (tsc) — clean
  • npx prettier --check — clean
  • npm test (jest) — 89/89 tests, 11 suites

No runtime or API behaviour changes — packaging metadata and documentation only.

Supersedes/closes #786.

tnaum-ms and others added 5 commits July 6, 2026 21:47
Reconcile the install prose and peer-dependency table with the actual
peerDependenciesMeta: list all four peers and mark react and
vscode-webview as optional, so host-only / non-React consumers know they
are not required.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address Copilot review feedback: the install prose implied a
framework-agnostic ./webview consumer needs vscode-webview, which
contradicted the peer-dependency table. Only src/react/WebviewContext.tsx
imports vscode-webview; the ./webview transport uses its own structural
VsCodeApiLike. Reword the prose and table row to scope both optional
peers to the ./react surface, and record the review round in the notes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tnaum-ms

tnaum-ms commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Supersedes #786 — includes both of its changes (sideEffects: false + peer-dependency doc clarification) plus the WithTelemetry entry-point fix. Closing #786 in favor of this PR.

@tnaum-ms tnaum-ms marked this pull request as ready for review July 7, 2026 09:26
@tnaum-ms tnaum-ms requested a review from a team as a code owner July 7, 2026 09:26
Copilot AI review requested due to automatic review settings July 7, 2026 09:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the publish/readme metadata for the @microsoft/vscode-ext-webview package to improve consumer bundling (tree-shaking) and to correct/clarify documentation around entry points and peer dependencies, including a fix for the documented import location of WithTelemetry.

Changes:

  • Mark @microsoft/vscode-ext-webview as side-effect free via "sideEffects": false to enable better tree-shaking in consumer bundlers.
  • Update README install/peer-dependency docs to explicitly call out react + vscode-webview as optional peers (scoped to the ./react surface).
  • Fix docs to state WithTelemetry is exported from ./host (not the shared . entry point), aligning docs with the package’s actual exports.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/vscode-ext-webview/package.json Adds "sideEffects": false to improve consumer tree-shaking.
packages/vscode-ext-webview/README.md Clarifies optional peer deps and corrects WithTelemetry documentation/export location to ./host.
docs/ai-and-plans/PRs/786-webview-api-tweak/webview-api-tweak-notes.md Adds PR notes documenting the rationale and verification steps for the publish-readiness tweaks.
docs/ai-and-plans/PRs/766-webview-ext-package-redesign/webview-ext-migration-manual.md Corrects the migration manual to list WithTelemetry under ./host.

@tnaum-ms tnaum-ms enabled auto-merge July 7, 2026 09:32
@tnaum-ms tnaum-ms disabled auto-merge July 7, 2026 10:17
@tnaum-ms tnaum-ms enabled auto-merge July 7, 2026 10:20
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

✅ Code Quality Checks

Check Status How to fix
Localization (l10n) ✅ Passed
ESLint ✅ Passed
Prettier formatting ✅ Passed

This comment is updated automatically on each push.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📦 Build Size Report

Metric Base (main) PR Delta
VSIX (vscode-documentdb-0.9.1.vsix) 8.01 MB 8.01 MB ✅ 0 KB (0.0%)
Webview bundle (views.js) 5.88 MB 5.88 MB ✅ 0 KB (0.0%)

Download artifact · updated automatically on each push.

@tnaum-ms tnaum-ms merged commit 2e62eb8 into main Jul 7, 2026
8 checks passed
@tnaum-ms tnaum-ms deleted the copilot/devtnaumwebview-api-tweak branch July 7, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants