@lolyjs/core 0.2.0-alpha.3 → 0.2.0-alpha.31

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.
Files changed (46) hide show
  1. package/README.md +1462 -761
  2. package/dist/{bootstrap-BiCQmSkx.d.mts → bootstrap-BfGTMUkj.d.mts} +19 -0
  3. package/dist/{bootstrap-BiCQmSkx.d.ts → bootstrap-BfGTMUkj.d.ts} +19 -0
  4. package/dist/cli.cjs +15909 -2468
  5. package/dist/cli.cjs.map +1 -1
  6. package/dist/cli.js +15932 -2481
  7. package/dist/cli.js.map +1 -1
  8. package/dist/index.cjs +18098 -4160
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.mts +323 -55
  11. package/dist/index.d.ts +323 -55
  12. package/dist/index.js +18216 -4271
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.types-JJ0KjvFU.d.mts +266 -0
  15. package/dist/index.types-JJ0KjvFU.d.ts +266 -0
  16. package/dist/react/cache.cjs +107 -32
  17. package/dist/react/cache.cjs.map +1 -1
  18. package/dist/react/cache.d.mts +29 -21
  19. package/dist/react/cache.d.ts +29 -21
  20. package/dist/react/cache.js +107 -32
  21. package/dist/react/cache.js.map +1 -1
  22. package/dist/react/components.cjs +11 -12
  23. package/dist/react/components.cjs.map +1 -1
  24. package/dist/react/components.js +11 -12
  25. package/dist/react/components.js.map +1 -1
  26. package/dist/react/hooks.cjs +124 -74
  27. package/dist/react/hooks.cjs.map +1 -1
  28. package/dist/react/hooks.d.mts +6 -24
  29. package/dist/react/hooks.d.ts +6 -24
  30. package/dist/react/hooks.js +122 -71
  31. package/dist/react/hooks.js.map +1 -1
  32. package/dist/react/sockets.cjs +5 -6
  33. package/dist/react/sockets.cjs.map +1 -1
  34. package/dist/react/sockets.js +5 -6
  35. package/dist/react/sockets.js.map +1 -1
  36. package/dist/react/themes.cjs +61 -18
  37. package/dist/react/themes.cjs.map +1 -1
  38. package/dist/react/themes.js +63 -20
  39. package/dist/react/themes.js.map +1 -1
  40. package/dist/runtime.cjs +531 -104
  41. package/dist/runtime.cjs.map +1 -1
  42. package/dist/runtime.d.mts +2 -2
  43. package/dist/runtime.d.ts +2 -2
  44. package/dist/runtime.js +531 -104
  45. package/dist/runtime.js.map +1 -1
  46. package/package.json +56 -14
@@ -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