From fb7f12bed17483976e540b4adacedacaa45c6bd5 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Fri, 6 Mar 2026 17:32:28 +0000 Subject: [PATCH 1/2] chore: remove dead ./react-with-deps export (copy-paste bug from #221) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The react-with-deps build entry was introduced in PR #221 (e078250a) as a sibling to app-with-deps for CDN/unpkg no-bundler use. But its external array was duplicated without editing — it never dropped @modelcontextprotocol/sdk from externals, so it has shipped byte-identical to ./react for 10 releases (v0.3.1 → v1.2.0). After #534 merged, both entries use ['react', 'react-dom', ...PEER_EXTERNALS] — still identical, just smaller. Delete rather than fix: React apps always use a bundler; the CDN/unpkg use case (HTML-string apps like qr-server) doesn't apply to React hooks. Zero consumers verified (examples/docs/tests/plugins). --- build.bun.ts | 5 ----- package.json | 4 ---- 2 files changed, 9 deletions(-) diff --git a/build.bun.ts b/build.bun.ts index 03810303..7059f378 100644 --- a/build.bun.ts +++ b/build.bun.ts @@ -52,11 +52,6 @@ await Promise.all([ outdir: "dist/src/react", external: ["react", "react-dom", ...PEER_EXTERNALS], }), - buildJs("src/react/index.tsx", { - outdir: "dist/src/react", - external: ["react", "react-dom", ...PEER_EXTERNALS], - naming: { entry: "react-with-deps.js" }, - }), buildJs("src/server/index.ts", { outdir: "dist/src/server", external: PEER_EXTERNALS, diff --git a/package.json b/package.json index c8c73b8d..85883737 100644 --- a/package.json +++ b/package.json @@ -26,10 +26,6 @@ "types": "./dist/src/react/index.d.ts", "default": "./dist/src/react/index.js" }, - "./react-with-deps": { - "types": "./dist/src/react/index.d.ts", - "default": "./dist/src/react/react-with-deps.js" - }, "./app-bridge": { "types": "./dist/src/app-bridge.d.ts", "default": "./dist/src/app-bridge.js" From 999146781e6f1f3e31a35d2f5f8fbf7da56e774f Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Fri, 6 Mar 2026 19:06:41 +0000 Subject: [PATCH 2/2] fix: bundle SDK+zod in react-with-deps (keep React external) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reverts the deletion from the previous commit and applies the actual fix. The react-with-deps external array was copy-pasted in PR #221 without dropping PEER_EXTERNALS — now it mirrors app-with-deps: bundles @modelcontextprotocol/sdk + zod for CDN/import-map consumers. React and react-dom MUST remain external — bundling them would cause dual-React-instance hooks errors. Consumer provides them via import map. Before: index.js 26KB == react-with-deps.js 26KB (identical MD5) After: index.js 26KB != react-with-deps.js 323KB (SDK+zod bundled) --- build.bun.ts | 5 +++++ package.json | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/build.bun.ts b/build.bun.ts index 7059f378..a129d5dd 100644 --- a/build.bun.ts +++ b/build.bun.ts @@ -52,6 +52,11 @@ await Promise.all([ outdir: "dist/src/react", external: ["react", "react-dom", ...PEER_EXTERNALS], }), + buildJs("src/react/index.tsx", { + outdir: "dist/src/react", + external: ["react", "react-dom"], + naming: { entry: "react-with-deps.js" }, + }), buildJs("src/server/index.ts", { outdir: "dist/src/server", external: PEER_EXTERNALS, diff --git a/package.json b/package.json index 85883737..c8c73b8d 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,10 @@ "types": "./dist/src/react/index.d.ts", "default": "./dist/src/react/index.js" }, + "./react-with-deps": { + "types": "./dist/src/react/index.d.ts", + "default": "./dist/src/react/react-with-deps.js" + }, "./app-bridge": { "types": "./dist/src/app-bridge.d.ts", "default": "./dist/src/app-bridge.js"