6ee814b7f3
Cold load served ALL static + API responses uncompressed and without cache headers (~3.7MB over the wire). Delivery only — feature behavior unchanged; no DB/API-contract/MCP changes. - apps/client/vite.config.ts: vite-plugin-compression2 emits .br + .gz next to each built asset (excludes index.html, which the server rewrites at boot with window.CONFIG — a precompressed copy would go stale). Build emits 187 .br / 175 .gz under dist/assets. - static.module.ts: @fastify/static `preCompressed: true` serves the .br/.gz neighbour; `setHeaders` sets `immutable` ONLY for content-hashed /assets/*, `no-cache` for index.html, and leaves non-hashed files (locales, vad, icons, manifest) on default etag/last-modified revalidation. - main.ts: @fastify/compress (threshold 1024) compresses dynamic API JSON + the rewritten share-SEO HTML. SSE is safe on two counts: `text/event-stream` is not mime-db-compressible (allowlist skips it) AND the AI-chat stream hijacks the raw socket (pipeUIMessageStreamToResponse -> res.raw), bypassing the Fastify onSend lifecycle entirely. No double-compression with preCompressed static (compress skips already-Content-Encoding'd responses). - docker-compose.yml: comment recommending an optional HTTP/2 + brotli reverse proxy (not required). Deps: apps/client vite-plugin-compression2 2.5.3 (dev), apps/server @fastify/compress 9.0.0 (matches fastify 5.8.5). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptionsproperty like this:
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
- Replace
plugin:@typescript-eslint/recommendedtoplugin:@typescript-eslint/recommended-type-checkedorplugin:@typescript-eslint/strict-type-checked - Optionally add
plugin:@typescript-eslint/stylistic-type-checked - Install eslint-plugin-react and add
plugin:react/recommended&plugin:react/jsx-runtimeto theextendslist