docs(vscode-ext-webview): fix WithTelemetry documented entry point to ./host#787
Merged
Conversation
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>
Copilot created this pull request from a session on behalf of
tnaum-ms
July 7, 2026 08:56
View session
Collaborator
Contributor
There was a problem hiding this comment.
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-webviewas side-effect free via"sideEffects": falseto enable better tree-shaking in consumer bundlers. - Update README install/peer-dependency docs to explicitly call out
react+vscode-webviewas optional peers (scoped to the./reactsurface). - Fix docs to state
WithTelemetryis 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. |
Contributor
✅ Code Quality Checks
This comment is updated automatically on each push. |
Contributor
📦 Build Size Report
Download artifact · updated automatically on each push. |
tnaum-ms
approved these changes
Jul 7, 2026
languy
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR supersedes and closes #786. It carries forward both publish-readiness
tweaks from #786 to
@microsoft/vscode-ext-webviewand adds one more fixreported by an external consumer of the published package.
Changes
1.
"sideEffects": falseinpackage.jsonThe package is fully side-effect free (verified by scanning every non-test
source file — only pure declarations, a
WeakMapallocation, and a pureinitTRPC().create()builder). This lets bundlers safely tree-shake unusedexports.
engineswas intentionally not added (optional for a bundler-consumedlibrary; risks spurious
EBADENGINEwarnings).2. Clarify optional peer dependencies (README)
reactandvscode-webvieware already optional viapeerDependenciesMeta,but the README install prose omitted
vscode-webviewand didn't call outwhich peers are optional, or that both are scoped only to the
./reactsurface. Reconciled the install prose and peer-dependency table accordingly.
3. Fix
WithTelemetrydocumented entry point (new in this PR)An external consumer of
@microsoft/vscode-ext-webview@0.9.0-preview(thevscode-webview-starter-kit — its first real npm consumer) hit a
documentation/export-location mismatch: docs pointed to the shared
.entrypoint for
WithTelemetry, but the shipped type declarations only export itfrom
./host. Corrected the migration manual and README accordingly.ADVANCED.mdalready imported it correctly — no change needed there.Verification
npm run build(tsc) — cleannpx prettier --check— cleannpm test(jest) — 89/89 tests, 11 suitesNo runtime or API behaviour changes — packaging metadata and documentation only.
Supersedes/closes #786.