@jay-framework/stack-server-runtime 0.8.0 → 0.9.0
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 +2 -2
- package/dist/index.js +10 -5
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -21,8 +21,8 @@ declare class DevSlowlyChangingPhase implements SlowlyChangingPhase {
|
|
|
21
21
|
constructor(dontCacheSlowly: boolean);
|
|
22
22
|
runSlowlyForPage(pageParams: UrlParams, pageProps: PageProps, parts: Array<DevServerPagePart>): Promise<AnySlowlyRenderResult>;
|
|
23
23
|
}
|
|
24
|
-
declare function runLoadParams<
|
|
25
|
-
declare function runSlowlyChangingRender<
|
|
24
|
+
declare function runLoadParams<Refs extends object, SlowVS extends object, FastVS extends object, InteractiveVS extends object, Services extends Array<any>, Contexts extends Array<any>, PropsT extends object, Params extends UrlParams, CompCore extends JayComponentCore<PropsT, InteractiveVS>>(compDefinition: JayStackComponentDefinition<Refs, SlowVS, FastVS, InteractiveVS, Services, Contexts, PropsT, Params, CompCore>, services: Services): Promise<void>;
|
|
25
|
+
declare function runSlowlyChangingRender<Refs extends object, SlowVS extends object, FastVS extends object, InteractiveVS extends object, Services extends Array<any>, Contexts extends Array<any>, PropsT extends object, Params extends UrlParams, CompCore extends JayComponentCore<PropsT, InteractiveVS>>(compDefinition: JayStackComponentDefinition<Refs, SlowVS, FastVS, InteractiveVS, Services, Contexts, PropsT, Params, CompCore>): void;
|
|
26
26
|
|
|
27
27
|
declare function renderFastChangingData(pageParams: object, pageProps: PageProps, carryForward: object, parts: Array<DevServerPagePart>): Promise<AnyFastRenderResult>;
|
|
28
28
|
|
package/dist/index.js
CHANGED
|
@@ -166,10 +166,11 @@ async function loadPageParts(vite, route, pagesBase, jayRollupConfig) {
|
|
|
166
166
|
const exists = await fs.access(route.compPath, fs.constants.F_OK).then(() => true).catch(() => false);
|
|
167
167
|
const parts = [];
|
|
168
168
|
if (exists) {
|
|
169
|
-
const pageComponent = (await vite.ssrLoadModule(route.compPath)).page;
|
|
169
|
+
const pageComponent = (await vite.ssrLoadModule(route.compPath + "?jay-server")).page;
|
|
170
170
|
parts.push({
|
|
171
171
|
compDefinition: pageComponent,
|
|
172
|
-
|
|
172
|
+
// Client import uses client-only code (server code stripped)
|
|
173
|
+
clientImport: `import {page} from '${route.compPath}?jay-client'`,
|
|
173
174
|
clientPart: `{comp: page.comp, contextMarkers: []}`
|
|
174
175
|
});
|
|
175
176
|
}
|
|
@@ -191,14 +192,18 @@ async function loadPageParts(vite, route, pagesBase, jayRollupConfig) {
|
|
|
191
192
|
for await (const headlessImport of jayHtml.headlessImports) {
|
|
192
193
|
const module2 = headlessImport.codeLink.module;
|
|
193
194
|
const name = headlessImport.codeLink.names[0].name;
|
|
194
|
-
const
|
|
195
|
-
const
|
|
195
|
+
const isLocalModule = module2[0] === "." || module2[0] === "/";
|
|
196
|
+
const modulePath = isLocalModule ? path.resolve(dirName, module2) : require2.resolve(module2, { paths: require2.resolve.paths(dirName) });
|
|
197
|
+
const serverModulePath = isLocalModule ? modulePath + "?jay-server" : modulePath;
|
|
198
|
+
const compDefinition = (await vite.ssrLoadModule(serverModulePath))[name];
|
|
196
199
|
const moduleImport = module2.startsWith("./") ? path.resolve(pagesBase, module2) : module2;
|
|
200
|
+
const isNpmPackage = !module2.startsWith("./") && !module2.startsWith("../");
|
|
201
|
+
const clientModuleImport = isNpmPackage ? `${moduleImport}/client` : `${moduleImport}?jay-client`;
|
|
197
202
|
const key = headlessImport.key;
|
|
198
203
|
const part = {
|
|
199
204
|
key,
|
|
200
205
|
compDefinition,
|
|
201
|
-
clientImport: `import {${name}} from '${
|
|
206
|
+
clientImport: `import {${name}} from '${clientModuleImport}'`,
|
|
202
207
|
clientPart: `{comp: ${name}.comp, contextMarkers: [], key: '${headlessImport.key}'}`
|
|
203
208
|
};
|
|
204
209
|
parts.push(part);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/stack-server-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.mts",
|
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
"test:watch": "vitest"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@jay-framework/compiler-jay-html": "^0.
|
|
30
|
-
"@jay-framework/component": "^0.
|
|
31
|
-
"@jay-framework/fullstack-component": "^0.
|
|
32
|
-
"@jay-framework/runtime": "^0.
|
|
33
|
-
"@jay-framework/stack-route-scanner": "^0.
|
|
29
|
+
"@jay-framework/compiler-jay-html": "^0.9.0",
|
|
30
|
+
"@jay-framework/component": "^0.9.0",
|
|
31
|
+
"@jay-framework/fullstack-component": "^0.9.0",
|
|
32
|
+
"@jay-framework/runtime": "^0.9.0",
|
|
33
|
+
"@jay-framework/stack-route-scanner": "^0.9.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@jay-framework/dev-environment": "^0.
|
|
37
|
-
"@jay-framework/jay-cli": "^0.
|
|
38
|
-
"@jay-framework/stack-client-runtime": "^0.
|
|
36
|
+
"@jay-framework/dev-environment": "^0.9.0",
|
|
37
|
+
"@jay-framework/jay-cli": "^0.9.0",
|
|
38
|
+
"@jay-framework/stack-client-runtime": "^0.9.0",
|
|
39
39
|
"@types/express": "^5.0.2",
|
|
40
40
|
"@types/node": "^22.15.21",
|
|
41
41
|
"nodemon": "^3.0.3",
|