@lolyjs/core 0.2.0-alpha.2 → 0.2.0-alpha.21
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/LICENCE.md +9 -0
- package/README.md +1074 -761
- package/dist/{bootstrap-BiCQmSkx.d.mts → bootstrap-BfGTMUkj.d.mts} +19 -0
- package/dist/{bootstrap-BiCQmSkx.d.ts → bootstrap-BfGTMUkj.d.ts} +19 -0
- package/dist/cli.cjs +16997 -4416
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +17007 -4416
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +14731 -1652
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +295 -57
- package/dist/index.d.ts +295 -57
- package/dist/index.js +17190 -4102
- package/dist/index.js.map +1 -1
- package/dist/index.types-DMOO-uvF.d.mts +221 -0
- package/dist/index.types-DMOO-uvF.d.ts +221 -0
- package/dist/react/cache.cjs +107 -32
- package/dist/react/cache.cjs.map +1 -1
- package/dist/react/cache.d.mts +27 -21
- package/dist/react/cache.d.ts +27 -21
- package/dist/react/cache.js +107 -32
- package/dist/react/cache.js.map +1 -1
- package/dist/react/components.cjs +10 -8
- package/dist/react/components.cjs.map +1 -1
- package/dist/react/components.js +10 -8
- package/dist/react/components.js.map +1 -1
- package/dist/react/hooks.cjs +208 -26
- package/dist/react/hooks.cjs.map +1 -1
- package/dist/react/hooks.d.mts +75 -15
- package/dist/react/hooks.d.ts +75 -15
- package/dist/react/hooks.js +208 -26
- package/dist/react/hooks.js.map +1 -1
- package/dist/react/sockets.cjs +13 -6
- package/dist/react/sockets.cjs.map +1 -1
- package/dist/react/sockets.js +13 -6
- package/dist/react/sockets.js.map +1 -1
- package/dist/react/themes.cjs +61 -18
- package/dist/react/themes.cjs.map +1 -1
- package/dist/react/themes.js +63 -20
- package/dist/react/themes.js.map +1 -1
- package/dist/runtime.cjs +544 -111
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.d.mts +2 -2
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.js +540 -107
- package/dist/runtime.js.map +1 -1
- package/package.json +49 -4
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
declare const WINDOW_DATA_KEY = "__FW_DATA__";
|
|
2
|
+
declare const ROUTER_DATA_KEY = "__LOLY_ROUTER_DATA__";
|
|
3
|
+
declare const ROUTER_NAVIGATE_KEY = "__LOLY_ROUTER_NAVIGATE__";
|
|
2
4
|
|
|
3
5
|
type InitialData = {
|
|
4
6
|
pathname: string;
|
|
@@ -8,13 +10,24 @@ type InitialData = {
|
|
|
8
10
|
title?: string;
|
|
9
11
|
description?: string;
|
|
10
12
|
} | null;
|
|
13
|
+
className?: string;
|
|
11
14
|
notFound?: boolean;
|
|
12
15
|
error?: boolean;
|
|
13
16
|
theme?: string;
|
|
14
17
|
};
|
|
18
|
+
type RouterData = {
|
|
19
|
+
pathname: string;
|
|
20
|
+
params: Record<string, string>;
|
|
21
|
+
searchParams: Record<string, unknown>;
|
|
22
|
+
};
|
|
15
23
|
declare global {
|
|
16
24
|
interface Window {
|
|
17
25
|
[WINDOW_DATA_KEY]?: InitialData;
|
|
26
|
+
[ROUTER_DATA_KEY]?: RouterData;
|
|
27
|
+
[ROUTER_NAVIGATE_KEY]?: (url: string, options?: {
|
|
28
|
+
revalidate?: boolean;
|
|
29
|
+
replace?: boolean;
|
|
30
|
+
}) => Promise<void>;
|
|
18
31
|
}
|
|
19
32
|
}
|
|
20
33
|
type ClientLoadedComponents = {
|
|
@@ -41,6 +54,12 @@ type RouteViewState = {
|
|
|
41
54
|
/**
|
|
42
55
|
* Bootstraps the client-side application.
|
|
43
56
|
*
|
|
57
|
+
* Simplified flow:
|
|
58
|
+
* 1. Setup hot reload (development only)
|
|
59
|
+
* 2. Get container and initial data
|
|
60
|
+
* 3. Initialize router data
|
|
61
|
+
* 4. Load and hydrate initial route
|
|
62
|
+
*
|
|
44
63
|
* @param routes - Array of client routes
|
|
45
64
|
* @param notFoundRoute - Not-found route definition
|
|
46
65
|
* @param errorRoute - Error route definition
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
declare const WINDOW_DATA_KEY = "__FW_DATA__";
|
|
2
|
+
declare const ROUTER_DATA_KEY = "__LOLY_ROUTER_DATA__";
|
|
3
|
+
declare const ROUTER_NAVIGATE_KEY = "__LOLY_ROUTER_NAVIGATE__";
|
|
2
4
|
|
|
3
5
|
type InitialData = {
|
|
4
6
|
pathname: string;
|
|
@@ -8,13 +10,24 @@ type InitialData = {
|
|
|
8
10
|
title?: string;
|
|
9
11
|
description?: string;
|
|
10
12
|
} | null;
|
|
13
|
+
className?: string;
|
|
11
14
|
notFound?: boolean;
|
|
12
15
|
error?: boolean;
|
|
13
16
|
theme?: string;
|
|
14
17
|
};
|
|
18
|
+
type RouterData = {
|
|
19
|
+
pathname: string;
|
|
20
|
+
params: Record<string, string>;
|
|
21
|
+
searchParams: Record<string, unknown>;
|
|
22
|
+
};
|
|
15
23
|
declare global {
|
|
16
24
|
interface Window {
|
|
17
25
|
[WINDOW_DATA_KEY]?: InitialData;
|
|
26
|
+
[ROUTER_DATA_KEY]?: RouterData;
|
|
27
|
+
[ROUTER_NAVIGATE_KEY]?: (url: string, options?: {
|
|
28
|
+
revalidate?: boolean;
|
|
29
|
+
replace?: boolean;
|
|
30
|
+
}) => Promise<void>;
|
|
18
31
|
}
|
|
19
32
|
}
|
|
20
33
|
type ClientLoadedComponents = {
|
|
@@ -41,6 +54,12 @@ type RouteViewState = {
|
|
|
41
54
|
/**
|
|
42
55
|
* Bootstraps the client-side application.
|
|
43
56
|
*
|
|
57
|
+
* Simplified flow:
|
|
58
|
+
* 1. Setup hot reload (development only)
|
|
59
|
+
* 2. Get container and initial data
|
|
60
|
+
* 3. Initialize router data
|
|
61
|
+
* 4. Load and hydrate initial route
|
|
62
|
+
*
|
|
44
63
|
* @param routes - Array of client routes
|
|
45
64
|
* @param notFoundRoute - Not-found route definition
|
|
46
65
|
* @param errorRoute - Error route definition
|