ai-claude-code and ai-sandbox: add "sideEffects": false so translateSdkStream tree-shakes

Aperta
#2,032 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@tombeckenham ci sta già lavorando.

Dal 4/11/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

waiting-on: maintainer
TanStack AI version

@tanstack/ai-claude-code 1.0.1, @tanstack/ai-sandbox 1.1.0 (@tanstack/ai 1.1.0)

Framework/Library version

Vite 8.0.0 (Rolldown), TanStack Start 1.169, Nitro 3

Describe the bug and the steps to reproduce it

@tanstack/ai and @tanstack/ai-skills set "sideEffects": false in package.json. @tanstack/ai-claude-code and @tanstack/ai-sandbox do not. So a bundler must keep every module that the root entry of @tanstack/ai-claude-code imports, also when the app uses only translateSdkStream.

  1. Import only the translator in a server module:
    import { translateSdkStream } from "@tanstack/ai-claude-code"
    
  2. Build with Vite 8 (Rolldown).
  3. The server output keeps side-effect imports of @modelcontextprotocol/sdk (types.js plus ajv, about 475 kB) and of hono with @hono/node-server (about 27 kB). They come from @tanstack/ai-sandbox/dist/esm/tool-bridge.js through the root entry of @tanstack/ai-claude-code. No sandbox code is called.

With this Rolldown rule, both imports go away and the build still works:

build: {
  rolldownOptions: {
    treeshake: {
      moduleSideEffects: [
        { test: /\/@tanstack\/ai-(claude-code|sandbox)\//, sideEffects: false },
      ],
    },
  },
},

Expected: "sideEffects": false in both packages, as in @tanstack/ai. A subpath export for the translator, such as @tanstack/ai-claude-code/translate, would also let an app that only translates stream-json skip the required @tanstack/ai-sandbox peer.

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

The steps above. The rule shows the fix.

Lingua principale
TypeScript
Stelle
3.3k
Fork
378
Merge medio
1g 2h
PR unite (30g)
254

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TanStack/ai

Tutte le issue di TanStack/ai

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.