@lomray/vite-ssr-boost 8.2.0 → 8.3.0-beta.2
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/README.md +25 -13
- package/SECURITY.md +1 -1
- package/adapters/express/entry.d.ts +1 -1
- package/adapters/express/entry.js.map +1 -1
- package/adapters/express/render.d.ts +4 -1
- package/adapters/express/render.js +1 -1
- package/adapters/express/render.js.map +1 -1
- package/browser/entry.d.ts +1 -0
- package/browser/entry.js +1 -1
- package/browser/entry.js.map +1 -1
- package/browser/stream.d.ts +5 -0
- package/browser/stream.js +2 -0
- package/browser/stream.js.map +1 -0
- package/cli/diagnostic-codes.d.ts +3 -0
- package/cli/diagnostic-codes.js +2 -0
- package/cli/diagnostic-codes.js.map +1 -0
- package/cli/doctor.d.ts +55 -0
- package/cli/doctor.js +2 -0
- package/cli/doctor.js.map +1 -0
- package/cli/init.d.ts +17 -0
- package/cli/init.js +2 -0
- package/cli/init.js.map +1 -0
- package/cli/project.d.ts +56 -0
- package/cli/project.js +2 -0
- package/cli/project.js.map +1 -0
- package/cli.js +1 -1
- package/cli.js.map +1 -1
- package/core/compose-html.d.ts +3 -4
- package/core/compose-html.js +1 -1
- package/core/compose-html.js.map +1 -1
- package/core/data-stream.d.ts +50 -0
- package/core/data-stream.js +2 -0
- package/core/data-stream.js.map +1 -0
- package/core/html-boundary.d.ts +7 -0
- package/core/html-boundary.js +2 -0
- package/core/html-boundary.js.map +1 -0
- package/core/render.d.ts +7 -1
- package/core/render.js +1 -1
- package/core/render.js.map +1 -1
- package/core/script.d.ts +6 -0
- package/core/script.js +2 -0
- package/core/script.js.map +1 -0
- package/edge/render-to-stream.js +1 -1
- package/edge/render-to-stream.js.map +1 -1
- package/helpers/build-custom-state.d.ts +1 -1
- package/helpers/build-custom-state.js +1 -1
- package/helpers/build-custom-state.js.map +1 -1
- package/helpers/build-router-state.d.ts +1 -1
- package/helpers/build-router-state.js +1 -1
- package/helpers/build-router-state.js.map +1 -1
- package/helpers/is-route-file.js +1 -1
- package/helpers/is-route-file.js.map +1 -1
- package/node/render-to-stream.js +1 -1
- package/node/render-to-stream.js.map +1 -1
- package/package.json +18 -6
- package/plugins/normalize-route.js +1 -1
- package/plugins/normalize-route.js.map +1 -1
- package/services/build.d.ts +1 -0
- package/services/build.js +1 -1
- package/services/build.js.map +1 -1
- package/services/diagnostics.d.ts +8 -3
- package/services/diagnostics.js +1 -1
- package/services/diagnostics.js.map +1 -1
- package/services/parse-routes.d.ts +17 -55
- package/services/parse-routes.js +1 -1
- package/services/parse-routes.js.map +1 -1
- package/services/path-normalize.js +1 -1
- package/services/path-normalize.js.map +1 -1
- package/services/source-files.d.ts +35 -0
- package/services/source-files.js +2 -0
- package/services/source-files.js.map +1 -0
- package/services/ssr-manifest.js +1 -1
- package/services/ssr-manifest.js.map +1 -1
package/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sources":["../src/cli.ts"],"sourcesContent":[null],"names":["description","version","JSON","parse","readFileSync","URL","url","enableShortcuts","process","stdin","isTTY","setRawMode","on","onKeyPress","setEncoding","resume","program","Command","name","cliName","hook","_","actionCommand","global","viteBoostAction","hostOption","Option","default","focusOnlyOption","choices","portOption","envModeOption","env","buildDirOption","command","CliActions","dev","addOption","action","async","host","port","resetCache","mode","entrypoint","viteResetCache","isPrintInfo","console","info","chalk","cyan","server","config","runDev","isHost","entrypointName","cliContext","reboot","build","focusOnly","clientOptions","serverOptions","unlockRobots","eject","serverless","throwWarnings","runBuild","isUnlockRobots","isNoWarnings","isEject","isServerless","start","modulePreload","buildDir","runProd","preview","viteBoostStartTime","performance","now","setTimeout","getLogger","yellow","isWatch","onFinish","buildDocker","requiredOption","imageName","dockerOptions","dockerFile","runDockerBuild","buildAmplify","manifestFile","isOptimize","runAmplifyBuild","buildVercel","configFile","configVcFile","runVercelBuild"],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.js","sources":["../src/cli.ts"],"sourcesContent":[null],"names":["description","version","JSON","parse","readFileSync","URL","url","enableShortcuts","process","stdin","isTTY","setRawMode","on","onKeyPress","setEncoding","resume","program","Command","name","cliName","hook","_","actionCommand","global","viteBoostAction","hostOption","Option","default","focusOnlyOption","choices","portOption","envModeOption","env","buildDirOption","command","CliActions","dev","addOption","action","async","host","port","resetCache","mode","entrypoint","viteResetCache","isPrintInfo","console","info","chalk","cyan","server","config","runDev","isHost","entrypointName","cliContext","reboot","build","focusOnly","clientOptions","serverOptions","unlockRobots","eject","serverless","throwWarnings","runBuild","isUnlockRobots","isNoWarnings","isEject","isServerless","start","modulePreload","buildDir","runProd","preview","viteBoostStartTime","performance","now","setTimeout","getLogger","yellow","isWatch","onFinish","buildDocker","requiredOption","imageName","dockerOptions","dockerFile","runDockerBuild","buildAmplify","manifestFile","isOptimize","runAmplifyBuild","buildVercel","configFile","configVcFile","runVercelBuild","option","runDoctor","runInit"],"mappings":";ylBA+BA,MAAMA,YAAEA,EAAWC,QAAEA,GAAYC,KAAKC,MACpCC,EAAa,IAAIC,IAAI,6BAA8BC,KAAM,SAOrDC,EAAkB,KAClBC,QAAQC,MAAMC,QAChBF,QAAQC,MAAME,YAAW,GACzBH,QAAQC,MAAMG,GAAG,OAAQC,GAAYC,YAAY,QAAQC,WAIvDC,EAAU,IAAIC,EAEpBD,EACGE,KAAKC,GACLnB,YAAYA,GACZC,QAAQA,GACRmB,KAAK,YAAa,CAACC,EAAGC,KAErBC,OAAOC,gBAAkBF,EAAcJ,SAM3C,MAAMO,EAAa,IAAIC,EACrB,SACA,iFACAC,SAAQ,GACJC,EAAkB,IAAIF,EAC1B,2BACA,8CAECC,QAAQ,OACRE,QAAQ,CAAC,MAAO,MAAO,SAAU,SAAU,eACxCC,EAAa,IAAIJ,EAAO,gBAAiB,gBAAgBC,QAAQ,KACjEI,EAAgB,IAAIL,EAAO,gBAAiB,aAC/CM,IAAI,iBACJL,QAAQ,cACLM,EAAiB,IAAIP,EAAO,yBAA0B,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IX,EACF,kCACA,+FAGHW,UAAU,IAAIX,EAAO,gBAAiB,iCAAiCC,SAAQ,IAC/EU,UAAUN,GACVO,OAAOC,OAASoD,eAAchD,OAAMiD,uBAC7BC,EAAgB,CACpBF,eACAhD,OACAiD,iBAIN5E,EACGkB,QAAQC,EAAW2D,aACnB9F,YAAY,8CACZqC,UACC,IAAIX,EACF,8BACA,8FAGHW,UACC,IAAIX,EACF,oCACA,oGAGHW,UAAU,IAAIX,EAAO,gBAAiB,iCAAiCC,SAAQ,IAC/EU,UAAUN,GACVO,OAAOC,OAASwD,aAAYC,eAAcrD,OAAMiD,uBACzCK,EAAe,CACnBF,aACAC,eACArD,OACAiD,iBAIN5E,EACGkB,QAAQ,UACRlC,YAAY,mDACZkG,OAAO,SAAU,gCACjBA,OAAO,eAAgB,sBACvBA,OAAO,kBAAmB,6CAC1B5D,OAAO6D,GAEVnF,EACGkB,QAAQ,QACRlC,YAAY,wEACZkG,OAAO,YAAa,6CACpBA,OAAO,UAAW,+BAClBA,OAAO,eAAgB,sBACvBA,OAAO,iBAAkB,oDACzBA,OAAO,kBAAmB,qCAC1B5D,OAAO8D,GAEVpF,EAAQb"}
|
package/core/compose-html.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare const composeHtml: (header: string, body: ReadableStream<Uint8Array>, footer: string, abort?: (reason?: unknown) => void, onComplete?: () => void) => ReadableStream<Uint8Array>;
|
|
1
|
+
import type DataStream from './data-stream.js';
|
|
2
|
+
/** Stream shell, data frames, React bytes and footer only under downstream demand. */
|
|
3
|
+
declare const composeHtml: (header: string, body: ReadableStream<Uint8Array>, footer: string, abort?: (reason?: unknown) => void, onComplete?: () => void, data?: DataStream) => ReadableStream<Uint8Array>;
|
|
5
4
|
export default composeHtml;
|
package/core/compose-html.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const
|
|
1
|
+
import e from"./html-boundary.js";const n=(n,t,a,r,o,c)=>{const i=new TextEncoder,d=t.getReader();let u,l="header",f=!1,s=!1;const h=e();let y,v=!0;const w=()=>{s||(s=!0,d.releaseLock())};return new ReadableStream({cancel:async e=>{f=!0,r?.(e),c?.cancel();try{s||await d.cancel(e)}finally{w(),o?.()}},async pull(e){try{if("header"===l&&(l="body",n))return void e.enqueue(i.encode(n));for(;!f;){const n=v?c?.take():void 0;if(f)return;if(n)return void e.enqueue(i.encode(n));if(y)return v=h(y),e.enqueue(y),void(y=void 0);if("body"===l){u??=d.read();const e=await(c&&!c.isDone&&v?Promise.race([u,c.changed().then(()=>{})]):u);if(f)return;if(!e)continue;if(u=void 0,!e.done){y=e.value;continue}l="footer",v=!0,w();continue}!c||c.isDone?(a&&e.enqueue(i.encode(a)),f=!0,o?.(),e.close()):await c.changed()}}catch(n){if(f)return;f=!0,r?.(n),c?.cancel(),e.error(n);try{s||await d.cancel(n).catch(()=>{})}finally{w(),o?.()}}}},{highWaterMark:0})};export{n as default};
|
|
2
2
|
//# sourceMappingURL=compose-html.js.map
|
package/core/compose-html.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-html.js","sources":["../../src/core/compose-html.ts"],"sourcesContent":[null],"names":["composeHtml","header","body","footer","abort","onComplete","encoder","TextEncoder","reader","getReader","phase","ReadableStream","cancel","async","reason","
|
|
1
|
+
{"version":3,"file":"compose-html.js","sources":["../../src/core/compose-html.ts"],"sourcesContent":[null],"names":["composeHtml","header","body","footer","abort","onComplete","data","encoder","TextEncoder","reader","getReader","pendingRead","phase","isStopped","isReleased","observe","htmlBoundary","heldChunk","canInject","release","releaseLock","ReadableStream","cancel","async","reason","pull","controller","enqueue","encode","frames","take","undefined","read","chunk","isDone","Promise","race","changed","then","done","value","close","error","catch","highWaterMark"],"mappings":"kCAIA,MAAMA,EAAc,CAClBC,EACAC,EACAC,EACAC,EACAC,EACAC,KAEA,MAAMC,EAAU,IAAIC,YACdC,EAASP,EAAKQ,YACpB,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,IACAd,KACF,CACF,CACF,GAEF,CAAEuC,cAAe"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { StaticHandlerContext } from 'react-router';
|
|
2
|
+
import type Diagnostics from '../services/diagnostics.js';
|
|
3
|
+
interface IPending {
|
|
4
|
+
settled: boolean;
|
|
5
|
+
}
|
|
6
|
+
/** Preserve route response details without shipping arbitrary error properties. */
|
|
7
|
+
declare const errorProperties: (reason: unknown, diagnostics: boolean) => Record<string, unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* Request-local promise identities and settlements. devalue encodes each frame's
|
|
10
|
+
* value; promise reducers keep settlement scheduling outside the value codec.
|
|
11
|
+
* No React bytes are read here. Nested settlements can introduce further placeholders.
|
|
12
|
+
*/
|
|
13
|
+
declare class DataStream {
|
|
14
|
+
protected readonly diagnostics?: Diagnostics | undefined;
|
|
15
|
+
protected readonly nonce?: string | undefined;
|
|
16
|
+
readonly initial: string;
|
|
17
|
+
readonly done: Promise<void>;
|
|
18
|
+
protected resolveDone: () => void;
|
|
19
|
+
protected notify?: () => void;
|
|
20
|
+
protected change?: Promise<void>;
|
|
21
|
+
protected readonly identities: WeakMap<Promise<unknown>, number>;
|
|
22
|
+
protected readonly pending: Map<number, IPending>;
|
|
23
|
+
protected readonly frames: string[];
|
|
24
|
+
protected initialized: boolean;
|
|
25
|
+
protected stopped: boolean;
|
|
26
|
+
protected aborted: boolean;
|
|
27
|
+
protected nextId: number;
|
|
28
|
+
constructor(context: StaticHandlerContext, diagnostics?: Diagnostics | undefined, nonce?: string | undefined);
|
|
29
|
+
/** Use the codec's public plugin API, without depending on React Router internals. */
|
|
30
|
+
protected promiseId: (value: unknown) => [number] | false;
|
|
31
|
+
/** Encode one complete value, preserving the codec's built-in value representations. */
|
|
32
|
+
protected encodeValue(value: unknown): string;
|
|
33
|
+
/** Publish only once, and finish encoding before announcing a settlement. */
|
|
34
|
+
protected settle(id: number, value: unknown, rejected: boolean): void;
|
|
35
|
+
/** Notify a waiting pull and settle completion only after nested values were visited. */
|
|
36
|
+
protected wake(): void;
|
|
37
|
+
get isDone(): boolean;
|
|
38
|
+
/** Wait for data, without starting a read from the React stream. */
|
|
39
|
+
changed(): Promise<void>;
|
|
40
|
+
/** Drain completed value frames before delivering a React boundary chunk. */
|
|
41
|
+
take(): string;
|
|
42
|
+
/** Publish initialization in the selected shell/footer block to unblock hydration. */
|
|
43
|
+
state(isEarly: boolean): string;
|
|
44
|
+
/** Reject outstanding placeholders before a timeout closes the HTML response. */
|
|
45
|
+
abort(): void;
|
|
46
|
+
/** A disconnected client cannot receive scripts; detach request state from late work. */
|
|
47
|
+
cancel(): void;
|
|
48
|
+
}
|
|
49
|
+
export { errorProperties };
|
|
50
|
+
export default DataStream;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{stringify as t}from"devalue";import{isRouteErrorResponse as e}from"react-router";import i,{streamScript as s}from"./script.js";import o from"../helpers/serialize-errors.js";const r=(t,i)=>{const s=t,o=e(t),r="DataWithResponseInit"===s?.type,n=o?t.status:s?.init?.status,a=o?t.statusText:s?.init?.statusText,c={message:s?.message??(o||r?a||`Route data error (${n??500})`:String(t)),name:s?.name??"Error"};return(o||r)&&Object.assign(c,{status:n??500,statusText:a??"",data:s?.data,internal:!1}),i&&s?.stack&&(c.stack=s.stack),c};class n{diagnostics;nonce;initial;done;resolveDone;notify;change;identities=new WeakMap;pending=new Map;frames=[];initialized=!1;stopped=!1;aborted=!1;nextId=0;constructor(t,e,i){this.diagnostics=e,this.nonce=i,e?.inspectRouterState(t),this.done=new Promise(t=>{this.resolveDone=t});try{this.initial=this.encodeValue({loaderData:t.loaderData,actionData:t.actionData,errors:o(t.errors)}),this.initialized=!0,this.wake()}catch(t){throw this.cancel(),t}}promiseId=t=>{if(t instanceof Promise){let e=this.identities.get(t);if(void 0===e){e=this.nextId++,this.identities.set(t,e),this.pending.set(e,{settled:!1});const i=e;t.then(t=>this.settle(i,t,!1),t=>this.settle(i,t,!0)),this.aborted&&this.settle(e,new Error("SSR loader/action promise aborted before it settled."),!0)}return[e]}return!1};encodeValue(i){return t(i,{SSRBPromise:this.promiseId,SSRBError:t=>(t instanceof Error||e(t))&&Object.entries(r(t,Boolean(this.diagnostics))),SSRBObject:t=>Boolean(t&&"object"==typeof t&&Object.hasOwn(t,"__proto__"))&&Object.entries(t),SSRBUndefined:t=>"function"==typeof t||"symbol"==typeof t||Boolean(t&&"object"==typeof t&&!Array.isArray(t)&&![Object.prototype,null,Date.prototype,Map.prototype,Set.prototype,RegExp.prototype,Promise.prototype,Error.prototype].includes(Object.getPrototypeOf(t)))})}settle(t,e,i){const o=this.pending.get(t);if(o&&!o.settled&&!this.stopped){o.settled=!0,i||this.diagnostics?.inspectStreamValue(e,t);try{const o=this.encodeValue(i?Object.assign(new Error("Streamed loader/action rejection"),r(e,Boolean(this.diagnostics))):e);this.frames.push(s([i?"reject":"resolve",t,o],this.nonce))}catch(e){const i=this.encodeValue(new Error(`Cannot serialize streamed value: ${String(e)}`));this.frames.push(s(["reject",t,i],this.nonce))}finally{this.pending.delete(t),this.wake()}}}wake(){this.notify?.(),this.notify=void 0,this.change=void 0,this.initialized&&!this.pending.size&&this.resolveDone()}get isDone(){return this.initialized&&!this.pending.size}changed(){return this.frames.length||this.isDone?Promise.resolve():this.change??=new Promise(t=>{this.notify=t})}take(){return this.frames.splice(0).join("")}state(t){const{initial:e}=this;return i("window.__staticRouterHydrationData = {__ssrBoostStream: true};",this.nonce,!0)+s(["init",e,t],this.nonce)}abort(){this.aborted=!0;let t=0;for(const[e,i]of this.pending)i.settled||(t++,this.settle(e,new Error("SSR loader/action promise aborted before it settled."),!0));t&&this.diagnostics?.streamAborted(t)}cancel(){this.stopped=!0,this.initialized=!0,this.pending.clear(),this.frames.length=0,this.wake()}}export{n as default,r as errorProperties};
|
|
2
|
+
//# sourceMappingURL=data-stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-stream.js","sources":["../../src/core/data-stream.ts"],"sourcesContent":[null],"names":["errorProperties","reason","diagnostics","value","isResponse","isRouteErrorResponse","isDataError","type","status","init","statusText","properties","message","String","name","Object","assign","data","internal","stack","DataStream","nonce","initial","done","resolveDone","notify","change","identities","WeakMap","pending","Map","frames","initialized","stopped","aborted","nextId","constructor","context","this","inspectRouterState","Promise","resolve","encodeValue","loaderData","actionData","errors","serializeErrors","wake","error","cancel","promiseId","id","get","undefined","set","settled","then","result","settle","Error","stringify","SSRBPromise","SSRBError","entries","Boolean","SSRBObject","item","hasOwn","SSRBUndefined","Array","isArray","prototype","Date","Set","RegExp","includes","getPrototypeOf","rejected","inspectStreamValue","payload","push","streamScript","delete","size","isDone","changed","length","take","splice","join","state","isEarly","script","abort","count","streamAborted","clear"],"mappings":"oLAYA,MAAMA,EAAkB,CAACC,EAAiBC,KACxC,MAAMC,EAAQF,EAQRG,EAAaC,EAAqBJ,GAClCK,EAA8B,yBAAhBH,GAAOI,KACrBC,EAASJ,EAAaH,EAAOO,OAASL,GAAOM,MAAMD,OACnDE,EAAaN,EAAaH,EAAOS,WAAaP,GAAOM,MAAMC,WAC3DC,EAAsC,CAC1CC,QACET,GAAOS,UACNR,GAAcE,EACXI,GAAc,qBAAqBF,GAAU,OAC7CK,OAAOZ,IACba,KAAMX,GAAOW,MAAQ,SAgBvB,OAbIV,GAAcE,IAChBS,OAAOC,OAAOL,EAAY,CACxBH,OAAQA,GAAU,IAClBE,WAAYA,GAAc,GAC1BO,KAAMd,GAAOc,KACbC,UAAU,IAIVhB,GAAeC,GAAOgB,QACxBR,EAAWQ,MAAQhB,EAAMgB,OAGpBR,GAQT,MAAMS,EAgBiBlB,YACAmB,MAhBLC,QACAC,KACNC,YACAC,OACAC,OACSC,WAAa,IAAIC,QACjBC,QAAU,IAAIC,IACdC,OAAmB,GAC5BC,aAAc,EACdC,SAAU,EACVC,SAAU,EACVC,OAAS,EAEnB,WAAAC,CACEC,EACmBnC,EACAmB,GADAiB,KAAApC,YAAAA,EACAoC,KAAAjB,MAA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AC,OAAQ3D,EAASqE,GAAUrD,KAAKjB,MAEzF,CAGO,KAAAwE,GACLvD,KAAKJ,SAAU,EACf,IAAI4D,EAAQ,EAEZ,IAAK,MAAO3C,EAAIhD,KAAUmC,KAAKT,QACxB1B,EAAMoD,UACTuC,IACAxD,KAAKoB,OAAOP,EAAI,IAAIQ,MAAM,yDAAyD,IAInFmC,GACFxD,KAAKpC,aAAa6F,cAAcD,EAEpC,CAGO,MAAA7C,GACLX,KAAKL,SAAU,EACfK,KAAKN,aAAc,EACnBM,KAAKT,QAAQmE,QACb1D,KAAKP,OAAOuD,OAAS,EACrBhD,KAAKS,MACP"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Track tag, comment and raw-text boundaries across arbitrary React byte chunks.
|
|
3
|
+
* Data scripts may be inserted only after a complete tag, never in a split token
|
|
4
|
+
* or script/style body. This observer neither buffers HTML nor reads ahead.
|
|
5
|
+
*/
|
|
6
|
+
declare const htmlBoundary: () => ((chunk: Uint8Array) => boolean);
|
|
7
|
+
export default htmlBoundary;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const t=()=>{let t="text",e="",r="",o="";return s=>{for(const n of s){const s=String.fromCharCode(n);"raw"===t?(e=(e+s).slice(-32),">"===s&&new RegExp(`</${o}\\s*>$`,"i").test(e)&&(t="text",e="",o="")):"comment"===t?(e=(e+s).slice(-3),"--\x3e"===e&&(t="text",e="")):"tag"===t?(e.length<32&&(e+=s),"\x3c!--"===e?t="comment":r?s===r&&(r=""):'"'===s||"'"===s?r=s:">"===s&&(o=/^<(script|style|textarea|title)(?:\s|>)/i.exec(e)?.[1]?.toLowerCase()??"",t=o?"raw":"text",e="")):"<"===s&&(t="tag",e="<")}return"text"===t&&62===s[s.length-1]}};export{t as default};
|
|
2
|
+
//# sourceMappingURL=html-boundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-boundary.js","sources":["../../src/core/html-boundary.ts"],"sourcesContent":[null],"names":["htmlBoundary","mode","token","quote","raw","chunk","byte","char","String","fromCharCode","slice","RegExp","test","length","exec","toLowerCase"],"mappings":"AAKA,MAAMA,EAAe,KACnB,IAAIC,EAA2C,OAC3CC,EAAQ,GACRC,EAAQ,GACRC,EAAM,GAEV,OAAQC,IACN,IAAK,MAAMC,KAAQD,EAAO,CACxB,MAAME,EAAOC,OAAOC,aAAaH,GAEpB,QAATL,GACFC,GAASA,EAAQK,GAAMG,OAAM,IAEhB,MAATH,GAAgB,IAAII,OAAO,KAAKP,UAAa,KAAKQ,KAAKV,KACzDD,EAAO,OACPC,EAAQ,GACRE,EAAM,KAEU,YAATH,GACTC,GAASA,EAAQK,GAAMG,OAAM,GAEf,WAAVR,IACFD,EAAO,OACPC,EAAQ,KAEQ,QAATD,GACLC,EAAMW,OAAS,KACjBX,GAASK,GAGG,YAAVL,EACFD,EAAO,UACEE,EACLI,IAASJ,IACXA,EAAQ,IAEQ,MAATI,GAAyB,MAATA,EACzBJ,EAAQI,EACU,MAATA,IACTH,EAAM,2CAA2CU,KAAKZ,KAAS,IAAIa,eAAiB,GACpFd,EAAOG,EAAM,MAAQ,OACrBF,EAAQ,KAEQ,MAATK,IACTN,EAAO,MACPC,EAAQ,IAEZ,CAEA,MAAgB,SAATD,GAA+C,KAA5BI,EAAMA,EAAMQ,OAAS"}
|
package/core/render.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export interface ISsrRequestContext<TAppProps = Record<string, any>> {
|
|
|
29
29
|
serverContext?: IServerContext;
|
|
30
30
|
}
|
|
31
31
|
export interface IRenderStreamOptions {
|
|
32
|
+
nonce?: string;
|
|
33
|
+
bootstrapScriptContent?: string;
|
|
32
34
|
onError: (error: unknown) => void;
|
|
33
35
|
signal: AbortSignal;
|
|
34
36
|
}
|
|
@@ -58,6 +60,10 @@ export interface ICoreRenderParams<TAppProps = Record<string, any>> {
|
|
|
58
60
|
renderToStream: TRenderToStream;
|
|
59
61
|
}
|
|
60
62
|
export interface ICoreRenderOptions<TAppProps = Record<string, any>> {
|
|
63
|
+
/** Hydrate the parsed shell while deferred boundaries are still pending. */
|
|
64
|
+
hydration?: 'early' | 'footer';
|
|
65
|
+
nonce?: string;
|
|
66
|
+
bootstrapScriptContent?: string;
|
|
61
67
|
/**
|
|
62
68
|
* React rendering deadline in milliseconds, starting after router preparation.
|
|
63
69
|
*/
|
|
@@ -100,5 +106,5 @@ export interface ICoreRenderOptions<TAppProps = Record<string, any>> {
|
|
|
100
106
|
/**
|
|
101
107
|
* Coordinate router queries, React rendering and the final Fetch response.
|
|
102
108
|
*/
|
|
103
|
-
declare const render: <TAppProps>({ createApp, handler, renderToStream }: ICoreRenderParams<TAppProps>, context: ISsrRequestContext<TAppProps>, { abortDelay, getState, onError, onResponse, onRouterReady, onShellError, onShellReady, prepare, routerRequestContext, }: ICoreRenderOptions<TAppProps>, executionContext?: ISsrExecutionContext) => Promise<Response>;
|
|
109
|
+
declare const render: <TAppProps>({ createApp, handler, renderToStream }: ICoreRenderParams<TAppProps>, context: ISsrRequestContext<TAppProps>, { abortDelay, getState, hydration, nonce, bootstrapScriptContent, onError, onResponse, onRouterReady, onShellError, onShellReady, prepare, routerRequestContext, }: ICoreRenderOptions<TAppProps>, executionContext?: ISsrExecutionContext) => Promise<Response>;
|
|
104
110
|
export default render;
|
package/core/render.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import{createStaticRouter as t,StaticRouterProvider as r}from"react-router";import
|
|
1
|
+
import e from"react";import{createStaticRouter as t,StaticRouterProvider as r}from"react-router";import o from"../constants/stream-error.js";import{ServerProvider as s}from"../context/server.js";import n from"./compose-html.js";import a from"./data-stream.js";import c from"./head-response.js";import{mergeResponseHeaders as d}from"./headers.js";import i from"./transform-html.js";import l from"../helpers/build-custom-state.js";import m from"../helpers/obtain-stream-error.js";const u="text/html",h="Content-Type",p=async({createApp:p,handler:x,renderToStream:f},w,{abortDelay:y=15e3,getState:R,hydration:S="footer",nonce:C,bootstrapScriptContent:E,onError:b,onResponse:g,onRouterReady:q,onShellError:v,onShellReady:j,prepare:T,routerRequestContext:A},B)=>{const H=await x.query(w.request,{requestContext:A??w});if(H instanceof Response)return c(w.request,d(H,w.response.headers));w.routerContext=H;const _=new a(H,w.diagnostics,C);try{await(T?.({context:w,executionContext:B}))}catch(e){throw _.cancel(),e}const{isStream:D=!0}=await(q?.({context:w}))??{};w.isStream=D,w.serverContext={basename:w.routerContext.basename,isServer:!0,response:null};const L=t(x.dataRoutes,w.routerContext),k=e.createElement(s,{context:w.serverContext},p(e.createElement(r,{router:L,context:w.routerContext,hydrate:!1}),w)),P=new AbortController;let I,$,z=!1;const F=()=>K(w.request.signal.reason),G=()=>clearTimeout(M),J=()=>{G(),w.request.signal.removeEventListener("abort",F)},K=e=>{z||(z=!0,I=e,J(),w.didError??=o.RenderCancel,_.abort(),P.abort(e),$?.abort(e))},M=setTimeout(()=>{w.didError=o.RenderTimeout,K()},y);w.request.signal.aborted?K(w.request.signal.reason):w.request.signal.addEventListener("abort",F,{once:!0});try{$=await f(k,{nonce:C,bootstrapScriptContent:"early"===S&&D?`(window.__ssrBoostStream = window.__ssrBoostStream || []).push(["shell"]);${E??""};document.currentScript?.remove();`:E,onError:e=>{const t=m(e);!z||t.code!==o.RenderAborted&&e!==P.signal.reason||(t.code=w.didError===o.RenderTimeout?o.RenderTimeout:o.RenderCancel);const{code:r}=t;w.didError??=r,b?.({context:w,error:t})},signal:P.signal}),z&&$.abort(I),Promise.all([$.allReady,_.done]).then(G,G),await(D?$.shellReady:Promise.all([$.allReady,_.done]))}catch(e){return K(e),await($?.stream.cancel(e).catch(()=>{})),((e,t,r)=>{const o=t instanceof Error?t:new Error(String(t)),s=r?.({context:e,error:o})||"<!doctype html><p>Internal Server Error</p>",n=new Headers(e.response.headers);return n.set(h,u),new Response("HEAD"===e.request.method?null:s,{headers:n,status:500})})(w,e,v)}try{const e=w.serverContext.response;if(e&&(N=e,Boolean(N&&N.status>=300&&N.status<400&&N.headers.has("Location"))))return K(),await $.stream.cancel().catch(()=>{}),c(w.request,d(e,w.response.headers));const{header:t,footer:r,headers:o,status:s}=((e,{getState:t,onShellReady:r,hydration:o,nonce:s},n)=>{const a=e.serverContext.response;e.response.status=a?.status??e.response.status??e.routerContext.statusCode??200,e.response.headers.has(h)||e.response.headers.set(h,u);const c=r?.({context:e})??{},d="early"===o&&e.isStream,i=l(t?.({context:e}),e.diagnostics,s,Boolean(d));let m=c.header||e.html.header;const p=c.footer||e.html.footer;e.diagnostics?.inspectShell({header:m,footer:p});let x=p;return d?m+=i+n.state(!0):x=i+n.state(!1)+n.take()+x,{header:m,footer:x,headers:new Headers(e.response.headers),status:e.response.status}})(w,{getState:R,onShellReady:j,hydration:S,nonce:C},_);if("HEAD"===w.request.method||[204,205,304].includes(s))return K(),await $.stream.cancel().catch(()=>{}),new Response(null,{headers:o,status:s});const a=n(t,$.stream,r,K,J,_),m=i(a,g?(e,t)=>g({context:w,html:e,isEnd:t}):void 0,w.diagnostics);return $.start(),new Response(m,{headers:o,status:s})}catch(e){throw K(e),$.stream.locked||await $.stream.cancel(e).catch(()=>{}),e}var N};export{p as default};
|
|
2
2
|
//# sourceMappingURL=render.js.map
|
package/core/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sources":["../../src/core/render.tsx"],"sourcesContent":[null],"names":["HTML_CONTENT_TYPE","CONTENT_TYPE","render","async","createApp","handler","renderToStream","context","abortDelay","getState","onError","onResponse","onRouterReady","onShellError","onShellReady","prepare","routerRequestContext","executionContext","queried","query","request","requestContext","Response","headResponse","mergeResponseHeaders","response","headers","routerContext","isStream","serverContext","basename","isServer","router","createStaticRouter","dataRoutes","node","React","createElement","ServerProvider","StaticRouterProvider","hydrate","renderController","AbortController","abortReason","output","hasAborted","onRequestAbort","abort","signal","reason","clearAbortTimer","clearTimeout","abortTimer","cleanup","removeEventListener","didError","StreamError","RenderCancel","setTimeout","RenderTimeout","aborted","addEventListener","once","
|
|
1
|
+
{"version":3,"file":"render.js","sources":["../../src/core/render.tsx"],"sourcesContent":[null],"names":["HTML_CONTENT_TYPE","CONTENT_TYPE","render","async","createApp","handler","renderToStream","context","abortDelay","getState","hydration","nonce","bootstrapScriptContent","onError","onResponse","onRouterReady","onShellError","onShellReady","prepare","routerRequestContext","executionContext","queried","query","request","requestContext","Response","headResponse","mergeResponseHeaders","response","headers","routerContext","dataStream","DataStream","diagnostics","error","cancel","isStream","serverContext","basename","isServer","router","createStaticRouter","dataRoutes","node","React","createElement","ServerProvider","StaticRouterProvider","hydrate","renderController","AbortController","abortReason","output","hasAborted","onRequestAbort","abort","signal","reason","clearAbortTimer","clearTimeout","abortTimer","cleanup","removeEventListener","didError","StreamError","RenderCancel","setTimeout","RenderTimeout","aborted","addEventListener","once","streamError","obtainStreamError","code","RenderAborted","Promise","all","allReady","done","then","shellReady","stream","catch","shellError","Error","String","html","Headers","set","method","status","createShellErrorResponse","serverResponse","Boolean","has","header","footer","statusCode","shell","isEarly","customState","buildCustomState","shellFooter","inspectShell","state","take","prepareHtmlResponse","includes","body","composeHtml","transformed","transformHtml","isEnd","undefined","start","locked"],"mappings":"8dAgIA,MAAMA,EAAoB,YACpBC,EAAe,eA8EfC,EAASC,OACXC,YAAWC,UAASC,kBACtBC,GAEEC,aAAa,KACbC,WACAC,YAAY,SACZC,QACAC,yBACAC,UACAC,aACAC,gBACAC,eACAC,eACAC,UACAC,wBAEFC,KAEA,MAAMC,QAAgBhB,EAAQiB,MAAMf,EAAQgB,QAAS,CACnDC,eAAgBL,GAAwBZ,IAG1C,GAAIc,aAAmBI,SACrB,OAAOC,EAAanB,EAAQgB,QAASI,EAAqBN,EAASd,EAAQqB,SAASC,UAGtFtB,EAAQuB,cAAgBT,EACxB,MAAMU,EAAa,IAAIC,EAAWX,EAASd,EAAQ0B,YAAatB,GAEhE,UACQO,IAAU,CAAEX,UAASa,qBAC7B,CAAE,MAAOc,GAEP,MADAH,EAAWI,SACLD,CACR,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EJ,CAAE,MAAOxD,GAOP,MANAqB,EAAMrB,GAEDkB,EAAO6B,OAAOkC,cACX/D,EAAO6B,OAAO9C,OAAOD,GAAOgD,MAAM,QAGpChD,CACR,CA/RiB,IAACN"}
|
package/core/script.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Escape an attribute independently of the JavaScript string escaping rules. */
|
|
2
|
+
declare const script: (content: string, nonce?: string, isTemporary?: boolean) => string;
|
|
3
|
+
/** Queue frames even when the async browser entry has not executed yet. */
|
|
4
|
+
declare const streamScript: (frame: unknown, nonce?: string) => string;
|
|
5
|
+
export { streamScript };
|
|
6
|
+
export default script;
|
package/core/script.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import r from"../helpers/html-escape.js";const e=(r,e,s=!1)=>`<script async${void 0===e?"":` nonce="${e.replace(/[&<>"']/g,r=>`&#${r.charCodeAt(0)};`)}"`}>${r}${s?"document.currentScript?.remove();":""}<\/script>`,s=(s,t)=>e(`(window.__ssrBoostStream = window.__ssrBoostStream || []).push(${r(JSON.stringify(s))});`,t,!0);export{e as default,s as streamScript};
|
|
2
|
+
//# sourceMappingURL=script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script.js","sources":["../../src/core/script.ts"],"sourcesContent":[null],"names":["script","content","nonce","isTemporary","undefined","replace","char","charCodeAt","streamScript","frame","htmlEscape","JSON","stringify"],"mappings":"yCAGA,MAAMA,EAAS,CAACC,EAAiBC,EAAgBC,GAAc,IAMtD,qBAJKC,IAAVF,EACI,GACA,WAAWA,EAAMG,QAAQ,WAAaC,GAAS,KAAKA,EAAKC,WAAW,aAEtCN,IAAUE,EAAc,oCAAsC,eAI9FK,EAAe,CAACC,EAAgBP,IACpCF,EACE,kEAAkEU,EAAWC,KAAKC,UAAUH,QAC5FP,GACA"}
|
package/edge/render-to-stream.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react-dom/server";const r=async()=>e.renderToReadableStream??(await(import("react-dom/server.browser"))).renderToReadableStream,
|
|
1
|
+
import*as e from"react-dom/server";const r=async()=>e.renderToReadableStream??(await(import("react-dom/server.browser"))).renderToReadableStream,t=async(e,{onError:t,signal:a,nonce:o,bootstrapScriptContent:n})=>{const s=new AbortController;let l;const c=new Promise((e,r)=>{l=r}),i=()=>{const{reason:e}=a;s.abort(e);const{reason:r}=s.signal;l(r instanceof Error?r:new Error(String(r)))};let d;a.aborted?i():a.addEventListener("abort",i,{once:!0});try{d=await Promise.race([r().then(r=>r(e,{onError:t,signal:s.signal,nonce:o,bootstrapScriptContent:n})),c])}catch(e){a.removeEventListener("abort",i);const r=Promise.reject(e);return r.catch(()=>{}),{allReady:r,abort:e=>s.abort(e),shellReady:r,start:()=>{},stream:new ReadableStream}}const b=()=>a.removeEventListener("abort",i);return d.allReady.then(b,b),{allReady:d.allReady,abort:e=>s.abort(e),shellReady:Promise.resolve(),start:()=>{},stream:d}};export{t as default};
|
|
2
2
|
//# sourceMappingURL=render-to-stream.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-to-stream.js","sources":["../../src/edge/render-to-stream.ts"],"sourcesContent":[null],"names":["getRenderer","async","ReactDOMServer","renderToReadableStream","renderToStream","node","onError","signal","controller","AbortController","rejectPending","pendingAbort","Promise","_","reject","abort","reason","signalReason","Error","String","stream","aborted","addEventListener","once","race","then","error","removeEventListener","shellError","catch","allReady","shellReady","start","ReadableStream","removeAbortListener","resolve"],"mappings":"mCAMA,MAAMA,EAAcC,SAClBC,EAAeC,sCACD,8BAA6BA,uBAKvCC,EAAkCH,
|
|
1
|
+
{"version":3,"file":"render-to-stream.js","sources":["../../src/edge/render-to-stream.ts"],"sourcesContent":[null],"names":["getRenderer","async","ReactDOMServer","renderToReadableStream","renderToStream","node","onError","signal","nonce","bootstrapScriptContent","controller","AbortController","rejectPending","pendingAbort","Promise","_","reject","abort","reason","signalReason","Error","String","stream","aborted","addEventListener","once","race","then","error","removeEventListener","shellError","catch","allReady","shellReady","start","ReadableStream","removeAbortListener","resolve"],"mappings":"mCAMA,MAAMA,EAAcC,SAClBC,EAAeC,sCACD,8BAA6BA,uBAKvCC,EAAkCH,MACtCI,GACEC,UAASC,SAAQC,QAAOC,6BAE1B,MAAMC,EAAa,IAAIC,gBACvB,IAAIC,EAKJ,MAAMC,EAAe,IAAIC,QAAe,CAACC,EAAGC,KAC1CJ,EAAgBI,IAMZC,EAAQ,KACZ,MAAQC,OAAQC,GAAiBZ,EAEjCG,EAAWO,MAAME,GAEjB,MAAMD,OAAEA,GAAWR,EAAWH,OAE9BK,EAAcM,aAAkBE,MAAQF,EAAS,IAAIE,MAAMC,OAAOH,MASpE,IAAII,EANAf,EAAOgB,QACTN,IAEAV,EAAOiB,iBAAiB,QAASP,EAAO,CAAEQ,MAAM,IAKlD,IACEH,QAAeR,QAAQY,KAAK,CAC1B1B,IAAc2B,KAAMxB,GAClBA,EAAuBE,EAAM,CAC3BC,UACAC,OAAQG,EAAWH,OACnBC,QACAC,4BAGJI,GAEJ,CAAE,MAAOe,GACPrB,EAAOsB,oBAAoB,QAASZ,GACpC,MAAMa,EAAahB,QAAQE,OAAOY,GAIlC,OAFKE,EAAWC,MAAM,QAEf,CACLC,SAAUF,EAKVb,MAAQC,GAAWR,EAAWO,MAAMC,GACpCe,WAAYH,EAKZI,MAAO,OACPZ,OAAQ,IAAIa,eAEhB,CAKA,MAAMC,EAAsB,IAAY7B,EAAOsB,oBAAoB,QAASZ,GAI5E,OAFKK,EAAOU,SAASL,KAAKS,EAAqBA,GAExC,CACLJ,SAAUV,EAAOU,SAKjBf,MAAQC,GAAWR,EAAWO,MAAMC,GACpCe,WAAYnB,QAAQuB,UAKpBH,MAAO,OACPZ"}
|
|
@@ -2,5 +2,5 @@ import type Diagnostics from '../services/diagnostics.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Build custom state
|
|
4
4
|
*/
|
|
5
|
-
declare function buildCustomState(initState?: Record<string, Record<string, any>> | void, diagnostics?: Diagnostics): string;
|
|
5
|
+
declare function buildCustomState(initState?: Record<string, Record<string, any>> | void, diagnostics?: Diagnostics, nonce?: string, isTemporary?: boolean): string;
|
|
6
6
|
export default buildCustomState;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"./html-escape.js";function e(e,
|
|
1
|
+
import t from"../core/script.js";import r from"./html-escape.js";function e(e,i,n,s=!1){i?.inspectState(e);return Object.entries(e??{}).map(([e,i])=>{if(!e||!i||!Object.keys(i||{}).length)return"";const o=r(JSON.stringify(JSON.stringify(i))),c=/^[A-Za-z_$][\w$]*$/.test(e)?`.${e}`:`[${r(JSON.stringify(e))}]`;return t(`window${c} = JSON.parse(${o});`,n,s)}).join("").trim()}export{e as default};
|
|
2
2
|
//# sourceMappingURL=build-custom-state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-custom-state.js","sources":["../../src/helpers/build-custom-state.ts"],"sourcesContent":[null],"names":["buildCustomState","initState","diagnostics","inspectState","Object","entries","map","key","state","keys","length","json","htmlEscape","JSON","stringify","test","join","trim"],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-custom-state.js","sources":["../../src/helpers/build-custom-state.ts"],"sourcesContent":[null],"names":["buildCustomState","initState","diagnostics","nonce","isTemporary","inspectState","Object","entries","map","key","state","keys","length","json","htmlEscape","JSON","stringify","property","test","script","join","trim"],"mappings":"iEAOA,SAASA,EACPC,EACAC,EACAC,EACAC,GAAc,GAEdF,GAAaG,aAAaJ,GAe1B,OAbqBK,OAAOC,QAAQN,GAAa,CAAA,GAAIO,IAAI,EAAEC,EAAKC,MAC9D,IAAKD,IAAQC,IAAUJ,OAAOK,KAAKD,GAAS,IAAIE,OAC9C,MAAO,GAGT,MAAMC,EAAOC,EAAWC,KAAKC,UAAUD,KAAKC,UAAUN,KAChDO,EAAW,qBAAqBC,KAAKT,GACvC,IAAIA,IACJ,IAAIK,EAAWC,KAAKC,UAAUP,OAElC,OAAOU,EAAO,SAASF,kBAAyBJ,MAAUV,EAAOC,KAG/CgB,KAAK,IAAIC,MAC/B"}
|
|
@@ -3,5 +3,5 @@ import type Diagnostics from '../services/diagnostics.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Build router state
|
|
5
5
|
*/
|
|
6
|
-
declare function buildRouterState(context: StaticHandlerContext, diagnostics?: Diagnostics): string;
|
|
6
|
+
declare function buildRouterState(context: StaticHandlerContext, diagnostics?: Diagnostics, nonce?: string): string;
|
|
7
7
|
export default buildRouterState;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"./html-escape.js";import
|
|
1
|
+
import r from"../core/script.js";import t from"./html-escape.js";import a from"./serialize-errors.js";function o(o,e,i){e?.inspectRouterState(o);const{loaderData:s,actionData:n,errors:c}=o,p={loaderData:s,actionData:n,errors:a(c)},f=t(JSON.stringify(JSON.stringify(p)));return r(`window.__staticRouterHydrationData = JSON.parse(${f});`,i)}export{o as default};
|
|
2
2
|
//# sourceMappingURL=build-router-state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-router-state.js","sources":["../../src/helpers/build-router-state.ts"],"sourcesContent":[null],"names":["buildRouterState","context","diagnostics","inspectRouterState","loaderData","actionData","errors","routerState","serializeErrors","htmlEscape","JSON","stringify"],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-router-state.js","sources":["../../src/helpers/build-router-state.ts"],"sourcesContent":[null],"names":["buildRouterState","context","diagnostics","nonce","inspectRouterState","loaderData","actionData","errors","routerState","serializeErrors","json","htmlEscape","JSON","stringify","script"],"mappings":"sGASA,SAASA,EACPC,EACAC,EACAC,GAEAD,GAAaE,mBAAmBH,GAEhC,MAAMI,WAAEA,EAAUC,WAAEA,EAAUC,OAAEA,GAAWN,EACrCO,EAAc,CAClBH,aACAC,aACAC,OAAQE,EAAgBF,IAEpBG,EAAOC,EAAWC,KAAKC,UAAUD,KAAKC,UAAUL,KAEtD,OAAOM,EAAO,mDAAmDJ,MAAUP,EAC7E"}
|
package/helpers/is-route-file.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const
|
|
1
|
+
const s=s=>/(?:\blazy|['"]lazy['"]\s*\]?)\s*:\s*(?:async\s*)?(?:function|\([^)]*\)\s*=>)/s.test(s)||/{.*(?:path|index)\s*:.*(?:Component|element)\s*:|{.*(?:Component|element)\s*:.*(?:path|index)\s*:/s.test(s);export{s as default};
|
|
2
2
|
//# sourceMappingURL=is-route-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-route-file.js","sources":["../../src/helpers/is-route-file.ts"],"sourcesContent":[null],"names":["isRoutesFile","code","test"],"mappings":"AAGA,MAAMA,EAAgBC,GACpB
|
|
1
|
+
{"version":3,"file":"is-route-file.js","sources":["../../src/helpers/is-route-file.ts"],"sourcesContent":[null],"names":["isRoutesFile","code","test"],"mappings":"AAGA,MAAMA,EAAgBC,GACpB,gFAAgFC,KAAKD,IACrF,qGAAqGC,KACnGD"}
|
package/node/render-to-stream.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{PassThrough as r,Readable as e}from"node:stream";import{renderToPipeableStream as t}from"react-dom/server";const o=(o,n)=>{const a=new r,s=e.toWeb(a,{strategy:{highWaterMark:a.readableHighWaterMark,size:r=>r.byteLength}});let i,l,c,d;const
|
|
1
|
+
import{PassThrough as r,Readable as e}from"node:stream";import{renderToPipeableStream as t}from"react-dom/server";const o=(o,n)=>{const a=new r,s=e.toWeb(a,{strategy:{highWaterMark:a.readableHighWaterMark,size:r=>r.byteLength}});let i,l,c,d;const b=new Promise((r,e)=>{i=e,c=r}),g=new Promise((r,e)=>{l=e,d=r});b.catch(()=>{}),g.catch(()=>{});let h=!1,m=!1;const p=t(o,{nonce:n.nonce,bootstrapScriptContent:n.bootstrapScriptContent,onAllReady:c,onError:n.onError,onShellError:r=>{const e=r instanceof Error?r:new Error(String(r));h=!0,i(e),l(e)},onShellReady:()=>{h=!0,d()}}),E=r=>{if(!m){if(m=!0,!h){h=!0;const e=r instanceof Error?r:new Error("string"==typeof r?r:"Render aborted");l(e),i(e)}p.abort(r)}},f=()=>E(n.signal.reason),y=()=>n.signal.removeEventListener("abort",f);n.signal.aborted?f():n.signal.addEventListener("abort",f,{once:!0}),b.then(y,y);let w=!1;return{allReady:b,abort:E,shellReady:g,start:()=>{w||(w=!0,p.pipe(a))},stream:s}};export{o as default};
|
|
2
2
|
//# sourceMappingURL=render-to-stream.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-to-stream.js","sources":["../../src/node/render-to-stream.ts"],"sourcesContent":[null],"names":["renderToStream","node","options","destination","PassThrough","stream","Readable","toWeb","strategy","highWaterMark","readableHighWaterMark","size","chunk","byteLength","rejectAll","rejectShell","resolveAll","resolveShell","allReady","Promise","resolve","reject","shellReady","catch","hasShellSettled","hasAborted","rendered","renderToPipeableStream","onAllReady","onError","onShellError","error","shellError","Error","String","onShellReady","abort","reason","onAbort","signal","cleanup","removeEventListener","aborted","addEventListener","once","then","hasStarted","start","pipe"],"mappings":"kHAOA,MAAMA,EAAkC,CAACC,EAAMC,KAC7C,MAAMC,EAAc,IAAIC,EAClBC,EAASC,EAASC,MAAMJ,EAAa,CACzCK,SAAU,CACRC,cAAeN,EAAYO,sBAK3BC,KAAOC,GAAsBA,EAAMC,cAGvC,IAAIC,EACAC,EACAC,EACAC,EAKJ,MAAMC,EAAW,IAAIC,QAAc,CAACC,EAASC,KAC3CP,EAAYO,EACZL,EAAaI,IAMTE,EAAa,IAAIH,QAAc,CAACC,EAASC,KAC7CN,EAAcM,EACdJ,EAAeG,IAGZF,EAASK,MAAM,QACfD,EAAWC,MAAM,QAEtB,IAAIC,GAAkB,EAClBC,GAAa,EACjB,MAAMC,EAAWC,EAAuB1B,EAAM,CAC5C2B,
|
|
1
|
+
{"version":3,"file":"render-to-stream.js","sources":["../../src/node/render-to-stream.ts"],"sourcesContent":[null],"names":["renderToStream","node","options","destination","PassThrough","stream","Readable","toWeb","strategy","highWaterMark","readableHighWaterMark","size","chunk","byteLength","rejectAll","rejectShell","resolveAll","resolveShell","allReady","Promise","resolve","reject","shellReady","catch","hasShellSettled","hasAborted","rendered","renderToPipeableStream","nonce","bootstrapScriptContent","onAllReady","onError","onShellError","error","shellError","Error","String","onShellReady","abort","reason","onAbort","signal","cleanup","removeEventListener","aborted","addEventListener","once","then","hasStarted","start","pipe"],"mappings":"kHAOA,MAAMA,EAAkC,CAACC,EAAMC,KAC7C,MAAMC,EAAc,IAAIC,EAClBC,EAASC,EAASC,MAAMJ,EAAa,CACzCK,SAAU,CACRC,cAAeN,EAAYO,sBAK3BC,KAAOC,GAAsBA,EAAMC,cAGvC,IAAIC,EACAC,EACAC,EACAC,EAKJ,MAAMC,EAAW,IAAIC,QAAc,CAACC,EAASC,KAC3CP,EAAYO,EACZL,EAAaI,IAMTE,EAAa,IAAIH,QAAc,CAACC,EAASC,KAC7CN,EAAcM,EACdJ,EAAeG,IAGZF,EAASK,MAAM,QACfD,EAAWC,MAAM,QAEtB,IAAIC,GAAkB,EAClBC,GAAa,EACjB,MAAMC,EAAWC,EAAuB1B,EAAM,CAC5C2B,MAAO1B,EAAQ0B,MACfC,uBAAwB3B,EAAQ2B,uBAChCC,WAAYd,EACZe,QAAS7B,EAAQ6B,QAKjBC,aAAeC,IACb,MAAMC,EAAaD,aAAiBE,MAAQF,EAAQ,IAAIE,MAAMC,OAAOH,IAErET,GAAkB,EAClBV,EAAUoB,GACVnB,EAAYmB,IAMdG,aAAc,KACZb,GAAkB,EAClBP,OAOEqB,EAASC,IACb,IAAId,EAAJ,CASA,GALAA,GAAa,GAKRD,EAAiB,CACpBA,GAAkB,EAClB,MACMS,EAAQM,aAAkBJ,MAAQI,EAAS,IAAIJ,MADnB,iBAAXI,EAAsBA,EAAS,kBAGtDxB,EAAYkB,GACZnB,EAAUmB,EACZ,CAEAP,EAASY,MAAMC,EAhBf,GAsBIC,EAAU,IAAYF,EAAMpC,EAAQuC,OAAOF,QAK3CG,EAAU,IAAYxC,EAAQuC,OAAOE,oBAAoB,QAASH,GAEpEtC,EAAQuC,OAAOG,QACjBJ,IAEAtC,EAAQuC,OAAOI,iBAAiB,QAASL,EAAS,CAAEM,MAAM,IAGvD5B,EAAS6B,KAAKL,EAASA,GAC5B,IAAIM,GAAa,EAEjB,MAAO,CACL9B,WACAoB,QACAhB,aAKA2B,MAAO,KACAD,IACHA,GAAa,EACbtB,EAASwB,KAAK/C,KAGlBE"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lomray/vite-ssr-boost",
|
|
3
|
-
"version": "8.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "8.3.0-beta.2",
|
|
4
|
+
"description": "SSR and streaming for existing Vite + React Router apps in Data mode, without Framework mode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./node/production": {
|
|
@@ -32,7 +32,12 @@
|
|
|
32
32
|
"vite",
|
|
33
33
|
"plugin",
|
|
34
34
|
"react",
|
|
35
|
-
"ssr"
|
|
35
|
+
"ssr",
|
|
36
|
+
"react-router",
|
|
37
|
+
"server-side-rendering",
|
|
38
|
+
"data-router",
|
|
39
|
+
"streaming",
|
|
40
|
+
"spa"
|
|
36
41
|
],
|
|
37
42
|
"publishConfig": {
|
|
38
43
|
"access": "public"
|
|
@@ -51,7 +56,7 @@
|
|
|
51
56
|
"build": "rollup -c",
|
|
52
57
|
"build:watch": "rollup -c -w",
|
|
53
58
|
"docs:dev": "vitepress dev docs",
|
|
54
|
-
"docs:build": "vitepress build docs",
|
|
59
|
+
"docs:build": "vitepress build docs && node scripts/build-llms.mjs",
|
|
55
60
|
"docs:preview": "vitepress preview docs",
|
|
56
61
|
"release": "npm run build && cd lib && npm publish",
|
|
57
62
|
"lint:check": "eslint . --max-warnings=0",
|
|
@@ -63,13 +68,18 @@
|
|
|
63
68
|
"test:edge:packed": "node scripts/test-packed-edge.mjs",
|
|
64
69
|
"test:bun": "bun scripts/test-bun.mjs",
|
|
65
70
|
"test:template": "npm run build && node scripts/test-template.mjs",
|
|
66
|
-
"test:coverage": "vitest run --coverage"
|
|
71
|
+
"test:coverage": "vitest run --coverage",
|
|
72
|
+
"test:browser": "playwright test --config playwright.config.mjs"
|
|
67
73
|
},
|
|
68
74
|
"dependencies": {
|
|
69
75
|
"chalk": "^6.0.0",
|
|
70
76
|
"commander": "^15.0.0",
|
|
77
|
+
"devalue": "^5.9.2",
|
|
78
|
+
"diff": "^9.0.0",
|
|
71
79
|
"hoist-non-react-statics": "^3.3.2",
|
|
72
|
-
"json5": "^2.2.3"
|
|
80
|
+
"json5": "^2.2.3",
|
|
81
|
+
"parse5": "^8.0.1",
|
|
82
|
+
"semver": "^7.8.5"
|
|
73
83
|
},
|
|
74
84
|
"optionalDependencies": {
|
|
75
85
|
"compression": "^1.8.1",
|
|
@@ -85,6 +95,7 @@
|
|
|
85
95
|
"@lomray/eslint-config": "^7.0.0",
|
|
86
96
|
"@lomray/eslint-config-react": "^7.0.0",
|
|
87
97
|
"@lomray/prettier-config": "^3.0.0",
|
|
98
|
+
"@playwright/test": "^1.63.0",
|
|
88
99
|
"@rollup/plugin-terser": "^1.0.0",
|
|
89
100
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
90
101
|
"@testing-library/react": "^16.3.3",
|
|
@@ -96,6 +107,7 @@
|
|
|
96
107
|
"@types/node": "^22.20.1",
|
|
97
108
|
"@types/react": "^19.2.18",
|
|
98
109
|
"@types/react-dom": "^19.2.7",
|
|
110
|
+
"@types/semver": "^7.8.0",
|
|
99
111
|
"@types/serve-static": "^2.2.0",
|
|
100
112
|
"@types/sinon": "^22.0.0",
|
|
101
113
|
"@vitest/coverage-v8": "^5.0.0",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{extname as
|
|
1
|
+
import{extname as s}from"node:path";import e from"../constants/plugin-name.js";import o from"../helpers/is-route-file.js";import r from"../services/parse-routes.js";function t(t={}){const{routesPath:n,isSSR:i=!1,isBuild:m=!1}=t;return{name:`${e}-normalize-route`,enforce:"pre",transform(e,t){const[u]=s(t).split("?"),p=!n||t.includes(n);if(!t.includes("node_modules")&&[".js",".jsx",".mjs",".ts",".tsx",".mts"].includes(u)&&p&&o(e))return{code:r.handleRoutes(e,i&&!m,t),map:{mappings:""}}}}}export{t as default};
|
|
2
2
|
//# sourceMappingURL=normalize-route.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-route.js","sources":["../../src/plugins/normalize-route.ts"],"sourcesContent":[null],"names":["ViteNormalizeRouterPlugin","options","routesPath","isSSR","isBuild","name","PLUGIN_NAME","enforce","transform","code","id","extName","extname","split","isRoutesPath","includes","isRoutesFile","ParseRoutes","handleRoutes","map","mappings"],"mappings":"qKAoBA,SAASA,EAA0BC,EAA0B,IAC3D,MAAMC,WAAEA,EAAUC,MAAEA,GAAQ,EAAKC,QAAEA,GAAU,GAAUH,EAEvD,MAAO,CACLI,KAAM,GAAGC,oBACTC,QAAS,MACT,SAAAC,CAAUC,EAAMC,GACd,MAAOC,GAAWC,EAAQF,GAAIG,MAAM,KAC9BC,GAAgBZ,GAAcQ,EAAGK,SAASb,GAEhD,IACEQ,EAAGK,SAAS,iBACX,CAAC,MAAO,OAAQ,MAAO,QAAQA,SAASJ,
|
|
1
|
+
{"version":3,"file":"normalize-route.js","sources":["../../src/plugins/normalize-route.ts"],"sourcesContent":[null],"names":["ViteNormalizeRouterPlugin","options","routesPath","isSSR","isBuild","name","PLUGIN_NAME","enforce","transform","code","id","extName","extname","split","isRoutesPath","includes","isRoutesFile","ParseRoutes","handleRoutes","map","mappings"],"mappings":"qKAoBA,SAASA,EAA0BC,EAA0B,IAC3D,MAAMC,WAAEA,EAAUC,MAAEA,GAAQ,EAAKC,QAAEA,GAAU,GAAUH,EAEvD,MAAO,CACLI,KAAM,GAAGC,oBACTC,QAAS,MACT,SAAAC,CAAUC,EAAMC,GACd,MAAOC,GAAWC,EAAQF,GAAIG,MAAM,KAC9BC,GAAgBZ,GAAcQ,EAAGK,SAASb,GAEhD,IACEQ,EAAGK,SAAS,iBACX,CAAC,MAAO,OAAQ,OAAQ,MAAO,OAAQ,QAAQA,SAASJ,IACxDG,GACAE,EAAaP,GAKhB,MAAO,CACLA,KAAMQ,EAAYC,aAChBT,EAEAN,IAAUC,EACVM,GAEFS,IAAK,CAAEC,SAAU,IAErB,EAEJ"}
|
package/services/build.d.ts
CHANGED
package/services/build.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import i from"node:child_process";import s from"node:fs";import t from"node:path";import e from"chalk";import{resolveConfig as o}from"vite";import r from"../cli/helpers/vite-reset-cache.js";import
|
|
1
|
+
import i from"node:child_process";import s from"node:fs";import t from"node:path";import e from"chalk";import{resolveConfig as o}from"vite";import r from"../cli/diagnostic-codes.js";import n from"../cli/helpers/vite-reset-cache.js";import l from"../helpers/create-focus-only.js";import{createDevMarker as a}from"../helpers/dev-marker.js";import c from"../helpers/plugin-config.js";import d from"../helpers/process-stop.js";import u from"./server-config.js";import h from"./ssr-manifest.js";class p{isProd;nodeEnv;buildDir;viteConfig;pluginConfig;params={mode:"",clientOptions:"",serverOptions:"",focusOnly:"app",isWatch:!1,isUnlockRobots:!1,isEject:!1,isServerless:!1,isNoWarnings:!1};abortController=null;runningBuild=[];hasPreviewModeExitListener=!1;diagnosticCodes=new Set;constructor(i){this.params={...this.params,...i}}async makeConfig(){const{mode:i}=this.params;this.viteConfig=await o({},"build",i,"production"),this.pluginConfig=c(this.viteConfig),this.buildDir=t.resolve(this.viteConfig.root,this.viteConfig.build.outDir),this.nodeEnv=process.env.NODE_ENV||"production",this.isProd="production"===this.nodeEnv}clearBuildFolder(){s.existsSync(this.buildDir)&&s.rmSync(this.buildDir,{recursive:!0})}getIsProd(){return this.isProd}getNodeEnv(){return this.nodeEnv}getRunningBuildNames(){return this.runningBuild.map(({name:i})=>i)}promisifyProcess(i,s=!1){const t=new Promise((t,e)=>{i.on("exit",i=>{t(i)}),i.on("close",i=>{t(i)}),i.on("error",i=>{e(i)}),s&&i.stderr?.on("data",i=>{const s=Buffer.from(i).toString();(s.includes("warning")||s.includes("WARNING"))&&t(1)})});i.stdout?.pipe(process.stdout),i.stderr?.pipe(process.stderr);for(const s of[i.stdout,i.stderr]){let i="";s?.on("data",s=>{const t=i+Buffer.from(s).toString();r.filter(i=>t.includes(i)).forEach(i=>this.diagnosticCodes.add(i)),i=t.slice(-80)})}return{promise:t,command:i}}buildManifest(){console.info(e.blue("Building routes manifest file"));const i=u.init({isProd:this.isProd,mode:this.params.mode},{root:this.viteConfig.root,clientFile:this.pluginConfig.clientFile});h.get(i,{buildDir:this.viteConfig.build.outDir,viteAliases:this.viteConfig.resolve.alias,basename:this.viteConfig.base,renderBuiltUrl:this.viteConfig?.experimental?.renderBuiltUrl}).buildRoutesManifest()}unlockRobots(){const i=`${this.buildDir}/client/robots.txt`;if(!s.existsSync(i))return void console.warn(`Failed to unlock robots.txt, file not exist: ${i}`);const t=s.readFileSync(i,{encoding:"utf-8"}).replace(/Disallow: \/$/m,"Allow: /");s.writeFileSync(i,t,{encoding:"utf-8"}),console.info(e.blue("\nrobots.txt unlocked."))}eject(){const i=`${this.buildDir}/server/start.js`;s.writeFileSync(i,"import runProd from '@lomray/vite-ssr-boost/cli/run-prod.js';\n\nconst VERSION = process.env.VERSION || \"1.0.0\";\nconst PORT = process.env.PORT || 3000;\nconst IS_HOST = process.env.IS_HOST || \"0\";\nconst ONLY_CLIENT = process.env.ONLY_CLIENT || \"0\";\n\nawait runProd({\n version: VERSION,\n isHost: IS_HOST === '1',\n isPrintInfo: true,\n port: PORT,\n onlyClient: ONLY_CLIENT === '1',\n });\n",{encoding:"utf-8"})}createServerless(){const i=`${this.buildDir}/server/serverless.js`;s.writeFileSync(i,"import runServerless from '@lomray/vite-ssr-boost/cli/run-serverless.js';\n\nexport default await runServerless({ version: process.env.VERSION || \"1.0.0\" });\n",{encoding:"utf-8"})}async spawnBuild(s,t,e={}){const{mode:o,isNoWarnings:r}=this.params,{focusOnly:n=this.params.focusOnly,shouldWait:a=!1,env:c={}}=e,d=o&&!t.includes("--mode")?`--mode ${o}`:"",u=this.promisifyProcess(i.spawn(`vite build ${t} ${d} --emptyOutDir`,{signal:this.abortController.signal,stdio:[process.stdin,"pipe","pipe"],shell:!0,env:{...process.env,...c,FORCE_COLOR:"2",SSR_BOOST_IS_SSR:l(n).isOnlyClient()?"0":"1",SSR_BOOST_ACTION:global.viteBoostAction}}),r);this.runningBuild.push({name:s,buildProcess:u}),a&&await this.waitLastBuild()}async waitLastBuild(){const i=this.runningBuild.at(-1);if(!i)return;const s=await i.buildProcess.promise;d(s,!0)}runPreviewMode(){this.hasPreviewModeExitListener||(process.on("exit",()=>{this.abortController.abort()}),this.hasPreviewModeExitListener=!0);const{onFinish:i}=this.params;let s=this.runningBuild.length;const t=e=>{Buffer.from(e).toString().includes("built in")&&(s-=1,s||(this.runningBuild.forEach(({buildProcess:i})=>{i.command.stdout?.removeListener("data",t)}),a(this.isProd,this.viteConfig),i?.()))};this.runningBuild.forEach(({buildProcess:i})=>{i.command.stdout?.on("data",t)})}async build(){await this.makeConfig(),await n(),this.clearBuildFolder(),this.diagnosticCodes.clear();const{clientOptions:i,serverOptions:e,onFinish:o,isWatch:r,focusOnly:c,isEject:d,isServerless:u,isUnlockRobots:h}=this.params,{outDir:p}=this.viteConfig.build,f=l(c);this.abortController=new AbortController,this.runningBuild=[],f.isClient()&&await this.spawnBuild("client",`${i} --outDir ${p}/client`,{shouldWait:!r}),f.isServer()&&(await this.spawnBuild("server",`${e} --outDir ${p}/server --ssr ${this.pluginConfig.serverFile}`,{shouldWait:!r}),r||(this.buildManifest(),d&&this.eject(),u&&this.createServerless()));const{entrypoint:m}=this.pluginConfig;if(m?.length&&f.isEntrypoint())for(const{name:i,type:s,serverFile:t,buildOptions:e=""}of m){const o=t&&"ssr"===s?`--ssr ${t}`:"";await this.spawnBuild(i,`${e} ${o} --outDir ${p}/${i}`,{shouldWait:!r,focusOnly:"ssr"===s?"server":"client",env:{SSR_BOOST_CUSTOM_ENTRYPOINT_BUILD_NAME:i}})}r?this.runPreviewMode():(h&&this.unlockRobots(),a(this.isProd,this.viteConfig),s.mkdirSync(this.buildDir,{recursive:!0}),s.writeFileSync(t.join(this.buildDir,"ssr-boost-diagnostics.json"),JSON.stringify({codes:[...this.diagnosticCodes].sort((i,s)=>i.localeCompare(s))},null,2)),o?.())}}export{p as default};
|
|
2
2
|
//# sourceMappingURL=build.js.map
|
package/services/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sources":["../../src/services/build.ts"],"sourcesContent":[null],"names":["Build","isProd","nodeEnv","buildDir","viteConfig","pluginConfig","params","mode","clientOptions","serverOptions","focusOnly","isWatch","isUnlockRobots","isEject","isServerless","isNoWarnings","abortController","runningBuild","hasPreviewModeExitListener","constructor","this","makeConfig","resolveConfig","getPluginConfig","path","resolve","root","build","outDir","process","env","NODE_ENV","clearBuildFolder","fs","existsSync","rmSync","recursive","getIsProd","getNodeEnv","getRunningBuildNames","map","name","promisifyProcess","command","isRejectWarnings","promise","Promise","reject","on","code","message","stderr","buff","msg","Buffer","from","toString","includes","stdout","pipe","buildManifest","console","info","chalk","blue","serverConfig","ServerConfig","init","clientFile","SsrManifest","get","viteAliases","alias","basename","base","renderBuiltUrl","experimental","buildRoutesManifest","unlockRobots","robotsFile","warn","data","readFileSync","encoding","replace","writeFileSync","eject","entrypoint","createServerless","spawnBuild","buildOptions","shouldWait","modeOpt","buildProcess","childProcess","spawn","signal","stdio","stdin","shell","FORCE_COLOR","SSR_BOOST_IS_SSR","createFocusOnly","isOnlyClient","SSR_BOOST_ACTION","global","viteBoostAction","push","waitLastBuild","latestProcess","at","exitCode","processStop","runPreviewMode","abort","onFinish","buildCount","length","listener","
|
|
1
|
+
{"version":3,"file":"build.js","sources":["../../src/services/build.ts"],"sourcesContent":[null],"names":["Build","isProd","nodeEnv","buildDir","viteConfig","pluginConfig","params","mode","clientOptions","serverOptions","focusOnly","isWatch","isUnlockRobots","isEject","isServerless","isNoWarnings","abortController","runningBuild","hasPreviewModeExitListener","diagnosticCodes","Set","constructor","this","makeConfig","resolveConfig","getPluginConfig","path","resolve","root","build","outDir","process","env","NODE_ENV","clearBuildFolder","fs","existsSync","rmSync","recursive","getIsProd","getNodeEnv","getRunningBuildNames","map","name","promisifyProcess","command","isRejectWarnings","promise","Promise","reject","on","code","message","stderr","buff","msg","Buffer","from","toString","includes","stdout","pipe","stream","tail","chunk","text","DIAGNOSTIC_CODES","filter","forEach","add","slice","buildManifest","console","info","chalk","blue","serverConfig","ServerConfig","init","clientFile","SsrManifest","get","viteAliases","alias","basename","base","renderBuiltUrl","experimental","buildRoutesManifest","unlockRobots","robotsFile","warn","data","readFileSync","encoding","replace","writeFileSync","eject","entrypoint","createServerless","spawnBuild","buildOptions","shouldWait","modeOpt","buildProcess","childProcess","spawn","signal","stdio","stdin","shell","FORCE_COLOR","SSR_BOOST_IS_SSR","createFocusOnly","isOnlyClient","SSR_BOOST_ACTION","global","viteBoostAction","push","waitLastBuild","latestProcess","at","exitCode","processStop","runPreviewMode","abort","onFinish","buildCount","length","listener","removeListener","createDevMarker","viteResetCache","clear","focus","AbortController","isClient","isServer","serverFile","isEntrypoint","type","cliOptions","SSR_BOOST_CUSTOM_ENTRYPOINT_BUILD_NAME","mkdirSync","join","JSON","stringify","codes","sort","a","b","localeCompare"],"mappings":"0eAyDA,MAAMA,EAIMC,OAKAC,QAKAC,SAKAC,WAKAC,aAKAC,OAAuB,CAC/BC,KAAM,GACNC,cAAe,GACfC,cAAe,GACfC,UAAW,MACXC,SAAS,EACTC,gBAAgB,EAChBC,SAAS,EACTC,cAAc,EACdC,cAAc,GAMNC,gBAA0C,KAK1CC,aAAgE,GAKhEC,4BAA6B,EAE7BC,gBAAkB,IAAIC,IAKhC,WAAAC,CAAmBf,GACjBgB,KAAKhB,OAAS,IAA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