🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
🐛 fix(workbench): render completed reports in initial SSR HTML (#20012)
AmAzing-5a65aa8a24b1
diff --git a/apps/workbench/app/entry.server.test.ts b/apps/workbench/app/entry.server.test.tsnew file mode 100644index 00000000000..e74bb6e8a3e--- /dev/null+++ b/apps/workbench/app/entry.server.test.ts@@ -0,0 +1,56 @@+// @vitest-environment node++import { createElement, lazy, Suspense } from 'react';+import type { EntryContext } from 'react-router';+import { describe, expect, it, vi } from 'vitest';++import handleRequest from './entry.server';++vi.mock('virtual:lobehub/antd-static-css', () => ({ styleKeys: [] }));++vi.mock('react-router', () => ({+ ServerRouter: () => {+ const Report = lazy(async () => ({+ default: () =>+ createElement(+ 'main',+ null,+ Array.from({ length: 1200 }, (_, index) =>+ createElement('p', { key: index }, `Report evidence item ${index}`),+ ),+ ),+ }));++ return createElement(+ 'html',+ null,+ createElement('head'),+ createElement(+ 'body',+ null,+ createElement(+ Suspense,+ { fallback: createElement('span', { 'aria-label': 'Loading' }) },+ createElement(Report),+ ),+ ),+ );+ },+}));++describe('workbench SSR document', () => {+ it('renders a completed large report inline without waiting for a browser reveal script', async () => {+ const response = await handleRequest(+ new Request('https://workbench.example/acceptance/report'),+ 200,+ new Headers(),+ {} as EntryContext,+ );+ const html = await response.text();++ expect(response.status).toBe(200);+ expect(html).toContain('<p>Report evidence item 1199</p>');+ expect(html.includes('aria-label="Loading"')).toBe(false);+ expect(html.includes('<div hidden')).toBe(false);+ });+});diff --git a/apps/workbench/app/entry.server.tsx b/apps/workbench/app/entry.server.tsxindex e739a4bdc96..e4096e1afb4 100644--- a/apps/workbench/app/entry.server.tsx+++ b/apps/workbench/app/entry.server.tsx@@ -20,6 +20,9 @@ export default async function handleRequest(<ServerRouter context={routerContext} url={request.url} /></StyleProvider>,{+ // This response is fully buffered. Keep completed Suspense content inline+ // instead of sending a fallback and a hidden segment that needs browser JS.+ progressiveChunkSize: Number.MAX_SAFE_INTEGER,onError(error) {status = 500;console.error(error);