@lolyjs/core 0.1.0-alpha.8 → 0.1.0-alpha.9
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/cli.cjs.map +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +15 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +0 -4
- package/dist/index.d.ts +0 -4
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/runtime.cjs +15 -15
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.d.mts +0 -4
- package/dist/runtime.d.ts +0 -4
- package/dist/runtime.js +15 -15
- package/dist/runtime.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -246,10 +246,6 @@ type ClientRouteLoaded = {
|
|
|
246
246
|
|
|
247
247
|
/**
|
|
248
248
|
* Bootstraps the client-side application.
|
|
249
|
-
*
|
|
250
|
-
* @param routes - Array of client routes
|
|
251
|
-
* @param notFoundRoute - Not-found route definition
|
|
252
|
-
* @param errorRoute - Error route definition
|
|
253
249
|
*/
|
|
254
250
|
declare function bootstrapClient(routes: ClientRouteLoaded[], notFoundRoute: ClientRouteLoaded | null, errorRoute?: ClientRouteLoaded | null): void;
|
|
255
251
|
|
package/dist/index.d.ts
CHANGED
|
@@ -246,10 +246,6 @@ type ClientRouteLoaded = {
|
|
|
246
246
|
|
|
247
247
|
/**
|
|
248
248
|
* Bootstraps the client-side application.
|
|
249
|
-
*
|
|
250
|
-
* @param routes - Array of client routes
|
|
251
|
-
* @param notFoundRoute - Not-found route definition
|
|
252
|
-
* @param errorRoute - Error route definition
|
|
253
249
|
*/
|
|
254
250
|
declare function bootstrapClient(routes: ClientRouteLoaded[], notFoundRoute: ClientRouteLoaded | null, errorRoute?: ClientRouteLoaded | null): void;
|
|
255
251
|
|
package/dist/index.js
CHANGED
|
@@ -5657,6 +5657,7 @@ function AppShell({
|
|
|
5657
5657
|
|
|
5658
5658
|
// modules/runtime/client/bootstrap.tsx
|
|
5659
5659
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
5660
|
+
var __loly_hydrated = false;
|
|
5660
5661
|
async function loadInitialRoute(initialUrl, initialData, routes, notFoundRoute, errorRoute) {
|
|
5661
5662
|
const isInitialNotFound = initialData?.notFound === true;
|
|
5662
5663
|
const isInitialError = initialData?.error === true;
|
|
@@ -5683,7 +5684,7 @@ async function loadInitialRoute(initialUrl, initialData, routes, notFoundRoute,
|
|
|
5683
5684
|
initialComponents = await notFoundRoute.load();
|
|
5684
5685
|
} else {
|
|
5685
5686
|
console.warn(
|
|
5686
|
-
`[client] No route match found for ${initialUrl}.
|
|
5687
|
+
`[client] No route match found for ${initialUrl}. Routes:`,
|
|
5687
5688
|
routes.map((r) => r.pattern)
|
|
5688
5689
|
);
|
|
5689
5690
|
}
|
|
@@ -5697,21 +5698,24 @@ async function loadInitialRoute(initialUrl, initialData, routes, notFoundRoute,
|
|
|
5697
5698
|
};
|
|
5698
5699
|
}
|
|
5699
5700
|
function bootstrapClient(routes, notFoundRoute, errorRoute = null) {
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5701
|
+
if (__loly_hydrated) {
|
|
5702
|
+
console.warn("[loly:runtime] bootstrapClient SKIPPED (already hydrated)");
|
|
5703
|
+
return;
|
|
5704
|
+
}
|
|
5705
|
+
__loly_hydrated = true;
|
|
5706
|
+
console.log("[loly:runtime] bootstrapClient START");
|
|
5705
5707
|
(async function bootstrap() {
|
|
5706
5708
|
const container = document.getElementById(APP_CONTAINER_ID2);
|
|
5707
5709
|
const initialData = getWindowData();
|
|
5708
5710
|
console.log("[loly:runtime] bootstrap starting", {
|
|
5709
5711
|
hasContainer: !!container,
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
+
hasInitialData: !!initialData,
|
|
5713
|
+
containerId: APP_CONTAINER_ID2
|
|
5712
5714
|
});
|
|
5713
5715
|
if (!container) {
|
|
5714
|
-
console.error(
|
|
5716
|
+
console.error(
|
|
5717
|
+
`[loly:runtime] Container #${APP_CONTAINER_ID2} not found.`
|
|
5718
|
+
);
|
|
5715
5719
|
return;
|
|
5716
5720
|
}
|
|
5717
5721
|
const initialUrl = window.location.pathname + window.location.search;
|
|
@@ -5745,13 +5749,9 @@ function bootstrapClient(routes, notFoundRoute, errorRoute = null) {
|
|
|
5745
5749
|
}
|
|
5746
5750
|
)
|
|
5747
5751
|
);
|
|
5748
|
-
console.log("[loly:runtime]
|
|
5752
|
+
console.log("[loly:runtime] Hydrated successfully");
|
|
5749
5753
|
} catch (error) {
|
|
5750
|
-
console.error(
|
|
5751
|
-
"[loly:runtime] Error loading initial route components for",
|
|
5752
|
-
initialUrl,
|
|
5753
|
-
error
|
|
5754
|
-
);
|
|
5754
|
+
console.error("[loly:runtime] Error during hydration:", error);
|
|
5755
5755
|
window.location.reload();
|
|
5756
5756
|
}
|
|
5757
5757
|
})();
|