@absolutejs/absolute 0.19.0-beta.35 → 0.19.0-beta.37
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/.absolutejs/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +17 -19
- package/dist/index.js.map +4 -4
- package/dist/react/index.js +17 -19
- package/dist/react/index.js.map +4 -4
- package/native/packages/darwin-arm64/package.json +1 -1
- package/native/packages/darwin-x64/package.json +1 -1
- package/native/packages/linux-arm64/package.json +1 -1
- package/native/packages/linux-x64/package.json +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -143,7 +143,7 @@ var worker = null, requestId = 0, pending, getWorker = () => {
|
|
|
143
143
|
if (worker)
|
|
144
144
|
return worker;
|
|
145
145
|
const workerPath = resolve(import.meta.dir, "ssrWorker.ts");
|
|
146
|
-
worker = new Worker(workerPath);
|
|
146
|
+
worker = new Worker(workerPath, { cwd: process.cwd() });
|
|
147
147
|
worker.onmessage = (event) => {
|
|
148
148
|
const { id, ok, html, error } = event.data;
|
|
149
149
|
const req = pending.get(id);
|
|
@@ -204370,7 +204370,7 @@ var {file } = globalThis.Bun;
|
|
|
204370
204370
|
|
|
204371
204371
|
// src/react/pageHandler.ts
|
|
204372
204372
|
var isDev = process.env["NODE_ENV"] === "development";
|
|
204373
|
-
var
|
|
204373
|
+
var findComponentPath = (component) => {
|
|
204374
204374
|
const name = component.displayName ?? component.name;
|
|
204375
204375
|
if (!name)
|
|
204376
204376
|
return null;
|
|
@@ -204381,12 +204381,8 @@ var resolveComponentPath = (component) => {
|
|
|
204381
204381
|
const { resolve: resolve2, join } = __require("path");
|
|
204382
204382
|
const { existsSync } = __require("fs");
|
|
204383
204383
|
const pagesDir = resolve2(reactDir, "pages");
|
|
204384
|
-
const
|
|
204385
|
-
join(pagesDir, `${name}
|
|
204386
|
-
join(pagesDir, `${name}.jsx`),
|
|
204387
|
-
join(pagesDir, `${name}.ts`)
|
|
204388
|
-
];
|
|
204389
|
-
for (const candidate of candidates) {
|
|
204384
|
+
for (const ext of [".tsx", ".jsx", ".ts"]) {
|
|
204385
|
+
const candidate = join(pagesDir, `${name}${ext}`);
|
|
204390
204386
|
if (existsSync(candidate))
|
|
204391
204387
|
return candidate;
|
|
204392
204388
|
}
|
|
@@ -204396,17 +204392,19 @@ var handleReactPageRequest = async (PageComponent, index, ...props) => {
|
|
|
204396
204392
|
try {
|
|
204397
204393
|
const [maybeProps] = props;
|
|
204398
204394
|
if (isDev) {
|
|
204399
|
-
const componentPath =
|
|
204395
|
+
const componentPath = findComponentPath(PageComponent);
|
|
204400
204396
|
if (componentPath) {
|
|
204401
|
-
|
|
204402
|
-
|
|
204403
|
-
|
|
204404
|
-
|
|
204405
|
-
|
|
204406
|
-
|
|
204407
|
-
|
|
204408
|
-
|
|
204409
|
-
|
|
204397
|
+
try {
|
|
204398
|
+
const { renderInWorker: renderInWorker2 } = await Promise.resolve().then(() => (init_ssrRenderer(), exports_ssrRenderer));
|
|
204399
|
+
const html = await renderInWorker2({
|
|
204400
|
+
componentPath,
|
|
204401
|
+
indexPath: index,
|
|
204402
|
+
props: maybeProps
|
|
204403
|
+
});
|
|
204404
|
+
return new Response(html, {
|
|
204405
|
+
headers: { "Content-Type": "text/html" }
|
|
204406
|
+
});
|
|
204407
|
+
} catch {}
|
|
204410
204408
|
}
|
|
204411
204409
|
}
|
|
204412
204410
|
const { createElement } = await import("react");
|
|
@@ -204654,5 +204652,5 @@ export {
|
|
|
204654
204652
|
ANGULAR_INIT_TIMEOUT_MS
|
|
204655
204653
|
};
|
|
204656
204654
|
|
|
204657
|
-
//# debugId=
|
|
204655
|
+
//# debugId=C7E8263A117DC2CD64756E2164756E21
|
|
204658
204656
|
//# sourceMappingURL=index.js.map
|