@jay-framework/stack-server-runtime 0.15.1 → 0.15.3
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/index.d.ts +1 -2
- package/dist/index.js +10 -14
- package/package.json +13 -13
package/dist/index.d.ts
CHANGED
|
@@ -131,7 +131,7 @@ declare function slowRenderInstances(discovered: DiscoveredHeadlessInstance[], h
|
|
|
131
131
|
*/
|
|
132
132
|
declare function validateForEachInstances(forEachInstances: ForEachHeadlessInstance[], headlessInstanceComponents: HeadlessInstanceComponent[]): string[];
|
|
133
133
|
|
|
134
|
-
declare function renderFastChangingData(pageParams: object, pageProps: PageProps, carryForward: object, parts: Array<DevServerPagePart>, instancePhaseData?: InstancePhaseData, forEachInstances?: ForEachHeadlessInstance[], headlessInstanceComponents?: HeadlessInstanceComponent[], mergedSlowViewState?: object): Promise<AnyFastRenderResult>;
|
|
134
|
+
declare function renderFastChangingData(pageParams: object, pageProps: PageProps, carryForward: object, parts: Array<DevServerPagePart>, instancePhaseData?: InstancePhaseData, forEachInstances?: ForEachHeadlessInstance[], headlessInstanceComponents?: HeadlessInstanceComponent[], mergedSlowViewState?: object, query?: Record<string, string>): Promise<AnyFastRenderResult>;
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
137
|
* Action metadata loaded from .jay-action files.
|
|
@@ -896,7 +896,6 @@ interface PluginsIndexEntry {
|
|
|
896
896
|
actions?: ActionIndexEntry[];
|
|
897
897
|
}
|
|
898
898
|
interface PluginsIndex {
|
|
899
|
-
jay_stack_version: string;
|
|
900
899
|
plugins: PluginsIndexEntry[];
|
|
901
900
|
}
|
|
902
901
|
interface MaterializeContractsOptions {
|
package/dist/index.js
CHANGED
|
@@ -365,7 +365,7 @@ function resolveBinding(binding, item) {
|
|
|
365
365
|
}
|
|
366
366
|
return binding;
|
|
367
367
|
}
|
|
368
|
-
async function renderFastChangingData(pageParams, pageProps, carryForward, parts, instancePhaseData, forEachInstances, headlessInstanceComponents, mergedSlowViewState) {
|
|
368
|
+
async function renderFastChangingData(pageParams, pageProps, carryForward, parts, instancePhaseData, forEachInstances, headlessInstanceComponents, mergedSlowViewState, query = {}) {
|
|
369
369
|
let fastViewState = {};
|
|
370
370
|
let fastCarryForward = {};
|
|
371
371
|
for (const part of parts) {
|
|
@@ -376,6 +376,7 @@ async function renderFastChangingData(pageParams, pageProps, carryForward, parts
|
|
|
376
376
|
const partProps = {
|
|
377
377
|
...pageProps,
|
|
378
378
|
...pageParams,
|
|
379
|
+
query,
|
|
379
380
|
...contractInfo && {
|
|
380
381
|
contractName: contractInfo.contractName,
|
|
381
382
|
metadata: contractInfo.metadata
|
|
@@ -412,7 +413,8 @@ async function renderFastChangingData(pageParams, pageProps, carryForward, parts
|
|
|
412
413
|
continue;
|
|
413
414
|
const services = resolveServices(comp.compDefinition.services);
|
|
414
415
|
const cf = instancePhaseData.carryForwards[coordKey];
|
|
415
|
-
const
|
|
416
|
+
const instanceProps = { ...instance.props, query };
|
|
417
|
+
const fastResult = comp.compDefinition.slowlyRender ? await comp.compDefinition.fastRender(instanceProps, cf, ...services) : await comp.compDefinition.fastRender(instanceProps, ...services);
|
|
416
418
|
if (fastResult.kind === "PhaseOutput") {
|
|
417
419
|
const instanceSlowVS = carryForward?.__instanceSlowViewStates?.[coordKey];
|
|
418
420
|
instanceViewStates[coordKey] = instanceSlowVS ? { ...instanceSlowVS, ...fastResult.rendered } : fastResult.rendered;
|
|
@@ -457,7 +459,8 @@ async function renderFastChangingData(pageParams, pageProps, carryForward, parts
|
|
|
457
459
|
cf = slowResult.carryForward;
|
|
458
460
|
}
|
|
459
461
|
}
|
|
460
|
-
const
|
|
462
|
+
const forEachProps = { ...props, query };
|
|
463
|
+
const fastResult = comp.compDefinition.slowlyRender ? await comp.compDefinition.fastRender(forEachProps, cf, ...services) : await comp.compDefinition.fastRender(forEachProps, ...services);
|
|
461
464
|
if (fastResult.kind === "PhaseOutput") {
|
|
462
465
|
const coord = computeForEachInstanceKey(
|
|
463
466
|
trackByValue,
|
|
@@ -719,6 +722,10 @@ async function compileAndLoadServerElement(vite, jayHtmlContent, jayHtmlFilename
|
|
|
719
722
|
const serverElementFilename = jayHtmlFilename.replace(".jay-html", ".server-element.ts");
|
|
720
723
|
const serverElementPath = path__default.join(serverElementDir, serverElementFilename);
|
|
721
724
|
await fs$2.writeFile(serverElementPath, adjustedCode, "utf-8");
|
|
725
|
+
const existingModule = vite.moduleGraph.getModuleById(serverElementPath);
|
|
726
|
+
if (existingModule) {
|
|
727
|
+
vite.moduleGraph.invalidateModule(existingModule);
|
|
728
|
+
}
|
|
722
729
|
const serverModule = await vite.ssrLoadModule(serverElementPath);
|
|
723
730
|
return {
|
|
724
731
|
renderToStream: serverModule.renderToStream,
|
|
@@ -2039,15 +2046,6 @@ function resolveActionFilePath(actionPath, packageName, pluginPath, isLocal, pro
|
|
|
2039
2046
|
function toKebabCase(str) {
|
|
2040
2047
|
return str.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, "");
|
|
2041
2048
|
}
|
|
2042
|
-
function getJayStackVersion() {
|
|
2043
|
-
try {
|
|
2044
|
-
const packageJsonPath = path.join(__dirname, "..", "package.json");
|
|
2045
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
2046
|
-
return packageJson.version || "0.0.0";
|
|
2047
|
-
} catch {
|
|
2048
|
-
return "0.0.0";
|
|
2049
|
-
}
|
|
2050
|
-
}
|
|
2051
2049
|
async function materializeContracts(options, services = /* @__PURE__ */ new Map()) {
|
|
2052
2050
|
const {
|
|
2053
2051
|
projectRoot,
|
|
@@ -2180,7 +2178,6 @@ async function materializeContracts(options, services = /* @__PURE__ */ new Map(
|
|
|
2180
2178
|
}
|
|
2181
2179
|
}
|
|
2182
2180
|
const pluginsIndex = {
|
|
2183
|
-
jay_stack_version: getJayStackVersion(),
|
|
2184
2181
|
plugins: Array.from(pluginsIndexMap.entries()).map(([name, data]) => ({
|
|
2185
2182
|
name,
|
|
2186
2183
|
path: data.path,
|
|
@@ -2248,7 +2245,6 @@ async function listContracts(options) {
|
|
|
2248
2245
|
}
|
|
2249
2246
|
}
|
|
2250
2247
|
return {
|
|
2251
|
-
jay_stack_version: getJayStackVersion(),
|
|
2252
2248
|
plugins: Array.from(pluginsMap.entries()).map(([name, data]) => ({
|
|
2253
2249
|
name,
|
|
2254
2250
|
path: data.path,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/stack-server-runtime",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.mts",
|
|
@@ -26,21 +26,21 @@
|
|
|
26
26
|
"test:watch": "vitest"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@jay-framework/compiler-jay-html": "^0.15.
|
|
30
|
-
"@jay-framework/compiler-shared": "^0.15.
|
|
31
|
-
"@jay-framework/component": "^0.15.
|
|
32
|
-
"@jay-framework/fullstack-component": "^0.15.
|
|
33
|
-
"@jay-framework/logger": "^0.15.
|
|
34
|
-
"@jay-framework/runtime": "^0.15.
|
|
35
|
-
"@jay-framework/ssr-runtime": "^0.15.
|
|
36
|
-
"@jay-framework/stack-route-scanner": "^0.15.
|
|
37
|
-
"@jay-framework/view-state-merge": "^0.15.
|
|
29
|
+
"@jay-framework/compiler-jay-html": "^0.15.3",
|
|
30
|
+
"@jay-framework/compiler-shared": "^0.15.3",
|
|
31
|
+
"@jay-framework/component": "^0.15.3",
|
|
32
|
+
"@jay-framework/fullstack-component": "^0.15.3",
|
|
33
|
+
"@jay-framework/logger": "^0.15.3",
|
|
34
|
+
"@jay-framework/runtime": "^0.15.3",
|
|
35
|
+
"@jay-framework/ssr-runtime": "^0.15.3",
|
|
36
|
+
"@jay-framework/stack-route-scanner": "^0.15.3",
|
|
37
|
+
"@jay-framework/view-state-merge": "^0.15.3",
|
|
38
38
|
"yaml": "^2.3.4"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@jay-framework/dev-environment": "^0.15.
|
|
42
|
-
"@jay-framework/jay-cli": "^0.15.
|
|
43
|
-
"@jay-framework/stack-client-runtime": "^0.15.
|
|
41
|
+
"@jay-framework/dev-environment": "^0.15.3",
|
|
42
|
+
"@jay-framework/jay-cli": "^0.15.3",
|
|
43
|
+
"@jay-framework/stack-client-runtime": "^0.15.3",
|
|
44
44
|
"@types/express": "^5.0.2",
|
|
45
45
|
"@types/node": "^22.15.21",
|
|
46
46
|
"nodemon": "^3.0.3",
|