veryfront 0.1.1127 → 0.1.1128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/cli/templates/manifest.d.ts +1 -0
- package/esm/cli/templates/manifest.js +3 -2
- package/esm/deno.js +1 -1
- package/esm/src/html/hydration-script-builder/dev-client-renderer.js +1 -1
- package/esm/src/html/hydration-script-builder/prod-scripts.js +1 -1
- package/esm/src/html/hydration-script-builder/templates/router.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/templates/router.js +35 -11
- package/esm/src/html/utils.d.ts.map +1 -1
- package/esm/src/html/utils.js +19 -45
- package/esm/src/index.client.d.ts +6 -21
- package/esm/src/index.client.d.ts.map +1 -1
- package/esm/src/index.client.js +6 -21
- package/esm/src/react/runtime/core.d.ts +22 -0
- package/esm/src/react/runtime/core.d.ts.map +1 -1
- package/esm/src/react/runtime/core.js +1 -1
- package/esm/src/rendering/orchestrator/module-collection.d.ts +8 -0
- package/esm/src/rendering/orchestrator/module-collection.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-collection.js +10 -0
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +2 -2
- package/esm/src/routing/api/context-builder.d.ts +7 -0
- package/esm/src/routing/api/context-builder.d.ts.map +1 -1
- package/esm/src/routing/api/context-builder.js +20 -2
- package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/files/esbuild-plugins.js +22 -0
- package/esm/src/server/handlers/request/module/page-data-endpoint-handler.js +24 -1
- package/esm/src/server/handlers/response/not-found.d.ts +0 -1
- package/esm/src/server/handlers/response/not-found.d.ts.map +1 -1
- package/esm/src/server/handlers/response/not-found.js +9 -110
- package/esm/src/server/services/rsc/orchestrators/handler.d.ts +3 -1
- package/esm/src/server/services/rsc/orchestrators/handler.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/handler.js +13 -8
- package/esm/src/server/services/rsc/orchestrators/render-handler.d.ts +1 -1
- package/esm/src/server/services/rsc/orchestrators/render-handler.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/render-handler.js +2 -2
- package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache.js +132 -46
- package/esm/src/transforms/esm/in-flight-manager.d.ts +3 -2
- package/esm/src/transforms/esm/in-flight-manager.d.ts.map +1 -1
- package/esm/src/transforms/esm/in-flight-manager.js +6 -5
- package/esm/src/transforms/import-rewriter/strategies/bare-strategy.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/strategies/bare-strategy.js +16 -2
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +5 -5
|
@@ -51,15 +51,16 @@ export default {
|
|
|
51
51
|
"app/api/ag-ui/route.ts": "import { createAgUiHandler } from \"veryfront/agent\";\nimport { store } from \"../../../store.ts\";\n\nexport const POST = createAgUiHandler(\"rag\", {\n beforeStream: async ({ lastUserText }) => {\n const query = lastUserText.trim();\n if (!query) return;\n\n try {\n const results = await store.search(query, { topK: 5 });\n if (results.length === 0) return;\n\n const contextBlock = results\n .map(\n (result) =>\n `[${result.title}] (score: ${\n result.score.toFixed(2)\n })\\n${result.text}`,\n )\n .join(\"\\n\\n---\\n\\n\");\n\n return {\n prepend: [\n {\n role: \"system\",\n parts: [\n {\n type: \"text\",\n text:\n `Here are relevant documents retrieved for your question:\\n\\n${contextBlock}\\n\\n` +\n \"Use these documents to answer. Cite the document title when referencing information.\",\n },\n ],\n },\n ],\n };\n } catch (e) {\n console.error(\"[RAG] Retrieval failed:\", e);\n return;\n }\n },\n});\n",
|
|
52
52
|
"app/api/ingest/route.ts": "import { store } from \"../../../store.ts\";\n\nexport async function POST() {\n await store.indexContentDir();\n return Response.json({ ok: true });\n}\n",
|
|
53
53
|
"app/api/uploads/route.ts": "import { createUploadHandler } from \"veryfront/embedding\";\nimport { store } from \"../../../store.ts\";\n\nexport const { POST, GET, DELETE } = createUploadHandler(store, {\n auth: { type: \"none\", allowUnauthenticated: true },\n});\n",
|
|
54
|
-
"app/layout.tsx": "'use client'\n\nimport \"../globals.css\";\nimport {\n AppShell,\n ChatSidebar,\n ChatThemeScope,\n ConversationsProvider,\n Tabs,\n TabsItem,\n} from \"veryfront/chat\";\nimport { Head } from \"veryfront/head\";\nimport { useRouter } from \"veryfront/router\";\n\nexport default function RootLayout({ children }: { children: React.ReactNode }): React.ReactNode {\n const router = useRouter();\n const activeTab = router.pathname.startsWith(\"/uploads\") ? \"uploads\" : \"chat\";\n\n return (\n <>\n <Head><title>Docs Agent</title></Head>\n <ChatThemeScope className=\"flex flex-col h-screen\">\n <ConversationsProvider storageKey=\"rag-conversations\">\n <AppShell className=\"flex-1 min-h-0\">\n <AppShell.Sidebar side=\"left\" className=\"border-r border-[var(--outline-border)]\">\n <AppShell.SidebarContent className=\"p-0\">\n <ChatSidebar.Root>\n <ChatSidebar.NewButton />\n <ChatSidebar.List />\n </ChatSidebar.Root>\n </AppShell.SidebarContent>\n </AppShell.Sidebar>\n <AppShell.Main>\n <AppShell.Header border className=\"h-16 gap-3 px-3\">\n <AppShell.Trigger side=\"left\" />\n <div className=\"flex flex-1 justify-center\">\n <Tabs\n value={activeTab}\n onValueChange={(value)
|
|
54
|
+
"app/layout.tsx": "'use client'\n\nimport \"../globals.css\";\nimport {\n AppShell,\n ChatSidebar,\n ChatThemeScope,\n ConversationsProvider,\n Tabs,\n TabsItem,\n} from \"veryfront/chat\";\nimport { Head } from \"veryfront/head\";\nimport { useRouter } from \"veryfront/router\";\n\nexport default function RootLayout({ children }: { children: React.ReactNode }): React.ReactNode {\n const router = useRouter();\n const activeTab = router.pathname.startsWith(\"/uploads\") ? \"uploads\" : \"chat\";\n\n return (\n <>\n <Head><title>Docs Agent</title></Head>\n <ChatThemeScope className=\"flex flex-col h-screen\">\n <ConversationsProvider storageKey=\"rag-conversations\">\n <AppShell className=\"flex-1 min-h-0\">\n <AppShell.Sidebar side=\"left\" className=\"border-r border-[var(--outline-border)]\">\n <AppShell.SidebarContent className=\"p-0\">\n <ChatSidebar.Root>\n <ChatSidebar.NewButton />\n <ChatSidebar.List />\n </ChatSidebar.Root>\n </AppShell.SidebarContent>\n </AppShell.Sidebar>\n <AppShell.Main>\n <AppShell.Header border className=\"h-16 gap-3 px-3\">\n <AppShell.Trigger side=\"left\" />\n <div className=\"flex flex-1 justify-center\">\n <Tabs\n value={activeTab}\n onValueChange={(value: string) =>\n router.push(value === \"uploads\" ? \"/uploads\" : \"/\")}\n >\n <TabsItem value=\"chat\">Chat</TabsItem>\n <TabsItem value=\"uploads\">Uploads</TabsItem>\n </Tabs>\n </div>\n </AppShell.Header>\n <AppShell.Content className=\"flex flex-col min-h-0 pt-3\">\n {children}\n </AppShell.Content>\n </AppShell.Main>\n </AppShell>\n </ConversationsProvider>\n </ChatThemeScope>\n </>\n );\n}\n",
|
|
55
55
|
"app/page.tsx": "'use client'\n\nimport { Chat } from 'veryfront/chat'\n\nconst ACCEPT = '.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.csv,.txt,.md,.mdx,.html,.rtf,.epub,.json,.xml'\n\nexport default function DocsChat() {\n return (\n <Chat\n agentId=\"rag\"\n api=\"/api/ag-ui\"\n uploadApi=\"/api/uploads\"\n attachAccept={ACCEPT}\n className=\"flex-1 min-h-0\"\n placeholder=\"Ask anything about your documents...\"\n />\n )\n}\n",
|
|
56
56
|
"app/uploads/page.tsx": "'use client'\n\nimport { AttachmentsPanel, useUploadsRegistry } from 'veryfront/chat'\n\nconst UPLOAD_API = '/api/uploads'\nconst ACCEPT = '.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.csv,.txt,.md,.mdx,.html,.rtf,.epub,.json,.xml'\n\nexport default function UploadsPage(): React.JSX.Element {\n const uploads = useUploadsRegistry({ url: UPLOAD_API, storageKey: 'rag-uploads' })\n\n return (\n <AttachmentsPanel\n uploads={uploads.items}\n loading={uploads.isLoading}\n onAttach={uploads.upload}\n onRemoveUpload={uploads.remove}\n attachAccept={ACCEPT}\n className=\"flex-1 min-h-0\"\n />\n )\n}\n",
|
|
57
57
|
"content/architecture.md": "# Architecture\n\nAcme Platform uses a modular, event-driven architecture.\n\n## Core Components\n\n### API Gateway\nRoutes incoming requests to the appropriate microservice. Handles authentication, rate limiting, and request validation.\n\n### Event Bus\nAsynchronous message broker connecting all services. Supports pub/sub and point-to-point messaging patterns.\n\n### Data Layer\nMulti-tenant data storage with automatic sharding. Supports PostgreSQL for relational data and Redis for caching.\n\n## Request Flow\n\n1. Client sends request to API Gateway\n2. Gateway validates authentication token\n3. Request is routed to the target service\n4. Service processes request and publishes events\n5. Response is returned through the gateway\n\n## Scaling\n\nEach component scales independently. The API Gateway uses horizontal scaling with load balancing. Services auto-scale based on queue depth and CPU utilization.\n\n## Security\n\n- All inter-service communication uses mTLS\n- API tokens are rotated every 24 hours\n- Data at rest is encrypted with AES-256\n- Audit logs are retained for 90 days\n",
|
|
58
58
|
"content/getting-started.md": "# Getting Started\n\nWelcome to Acme Platform. This guide covers initial setup and core concepts.\n\n## Installation\n\nInstall the CLI globally:\n\n```bash\nnpm install -g @acme/cli\n```\n\n## Creating a Project\n\nRun the init command to scaffold a new project:\n\n```bash\nacme init my-project\ncd my-project\n```\n\n## Project Structure\n\n- `src/`: Application source code\n- `config/`: Configuration files\n- `tests/`: Test suite\n- `docs/`: Documentation\n\n## Configuration\n\nCreate an `acme.config.ts` file in your project root:\n\n```ts\nexport default {\n name: \"my-project\",\n region: \"us-east-1\",\n features: [\"auth\", \"storage\"],\n};\n```\n\n## Next Steps\n\n- Read the [Architecture Guide](./architecture) to understand the system design\n- Check [API Reference](./api-reference) for available endpoints\n- Join our Discord community for support\n",
|
|
59
59
|
"globals.css": "@import \"tailwindcss\";\n",
|
|
60
|
+
"globals.d.ts": "declare module \"*.css\";\n",
|
|
60
61
|
"README.md": "# Docs Agent\n\nA chatbot that answers questions from your own documents using Retrieval-Augmented Generation (RAG).\n\n## What's included\n\n- Q&A agent with source citation\n- Embedding-based semantic search with convention-based model selection\n- Document upload supporting PDF, DOCX, XLSX, PPTX, CSV, HTML, RTF, EPUB, TXT, and Markdown\n- `ragStore()` with local JSON storage by default, and Veryfront Cloud RAG when bootstrap is present\n- Veryfront Cloud AI Gateway routing for generation and embeddings when bootstrap is present\n- Original uploaded files stored in Veryfront Cloud project uploads when cloud bootstrap is present\n- Sample content in `/content` indexed through a dedicated ingestion route\n\n## Getting started\n\n1. Set your Veryfront Cloud bootstrap vars:\n\n ```bash\n export VERYFRONT_API_TOKEN=vf_...\n export VERYFRONT_PROJECT_SLUG=my-project\n ```\n\n2. Start the dev server:\n\n ```bash\n npx veryfront dev\n ```\n\n3. Index the sample docs in `content/`:\n\n ```bash\n curl -X POST http://localhost:3000/api/ingest\n ```\n\n4. Open the app and upload a document or ask a question.\n\nIf you are using a self-hosted Veryfront API, also set `VERYFRONT_API_URL`.\n\n## Cloud mode\n\nWith `VERYFRONT_API_TOKEN` and `VERYFRONT_PROJECT_SLUG` set, the template uses\nVeryfront Cloud automatically:\n\n- Agent generation routes through Veryfront Cloud model routing.\n- Query and document embeddings route through Veryfront Cloud embedding routing.\n- `veryfront-cloud/openai/...` and `veryfront-cloud/google/...` models use AI Gateway.\n- RAG documents, chunks, and embeddings are stored in the target project.\n\nThe default cloud embedding model is\n`veryfront-cloud/openai/text-embedding-3-small`. Set\n`VERYFRONT_DEFAULT_EMBEDDING_MODEL` only when you need a different embedding\nmodel.\n\n## Architecture\n\nRAG grounds LLM responses in your documents through three pipelines: **Ingestion**, **Query**, and **RAG**. These pipelines are orchestrated around a shared vector store.\n\n```mermaid\nflowchart LR\n ChatUI_L[\"Chat UI\"]\n\n subgraph IngestionFlow[\"Ingestion Pipeline\"]\n D[\"Documents\"] --> EXT[\"Extraction\"] --> DC[\"Chunking\"] --> DE[\"Document\\nEmbedding\"] --> ING[\"Storage\"]\n end\n\n subgraph QueryFlow[\"Query Pipeline\"]\n Q[\"Query\"] --> QE[\"Query\\nEmbedding\"] --> SS[\"Similarity\\nSearch\"]\n end\n\n subgraph RAGFlow[\"RAG Pipeline\"]\n BF[\"beforeStream\\nHook\"] --> RET[\"Retrieval\"] --> AUG[\"Augmentation\"] --> AG[\"Agent\"] --> GEN[\"Generation\"]\n end\n\n EMB((\"Embedding\\nModel\"))\n GEN_LLM((\"Generative\\nModel\"))\n VS[(\"Vector\\nStore\")]\n ChatUI_R[\"Chat UI\"]\n\n ChatUI_L --> D\n ChatUI_L --> Q\n\n QE -.- EMB\n DE -.- EMB\n\n SS --> VS\n ING --> VS\n\n Q --> BF\n VS --> RET\n AG -.- GEN_LLM\n GEN -.- GEN_LLM\n GEN --> ChatUI_R\n```\n\n### Pipelines\n\n**Ingestion**: Documents are parsed into plain text via the built-in kreuzberg extraction engine (supporting PDF, DOCX, XLSX, PPTX, HTML, RTF, EPUB, and 76+ formats), split into overlapping chunks (~1000 chars, 200 char overlap), and stored in the default `ragStore()`. In local mode that means `data/index.json`; with Veryfront Cloud bootstrap it upgrades to the cloud RAG backend automatically. The original uploaded binary is also stored in the project's Veryfront Cloud uploads store so remote projects retain the source file, not just the extracted text. Uploaded files are ingested by the upload route. Bundled files in `content/` are ingested by the `/api/ingest` route.\n\n**Query**: The user's query is embedded into the same vector space as the documents, then compared against all stored chunks using cosine similarity to find the top-*k* most relevant results.\n\n**RAG**: The `beforeStream` hook in the AG-UI route intercepts each message before it reaches the agent. It searches the document store for relevant chunks, assembles them into context, and prepends them as retrieved reference data. The agent then generates a cited response streamed back to the user.\n\n## Structure\n\n```\nstore.ts RAG store config\nagents/rag.ts Q&A agent with citation instructions\ncontent/\n getting-started.md Sample document\n architecture.md Sample document\napp/\n api/ag-ui/route.ts AG-UI endpoint\n api/ingest/route.ts Bundled content ingestion\n api/uploads/route.ts Upload, list, and delete uploads\n uploads/page.tsx Upload management panel\n page.tsx Chat UI\n layout.tsx Chat shell with sidebar and tabs\n```\n\n## Framework usage\n\n| What | Framework | Template code |\n|------|-----------|---------------|\n| Chat UI + streaming | app-mode `Chat` | `page.tsx` |\n| Upload management | `AttachmentsPanel`, `useUploadsRegistry` | `uploads/page.tsx` |\n| Source display | Built into the `Chat` preset | `page.tsx` |\n| Upload API route | `createUploadHandler` | 1 line in `route.ts` |\n| AG-UI route | `createAgUiHandler` | 1 line in `route.ts` |\n| Agent definition | `agent()` | Config object in `agents/rag.ts` |\n| RAG retrieval | `beforeStream` hook | Context injection in `api/ag-ui/route.ts` |\n| Vector store | `ragStore()` | Config in `store.ts` |\n\n## Adding documents\n\n- Drop files into `content/`, then run `curl -X POST http://localhost:3000/api/ingest`\n- Or use the upload panel in the UI for PDF, DOCX, XLSX, PPTX, CSV, HTML, RTF, EPUB, TXT, and MD files\n\n## Production notes\n\nThis is a starter template, not a production-ready setup. For production, consider:\n\n- **Vector store**: Replace the default store with pgvector, Pinecone, or Qdrant for datasets beyond ~10k chunks\n- **Reranking**: Add a cross-encoder reranker (e.g. Cohere Rerank) after retrieval to improve precision\n- **Hybrid search**: Combine dense vectors with BM25 keyword matching for better recall\n",
|
|
61
62
|
"store.ts": "import { ragStore } from \"veryfront/embedding\";\n\nexport const store = ragStore({\n storagePath: \"data/index.json\",\n contentDir: \"content\",\n});\n",
|
|
62
|
-
"tsconfig.json": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"strict\": true,\n \"jsx\": \"react-jsx\",\n \"skipLibCheck\": true,\n \"esModuleInterop\": true,\n \"paths\": {\n \"@/*\": [\"./*\"]\n }\n },\n \"include\": [\"**/*.ts\", \"**/*.tsx\"],\n \"exclude\": [\"node_modules\"]\n}\n"
|
|
63
|
+
"tsconfig.json": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"strict\": true,\n \"jsx\": \"react-jsx\",\n \"skipLibCheck\": true,\n \"esModuleInterop\": true,\n \"noEmit\": true,\n \"allowImportingTsExtensions\": true,\n \"paths\": {\n \"@/*\": [\"./*\"]\n }\n },\n \"include\": [\"**/*.ts\", \"**/*.tsx\"],\n \"exclude\": [\"node_modules\"]\n}\n"
|
|
63
64
|
}
|
|
64
65
|
},
|
|
65
66
|
"minimal": {
|
package/esm/deno.js
CHANGED
|
@@ -6,7 +6,7 @@ export function generateDevClientRendererScript(nonce) {
|
|
|
6
6
|
<script type="module"${nonceAttr}>
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
|
-
import { RouterProvider, useRouter as useRouterFromModule } from 'veryfront/router';
|
|
9
|
+
import { RouterProvider, useRouter as useRouterFromModule, getNavigationStore } from 'veryfront/router';
|
|
10
10
|
import { PageContextProvider } from 'veryfront/context';
|
|
11
11
|
|
|
12
12
|
${getRouterScript()}
|
|
@@ -8,7 +8,7 @@ export function generateProdHydrationModule() {
|
|
|
8
8
|
return [
|
|
9
9
|
`import * as React from 'react';`,
|
|
10
10
|
`import { createRoot } from 'react-dom/client';`,
|
|
11
|
-
`import { RouterProvider, useRouter as useRouterFromModule } from 'veryfront/router';`,
|
|
11
|
+
`import { RouterProvider, useRouter as useRouterFromModule, getNavigationStore } from 'veryfront/router';`,
|
|
12
12
|
`import { PageContextProvider } from 'veryfront/context';`,
|
|
13
13
|
getRouterScript().trim(),
|
|
14
14
|
getLoaderScript().trim(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/router.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/router.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,cA8uC3B,CAAC"}
|
|
@@ -592,7 +592,7 @@ export const getRouterScript = () => `
|
|
|
592
592
|
// ============================================
|
|
593
593
|
// SPA navigation handler
|
|
594
594
|
// ============================================
|
|
595
|
-
async function navigateSPA(href,
|
|
595
|
+
async function navigateSPA(href, historyMode = 'push', restoreScroll = false) {
|
|
596
596
|
currentAbortController?.abort();
|
|
597
597
|
|
|
598
598
|
if (isNavigating) return;
|
|
@@ -626,14 +626,24 @@ export const getRouterScript = () => `
|
|
|
626
626
|
// { redirect: { destination } } payload. Follow it with a document
|
|
627
627
|
// navigation to the target (the same net effect as the full-page 302),
|
|
628
628
|
// instead of trying to render a page that does not exist here.
|
|
629
|
+
// Only follow http(s)/relative destinations: assigning a javascript:/data:
|
|
630
|
+
// URL to location.href would EXECUTE it (the server also filters these, so
|
|
631
|
+
// this is defense in depth). Fall through to the normal error path otherwise.
|
|
629
632
|
if (pageData && pageData.redirect && typeof pageData.redirect.destination === 'string') {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
+
try {
|
|
634
|
+
var redirectTarget = new URL(pageData.redirect.destination, window.location.origin);
|
|
635
|
+
if (redirectTarget.protocol === 'http:' || redirectTarget.protocol === 'https:') {
|
|
636
|
+
log('SPA navigation redirect -> ' + redirectTarget.href);
|
|
637
|
+
window.location.href = redirectTarget.href;
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
} catch (e) { /* invalid destination — do not follow */ }
|
|
633
641
|
}
|
|
634
642
|
|
|
635
|
-
if (
|
|
643
|
+
if (historyMode === 'push') {
|
|
636
644
|
window.history.pushState({ pageData, scrollY: 0 }, '', href);
|
|
645
|
+
} else if (historyMode === 'replace') {
|
|
646
|
+
window.history.replaceState({ pageData, scrollY: 0 }, '', href);
|
|
637
647
|
}
|
|
638
648
|
|
|
639
649
|
// Update the shared router snapshot BEFORE rendering. RouterProvider
|
|
@@ -666,7 +676,11 @@ export const getRouterScript = () => `
|
|
|
666
676
|
|
|
667
677
|
hideNavigationProgress();
|
|
668
678
|
perfEnd('nav:total:' + href);
|
|
669
|
-
emitRouteTiming('total', targetPath, navigationStartedAt, {
|
|
679
|
+
emitRouteTiming('total', targetPath, navigationStartedAt, {
|
|
680
|
+
href,
|
|
681
|
+
historyMode,
|
|
682
|
+
restoreScroll
|
|
683
|
+
});
|
|
670
684
|
log('SPA navigation complete');
|
|
671
685
|
} catch (error) {
|
|
672
686
|
hideNavigationProgress();
|
|
@@ -1076,10 +1090,10 @@ export const getRouterScript = () => `
|
|
|
1076
1090
|
domain: window.location.origin,
|
|
1077
1091
|
path: window.location.pathname,
|
|
1078
1092
|
push: (path) => {
|
|
1079
|
-
void navigateSPA(path,
|
|
1093
|
+
void navigateSPA(path, 'push');
|
|
1080
1094
|
},
|
|
1081
1095
|
replace: (path) => {
|
|
1082
|
-
void navigateSPA(path,
|
|
1096
|
+
void navigateSPA(path, 'replace');
|
|
1083
1097
|
},
|
|
1084
1098
|
back: () => {
|
|
1085
1099
|
window.history.back();
|
|
@@ -1105,12 +1119,22 @@ export const getRouterScript = () => `
|
|
|
1105
1119
|
})(),
|
|
1106
1120
|
isPreview: false,
|
|
1107
1121
|
isMounted: true,
|
|
1108
|
-
navigate: (path) => navigateSPA(path,
|
|
1122
|
+
navigate: (path) => navigateSPA(path, 'push'),
|
|
1109
1123
|
reload: () => window.location.reload()
|
|
1110
1124
|
};
|
|
1111
1125
|
|
|
1112
1126
|
window.__veryfrontRouter = router;
|
|
1113
1127
|
|
|
1128
|
+
// Route useRouter().push/replace/navigate (from veryfront/router) through the
|
|
1129
|
+
// same SPA navigator that intercepts <Link> clicks. Without this the shared
|
|
1130
|
+
// navigation store has no navigator registered and its navigate() falls back
|
|
1131
|
+
// to a full-page location.assign (finding #7: push() full-reloads).
|
|
1132
|
+
getNavigationStore().setNavigator((href, options) => {
|
|
1133
|
+
const mode = options && options.history;
|
|
1134
|
+
const historyMode = mode === 'replace' ? 'replace' : mode === 'none' ? 'none' : 'push';
|
|
1135
|
+
return navigateSPA(href, historyMode);
|
|
1136
|
+
});
|
|
1137
|
+
|
|
1114
1138
|
// ============================================
|
|
1115
1139
|
// Event handlers
|
|
1116
1140
|
// ============================================
|
|
@@ -1121,7 +1145,7 @@ export const getRouterScript = () => `
|
|
|
1121
1145
|
saveScrollPosition(currentPath);
|
|
1122
1146
|
|
|
1123
1147
|
if (!e.state?.pageData) {
|
|
1124
|
-
await navigateSPA(path,
|
|
1148
|
+
await navigateSPA(path, 'none', true);
|
|
1125
1149
|
return;
|
|
1126
1150
|
}
|
|
1127
1151
|
|
|
@@ -1177,7 +1201,7 @@ export const getRouterScript = () => `
|
|
|
1177
1201
|
|
|
1178
1202
|
e.preventDefault();
|
|
1179
1203
|
cancelScheduledPrefetch();
|
|
1180
|
-
void navigateSPA(href,
|
|
1204
|
+
void navigateSPA(href, 'push');
|
|
1181
1205
|
});
|
|
1182
1206
|
|
|
1183
1207
|
document.addEventListener(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/src/html/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAO1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAgBjF,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,OAAO,EACjB,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CAQR;AAaD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AA4DD,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGrD,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/src/html/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAO1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAgBjF,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,OAAO,EACjB,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CAQR;AAaD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AA4DD,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGrD,CAAC;AAuJF,UAAU,qBAAqB;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oBAAoB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACpD;AA+GD,wBAAsB,cAAc,CAClC,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACvD,OAAO,CAAC,cAAc,CAAC,CA4DzB;AAED,wBAAsB,kBAAkB,CACtC,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACvD,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED,wBAAgB,mBAAmB,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAElF"}
|
package/esm/src/html/utils.js
CHANGED
|
@@ -70,37 +70,33 @@ export const PLATFORM_UTILITIES = {
|
|
|
70
70
|
...CORE_PLATFORM_UTILITIES,
|
|
71
71
|
...AI_MODULE_UTILITIES,
|
|
72
72
|
};
|
|
73
|
+
// React import-map entries, always from esm.sh — the only CDN that serves React
|
|
74
|
+
// as real ESM. Uses the centralized esmShReact() helper so the URLs stay
|
|
75
|
+
// byte-identical across SSR/client (any mismatch loads a second React instance
|
|
76
|
+
// and hooks fail).
|
|
77
|
+
function esmShReactImports(react) {
|
|
78
|
+
return {
|
|
79
|
+
react: esmShReact("react", react),
|
|
80
|
+
"react-dom": esmShReact("react-dom", react, "", true),
|
|
81
|
+
"react-dom/client": esmShReact("react-dom", react, "/client", true),
|
|
82
|
+
"react/jsx-runtime": esmShReact("react", react, "/jsx-runtime", true),
|
|
83
|
+
"react/jsx-dev-runtime": esmShReact("react", react, "/jsx-dev-runtime", true),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
73
86
|
const CDN_URL_TEMPLATES = {
|
|
74
87
|
"esm.sh": {
|
|
75
|
-
// Use centralized esmShReact() helper from package-registry.ts to ensure URL consistency
|
|
76
|
-
// Any URL mismatch causes esm.sh to serve different modules -> multiple React instances -> hooks fail
|
|
77
|
-
react: (v) => esmShReact("react", v),
|
|
78
|
-
reactDom: (v) => esmShReact("react-dom", v, "", true),
|
|
79
|
-
reactDomClient: (v) => esmShReact("react-dom", v, "/client", true),
|
|
80
|
-
jsxRuntime: (v) => esmShReact("react", v, "/jsx-runtime", true),
|
|
81
|
-
jsxDevRuntime: (v) => esmShReact("react", v, "/jsx-dev-runtime", true),
|
|
82
88
|
veryfrontChat: (v) => `https://esm.sh/veryfront@${v}/chat?external=react,react-dom&target=es2022`,
|
|
83
89
|
veryfrontMarkdown: (v) => `https://esm.sh/veryfront@${v}/markdown?external=react,react-dom&target=es2022`,
|
|
84
90
|
veryfrontMdx: (v) => `https://esm.sh/veryfront@${v}/mdx?external=react,react-dom&target=es2022`,
|
|
85
91
|
veryfrontWorkflow: (v) => `https://esm.sh/veryfront@${v}/workflow/react?external=react,react-dom&target=es2022`,
|
|
86
92
|
},
|
|
87
93
|
unpkg: {
|
|
88
|
-
react: (v) => `https://unpkg.com/react@${v}/umd/react.production.min.js`,
|
|
89
|
-
reactDom: (v) => `https://unpkg.com/react-dom@${v}/umd/react-dom.production.min.js`,
|
|
90
|
-
reactDomClient: (v) => `https://unpkg.com/react-dom@${v}/umd/react-dom.production.min.js`,
|
|
91
|
-
jsxRuntime: (v) => `https://unpkg.com/react@${v}/jsx-runtime`,
|
|
92
|
-
jsxDevRuntime: (v) => `https://unpkg.com/react@${v}/jsx-dev-runtime`,
|
|
93
94
|
veryfrontChat: (v) => `https://unpkg.com/veryfront@${v}/esm/src/chat/index.js`,
|
|
94
95
|
veryfrontMarkdown: (v) => `https://unpkg.com/veryfront@${v}/esm/src/markdown/index.js`,
|
|
95
96
|
veryfrontMdx: (v) => `https://unpkg.com/veryfront@${v}/esm/src/mdx/index.js`,
|
|
96
97
|
veryfrontWorkflow: (v) => `https://unpkg.com/veryfront@${v}/esm/src/workflow/react/index.js`,
|
|
97
98
|
},
|
|
98
99
|
jsdelivr: {
|
|
99
|
-
react: (v) => `https://cdn.jsdelivr.net/npm/react@${v}/umd/react.production.min.js`,
|
|
100
|
-
reactDom: (v) => `https://cdn.jsdelivr.net/npm/react-dom@${v}/umd/react-dom.production.min.js`,
|
|
101
|
-
reactDomClient: (v) => `https://cdn.jsdelivr.net/npm/react-dom@${v}/umd/react-dom.production.min.js`,
|
|
102
|
-
jsxRuntime: (v) => `https://cdn.jsdelivr.net/npm/react@${v}/jsx-runtime`,
|
|
103
|
-
jsxDevRuntime: (v) => `https://cdn.jsdelivr.net/npm/react@${v}/jsx-dev-runtime`,
|
|
104
100
|
veryfrontChat: (v) => `https://cdn.jsdelivr.net/npm/veryfront@${v}/esm/src/chat/index.js`,
|
|
105
101
|
veryfrontMarkdown: (v) => `https://cdn.jsdelivr.net/npm/veryfront@${v}/esm/src/markdown/index.js`,
|
|
106
102
|
veryfrontMdx: (v) => `https://cdn.jsdelivr.net/npm/veryfront@${v}/esm/src/mdx/index.js`,
|
|
@@ -117,25 +113,15 @@ function buildCdnImportMapFromTemplates(versions, templates,
|
|
|
117
113
|
// optionally, the AI modules — never the core runtime.
|
|
118
114
|
includeAiModulesLocally) {
|
|
119
115
|
const { react, veryfront } = versions;
|
|
120
|
-
// React is ALWAYS served from esm.sh, regardless of the configured CDN
|
|
121
|
-
// provider. esm.sh is the only CDN that serves React as real ESM; unpkg and
|
|
122
|
-
// jsdelivr only ship UMD globals (react/umd/react.production.min.js), which
|
|
123
|
-
// cannot be consumed through an import map at all — the browser rejects them
|
|
124
|
-
// with a module-resolution/CORS error and hydration never starts. Self-hosted
|
|
125
|
-
// mode already does exactly this. The `provider` only governs where the
|
|
126
|
-
// veryfront framework modules load from.
|
|
127
|
-
const reactTemplates = CDN_URL_TEMPLATES["esm.sh"];
|
|
128
116
|
return {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
"react/jsx-runtime": reactTemplates.jsxRuntime(react),
|
|
133
|
-
"react/jsx-dev-runtime": reactTemplates.jsxDevRuntime(react),
|
|
117
|
+
// React is ALWAYS from esm.sh, regardless of the configured provider (see
|
|
118
|
+
// esmShReactImports). The `provider` only governs the veryfront modules.
|
|
119
|
+
...esmShReactImports(react),
|
|
134
120
|
"veryfront/chat": templates.veryfrontChat(veryfront),
|
|
135
121
|
"veryfront/markdown": templates.veryfrontMarkdown(veryfront),
|
|
136
122
|
"veryfront/mdx": templates.veryfrontMdx(veryfront),
|
|
137
123
|
"veryfront/workflow": templates.veryfrontWorkflow(veryfront),
|
|
138
|
-
// Core runtime utilities always resolve locally
|
|
124
|
+
// Core runtime utilities always resolve locally.
|
|
139
125
|
...CORE_PLATFORM_UTILITIES,
|
|
140
126
|
// AI modules only override the CDN entries when requested.
|
|
141
127
|
...(includeAiModulesLocally ? AI_MODULE_UTILITIES : {}),
|
|
@@ -152,13 +138,8 @@ function getJsdelivrImportMap(versions) {
|
|
|
152
138
|
}
|
|
153
139
|
function getSelfHostedImportMap(versions) {
|
|
154
140
|
const { react } = versions;
|
|
155
|
-
const esmShTemplates = CDN_URL_TEMPLATES["esm.sh"];
|
|
156
141
|
return {
|
|
157
|
-
|
|
158
|
-
"react-dom": esmShTemplates.reactDom(react),
|
|
159
|
-
"react-dom/client": esmShTemplates.reactDomClient(react),
|
|
160
|
-
"react/jsx-runtime": esmShTemplates.jsxRuntime(react),
|
|
161
|
-
"react/jsx-dev-runtime": esmShTemplates.jsxDevRuntime(react),
|
|
142
|
+
...esmShReactImports(react),
|
|
162
143
|
"veryfront/chat": "/_veryfront/lib/chat.js",
|
|
163
144
|
"veryfront/markdown": "/_veryfront/lib/markdown.js",
|
|
164
145
|
"veryfront/mdx": "/_veryfront/lib/mdx.js",
|
|
@@ -297,14 +278,7 @@ export async function buildImportMap(options) {
|
|
|
297
278
|
? await resolveVersions(projectDir, config)
|
|
298
279
|
: DEFAULT_VERSIONS;
|
|
299
280
|
if (mode === "bundled") {
|
|
300
|
-
|
|
301
|
-
let imports = {
|
|
302
|
-
react: reactTemplates.react(versions.react),
|
|
303
|
-
"react-dom": reactTemplates.reactDom(versions.react),
|
|
304
|
-
"react-dom/client": reactTemplates.reactDomClient(versions.react),
|
|
305
|
-
"react/jsx-runtime": reactTemplates.jsxRuntime(versions.react),
|
|
306
|
-
"react/jsx-dev-runtime": reactTemplates.jsxDevRuntime(versions.react),
|
|
307
|
-
};
|
|
281
|
+
let imports = { ...esmShReactImports(versions.react) };
|
|
308
282
|
imports = applyManifestDependencies(imports, releaseAssetManifest);
|
|
309
283
|
imports = applyReleaseModuleVersions(imports, releaseAssetManifest);
|
|
310
284
|
imports = { ...imports, ...customImports };
|
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Browser- and SSR-safe helpers from the `veryfront` package.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `src/server/production-server.ts`, which has module top-level `await` and
|
|
10
|
-
* cannot be transformed to the es2020 browser target (HTTP 500 on that chunk,
|
|
11
|
-
* which aborts hydration).
|
|
12
|
-
*
|
|
13
|
-
* A client-reachable module doing a used value import from the barrel, for
|
|
14
|
-
* example `import { getEnv } from "veryfront"`, is not dead-stripped, so it
|
|
15
|
-
* keeps the barrel and the leak. This barrel exposes exactly the same
|
|
16
|
-
* browser-safe surface minus the server bootstrap functions, which no
|
|
17
|
-
* client/SSR page code legitimately calls. The import rewriter redirects
|
|
18
|
-
* `veryfront` to this module for the `browser` and `ssr` targets (see
|
|
19
|
-
* `src/transforms/import-rewriter/strategies/veryfront-strategy.ts`), the same
|
|
20
|
-
* mechanism `veryfront/workflow` already uses.
|
|
21
|
-
*
|
|
22
|
-
* Keep the exports below in sync with {@link file://./index.ts}: everything
|
|
23
|
-
* except the `createHandler` / `startServer` / `toNodeHandler` value exports.
|
|
4
|
+
* This entrypoint exposes the root package's client-safe configuration,
|
|
5
|
+
* platform, routing, data, and security helpers without server bootstrap
|
|
6
|
+
* functions. Most app code can import these helpers from `veryfront`; use this
|
|
7
|
+
* explicit entrypoint when a browser or SSR module needs to declare that
|
|
8
|
+
* boundary directly.
|
|
24
9
|
*
|
|
25
10
|
* @example
|
|
26
11
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../src/src/index.client.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../src/src/index.client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACpF,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAM7C,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE/F,OAAO,EACL,UAAU,EACV,SAAS,EACT,IAAI,EACJ,QAAQ,IAAI,WAAW,EACvB,QAAQ,IAAI,WAAW,EACvB,WAAW,EACX,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAExF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrD,YAAY,EACV,WAAW,EACX,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/esm/src/index.client.js
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Browser- and SSR-safe helpers from the `veryfront` package.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `src/server/production-server.ts`, which has module top-level `await` and
|
|
10
|
-
* cannot be transformed to the es2020 browser target (HTTP 500 on that chunk,
|
|
11
|
-
* which aborts hydration).
|
|
12
|
-
*
|
|
13
|
-
* A client-reachable module doing a used value import from the barrel, for
|
|
14
|
-
* example `import { getEnv } from "veryfront"`, is not dead-stripped, so it
|
|
15
|
-
* keeps the barrel and the leak. This barrel exposes exactly the same
|
|
16
|
-
* browser-safe surface minus the server bootstrap functions, which no
|
|
17
|
-
* client/SSR page code legitimately calls. The import rewriter redirects
|
|
18
|
-
* `veryfront` to this module for the `browser` and `ssr` targets (see
|
|
19
|
-
* `src/transforms/import-rewriter/strategies/veryfront-strategy.ts`), the same
|
|
20
|
-
* mechanism `veryfront/workflow` already uses.
|
|
21
|
-
*
|
|
22
|
-
* Keep the exports below in sync with {@link file://./index.ts}: everything
|
|
23
|
-
* except the `createHandler` / `startServer` / `toNodeHandler` value exports.
|
|
4
|
+
* This entrypoint exposes the root package's client-safe configuration,
|
|
5
|
+
* platform, routing, data, and security helpers without server bootstrap
|
|
6
|
+
* functions. Most app code can import these helpers from `veryfront`; use this
|
|
7
|
+
* explicit entrypoint when a browser or SSR module needs to declare that
|
|
8
|
+
* boundary directly.
|
|
24
9
|
*
|
|
25
10
|
* @example
|
|
26
11
|
* ```ts
|
|
@@ -77,6 +77,28 @@ export interface PageContextProviderProps {
|
|
|
77
77
|
/** Page context value to expose to descendants. */
|
|
78
78
|
pageContext?: PageContextValue;
|
|
79
79
|
}
|
|
80
|
+
/** How a navigation should affect the history stack. */
|
|
81
|
+
type HistoryMode = "push" | "replace" | "none";
|
|
82
|
+
/** Options accepted by the navigation store's `navigate`. */
|
|
83
|
+
interface NavigateOptions {
|
|
84
|
+
history?: HistoryMode;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The cross-bundle navigation store the client router and this React runtime
|
|
88
|
+
* share. This is an inline mirror of `rendering/client/navigation-store.ts`,
|
|
89
|
+
* kept here so the public React runtime bundle does not import the rendering
|
|
90
|
+
* layer. The shared `Symbol.for` key guarantees both bundles resolve the *same*
|
|
91
|
+
* runtime object regardless of which one evaluates first — so `RouterProvider`
|
|
92
|
+
* can subscribe synchronously on its first render, with no boot-order race.
|
|
93
|
+
*/
|
|
94
|
+
interface NavigationStore {
|
|
95
|
+
subscribe(listener: () => void): () => void;
|
|
96
|
+
getHref(): string;
|
|
97
|
+
notify(): void;
|
|
98
|
+
navigate(href: string, options?: NavigateOptions): Promise<void>;
|
|
99
|
+
setNavigator(navigator: (href: string, options?: NavigateOptions) => Promise<void>): void;
|
|
100
|
+
}
|
|
101
|
+
export declare function getNavigationStore(): NavigationStore;
|
|
80
102
|
/**
|
|
81
103
|
* Provides the router context. `pathname`/`query` track the live URL through the
|
|
82
104
|
* shared navigation store's `useSyncExternalStore` surface; `params`/`domain`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/src/react/runtime/core.ts"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,kDAAkD;AAClD,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,qDAAqD;IACrD,SAAS,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,SAAS,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,6CAA6C;IAC7C,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,oDAAoD;IACpD,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,gCAAgC;IAChC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED,kCAAkC;AAClC,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACtE,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AA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,CA0C5F;AAED,4CAA4C;AAC5C,MAAM,WAAW,oBAAoB;IACnC,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,CAAC,SAAS,EACtB,OAAO,GAAE,oBAAyB,GACjC,KAAK,CAAC,YAAY,CA6BpB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,WAAW,CAEvC;AAED,2EAA2E;AAC3E,wBAAgB,IAAI,CAAC,EACnB,QAAe,EACf,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,SAAS,GAAG,KAAK,CAAC,YAAY,CAMhC;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,WAAW,GACZ,EAAE,wBAAwB,GAAG,KAAK,CAAC,YAAY,CAc/C;AAED,sCAAsC;AACtC,wBAAgB,cAAc,IAAI,gBAAgB,CAEjD;AAED,sEAAsE;AACtE,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,GAAG,KAAK,CAAC,YAAY,CAwIpF;AAED,OAAO,EAAE,cAAc,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -50,7 +50,7 @@ function collectHead(data) {
|
|
|
50
50
|
collector?.(data);
|
|
51
51
|
}
|
|
52
52
|
const NAVIGATION_STORE_KEY = Symbol.for("veryfront.navigation.store.v1");
|
|
53
|
-
function getNavigationStore() {
|
|
53
|
+
export function getNavigationStore() {
|
|
54
54
|
const holder = globalThis;
|
|
55
55
|
const existing = holder[NAVIGATION_STORE_KEY];
|
|
56
56
|
if (existing)
|
|
@@ -17,6 +17,14 @@ export declare const MODULE_LOAD_HARD_TIMEOUT_MS = 45000;
|
|
|
17
17
|
export declare const DATA_FETCH_TIMEOUT_MS = 15000;
|
|
18
18
|
/** Timeout for SSR rendering stage */
|
|
19
19
|
export declare const SSR_RENDER_TIMEOUT_MS = 20000;
|
|
20
|
+
/**
|
|
21
|
+
* Human-readable label for the module-loading timeout.
|
|
22
|
+
*
|
|
23
|
+
* Falls back to the route pathname when the slug is empty — the index route's
|
|
24
|
+
* slug is `""`, which otherwise produced a blank timeout label
|
|
25
|
+
* (`"Module loading for "`) that named no route when a cold load stalled.
|
|
26
|
+
*/
|
|
27
|
+
export declare function moduleLoadLabel(slug: string, pathname: string): string;
|
|
20
28
|
/** Module to load for data fetching */
|
|
21
29
|
export interface ModuleToLoad {
|
|
22
30
|
type: "page" | "layout";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-collection.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/module-collection.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mGAAmG;AACnG,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,2BAA2B,QAAS,CAAC;AAElD,+DAA+D;AAC/D,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAE5C,sCAAsC;AACtC,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAE5C,uCAAuC;AACvC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,iCAAiC;AACjC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,OAAO,EACxB,iBAAiB,EAAE,OAAO,EAC1B,aAAa,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAC7D,YAAY,EAAE,CAchB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAI7D"}
|
|
1
|
+
{"version":3,"file":"module-collection.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/module-collection.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mGAAmG;AACnG,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,2BAA2B,QAAS,CAAC;AAElD,+DAA+D;AAC/D,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAE5C,sCAAsC;AACtC,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAE5C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,uCAAuC;AACvC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,iCAAiC;AACjC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,OAAO,EACxB,iBAAiB,EAAE,OAAO,EAC1B,aAAa,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAC7D,YAAY,EAAE,CAchB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAI7D"}
|
|
@@ -17,6 +17,16 @@ export const MODULE_LOAD_HARD_TIMEOUT_MS = 45_000;
|
|
|
17
17
|
export const DATA_FETCH_TIMEOUT_MS = 15_000;
|
|
18
18
|
/** Timeout for SSR rendering stage */
|
|
19
19
|
export const SSR_RENDER_TIMEOUT_MS = 20_000;
|
|
20
|
+
/**
|
|
21
|
+
* Human-readable label for the module-loading timeout.
|
|
22
|
+
*
|
|
23
|
+
* Falls back to the route pathname when the slug is empty — the index route's
|
|
24
|
+
* slug is `""`, which otherwise produced a blank timeout label
|
|
25
|
+
* (`"Module loading for "`) that named no route when a cold load stalled.
|
|
26
|
+
*/
|
|
27
|
+
export function moduleLoadLabel(slug, pathname) {
|
|
28
|
+
return `Module loading for ${slug || pathname || "unknown route"}`;
|
|
29
|
+
}
|
|
20
30
|
/**
|
|
21
31
|
* Collect modules that need to be loaded for data fetching.
|
|
22
32
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAUH,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,iCAAiC,CAAC;AASzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KA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uBAAuB;YAYjB,kBAAkB;IA6FhC,OAAO,CAAC,kBAAkB;YAQZ,uBAAuB;IAmBrC;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;CAStB"}
|
|
@@ -45,7 +45,7 @@ import { determineClientModuleStrategy } from "../rsc/client-module-strategy.js"
|
|
|
45
45
|
// Extracted modules
|
|
46
46
|
import { EMPTY_LAYOUT_RESULT, isDotPath } from "./path-helpers.js";
|
|
47
47
|
import { cachePageCss, CSS_SSR_TIMEOUT_MS, getCachedPageCss, getPageCssCacheKey, } from "./css-cache.js";
|
|
48
|
-
import { collectModulesToLoad, DATA_FETCH_TIMEOUT_MS, hasDataFetchingFunction, MODULE_LOAD_HARD_TIMEOUT_MS, MODULE_LOAD_TIMEOUT_MS, SSR_RENDER_TIMEOUT_MS, } from "./module-collection.js";
|
|
48
|
+
import { collectModulesToLoad, DATA_FETCH_TIMEOUT_MS, hasDataFetchingFunction, MODULE_LOAD_HARD_TIMEOUT_MS, MODULE_LOAD_TIMEOUT_MS, moduleLoadLabel, SSR_RENDER_TIMEOUT_MS, } from "./module-collection.js";
|
|
49
49
|
const renderPageLog = logger.component("render-page");
|
|
50
50
|
const renderPipelineLog = logger.component("render-pipeline");
|
|
51
51
|
const resolvePageDataLog = logger.component("resolve-page-data");
|
|
@@ -251,7 +251,7 @@ export class RenderPipeline {
|
|
|
251
251
|
const loadedModules = await profilePhase("render.load_modules", () => withSpan(SpanNames.RENDER_LOAD_MODULES, () => withProgressTimeoutThrow((control) => this.loadModulesInParallel(modulesToLoad, options, control), {
|
|
252
252
|
idleTimeoutMs: MODULE_LOAD_TIMEOUT_MS,
|
|
253
253
|
hardTimeoutMs: options.abortSignal ? undefined : MODULE_LOAD_HARD_TIMEOUT_MS,
|
|
254
|
-
label:
|
|
254
|
+
label: moduleLoadLabel(slug, options.url?.pathname ?? ""),
|
|
255
255
|
signal: options.abortSignal,
|
|
256
256
|
}), { "render.module_count": modulesToLoad.length }));
|
|
257
257
|
const dataJobs = loadedModules.filter((m) => options?.staticDataOnly
|
|
@@ -35,6 +35,13 @@ export interface APIContext {
|
|
|
35
35
|
* behave identically. Handlers must not care which one ran them.
|
|
36
36
|
*/
|
|
37
37
|
export declare function createJsonHelper(_request: Request): APIContext["json"];
|
|
38
|
+
/**
|
|
39
|
+
* Build the `ctx.text` response helper.
|
|
40
|
+
*
|
|
41
|
+
* Exported for the isolation Worker so both execution modes share Fetch's
|
|
42
|
+
* null-body status handling instead of maintaining separate implementations.
|
|
43
|
+
*/
|
|
44
|
+
export declare function createTextHelper(): APIContext["text"];
|
|
38
45
|
/**
|
|
39
46
|
* Build the `ctx.body` request-body reader.
|
|
40
47
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-builder.d.ts","sourceRoot":"","sources":["../../../../src/src/routing/api/context-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAI3D,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,mDAAmD;AACnD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC1C,KAAK,EAAE,eAAe,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,GAAG,CAAC;IACT;;;;OAIG;IACH,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,YAAY,KAAK,QAAQ,CAAC;IACvD;;;;;;OAMG;IACH,IAAI,EAAE,CAAC,CAAC,GAAG,OAAO,OAAO,OAA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wBAAgB,gBAAgB,IAAI,UAAU,CAAC,MAAM,CAAC,CAErD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAiBrE;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,UAAU,EACjB,EAAE,EAAE,iBAAiB,GACpB,UAAU,CAmBZ;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,GACxC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB"}
|
|
@@ -2,8 +2,17 @@ import { parseCookies } from "../../utils/cookie-utils.js";
|
|
|
2
2
|
import { INVALID_ARGUMENT } from "../../errors/index.js";
|
|
3
3
|
import { flattenRouteParams } from "../flatten-route-params.js";
|
|
4
4
|
export { parseCookies };
|
|
5
|
+
/**
|
|
6
|
+
* Statuses that the Fetch spec forbids from carrying a body. Constructing
|
|
7
|
+
* `new Response(body, { status })` with a non-null `body` (an empty string
|
|
8
|
+
* still counts) throws `Response with null body status cannot have body`, so
|
|
9
|
+
* the helpers below must send `null` for these.
|
|
10
|
+
*/
|
|
11
|
+
const NULL_BODY_STATUSES = new Set([101, 103, 204, 205, 304]);
|
|
5
12
|
function createResponse(body, contentType, init) {
|
|
6
|
-
|
|
13
|
+
const status = init?.status;
|
|
14
|
+
const hasNullBodyStatus = status !== undefined && NULL_BODY_STATUSES.has(status);
|
|
15
|
+
return new Response(hasNullBodyStatus ? null : body, {
|
|
7
16
|
...init,
|
|
8
17
|
headers: {
|
|
9
18
|
"Content-Type": contentType,
|
|
@@ -20,6 +29,15 @@ function createResponse(body, contentType, init) {
|
|
|
20
29
|
export function createJsonHelper(_request) {
|
|
21
30
|
return (data, init) => createResponse(JSON.stringify(data), "application/json", init);
|
|
22
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Build the `ctx.text` response helper.
|
|
34
|
+
*
|
|
35
|
+
* Exported for the isolation Worker so both execution modes share Fetch's
|
|
36
|
+
* null-body status handling instead of maintaining separate implementations.
|
|
37
|
+
*/
|
|
38
|
+
export function createTextHelper() {
|
|
39
|
+
return (data, init) => createResponse(data, "text/plain", init);
|
|
40
|
+
}
|
|
23
41
|
/**
|
|
24
42
|
* Build the `ctx.body` request-body reader.
|
|
25
43
|
*
|
|
@@ -52,7 +70,7 @@ export function createContext(request, match, fs) {
|
|
|
52
70
|
const url = new URL(request.url);
|
|
53
71
|
const json = createJsonHelper(request);
|
|
54
72
|
const body = createBodyReader(request);
|
|
55
|
-
const text = (
|
|
73
|
+
const text = createTextHelper();
|
|
56
74
|
return {
|
|
57
75
|
request,
|
|
58
76
|
req: request,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esbuild-plugins.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/handlers/dev/files/esbuild-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA6B,MAAM,EAAe,MAAM,yCAAyC,CAAC;AAG9G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAS5E,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,sCAAsC,CAAC;AAgC9C,MAAM,WAAW,uBAAuB;IACtC,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AASD,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AAE5E,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,uBAAuB,CAAC,CAmClC;AAoBD,gFAAgF;AAChF,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,cAAc,EACvB,OAAO,GAAE,uBAA4B,GACpC,MAAM,CA2KR;AAKD,UAAU,yBAAyB;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;
|
|
1
|
+
{"version":3,"file":"esbuild-plugins.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/handlers/dev/files/esbuild-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA6B,MAAM,EAAe,MAAM,yCAAyC,CAAC;AAG9G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAS5E,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,sCAAsC,CAAC;AAgC9C,MAAM,WAAW,uBAAuB;IACtC,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AASD,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AAE5E,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,uBAAuB,CAAC,CAmClC;AAoBD,gFAAgF;AAChF,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,cAAc,EACvB,OAAO,GAAE,uBAA4B,GACpC,MAAM,CA2KR;AAKD,UAAU,yBAAyB;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAuED,kFAAkF;AAClF,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,yBAAyB,GAAG,OAAe,GACnD,MAAM,CAqFR;AAED,wBAAgB,wBAAwB,IAAI,MAAM,CAUjD"}
|