Skip to content

Split heavy services out of the documentation Worker - #1385

Merged
tannerlinsley merged 1 commit into
mainfrom
taren/worker-performance-boundaries
Oct 16, 2026
Merged

tannerlinsley merged 1 commit into
mainfrom
taren/worker-performance-boundaries

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Documentation requests previously carried the chat backend, image renderer, project templates and browser-only catalogs in the same Worker upload, even when those modules were lazy. Keep one Start app and browser route tree, but deploy OG generation, chat services and project generation as auxiliary Workers. Remove the chat app and icon catalog from the server build through client-only imports.

Also cache the docs manifest, refresh stale positive content in the background, keep docs HTML private and uncached, and add request timings plus build guards that prevent heavy modules returning to the site upload.

Validation:

  • Production build and full TypeScript, lint, unit, chat and desktop suites.
  • Native local multi-Worker runtime, image rendering, client-only icon browser and API route parity.
  • Disposable staged storage/workflow transfer, followed by production namespace and workflow ID verification.
  • Production image generation, starter generation and docs client navigation, with no chat requests on docs pages.

The site upload is about 58% smaller. An 80-request controlled payload comparison reduced first-instance median latency from 1,048 ms to 472 ms. Production docs samples had a roughly unchanged settled median near 250 ms, so this is not a 55% end-to-end page speedup. Raw measurements and limitations are in docs/worker-split-validation.md and docs/worker-split-measurements.json.

The production namespaces and existing workflow have already moved to tanstack-chat without changing their IDs. The deployment script handles the first staged rollout and ordinary subsequent deployments, checking child credentials before making changes. This configuration needs to reach main before its next production deployment.

The saved session was already expired before rollout. Authentication rejection checks pass, but a successful signed-in check needs a fresh login.

Final deployment incorporates main through b416acb. Site version: bb60eccc-63a1-4412-8670-c7b3d77a4bcf. A further 24-request sample immediately after that redeployment returned 200 throughout, with median TTFB 283.6 ms and p95 1,496.5 ms. This reinforces the limitation above: the live samples do not establish an overall docs response improvement, despite the controlled reduction in cold payload preparation time.

@changeset-bot

changeset-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4aec6a9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 312 files, which is 162 over the limit of 150.

To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

Usage-priced reviews support at most 300 files.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 07bac0b2-3f82-4040-8daa-2372c1714179
📥 Commits

Reviewing files that changed from the base of the PR and between b416acb and 4aec6a9.

