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

Abierto
#2,032 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@tombeckenham ya está trabajando en esto.

Desde el 4/11/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
3.3k
Forks
378
Merge medio
1 d 2 h
PR fusionados (30 d)
254

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TanStack/ai

Todos los issues de TanStack/ai

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.