@reckona/mreact-router 0.0.113 → 0.0.114
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/build.d.ts.map +1 -1
- package/dist/build.js +32 -14
- package/dist/build.js.map +1 -1
- package/package.json +11 -11
- package/src/build.ts +32 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reckona/mreact-router",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.114",
|
|
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
|
|
110
|
-
"@reckona/mreact-
|
|
111
|
-
"@reckona/mreact-query": "0.0.
|
|
112
|
-
"@reckona/mreact-reactive-
|
|
113
|
-
"@reckona/mreact-
|
|
114
|
-
"@reckona/mreact-
|
|
115
|
-
"@reckona/mreact-
|
|
116
|
-
"@reckona/mreact": "0.0.
|
|
108
|
+
"@reckona/mreact-compat": "0.0.114",
|
|
109
|
+
"@reckona/mreact": "0.0.114",
|
|
110
|
+
"@reckona/mreact-compiler": "0.0.114",
|
|
111
|
+
"@reckona/mreact-query": "0.0.114",
|
|
112
|
+
"@reckona/mreact-reactive-core": "0.0.114",
|
|
113
|
+
"@reckona/mreact-devtools": "0.0.114",
|
|
114
|
+
"@reckona/mreact-reactive-dom": "0.0.114",
|
|
115
|
+
"@reckona/mreact-server": "0.0.114",
|
|
116
|
+
"@reckona/mreact-shared": "0.0.114"
|
|
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.114"
|
|
123
123
|
}
|
|
124
124
|
}
|
package/src/build.ts
CHANGED
|
@@ -2611,24 +2611,42 @@ async function writeCloudflareRouteModules(options: {
|
|
|
2611
2611
|
function cloudflarePageRouteFacadeModuleSource(componentImport: string): string {
|
|
2612
2612
|
return `import * as componentModule from ${JSON.stringify(componentImport)};
|
|
2613
2613
|
|
|
2614
|
-
const componentDefault = readComponentModuleExport(componentModule, "default");
|
|
2615
|
-
const componentApp = readComponentModuleExport(componentModule, "App");
|
|
2616
2614
|
const componentSlots = readComponentModuleExport(componentModule, "slots");
|
|
2617
|
-
const routeComponent = typeof componentDefault === "function"
|
|
2618
|
-
? componentDefault
|
|
2619
|
-
: typeof componentApp === "function"
|
|
2620
|
-
? componentApp
|
|
2621
|
-
: undefined;
|
|
2622
2615
|
|
|
2623
|
-
export
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
export
|
|
2616
|
+
export function App(props) {
|
|
2617
|
+
return renderCloudflareRouteComponent(props);
|
|
2618
|
+
}
|
|
2619
|
+
export default function CloudflareDefaultRouteComponent(props) {
|
|
2620
|
+
return renderCloudflareRouteComponent(props);
|
|
2621
|
+
}
|
|
2622
|
+
export function CloudflareRouteComponent(props) {
|
|
2623
|
+
return renderCloudflareRouteComponent(props);
|
|
2624
|
+
}
|
|
2630
2625
|
export const slots = componentSlots === undefined ? undefined : { ...componentSlots };
|
|
2631
2626
|
|
|
2627
|
+
function renderCloudflareRouteComponent(props) {
|
|
2628
|
+
const routeComponent = resolveCloudflareRouteComponent();
|
|
2629
|
+
if (routeComponent === undefined) {
|
|
2630
|
+
throw new Error("No Cloudflare component export was found for ${componentImport}.");
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
return routeComponent(props);
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
function resolveCloudflareRouteComponent() {
|
|
2637
|
+
const componentDefault = readComponentModuleExport(componentModule, "default");
|
|
2638
|
+
if (typeof componentDefault === "function") {
|
|
2639
|
+
return componentDefault;
|
|
2640
|
+
}
|
|
2641
|
+
|
|
2642
|
+
const componentApp = readComponentModuleExport(componentModule, "App");
|
|
2643
|
+
if (typeof componentApp === "function") {
|
|
2644
|
+
return componentApp;
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2647
|
+
return undefined;
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2632
2650
|
function readComponentModuleExport(module, name) {
|
|
2633
2651
|
const descriptor = Object.getOwnPropertyDescriptor(module, name);
|
|
2634
2652
|
if (descriptor === undefined) {
|