📒 Files selected for processing: 312
  • docs/docs-html-cache-experiment.ts.txt
  • docs/docs-performance-measurements.json
  • docs/docs-performance-spike.md
  • docs/docs-production-performance-measurements.json
  • docs/worker-cold-start-investigation.md
  • docs/worker-cold-start-measurements.json
  • docs/worker-cold-start-probes/README.md
  • docs/worker-cold-start-probes/measure.py.txt
  • docs/worker-cold-start-probes/probe.js.txt
  • docs/worker-cold-start-probes/rebundle.mjs.txt
  • docs/worker-deployment-boundaries.md
  • docs/worker-split-measurements.json
  • docs/worker-split-validation.md
  • harness-tests/core/catalog-detail-http.test.ts
  • harness-tests/core/chat-entrypoints.test.js
  • harness-tests/core/chat-file-route.test.ts
  • harness-tests/core/chat-mcp-route.test.ts
  • harness-tests/core/chat-model-route.test.ts
  • harness-tests/core/chat-plugin-route.test.ts
  • harness-tests/core/chat-runtime-headers.test.ts
  • harness-tests/core/chat-skill-route.test.ts
  • package.json
  • scripts/chat-isolation-vite.ts
  • scripts/deploy-cloudflare.mjs
  • scripts/worker-isolation-vite.ts
  • src/application-starter/api/http/compile-attributed.ts
  • src/application-starter/api/http/compile.ts
  • src/application-starter/api/http/deploy/check-name.ts
  • src/application-starter/api/http/deploy/github.ts
  • src/application-starter/api/http/download.ts
  • src/application-starter/api/http/feature-artifacts.ts
  • src/application-starter/api/http/features.ts
  • src/application-starter/api/http/load-remote-addon.ts
  • src/application-starter/api/http/load-remote-template.ts
  • src/application-starter/api/http/load-template.ts
  • src/application-starter/api/http/resolve.ts
  • src/application-starter/api/http/routes.ts
  • src/application-starter/api/http/suggest.ts
  • src/application-starter/api/http/validate.ts
  • src/application-starter/api/request-boundary.server.ts
  • src/chat/components/AppRoute.tsx
  • src/chat/components/ChatShellRoute.tsx
  • src/chat/components/projects/Loading.tsx
  • src/chat/server/entries.ts
  • src/chat/server/http/api/chat/account/composer-drafts/$accountId.$scope.ts
  • src/chat/server/http/api/chat/account/devices.ts
  • src/chat/server/http/api/chat/account/onboarding.ts
  • src/chat/server/http/api/chat/account/preferences.ts
  • src/chat/server/http/api/chat/activity.ts
  • src/chat/server/http/api/chat/app-version.ts
  • src/chat/server/http/api/chat/bootstrap.ts
  • src/chat/server/http/api/chat/bot-drafts/$id.files.$fileId.content.ts
  • src/chat/server/http/api/chat/bot-drafts/$id.files.$fileId.ts
  • src/chat/server/http/api/chat/bot-drafts/$id.files.ts
  • src/chat/server/http/api/chat/bot-drafts/$id.ts
  • src/chat/server/http/api/chat/bots.ts
  • src/chat/server/http/api/chat/bots/$id.$operation.ts
  • src/chat/server/http/api/chat/bots/$id.files.$fileId.content.ts
  • src/chat/server/http/api/chat/bots/$id.files.$fileId.ts
  • src/chat/server/http/api/chat/bots/$id.files.ts
  • src/chat/server/http/api/chat/bots/$id.ts
  • src/chat/server/http/api/chat/bots/bulk.ts
  • src/chat/server/http/api/chat/bots/move.ts
  • src/chat/server/http/api/chat/connection.ts
  • src/chat/server/http/api/chat/conversations/$id.$operation.ts
  • src/chat/server/http/api/chat/conversations/$id.execution.snapshots.$snapshotId.ts
  • src/chat/server/http/api/chat/conversations/$id.files.$fileId.content.ts
  • src/chat/server/http/api/chat/conversations/$id.files.$fileId.ts
  • src/chat/server/http/api/chat/conversations/$id.files.ts
  • src/chat/server/http/api/chat/conversations/$id.workflow-runs.$runId.cancel.ts
  • src/chat/server/http/api/chat/conversations/$id.workflow-runs.$runId.ts
  • src/chat/server/http/api/chat/conversations/$id.workflows.$workflowId.ts
  • src/chat/server/http/api/chat/conversations/$id/files/import.ts
  • src/chat/server/http/api/chat/conversations/$id/memories.ts
  • src/chat/server/http/api/chat/conversations/$id/memories/$memoryId.ts
  • src/chat/server/http/api/chat/conversations/$id/references.ts
  • src/chat/server/http/api/chat/copies/$id.ts
  • src/chat/server/http/api/chat/device-transport.ts
  • src/chat/server/http/api/chat/draft.ts
  • src/chat/server/http/api/chat/files.ts
  • src/chat/server/http/api/chat/kody/account.ts
  • src/chat/server/http/api/chat/kody/callback.ts
  • src/chat/server/http/api/chat/kody/community.ts
  • src/chat/server/http/api/chat/kody/community/$listingId.ts
  • src/chat/server/http/api/chat/kody/connect.ts
  • src/chat/server/http/api/chat/kody/jobs/$jobId/enabled.ts
  • src/chat/server/http/api/chat/kody/mail/inboxes.ts
  • src/chat/server/http/api/chat/kody/mail/messages.ts
  • src/chat/server/http/api/chat/kody/mail/messages/$messageId.ts
  • src/chat/server/http/api/chat/kody/memories.ts
  • src/chat/server/http/api/chat/kody/memories/$memoryId.ts
  • src/chat/server/http/api/chat/kody/memories/$memoryId/apply.ts
  • src/chat/server/http/api/chat/kody/memories/$memoryId/review.ts
  • src/chat/server/http/api/chat/kody/memories/create/apply.ts
  • src/chat/server/http/api/chat/kody/memories/create/review.ts
  • src/chat/server/http/api/chat/kody/packages/$packageId/document.ts
  • src/chat/server/http/api/chat/kody/resources/$kind.ts
  • src/chat/server/http/api/chat/kody/runs.ts
  • src/chat/server/http/api/chat/kody/runs/$runId.ts
  • src/chat/server/http/api/chat/kody/runs/$runId/triage.ts
  • src/chat/server/http/api/chat/kody/servers.ts
  • src/chat/server/http/api/chat/kody/servers/$serverId/check.ts
  • src/chat/server/http/api/chat/kody/servers/$serverId/enabled.ts
  • src/chat/server/http/api/chat/kody/servers/$serverId/reconnect.ts
  • src/chat/server/http/api/chat/kody/sync.ts
  • src/chat/server/http/api/chat/kody/unlink.ts
  • src/chat/server/http/api/chat/kody/usage.ts
  • src/chat/server/http/api/chat/mcp/$.ts
  • src/chat/server/http/api/chat/mcp/contract.ts
  • src/chat/server/http/api/chat/model-options.ts
  • src/chat/server/http/api/chat/models.ts
  • src/chat/server/http/api/chat/openrouter/callback.ts
  • src/chat/server/http/api/chat/plugins.ts
  • src/chat/server/http/api/chat/plugins/$id.ts
  • src/chat/server/http/api/chat/policy.ts
  • src/chat/server/http/api/chat/project-snapshots.$hash.quarantine.ts
  • src/chat/server/http/api/chat/project-snapshots.$hash.ts
  • src/chat/server/http/api/chat/project-snapshots.ts
  • src/chat/server/http/api/chat/projects.$id.sync.ts
  • src/chat/server/http/api/chat/projects.$id.ts
  • src/chat/server/http/api/chat/projects.ts
  • src/chat/server/http/api/chat/recipes.ts
  • src/chat/server/http/api/chat/recipes/$id.ts
  • src/chat/server/http/api/chat/references.ts
  • src/chat/server/http/api/chat/references/kody/inspect.ts
  • src/chat/server/http/api/chat/references/kody/refresh.ts
  • src/chat/server/http/api/chat/references/tools/refresh.ts
  • src/chat/server/http/api/chat/retries/$id.prepare.ts
  • src/chat/server/http/api/chat/retries/$id.ts
  • src/chat/server/http/api/chat/sections.ts
  • src/chat/server/http/api/chat/sections/$id.ts
  • src/chat/server/http/api/chat/skills.ts
  • src/chat/server/http/api/chat/skills/$id.ts
  • src/chat/server/http/api/chat/workspace-history.ts
  • src/chat/server/http/api/chat/workspace-index.activity.ts
  • src/chat/server/http/api/chat/workspace-index.ts
  • src/chat/server/http/api/chat/workspace-sync/$operation.ts
  • src/chat/server/http/api/chat/workspace.ts
  • src/chat/server/http/auth/mcp/callback.ts
  • src/chat/server/http/auth/mcp/client-metadata.ts
  • src/chat/server/http/routes.ts
  • src/chat/server/routes/draft.ts
  • src/chat/server/routes/files.ts
  • src/chat/server/routes/mcp/$.ts
  • src/chat/server/routes/models.ts
  • src/chat/server/routes/openrouter/callback.ts
  • src/chat/server/routes/plugins.ts
  • src/chat/server/routes/project-snapshots.$hash.quarantine.ts
  • src/chat/server/routes/project-snapshots.ts
  • src/chat/server/routes/projects.$id.sync.ts
  • src/chat/server/routes/projects.$id.ts
  • src/chat/server/routes/projects.ts
  • src/chat/server/routes/skills.ts
  • src/components/Navbar.tsx
  • src/components/ds/IconographyPage.client.tsx
  • src/db/client.ts
  • src/queries/docsManifest.ts
  • src/routes/__root.tsx
  • src/routes/_library/$libraryId/$version.docs.$.tsx
  • src/routes/_library/$libraryId/$version.docs.framework.$framework.$.tsx
  • src/routes/admin/chat-access.tsx
  • src/routes/api/application-starter/compile-attributed.ts
  • src/routes/api/application-starter/compile.ts
  • src/routes/api/application-starter/deploy/check-name.ts
  • src/routes/api/application-starter/deploy/github.ts
  • src/routes/api/application-starter/download.ts
  • src/routes/api/application-starter/feature-artifacts.ts
  • src/routes/api/application-starter/features.ts
  • src/routes/api/application-starter/load-remote-addon.ts
  • src/routes/api/application-starter/load-remote-template.ts
  • src/routes/api/application-starter/load-template.ts
  • src/routes/api/application-starter/resolve.ts
  • src/routes/api/application-starter/suggest.ts
  • src/routes/api/application-starter/validate.ts
  • src/routes/api/chat/account/composer-drafts/$accountId.$scope.ts
  • src/routes/api/chat/account/devices.ts
  • src/routes/api/chat/account/onboarding.ts
  • src/routes/api/chat/account/preferences.ts
  • src/routes/api/chat/activity.ts
  • src/routes/api/chat/app-version.ts
  • src/routes/api/chat/bootstrap.ts
  • src/routes/api/chat/bot-drafts/$id.files.$fileId.content.ts
  • src/routes/api/chat/bot-drafts/$id.files.$fileId.ts
  • src/routes/api/chat/bot-drafts/$id.files.ts
  • src/routes/api/chat/bot-drafts/$id.ts
  • src/routes/api/chat/bots.ts
  • src/routes/api/chat/bots/$id.$operation.ts
  • src/routes/api/chat/bots/$id.files.$fileId.content.ts
  • src/routes/api/chat/bots/$id.files.$fileId.ts
  • src/routes/api/chat/bots/$id.files.ts
  • src/routes/api/chat/bots/$id.ts
  • src/routes/api/chat/bots/bulk.ts
  • src/routes/api/chat/bots/move.ts
  • src/routes/api/chat/connection.ts
  • src/routes/api/chat/conversations/$id.$operation.ts
  • src/routes/api/chat/conversations/$id.execution.snapshots.$snapshotId.ts
  • src/routes/api/chat/conversations/$id.files.$fileId.content.ts
  • src/routes/api/chat/conversations/$id.files.$fileId.ts
  • src/routes/api/chat/conversations/$id.files.ts
  • src/routes/api/chat/conversations/$id.workflow-runs.$runId.cancel.ts
  • src/routes/api/chat/conversations/$id.workflow-runs.$runId.ts
  • src/routes/api/chat/conversations/$id.workflows.$workflowId.ts
  • src/routes/api/chat/conversations/$id/files/import.ts
  • src/routes/api/chat/conversations/$id/memories.ts
  • src/routes/api/chat/conversations/$id/memories/$memoryId.ts
  • src/routes/api/chat/conversations/$id/references.ts
  • src/routes/api/chat/copies/$id.ts
  • src/routes/api/chat/device-transport.ts
  • src/routes/api/chat/draft.ts
  • src/routes/api/chat/files.ts
  • src/routes/api/chat/kody/account.ts
  • src/routes/api/chat/kody/callback.ts
  • src/routes/api/chat/kody/community.ts
  • src/routes/api/chat/kody/community/$listingId.ts
  • src/routes/api/chat/kody/connect.ts
  • src/routes/api/chat/kody/jobs/$jobId/enabled.ts
  • src/routes/api/chat/kody/mail/inboxes.ts
  • src/routes/api/chat/kody/mail/messages.ts
  • src/routes/api/chat/kody/mail/messages/$messageId.ts
  • src/routes/api/chat/kody/memories.ts
  • src/routes/api/chat/kody/memories/$memoryId.ts
  • src/routes/api/chat/kody/memories/$memoryId/apply.ts
  • src/routes/api/chat/kody/memories/$memoryId/review.ts
  • src/routes/api/chat/kody/memories/create/apply.ts
  • src/routes/api/chat/kody/memories/create/review.ts
  • src/routes/api/chat/kody/packages/$packageId/document.ts
  • src/routes/api/chat/kody/resources/$kind.ts
  • src/routes/api/chat/kody/runs.ts
  • src/routes/api/chat/kody/runs/$runId.ts
  • src/routes/api/chat/kody/runs/$runId/triage.ts
  • src/routes/api/chat/kody/servers.ts
  • src/routes/api/chat/kody/servers/$serverId/check.ts
  • src/routes/api/chat/kody/servers/$serverId/enabled.ts
  • src/routes/api/chat/kody/servers/$serverId/reconnect.ts
  • src/routes/api/chat/kody/sync.ts
  • src/routes/api/chat/kody/unlink.ts
  • src/routes/api/chat/kody/usage.ts
  • src/routes/api/chat/mcp/$.ts
  • src/routes/api/chat/mcp/contract.ts
  • src/routes/api/chat/model-options.ts
  • src/routes/api/chat/models.ts
  • src/routes/api/chat/openrouter/callback.ts
  • src/routes/api/chat/plugins.ts
  • src/routes/api/chat/plugins/$id.ts
  • src/routes/api/chat/policy.ts
  • src/routes/api/chat/project-snapshots.$hash.quarantine.ts
  • src/routes/api/chat/project-snapshots.$hash.ts
  • src/routes/api/chat/project-snapshots.ts
  • src/routes/api/chat/projects.$id.sync.ts
  • src/routes/api/chat/projects.$id.ts
  • src/routes/api/chat/projects.ts
  • src/routes/api/chat/recipes.ts
  • src/routes/api/chat/recipes/$id.ts
  • src/routes/api/chat/references.ts
  • src/routes/api/chat/references/kody/inspect.ts
  • src/routes/api/chat/references/kody/refresh.ts
  • src/routes/api/chat/references/tools/refresh.ts
  • src/routes/api/chat/retries/$id.prepare.ts
  • src/routes/api/chat/retries/$id.ts
  • src/routes/api/chat/sections.ts
  • src/routes/api/chat/sections/$id.ts
  • src/routes/api/chat/skills.ts
  • src/routes/api/chat/skills/$id.ts
  • src/routes/api/chat/workspace-history.ts
  • src/routes/api/chat/workspace-index.activity.ts
  • src/routes/api/chat/workspace-index.ts
  • src/routes/api/chat/workspace-sync/$operation.ts
  • src/routes/api/chat/workspace.ts
  • src/routes/api/og/{$}[.]png.ts
  • src/routes/api/readme/{$}[.]png.ts
  • src/routes/auth/mcp/callback.ts
  • src/routes/auth/mcp/client-metadata.ts
  • src/routes/chat.c.$conversationId.tsx
  • src/routes/chat.charts.tsx
  • src/routes/chat.new-project.tsx
  • src/routes/chat.p.$hash.tsx
  • src/routes/chat.project.$projectId.tsx
  • src/routes/chat.shared.tsx
  • src/routes/chat.tsx
  • src/routes/chat.w.$workspaceId.b.$botId.tsx
  • src/routes/chat.w.$workspaceId.tsx
  • src/routes/ds.iconography.lazy.tsx
  • src/server.ts
  • src/server/og/og-http.server.ts
  • src/server/og/readme-http.server.ts
  • src/server/runtime/http-route.server.ts
  • src/server/runtime/worker-service.server.ts
  • src/server/scheduled.server.ts
  • src/types/durable-streams.d.ts
  • src/utils/docs-cache-headers.ts
  • src/utils/docs-html-headers.server.ts
  • src/utils/docs.functions.ts
  • src/utils/docs.ts
  • src/utils/github-content-cache.server.ts
  • src/utils/request-timing.server.ts
  • src/workers/chat.ts
  • src/workers/og.ts
  • src/workers/starter.ts
  • tests/builder-openrouter.test.ts
  • tests/builder-project-quarantine.test.ts
  • tests/chat-entrypoints.test.ts
  • tests/docs-html-headers.test.ts
  • tests/docs-manifest-cache.test.ts
  • tests/github-content-cache.test.ts
  • tests/request-timing.test.ts
  • tests/worker-boundaries.test.ts
  • tests/worker-deployment.test.ts
  • vite.config.ts
  • workers/chat/wrangler.jsonc
  • workers/og/wrangler.jsonc
  • workers/starter/wrangler.jsonc
  • wrangler.jsonc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com 4aec6a9 Commit Preview URL

Branch Preview URL
Oct 15 2026, 11:35 PM

@tannerlinsley
tannerlinsley marked this pull request as ready for review October 16, 2026 04:44
@tannerlinsley
tannerlinsley requested a review from a team October 16, 2026 04:44
@tannerlinsley
tannerlinsley merged commit 75254b0 into main Oct 16, 2026
8 checks passed
@tannerlinsley
tannerlinsley deleted the taren/worker-performance-boundaries branch October 16, 2026 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant