@reckona/mreact-router 0.0.107 → 0.0.109
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/adapters/cloudflare.d.ts.map +1 -1
- package/dist/adapters/cloudflare.js +18 -5
- package/dist/adapters/cloudflare.js.map +1 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +1 -0
- package/dist/build.js.map +1 -1
- package/package.json +11 -11
- package/src/adapters/cloudflare.ts +21 -5
- package/src/build.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reckona/mreact-router",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.109",
|
|
4
4
|
"description": "File-system app router, SSR, actions, and deployment adapters for mreact.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jsx",
|
|
@@ -105,20 +105,20 @@
|
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
107
|
"typescript": "^6.0.3",
|
|
108
|
-
"@reckona/mreact
|
|
109
|
-
"@reckona/mreact": "0.0.
|
|
110
|
-
"@reckona/mreact-
|
|
111
|
-
"@reckona/mreact-
|
|
112
|
-
"@reckona/mreact-
|
|
113
|
-
"@reckona/mreact-
|
|
114
|
-
"@reckona/mreact-reactive-dom": "0.0.
|
|
115
|
-
"@reckona/mreact-server": "0.0.
|
|
116
|
-
"@reckona/mreact-shared": "0.0.
|
|
108
|
+
"@reckona/mreact": "0.0.109",
|
|
109
|
+
"@reckona/mreact-compat": "0.0.109",
|
|
110
|
+
"@reckona/mreact-query": "0.0.109",
|
|
111
|
+
"@reckona/mreact-reactive-core": "0.0.109",
|
|
112
|
+
"@reckona/mreact-devtools": "0.0.109",
|
|
113
|
+
"@reckona/mreact-compiler": "0.0.109",
|
|
114
|
+
"@reckona/mreact-reactive-dom": "0.0.109",
|
|
115
|
+
"@reckona/mreact-server": "0.0.109",
|
|
116
|
+
"@reckona/mreact-shared": "0.0.109"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
119
|
"vite": ">=8 <9"
|
|
120
120
|
},
|
|
121
121
|
"optionalDependencies": {
|
|
122
|
-
"@reckona/mreact-router-native": "0.0.
|
|
122
|
+
"@reckona/mreact-router-native": "0.0.109"
|
|
123
123
|
}
|
|
124
124
|
}
|
|
@@ -453,15 +453,18 @@ const cloudflareReservedPageModuleExportNames = new Set([
|
|
|
453
453
|
function selectCloudflarePageComponent<Data, Env>(
|
|
454
454
|
module: CloudflareRouteModule<Data, Env>,
|
|
455
455
|
): CloudflareRouteModuleComponent<Data, Env> | undefined {
|
|
456
|
-
|
|
457
|
-
|
|
456
|
+
const defaultExport = readCloudflareModuleExport(module, "default");
|
|
457
|
+
if (typeof defaultExport === "function") {
|
|
458
|
+
return defaultExport as CloudflareRouteModuleComponent<Data, Env>;
|
|
458
459
|
}
|
|
459
460
|
|
|
460
|
-
|
|
461
|
-
|
|
461
|
+
const appExport = readCloudflareModuleExport(module, "App");
|
|
462
|
+
if (typeof appExport === "function") {
|
|
463
|
+
return appExport as CloudflareRouteModuleComponent<Data, Env>;
|
|
462
464
|
}
|
|
463
465
|
|
|
464
|
-
for (const
|
|
466
|
+
for (const name of Object.keys(module)) {
|
|
467
|
+
const value = readCloudflareModuleExport(module, name);
|
|
465
468
|
if (
|
|
466
469
|
!cloudflareReservedPageModuleExportNames.has(name) &&
|
|
467
470
|
typeof value === "function"
|
|
@@ -473,6 +476,19 @@ function selectCloudflarePageComponent<Data, Env>(
|
|
|
473
476
|
return undefined;
|
|
474
477
|
}
|
|
475
478
|
|
|
479
|
+
function readCloudflareModuleExport(module: object, name: string): unknown {
|
|
480
|
+
const descriptor = Object.getOwnPropertyDescriptor(module, name);
|
|
481
|
+
if (descriptor === undefined) {
|
|
482
|
+
return undefined;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
if ("value" in descriptor) {
|
|
486
|
+
return descriptor.value;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
return descriptor.get?.call(module);
|
|
490
|
+
}
|
|
491
|
+
|
|
476
492
|
const cloudflareDiagnosticPageModuleExportNames = ["default", "App", "slots"] as const;
|
|
477
493
|
|
|
478
494
|
// Fixed names + typeof only (never values) so the 500 response is useful without
|
package/src/build.ts
CHANGED
|
@@ -2623,6 +2623,7 @@ export const App = routeComponent === undefined
|
|
|
2623
2623
|
return routeComponent(props);
|
|
2624
2624
|
};
|
|
2625
2625
|
export default App;
|
|
2626
|
+
export const CloudflareRouteComponent = App;
|
|
2626
2627
|
export const slots = componentSlots === undefined ? undefined : { ...componentSlots };`;
|
|
2627
2628
|
}
|
|
2628
2629
|
|