rari 0.14.7 → 0.14.9
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/dist/alias-resolver-BIWqeQml.mjs +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/client.d.mts +4 -42
- package/dist/client.mjs +1 -2
- package/dist/feed-generator-CM9mK131.mjs +3 -0
- package/dist/index.d.mts +3 -3
- package/dist/{metadata-route-85WvBQcW.d.mts → metadata-route-_d5FkjlL.d.mts} +37 -1
- package/dist/props-extractor-C8FRV5vW.mjs +1 -0
- package/dist/{railway-s8_vD6IQ.mjs → railway--nFNI3h8.mjs} +1 -1
- package/dist/{render--U1cY-wT.mjs → render-EieI0V5b.mjs} +1 -1
- package/dist/resolve-R6nLL3qq.mjs +1 -0
- package/dist/robots-generator-CsTVq3Jp.mjs +2 -0
- package/dist/runtime/ErrorBoundaryWrapper.mjs +1 -1
- package/dist/runtime/entry-client.mjs +2 -7
- package/dist/runtime/rsc-client-runtime.mjs +2 -2
- package/dist/server-config-D7_4Hk9w.d.mts +107 -0
- package/dist/{sitemap-generator-BGu4N9qc.mjs → sitemap-generator-DWgqfKQu.mjs} +2 -2
- package/dist/{types-BWLVeCkK.d.mts → types-BwhW3M72.d.mts} +16 -1
- package/dist/{utils-BdLqcjvq-QFbF96eD.mjs → utils-DtilLmFs-CiitZqwE.mjs} +1 -0
- package/dist/vite.d.mts +50 -4
- package/dist/vite.mjs +30 -108
- package/package.json +17 -13
- package/dist/alias-resolver-BintHkb_.mjs +0 -1
- package/dist/robots-generator-l2O5neuR.mjs +0 -2
- package/dist/runtime-client-DHeO6y_7.mjs +0 -6
- package/dist/server-config-CwWYmtA0.d.mts +0 -237
- /package/dist/{timer-utils-Duul5JHq.mjs → timer-Duul5JHq.mjs} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rari",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.9",
|
|
5
5
|
"description": "Runtime Accelerated Rendering Infrastructure (rari)",
|
|
6
6
|
"author": "Ryan Skinner",
|
|
7
7
|
"license": "MIT",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"repository": {
|
|
10
10
|
"directory": "packages/rari",
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/rari-build/rari.git"
|
|
12
|
+
"url": "git+https://github.com/rari-build/rari.git"
|
|
13
13
|
},
|
|
14
14
|
"bugs": {
|
|
15
15
|
"url": "https://github.com/rari-build/rari/issues"
|
|
@@ -32,6 +32,10 @@
|
|
|
32
32
|
"full-stack",
|
|
33
33
|
"web-framework"
|
|
34
34
|
],
|
|
35
|
+
"sideEffects": [
|
|
36
|
+
"./dist/runtime/entry-client.mjs",
|
|
37
|
+
"./dist/runtime/rsc-client-runtime.mjs"
|
|
38
|
+
],
|
|
35
39
|
"exports": {
|
|
36
40
|
".": {
|
|
37
41
|
"browser": "./dist/client.mjs",
|
|
@@ -103,29 +107,29 @@
|
|
|
103
107
|
"node": ">=22.12.0"
|
|
104
108
|
},
|
|
105
109
|
"peerDependencies": {
|
|
106
|
-
"react": "^19.2.
|
|
107
|
-
"react-dom": "^19.2.
|
|
110
|
+
"react": "^19.2.7",
|
|
111
|
+
"react-dom": "^19.2.7"
|
|
108
112
|
},
|
|
109
113
|
"dependencies": {
|
|
110
114
|
"lightningcss": "^1.32.0",
|
|
111
115
|
"rolldown": "^1.1.0"
|
|
112
116
|
},
|
|
113
117
|
"optionalDependencies": {
|
|
114
|
-
"rari-darwin-arm64": "0.14.
|
|
115
|
-
"rari-darwin-x64": "0.14.
|
|
116
|
-
"rari-linux-arm64": "0.14.
|
|
117
|
-
"rari-linux-x64": "0.14.
|
|
118
|
-
"rari-win32-arm64": "0.14.
|
|
119
|
-
"rari-win32-x64": "0.14.
|
|
118
|
+
"rari-darwin-arm64": "0.14.9",
|
|
119
|
+
"rari-darwin-x64": "0.14.9",
|
|
120
|
+
"rari-linux-arm64": "0.14.9",
|
|
121
|
+
"rari-linux-x64": "0.14.9",
|
|
122
|
+
"rari-win32-arm64": "0.14.9",
|
|
123
|
+
"rari-win32-x64": "0.14.9"
|
|
120
124
|
},
|
|
121
125
|
"devDependencies": {
|
|
122
126
|
"@types/node": "^25.9.2",
|
|
123
127
|
"@types/react": "^19.2.17",
|
|
124
128
|
"@types/react-dom": "^19.2.3",
|
|
125
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
129
|
+
"@typescript/native-preview": "^7.0.0-dev.20260610.1",
|
|
126
130
|
"vite-plus": "^0.1.24",
|
|
127
|
-
"@rari/deploy": "0.
|
|
128
|
-
"@rari/logger": "0.
|
|
131
|
+
"@rari/deploy": "0.0.0",
|
|
132
|
+
"@rari/logger": "0.0.0"
|
|
129
133
|
},
|
|
130
134
|
"scripts": {
|
|
131
135
|
"build": "pnpm clean && pnpm typecheck && vp pack",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"node:path";function t(t,n,r){if(typeof t!=`string`)throw TypeError(`Expected source to be a string, but received ${typeof t}`);if(n==null)throw TypeError(`Expected aliases to be an object, but received ${n}`);if(typeof n!=`object`||Array.isArray(n))throw TypeError(`Expected aliases to be a plain object, but received ${Array.isArray(n)?`array`:typeof n}`);if(Object.getPrototypeOf(n)!==Object.prototype&&Object.getPrototypeOf(n)!==null)throw TypeError(`Expected aliases to be a plain object, but received ${n.constructor?.name||`object with custom prototype`}`);if(typeof r!=`string`)throw TypeError(`Expected projectRoot to be a string, but received ${typeof r}`);let i=Object.entries(n).sort((e,t)=>t[0].length-e[0].length);for(let[n,a]of i)if(t.startsWith(`${n}/`)||t===n){let i=t.slice(n.length),o=e.join(a,i);return e.isAbsolute(o)?o:e.resolve(r,o)}return null}export{t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Buffer as e}from"node:buffer";import{promises as t}from"node:fs";import n from"node:path";function r(e){return Array.isArray(e)?e:e?[e]:[`*`]}function i(e){return e===void 0?[]:(Array.isArray(e)?e:[e]).filter(e=>e!==``)}function a(e){let t=[],n=r(e.userAgent);for(let r of n){t.push(`User-Agent: ${r}`);let n=i(e.allow);for(let e of n)t.push(`Allow: ${e}`);let a=i(e.disallow);for(let e of a)t.push(`Disallow: ${e}`);e.crawlDelay!==void 0&&t.push(`Crawl-delay: ${e.crawlDelay}`),t.push(``)}return t}function o(e){return e?[`Host: ${e}`,``]:[]}function s(e){return i(e).map(e=>`Sitemap: ${e}`)}function c(e){let t=[],n=Array.isArray(e.rules)?e.rules:[e.rules];for(let e of n)t.push(...a(e));return t.push(...o(e.host)),t.push(...s(e.sitemap)),t.join(`
|
|
2
|
-
`)}async function l(e,r=[`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`,`.cjs`]){let i=n.join(e,`robots.txt`);try{return await t.access(i),{type:`static`,path:i}}catch(e){if(e?.code!==`ENOENT`)throw e}for(let i of r){let r=n.join(e,`robots${i}`);try{return await t.access(r),{type:`dynamic`,path:r}}catch(e){if(e?.code!==`ENOENT`)throw e}}return null}async function u(r){let{appDir:i,outDir:a,extensions:o}=r,s=await l(i,o);if(!s)return!1;let u=n.join(a,`robots.txt`);if(await t.mkdir(n.dirname(u),{recursive:!0}),s.type===`static`)return await t.copyFile(s.path,u),!0;try{let{build:r}=await import(`rolldown`),i=await t.readFile(s.path,`utf-8`),a=`\0virtual:robots`,o=await r({input:a,external:[`rari`],platform:`node`,write:!1,output:{format:`esm`,codeSplitting:!1},plugins:[{name:`virtual-robots`,resolveId(e){return e===a?e:e.startsWith(`.`)?n.resolve(n.dirname(s.path),e):null},load(e){if(e===a){let e=n.extname(s.path).slice(1),t;switch(e){case`ts`:t=`ts`;break;case`tsx`:t=`tsx`;break;case`js`:case`mjs`:case`cjs`:t=`js`;break;case`jsx`:t=`jsx`;break;default:throw Error(`Unsupported robots file extension: .${e}. Supported extensions are: .ts, .tsx, .js, .jsx, .mjs, .cjs`)}return{code:i,moduleType:t}}return null}}]});if(!o.output||o.output.length===0)throw Error(`Failed to build robots module`);let l=o.output.find(e=>e.type===`chunk`&&e.isEntry)||o.output.find(e=>e.type===`chunk`);if(!l||l.type!==`chunk`)throw Error(`No chunk output found in robots build result`);let d=l.code,f=await import(`data:text/javascript;base64,${e.from(d).toString(`base64`)}`);if(!f||f.default==null)throw Error(`Robots file must export a default export (either an object or a function)`);let p;if(typeof f.default==`function`){let e=f.default();p=e instanceof Promise?await e:e}else p=f.default;let m=c(p);return await t.writeFile(u,m),!0}catch(e){return console.error(`[rari] Failed to build/execute robots file:`,e),!1}}export{u as generateRobotsFile};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import{Component as t,Suspense as n}from"react";function r(e,t){e&&(e.notFound&&(t.notFound=!0),e.redirect&&(t.redirect=typeof e.redirect==`string`?e.redirect:e.redirect.destination),e.revalidate!==void 0&&(t.revalidate=e.revalidate),e.props&&(t.props={...t.props,...e.props}))}async function i(e,t,n,i){typeof e.getData==`function`&&r(await e.getData({params:t,searchParams:n}),i)}async function a(e,t,n,i){typeof e.getServerSideProps==`function`&&r(await e.getServerSideProps({params:t,searchParams:n}),i)}async function o(e,t,n){typeof e.getStaticProps==`function`&&r(await e.getStaticProps({params:t}),n)}async function s(e,t,n){try{let r=await import(e),s={props:{}};return await i(r,t,n,s),await a(r,t,n,s),await o(r,t,s),s}catch(t){return console.error(`[rari] Router: Failed to extract server props from ${e}:`,t),{props:{}}}}async function c(e,t,n){try{let r=await import(e);if(typeof r.generateMetadata==`function`){let e=await r.generateMetadata({params:t,searchParams:n});if(e&&typeof e==`object`)return e}return r.metadata&&typeof r.metadata==`object`?r.metadata:{}}catch(t){return console.error(`[rari] Router: Failed to extract metadata from ${e}:`,t),{}}}async function l(e){try{let t=await import(e);if(typeof t.generateStaticParams==`function`){let e=await t.generateStaticParams();if(Array.isArray(e))return e}return[]}catch(t){return console.error(`[rari] Router: Failed to extract static params from ${e}:`,t),[]}}async function u(e){try{let t=await import(e);return!!(t.getData||t.getServerSideProps||t.getStaticProps||t.generateMetadata||t.generateStaticParams)}catch{return!1}}const d=new Map;async function f(e,t,n,r=6e4){let i=`${e}:${JSON.stringify(t)}:${JSON.stringify(n)}`,a=d.get(i);if(a&&Date.now()-a.timestamp<r)return a.result;let o=await s(e,t,n);return d.set(i,{result:o,timestamp:Date.now()}),o}function p(){d.clear()}function m(e){for(let t of d.keys())t.startsWith(e)&&d.delete(t)}async function h(e){if(!e.ok){let t;try{t=await e.text()}catch{t=`<unable to read response body>`}let n=t.length>200?`${t.slice(0,200)}...`:t,r=Error(`HTTP ${e.status}: ${e.statusText}`);throw r.status=e.status,r.statusText=e.statusText,r.bodyPreview=n,r}}var g=class{baseUrl;timeout;components=[];initialized=!1;constructor(e={}){let{host:t=`127.0.0.1`,port:n=3e3,timeout:r=3e4,ssl:i=!1}=e,a=i?`https`:`http`;this.baseUrl=`${a}://${t}:${n}`,this.timeout=r}assertInitialized(){if(!this.initialized)throw Error(`Runtime client not initialized. Call initialize() first.`)}async request(e,t={}){let{method:n=`GET`,body:r,headers:i={}}=t,a=`${this.baseUrl}${e}`,o={method:n,headers:{"Content-Type":`application/json`,...i},signal:AbortSignal.timeout(this.timeout)};r&&(n===`POST`||n===`PUT`)&&(o.body=JSON.stringify(r));try{let e=await fetch(a,o);return await h(e),e.headers.get(`content-type`)?.includes(`application/json`)?await e.json():await e.text()}catch(e){if(e instanceof Error){if(e.name===`AbortError`)throw Error(`Request timeout after ${this.timeout}ms`);if(e.message.includes(`ECONNREFUSED`))throw Error(`Failed to connect to rari server at ${this.baseUrl}. Make sure the server is running.`)}throw e}}async initialize(){try{let e=await this.request(`/_rari/health`);if(e.status!==`healthy`)throw Error(`Server is not healthy: ${e.status}`);this.initialized=!0}catch(e){throw Error(`Failed to initialize runtime client: ${e}`)}}async registerComponent(e,t){this.assertInitialized();let n={component_id:e,component_code:t};try{let t=await this.request(`/_rari/register`,{method:`POST`,body:n});if(!t.success)throw Error(`Failed to register component: ${t.error||`Unknown error`}`);this.components.includes(e)||this.components.push(e)}catch(t){throw Error(`Failed to register component ${e}: ${t}`)}}async renderToStreamCallbacks(e,t){this.assertInitialized();let n={component_id:e,props:t?JSON.parse(t):void 0};try{let e=await fetch(`${this.baseUrl}/_rari/stream`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n),signal:AbortSignal.timeout(this.timeout)});return await h(e),e.body}catch(t){throw Error(`Failed to stream component ${e}: ${t}`)}}registerClientComponent(e,t,n){this.queueClientComponentRegistration(e,t,n)}async queueClientComponentRegistration(e,t,n){if(!this.initialized){console.error(`[rari] Runtime: Client not initialized. Client component registration will be delayed.`);return}let r={component_id:e,file_path:t,export_name:n};try{let e=await this.request(`/_rari/register-client`,{method:`POST`,body:r});if(!e.success)throw Error(`Failed to register client component: ${e.error||`Unknown error`}`)}catch(t){console.error(`[rari] Runtime: Failed to register client component ${e}:`,t)}}registerClientReference(e,t,n){this.queueClientComponentRegistration(e,t,n)}listComponents(){return[...this.components]}async shutdown(){try{this.initialized=!1,this.components=[]}catch(e){console.error(`[rari] Runtime: Error during shutdown:`,e)}}async getServerStatus(){return await this.request(`/_rari/status`)}async checkHealth(){return await this.request(`/_rari/health`)}isInitialized(){return this.initialized}getBaseUrl(){return this.baseUrl}};function _(e){return new g(e)}function v({children:t,fallback:r}){return e.createElement(n,{fallback:r},t)}function y(t){return({children:n})=>e.createElement(v,{fallback:t,children:n})}var b=class extends t{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.hasError){let t=()=>this.setState({hasError:!1,error:null});return this.props.fallback?this.props.fallback(this.state.error,t):e.createElement(`div`,{style:{padding:`1rem`,border:`1px solid #ef4444`,borderRadius:`0.5rem`,backgroundColor:`#fef2f2`}},[e.createElement(`h2`,{style:{color:`#dc2626`,margin:`0 0 0.5rem 0`}},`Something went wrong`),e.createElement(`p`,{style:{color:`#991b1b`,margin:`0 0 1rem 0`}},this.state.error?.message||`An unexpected error occurred`),e.createElement(`button`,{onClick:t,style:{padding:`0.5rem 1rem`,backgroundColor:`#dc2626`,color:`white`,border:`none`,borderRadius:`0.25rem`,cursor:`pointer`}},`Try again`)])}return this.props.children}};function x({children:t,fallback:n}){return e.createElement(b,{fallback:n},t)}function S(t){return({children:n})=>e.createElement(x,{fallback:t,children:n})}function C(){return e.createElement(`div`,{style:{padding:`2rem`,textAlign:`center`}},[e.createElement(`h1`,{style:{fontSize:`2rem`,margin:`0 0 1rem 0`}},`404 - Page Not Found`),e.createElement(`p`,{style:{color:`#6b7280`,margin:`0 0 1rem 0`}},`The page you're looking for doesn't exist.`),e.createElement(`button`,{onClick:()=>window.history.back(),style:{padding:`0.5rem 1rem`,backgroundColor:`#3b82f6`,color:`white`,border:`none`,borderRadius:`0.25rem`,cursor:`pointer`}},`Go back`)])}function w({size:t=`medium`}){let n={small:`1rem`,medium:`2rem`,large:`3rem`};return e.createElement(`div`,{style:{display:`inline-block`,width:n[t],height:n[t],border:`2px solid #e5e7eb`,borderTop:`2px solid #3b82f6`,borderRadius:`50%`,animation:`spin 1s linear infinite`}})}function T(){return e.createElement(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,padding:`2rem`,minHeight:`200px`}},e.createElement(w))}function E({error:t,reset:n}){return e.createElement(`div`,{style:{padding:`2rem`,border:`1px solid #ef4444`,borderRadius:`0.5rem`,backgroundColor:`#fef2f2`,textAlign:`center`}},[e.createElement(`h2`,{style:{color:`#dc2626`,margin:`0 0 1rem 0`}},`Something went wrong`),e.createElement(`p`,{style:{color:`#991b1b`,margin:`0 0 1rem 0`}},t.message||`An unexpected error occurred`),e.createElement(`button`,{onClick:n,style:{padding:`0.5rem 1rem`,backgroundColor:`#dc2626`,color:`white`,border:`none`,borderRadius:`0.25rem`,cursor:`pointer`}},`Try again`)])}if(typeof document<`u`){let e=document.createElement(`style`);e.textContent=`
|
|
2
|
-
@keyframes spin {
|
|
3
|
-
0% { transform: rotate(0deg); }
|
|
4
|
-
100% { transform: rotate(360deg); }
|
|
5
|
-
}
|
|
6
|
-
`,document.head.appendChild(e)}export{u as _,w as a,_ as c,p as d,m as f,l as g,f as h,g as i,y as l,s as m,T as n,C as o,c as p,b as r,S as s,E as t,h as u};
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Component, ReactElement, ReactNode } from "react";
|
|
3
|
-
|
|
4
|
-
//#region src/router/props-extractor.d.ts
|
|
5
|
-
interface ServerSidePropsResult {
|
|
6
|
-
props: Record<string, any>;
|
|
7
|
-
revalidate?: number;
|
|
8
|
-
notFound?: boolean;
|
|
9
|
-
redirect?: string;
|
|
10
|
-
}
|
|
11
|
-
interface MetadataResult {
|
|
12
|
-
title?: string | {
|
|
13
|
-
default?: string;
|
|
14
|
-
template?: string;
|
|
15
|
-
absolute?: string;
|
|
16
|
-
};
|
|
17
|
-
description?: string;
|
|
18
|
-
keywords?: string[];
|
|
19
|
-
openGraph?: {
|
|
20
|
-
title?: string;
|
|
21
|
-
description?: string;
|
|
22
|
-
url?: string;
|
|
23
|
-
siteName?: string;
|
|
24
|
-
images?: Array<string | {
|
|
25
|
-
url: string;
|
|
26
|
-
width?: number;
|
|
27
|
-
height?: number;
|
|
28
|
-
alt?: string;
|
|
29
|
-
}>;
|
|
30
|
-
type?: string;
|
|
31
|
-
};
|
|
32
|
-
twitter?: {
|
|
33
|
-
card?: 'summary' | 'summary_large_image' | 'app' | 'player';
|
|
34
|
-
site?: string;
|
|
35
|
-
creator?: string;
|
|
36
|
-
title?: string;
|
|
37
|
-
description?: string;
|
|
38
|
-
images?: string[];
|
|
39
|
-
};
|
|
40
|
-
robots?: {
|
|
41
|
-
index?: boolean;
|
|
42
|
-
follow?: boolean;
|
|
43
|
-
nocache?: boolean;
|
|
44
|
-
};
|
|
45
|
-
icons?: {
|
|
46
|
-
icon?: Array<{
|
|
47
|
-
url: string;
|
|
48
|
-
type?: string;
|
|
49
|
-
sizes?: string;
|
|
50
|
-
rel?: string;
|
|
51
|
-
}> | string | string[];
|
|
52
|
-
apple?: Array<{
|
|
53
|
-
url: string;
|
|
54
|
-
sizes?: string;
|
|
55
|
-
rel?: string;
|
|
56
|
-
}> | string | string[];
|
|
57
|
-
other?: Array<{
|
|
58
|
-
url: string;
|
|
59
|
-
rel?: string;
|
|
60
|
-
type?: string;
|
|
61
|
-
sizes?: string;
|
|
62
|
-
color?: string;
|
|
63
|
-
}>;
|
|
64
|
-
};
|
|
65
|
-
manifest?: string;
|
|
66
|
-
themeColor?: string | Array<{
|
|
67
|
-
color: string;
|
|
68
|
-
media?: string;
|
|
69
|
-
}>;
|
|
70
|
-
appleWebApp?: {
|
|
71
|
-
title?: string;
|
|
72
|
-
statusBarStyle?: 'default' | 'black' | 'black-translucent';
|
|
73
|
-
capable?: boolean;
|
|
74
|
-
};
|
|
75
|
-
viewport?: string;
|
|
76
|
-
canonical?: string;
|
|
77
|
-
}
|
|
78
|
-
type StaticParamsResult = Array<Record<string, string | string[]>>;
|
|
79
|
-
declare function extractServerProps(componentPath: string, params: Record<string, string>, searchParams: Record<string, string>): Promise<ServerSidePropsResult>;
|
|
80
|
-
declare function extractMetadata(componentPath: string, params: Record<string, string>, searchParams: Record<string, string>): Promise<MetadataResult>;
|
|
81
|
-
declare function extractStaticParams(componentPath: string): Promise<StaticParamsResult>;
|
|
82
|
-
declare function hasServerSideDataFetching(componentPath: string): Promise<boolean>;
|
|
83
|
-
declare function extractServerPropsWithCache(componentPath: string, params: Record<string, string>, searchParams: Record<string, string>, cacheTime?: number): Promise<ServerSidePropsResult>;
|
|
84
|
-
declare function clearPropsCache(): void;
|
|
85
|
-
declare function clearPropsCacheForComponent(componentPath: string): void;
|
|
86
|
-
//#endregion
|
|
87
|
-
//#region src/runtime-client.d.ts
|
|
88
|
-
interface RuntimeClient {
|
|
89
|
-
initialize: () => Promise<void>;
|
|
90
|
-
registerComponent: (componentId: string, componentCode: string) => Promise<void>;
|
|
91
|
-
renderToStreamCallbacks: (componentId: string, props?: string) => Promise<any>;
|
|
92
|
-
registerClientComponent: (componentId: string, filePath: string, exportName: string) => void;
|
|
93
|
-
registerClientReference: (referenceId: string, filePath: string, exportName: string) => void;
|
|
94
|
-
listComponents: () => string[];
|
|
95
|
-
shutdown: () => Promise<void>;
|
|
96
|
-
}
|
|
97
|
-
interface HealthResponse {
|
|
98
|
-
status: string;
|
|
99
|
-
timestamp: string;
|
|
100
|
-
}
|
|
101
|
-
interface StatusResponse {
|
|
102
|
-
status: string;
|
|
103
|
-
mode: string;
|
|
104
|
-
uptime_seconds: number;
|
|
105
|
-
request_count: number;
|
|
106
|
-
components_registered: number;
|
|
107
|
-
memory_usage?: number;
|
|
108
|
-
}
|
|
109
|
-
declare class HttpRuntimeClient implements RuntimeClient {
|
|
110
|
-
private baseUrl;
|
|
111
|
-
private timeout;
|
|
112
|
-
private components;
|
|
113
|
-
private initialized;
|
|
114
|
-
constructor(options?: {
|
|
115
|
-
host?: string;
|
|
116
|
-
port?: number;
|
|
117
|
-
timeout?: number;
|
|
118
|
-
ssl?: boolean;
|
|
119
|
-
});
|
|
120
|
-
private assertInitialized;
|
|
121
|
-
private request;
|
|
122
|
-
initialize(): Promise<void>;
|
|
123
|
-
registerComponent(componentId: string, componentCode: string): Promise<void>;
|
|
124
|
-
renderToStreamCallbacks(componentId: string, props?: string): Promise<any>;
|
|
125
|
-
registerClientComponent(componentId: string, filePath: string, exportName: string): void;
|
|
126
|
-
private queueClientComponentRegistration;
|
|
127
|
-
registerClientReference(referenceId: string, filePath: string, exportName: string): void;
|
|
128
|
-
listComponents(): string[];
|
|
129
|
-
shutdown(): Promise<void>;
|
|
130
|
-
getServerStatus(): Promise<StatusResponse>;
|
|
131
|
-
checkHealth(): Promise<HealthResponse>;
|
|
132
|
-
isInitialized(): boolean;
|
|
133
|
-
getBaseUrl(): string;
|
|
134
|
-
}
|
|
135
|
-
declare function createHttpRuntimeClient(options?: {
|
|
136
|
-
host?: string;
|
|
137
|
-
port?: number;
|
|
138
|
-
timeout?: number;
|
|
139
|
-
ssl?: boolean;
|
|
140
|
-
}): RuntimeClient;
|
|
141
|
-
declare function createLoadingBoundary(fallback: ReactElement): ({
|
|
142
|
-
children
|
|
143
|
-
}: {
|
|
144
|
-
children: ReactNode;
|
|
145
|
-
}) => React.FunctionComponentElement<{
|
|
146
|
-
children: ReactNode;
|
|
147
|
-
fallback: ReactElement;
|
|
148
|
-
}>;
|
|
149
|
-
declare class ErrorBoundary extends Component<{
|
|
150
|
-
children: ReactNode;
|
|
151
|
-
fallback?: (error: Error, reset: () => void) => ReactElement;
|
|
152
|
-
onError?: (error: Error, errorInfo: any) => void;
|
|
153
|
-
}, {
|
|
154
|
-
hasError: boolean;
|
|
155
|
-
error: Error | null;
|
|
156
|
-
}> {
|
|
157
|
-
constructor(props: any);
|
|
158
|
-
static getDerivedStateFromError(error: Error): {
|
|
159
|
-
hasError: boolean;
|
|
160
|
-
error: Error;
|
|
161
|
-
};
|
|
162
|
-
componentDidCatch(error: Error, errorInfo: any): void;
|
|
163
|
-
render(): ReactNode;
|
|
164
|
-
}
|
|
165
|
-
declare function createErrorBoundary(fallback?: (error: Error, reset: () => void) => ReactElement): ({
|
|
166
|
-
children
|
|
167
|
-
}: {
|
|
168
|
-
children: ReactNode;
|
|
169
|
-
}) => React.FunctionComponentElement<{
|
|
170
|
-
children: ReactNode;
|
|
171
|
-
fallback?: (error: Error, reset: () => void) => ReactElement;
|
|
172
|
-
}>;
|
|
173
|
-
declare function NotFound(): React.DetailedReactHTMLElement<{
|
|
174
|
-
style: {
|
|
175
|
-
padding: string;
|
|
176
|
-
textAlign: "center";
|
|
177
|
-
};
|
|
178
|
-
}, HTMLElement>;
|
|
179
|
-
declare function LoadingSpinner({
|
|
180
|
-
size
|
|
181
|
-
}: {
|
|
182
|
-
size?: 'small' | 'medium' | 'large';
|
|
183
|
-
}): React.DetailedReactHTMLElement<{
|
|
184
|
-
style: {
|
|
185
|
-
display: "inline-block";
|
|
186
|
-
width: string;
|
|
187
|
-
height: string;
|
|
188
|
-
border: string;
|
|
189
|
-
borderTop: string;
|
|
190
|
-
borderRadius: string;
|
|
191
|
-
animation: "spin 1s linear infinite";
|
|
192
|
-
};
|
|
193
|
-
}, HTMLElement>;
|
|
194
|
-
declare function DefaultLoading(): React.DetailedReactHTMLElement<{
|
|
195
|
-
style: {
|
|
196
|
-
display: "flex";
|
|
197
|
-
justifyContent: "center";
|
|
198
|
-
alignItems: "center";
|
|
199
|
-
padding: string;
|
|
200
|
-
minHeight: string;
|
|
201
|
-
};
|
|
202
|
-
}, HTMLElement>;
|
|
203
|
-
declare function DefaultError({
|
|
204
|
-
error,
|
|
205
|
-
reset
|
|
206
|
-
}: {
|
|
207
|
-
error: Error;
|
|
208
|
-
reset: () => void;
|
|
209
|
-
}): React.DetailedReactHTMLElement<{
|
|
210
|
-
style: {
|
|
211
|
-
padding: string;
|
|
212
|
-
border: string;
|
|
213
|
-
borderRadius: string;
|
|
214
|
-
backgroundColor: "#fef2f2";
|
|
215
|
-
textAlign: "center";
|
|
216
|
-
};
|
|
217
|
-
}, HTMLElement>;
|
|
218
|
-
//#endregion
|
|
219
|
-
//#region src/types/server-config.d.ts
|
|
220
|
-
interface ServerCSPConfig {
|
|
221
|
-
scriptSrc?: string[];
|
|
222
|
-
styleSrc?: string[];
|
|
223
|
-
imgSrc?: string[];
|
|
224
|
-
fontSrc?: string[];
|
|
225
|
-
connectSrc?: string[];
|
|
226
|
-
defaultSrc?: string[];
|
|
227
|
-
workerSrc?: string[];
|
|
228
|
-
}
|
|
229
|
-
interface ServerCacheControlConfig {
|
|
230
|
-
routes: Record<string, string>;
|
|
231
|
-
}
|
|
232
|
-
interface ServerConfig {
|
|
233
|
-
csp?: ServerCSPConfig;
|
|
234
|
-
cacheControl?: ServerCacheControlConfig;
|
|
235
|
-
}
|
|
236
|
-
//#endregion
|
|
237
|
-
export { hasServerSideDataFetching as C, extractStaticParams as S, clearPropsCache as _, DefaultLoading as a, extractServerProps as b, LoadingSpinner as c, createErrorBoundary as d, createHttpRuntimeClient as f, StaticParamsResult as g, ServerSidePropsResult as h, DefaultError as i, NotFound as l, MetadataResult as m, ServerCacheControlConfig as n, ErrorBoundary as o, createLoadingBoundary as p, ServerConfig as r, HttpRuntimeClient as s, ServerCSPConfig as t, RuntimeClient as u, clearPropsCacheForComponent as v, extractServerPropsWithCache as x, extractMetadata as y };
|
|
File without changes
|