@fluixi/core 1.0.0-alpha.83 → 1.0.0-alpha.85

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 (182) hide show
  1. package/dist/cdn/core.global.js +2 -1
  2. package/dist/cli/generate.cjs +4117 -292
  3. package/dist/cli/generate.mjs +4122 -292
  4. package/dist/cli/index.cjs +4117 -292
  5. package/dist/cli/index.mjs +4122 -292
  6. package/dist/cli/run.cjs +63 -1
  7. package/dist/cli/run.mjs +39 -1
  8. package/dist/src/cdn/chunk-MDJLC3PE.mjs +830 -0
  9. package/dist/src/cdn/core.cjs +1365 -1
  10. package/dist/src/cdn/core.d.ts +3 -3
  11. package/dist/src/cdn/core.js +3 -3
  12. package/dist/src/cdn/core.mjs +642 -1
  13. package/dist/src/cdn/router-JYFZP3EZ.mjs +70 -0
  14. package/dist/src/index.cjs +1280 -1
  15. package/dist/src/index.d.ts.map +1 -1
  16. package/dist/src/index.js +1 -11
  17. package/dist/src/index.mjs +1393 -1
  18. package/dist/src/jsx-dev-runtime.cjs +26 -1
  19. package/dist/src/jsx-dev-runtime.mjs +24 -1
  20. package/dist/src/jsx-runtime.cjs +26 -1
  21. package/dist/src/jsx-runtime.js +0 -9
  22. package/dist/src/jsx-runtime.mjs +24 -1
  23. package/dist/src/lib/client/chunk-7IUN2FLI.mjs +133 -0
  24. package/dist/src/lib/client/index.cjs +956 -1
  25. package/dist/src/lib/client/index.d.ts +17 -6
  26. package/dist/src/lib/client/index.d.ts.map +1 -1
  27. package/dist/src/lib/client/index.js +26 -19
  28. package/dist/src/lib/client/index.mjs +222 -1
  29. package/dist/src/lib/client/router-NOFEMOEH.mjs +631 -0
  30. package/dist/src/lib/context/context.cjs +118 -1
  31. package/dist/src/lib/context/context.d.ts +19 -37
  32. package/dist/src/lib/context/context.d.ts.map +1 -1
  33. package/dist/src/lib/context/context.js +8 -45
  34. package/dist/src/lib/context/context.mjs +99 -1
  35. package/dist/src/lib/context/index.cjs +120 -1
  36. package/dist/src/lib/context/index.mjs +99 -1
  37. package/dist/src/lib/control-flow.cjs +35 -1
  38. package/dist/src/lib/control-flow.mjs +25 -1
  39. package/dist/src/lib/core.cjs +1279 -1
  40. package/dist/src/lib/core.d.ts +0 -2
  41. package/dist/src/lib/core.d.ts.map +1 -1
  42. package/dist/src/lib/core.js +14 -48
  43. package/dist/src/lib/core.mjs +1393 -1
  44. package/dist/src/lib/env/index.cjs +60 -1
  45. package/dist/src/lib/env/index.d.ts +5 -5
  46. package/dist/src/lib/env/index.js +5 -5
  47. package/dist/src/lib/env/index.mjs +39 -1
  48. package/dist/src/lib/i18n/index.cjs +108 -1
  49. package/dist/src/lib/i18n/index.d.ts +31 -10
  50. package/dist/src/lib/i18n/index.d.ts.map +1 -1
  51. package/dist/src/lib/i18n/index.js +31 -10
  52. package/dist/src/lib/i18n/index.mjs +88 -1
  53. package/dist/src/lib/index.cjs +633 -1
  54. package/dist/src/lib/index.d.ts +0 -2
  55. package/dist/src/lib/index.d.ts.map +1 -1
  56. package/dist/src/lib/index.js +5 -11
  57. package/dist/src/lib/index.mjs +721 -1
  58. package/dist/src/lib/isomorphic.cjs +85 -1
  59. package/dist/src/lib/isomorphic.d.ts +41 -8
  60. package/dist/src/lib/isomorphic.d.ts.map +1 -1
  61. package/dist/src/lib/isomorphic.js +38 -5
  62. package/dist/src/lib/isomorphic.mjs +64 -1
  63. package/dist/src/lib/jsx-runtime/index.cjs +21 -1
  64. package/dist/src/lib/jsx-runtime/index.d.ts +1 -1
  65. package/dist/src/lib/jsx-runtime/index.js +1 -11
  66. package/dist/src/lib/jsx-runtime/index.mjs +4 -1
  67. package/dist/src/lib/jsx-runtime/jsx-dev-runtime.cjs +21 -1
  68. package/dist/src/lib/jsx-runtime/jsx-dev-runtime.mjs +4 -1
  69. package/dist/src/lib/plugins/fluixi-routes-plugin.cjs +302 -8
  70. package/dist/src/lib/plugins/fluixi-routes-plugin.d.ts +15 -1
  71. package/dist/src/lib/plugins/fluixi-routes-plugin.d.ts.map +1 -1
  72. package/dist/src/lib/plugins/fluixi-routes-plugin.js +19 -5
  73. package/dist/src/lib/plugins/fluixi-routes-plugin.mjs +271 -8
  74. package/dist/src/lib/plugins/index.cjs +311 -8
  75. package/dist/src/lib/plugins/index.mjs +279 -8
  76. package/dist/src/lib/plugins/route-codegen.cjs +73 -8
  77. package/dist/src/lib/plugins/route-codegen.d.ts +0 -1
  78. package/dist/src/lib/plugins/route-codegen.d.ts.map +1 -1
  79. package/dist/src/lib/plugins/route-codegen.js +4 -5
  80. package/dist/src/lib/plugins/route-codegen.mjs +52 -8
  81. package/dist/src/lib/plugins/route-scanner.cjs +189 -1
  82. package/dist/src/lib/plugins/route-scanner.d.ts +1 -2
  83. package/dist/src/lib/plugins/route-scanner.d.ts.map +1 -1
  84. package/dist/src/lib/plugins/route-scanner.js +7 -8
  85. package/dist/src/lib/plugins/route-scanner.mjs +158 -1
  86. package/dist/src/lib/plugins/vite.cjs +27 -1
  87. package/dist/src/lib/plugins/vite.mjs +6 -1
  88. package/dist/src/lib/render/await.cjs +38 -1
  89. package/dist/src/lib/render/await.d.ts +18 -0
  90. package/dist/src/lib/render/await.d.ts.map +1 -1
  91. package/dist/src/lib/render/await.js +20 -2
  92. package/dist/src/lib/render/await.mjs +17 -1
  93. package/dist/src/lib/render/component.cjs +221 -1
  94. package/dist/src/lib/render/component.d.ts +3 -44
  95. package/dist/src/lib/render/component.d.ts.map +1 -1
  96. package/dist/src/lib/render/component.js +23 -55
  97. package/dist/src/lib/render/component.mjs +214 -1
  98. package/dist/src/lib/render/deferred.cjs +175 -1
  99. package/dist/src/lib/render/deferred.js +5 -5
  100. package/dist/src/lib/render/deferred.mjs +158 -1
  101. package/dist/src/lib/render/index.cjs +573 -1
  102. package/dist/src/lib/render/index.d.ts +3 -17
  103. package/dist/src/lib/render/index.d.ts.map +1 -1
  104. package/dist/src/lib/render/index.js +8 -22
  105. package/dist/src/lib/render/index.mjs +590 -1
  106. package/dist/src/lib/render/lazy.cjs +67 -1
  107. package/dist/src/lib/render/lazy.d.ts +22 -1
  108. package/dist/src/lib/render/lazy.d.ts.map +1 -1
  109. package/dist/src/lib/render/lazy.js +26 -5
  110. package/dist/src/lib/render/lazy.mjs +50 -1
  111. package/dist/src/lib/render/suspense.cjs +141 -1
  112. package/dist/src/lib/render/suspense.d.ts +40 -0
  113. package/dist/src/lib/render/suspense.d.ts.map +1 -1
  114. package/dist/src/lib/render/suspense.js +46 -6
  115. package/dist/src/lib/render/suspense.mjs +136 -1
  116. package/dist/src/lib/render/versions.cjs +35 -1
  117. package/dist/src/lib/render/versions.js +6 -6
  118. package/dist/src/lib/render/versions.mjs +14 -1
  119. package/dist/src/lib/router/data.cjs +230 -1
  120. package/dist/src/lib/router/data.d.ts +1 -13
  121. package/dist/src/lib/router/data.d.ts.map +1 -1
  122. package/dist/src/lib/router/data.js +0 -12
  123. package/dist/src/lib/router/data.mjs +214 -1
  124. package/dist/src/lib/router/index.cjs +709 -1
  125. package/dist/src/lib/router/index.d.ts +78 -23
  126. package/dist/src/lib/router/index.d.ts.map +1 -1
  127. package/dist/src/lib/router/index.js +161 -37
  128. package/dist/src/lib/router/index.mjs +722 -1
  129. package/dist/src/lib/router/transition.cjs +75 -0
  130. package/dist/src/lib/router/transition.d.ts +81 -0
  131. package/dist/src/lib/router/transition.d.ts.map +1 -0
  132. package/dist/src/lib/router/transition.js +136 -0
  133. package/dist/src/lib/router/transition.mjs +54 -0
  134. package/dist/src/lib/server/hydration.cjs +169 -1
  135. package/dist/src/lib/server/hydration.d.ts +15 -55
  136. package/dist/src/lib/server/hydration.d.ts.map +1 -1
  137. package/dist/src/lib/server/hydration.js +23 -62
  138. package/dist/src/lib/server/hydration.mjs +148 -1
  139. package/dist/src/lib/server/index.cjs +401 -11
  140. package/dist/src/lib/server/index.d.ts +30 -6
  141. package/dist/src/lib/server/index.d.ts.map +1 -1
  142. package/dist/src/lib/server/index.js +34 -11
  143. package/dist/src/lib/server/index.mjs +379 -11
  144. package/dist/src/lib/server/reactive.cjs +197 -1
  145. package/dist/src/lib/server/reactive.d.ts +18 -77
  146. package/dist/src/lib/server/reactive.d.ts.map +1 -1
  147. package/dist/src/lib/server/reactive.js +19 -78
  148. package/dist/src/lib/server/reactive.mjs +176 -1
  149. package/dist/src/lib/theme/index.cjs +110 -1
  150. package/dist/src/lib/theme/index.d.ts +19 -4
  151. package/dist/src/lib/theme/index.d.ts.map +1 -1
  152. package/dist/src/lib/theme/index.js +17 -2
  153. package/dist/src/lib/theme/index.mjs +89 -1
  154. package/dist/src/lib/utils/index.cjs +209 -1
  155. package/dist/src/lib/utils/index.d.ts +0 -93
  156. package/dist/src/lib/utils/index.d.ts.map +1 -1
  157. package/dist/src/lib/utils/index.js +0 -93
  158. package/dist/src/lib/utils/index.mjs +188 -1
  159. package/dist/src/routes.cjs +37 -1
  160. package/dist/src/routes.d.ts +1 -1
  161. package/dist/src/routes.js +2 -2
  162. package/dist/src/routes.mjs +17 -1
  163. package/dist/src/server.cjs +400 -11
  164. package/dist/src/server.d.ts +0 -1
  165. package/dist/src/server.d.ts.map +1 -1
  166. package/dist/src/server.js +0 -1
  167. package/dist/src/server.mjs +377 -11
  168. package/dist/src/utils.cjs +21 -1
  169. package/dist/src/utils.d.ts +1 -1
  170. package/dist/src/utils.js +1 -1
  171. package/dist/src/utils.mjs +4 -1
  172. package/dist/src/version.generated.cjs +26 -1
  173. package/dist/src/version.generated.d.ts +1 -1
  174. package/dist/src/version.generated.js +2 -2
  175. package/dist/src/version.generated.mjs +5 -1
  176. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  177. package/package.json +17 -16
  178. package/src/index.ts +2 -14
  179. package/dist/src/cdn/chunk-55BT3H6E.mjs +0 -1
  180. package/dist/src/cdn/router-5JJZBK4E.mjs +0 -1
  181. package/dist/src/lib/client/chunk-SM4WHBOP.mjs +0 -1
  182. package/dist/src/lib/client/router-IBD4WPQT.mjs +0 -1
@@ -1,16 +1,406 @@
1
- "use strict";var T=Object.defineProperty;var st=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var ut=Object.prototype.hasOwnProperty;var dt=(t,e)=>{for(var n in e)T(t,n,{get:e[n],enumerable:!0})},lt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ct(e))!ut.call(t,o)&&o!==n&&T(t,o,{get:()=>e[o],enumerable:!(r=st(e,o))||r.enumerable});return t};var pt=t=>lt(T({},"__esModule",{value:!0}),t);var mt={};dt(mt,{batch:()=>I,cleanupHydration:()=>S,clearHydrationData:()=>g,clearHydrationDataKey:()=>H,createComputed:()=>P,createContext:()=>U,createDeferred:()=>X,createEffect:()=>f,createHtmlDocument:()=>tt,createHydratableResource:()=>k,createMemo:()=>m,createRenderEffect:()=>V,createResource:()=>J,createRoot:()=>F,createSelector:()=>B,createSignal:()=>K,deserializeHydrationData:()=>b,getHydrationData:()=>d,getOwner:()=>W,getSSRContext:()=>ft,hasHydrationData:()=>R,hydrationMarker:()=>O,hydrationMarkerEnd:()=>A,hydrationMarkerStart:()=>E,isClient:()=>nt,isClientEnvironment:()=>M,isClientReactive:()=>Q,isHydrating:()=>x,isServer:()=>et,isServerEnvironment:()=>j,isServerReactive:()=>G,onCleanup:()=>z,onClient:()=>gt,onServer:()=>xt,renderToPage:()=>Z,renderToStream:()=>rt,renderToString:()=>h,runWithOwner:()=>L,serializeHydrationData:()=>l,setHydrating:()=>D,setHydrationData:()=>u,setSSRContext:()=>yt,startServer:()=>St,startTransition:()=>q,untrack:()=>N,useContext:()=>Y,useHydrationData:()=>_,withSSRContext:()=>Tt});module.exports=pt(mt);var C=!1,a=new Map;function x(){return C}function D(t){C=t}function u(t,e){a.set(t,e)}function d(t){return a.get(t)}function R(t){return a.has(t)}function g(){a.clear()}function H(t){a.delete(t)}function l(){if(a.size===0)return"";let t=Object.fromEntries(a);return`<script type="application/json" id="__FLUIXI_HYDRATION__">${JSON.stringify(t)}<\/script>`}function b(){if(typeof window>"u")return!1;let t=document.getElementById("__FLUIXI_HYDRATION__");if(!t||t.getAttribute("type")!=="application/json")return!1;try{let e=t.textContent||"{}",n=JSON.parse(e);for(let[r,o]of Object.entries(n))a.set(r,o);return!0}catch(e){return console.error("Failed to deserialize hydration data:",e),!1}}function O(t){return`<!--#${t}-->`}function E(t){return`<!--#${t}-->`}function A(t){return`<!--/${t}-->`}function k(t,e){return async()=>{if(x()||typeof window<"u"){let r=d(t);if(r!==void 0)return r}let n=await e();return typeof window>"u"&&u(t,n),n}}function _(t,e){let n=d(t);if(n!==void 0)return n;let r=typeof e=="function"?e():e;return typeof window>"u"&&u(t,r),r}function S(){if(typeof window>"u")return;let t=document.getElementById("__FLUIXI_HYDRATION__");t&&t.remove();let e=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null),n=[],r;for(;r=e.nextNode();){let o=r,i=o.nodeValue||"";(i.startsWith("#")||i.startsWith("/"))&&n.push(o)}n.forEach(o=>o.remove()),g()}typeof window<"u"&&window.addEventListener("load",()=>{setTimeout(S,100)});function j(){return typeof window>"u"}function M(){return typeof window<"u"}var v=require("@fluixi/server");function K(t,e){let n=t;return[(()=>n),i=>(typeof i=="function"?n=i(n):n=i,n)]}function f(t,e,n){try{t(e)}catch(r){console.error("[Fluixi Server] Effect error:",r)}return{dispose:()=>{}}}function m(t,e,n){let r=t(e);return(()=>r)}function F(t){let e=[],n=()=>{e.forEach(r=>{try{r()}catch(o){console.error("[Fluixi Server] Cleanup error:",o)}}),e.length=0};try{return t(n)}catch(r){throw n(),r}}function I(t){return t()}function N(t){return t()}var $=null;function z(t){$&&$.push(t)}var p=null;function W(){return p}function L(t,e){let n=p;p=t;try{return e()}finally{p=n}}var s=new Map;function U(t){let e=Symbol("context");return{id:e,Provider:r=>{let o=s.get(e);s.set(e,r.value);try{return r.children}finally{o!==void 0?s.set(e,o):s.delete(e)}},defaultValue:t}}function Y(t){let e=s.get(t.id);return e!==void 0?e:t.defaultValue}function P(t){return f(t)}function V(t){return f(t)}function X(t){return m(t)}function B(t){let e=t();return n=>n===e}function J(t,e,n){return[()=>{},{mutate:r=>r,refetch:()=>{}}]}function q(t){t()}var G=!0,Q=!1;var c=null;function ft(){return c}function yt(t){c=t}function Tt(t,e){let n=c;c=t;try{return e()}finally{c=n}}async function Z(t,e={}){let n=await h(t);return tt(n,e)}function tt(t,e={}){let{title:n="Fluixi App",lang:r="en",stylesheets:o=[],scripts:i=[],head:ot="",bodyAttributes:w=""}=e,it=o.map(y=>`<link rel="stylesheet" href="${y}">`).join(`
2
- `),at=i.map(y=>`<script type="module" src="${y}"><\/script>`).join(`
3
- `);return`<!DOCTYPE html>
4
- <html lang="${r}">
1
+ /*! @fluixi/core v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/lib/server/index.ts
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
+ batch: () => batch,
25
+ cleanupHydration: () => cleanupHydration,
26
+ clearHydrationData: () => clearHydrationData,
27
+ clearHydrationDataKey: () => clearHydrationDataKey,
28
+ createComputed: () => createComputed,
29
+ createContext: () => createContext,
30
+ createDeferred: () => createDeferred,
31
+ createEffect: () => createEffect,
32
+ createHtmlDocument: () => createHtmlDocument,
33
+ createHydratableResource: () => createHydratableResource,
34
+ createMemo: () => createMemo,
35
+ createRenderEffect: () => createRenderEffect,
36
+ createResource: () => createResource,
37
+ createRoot: () => createRoot,
38
+ createSelector: () => createSelector,
39
+ createSignal: () => createSignal,
40
+ deserializeHydrationData: () => deserializeHydrationData,
41
+ getHydrationData: () => getHydrationData,
42
+ getOwner: () => getOwner,
43
+ getSSRContext: () => getSSRContext,
44
+ hasHydrationData: () => hasHydrationData,
45
+ hydrationMarker: () => hydrationMarker,
46
+ hydrationMarkerEnd: () => hydrationMarkerEnd,
47
+ hydrationMarkerStart: () => hydrationMarkerStart,
48
+ isClient: () => isClient2,
49
+ isClientEnvironment: () => isClientEnvironment,
50
+ isClientReactive: () => isClient,
51
+ isHydrating: () => isHydrating,
52
+ isServer: () => import_dom2.isServer,
53
+ isServerEnvironment: () => isServerEnvironment,
54
+ isServerReactive: () => isServer,
55
+ onCleanup: () => onCleanup,
56
+ onClient: () => onClient,
57
+ onServer: () => onServer,
58
+ renderToPage: () => renderToPage,
59
+ renderToStream: () => renderToStream,
60
+ renderToString: () => renderToString,
61
+ runWithOwner: () => runWithOwner,
62
+ serializeHydrationData: () => serializeHydrationData,
63
+ setHydrating: () => setHydrating,
64
+ setHydrationData: () => setHydrationData,
65
+ setSSRContext: () => setSSRContext,
66
+ startServer: () => startServer,
67
+ startTransition: () => startTransition,
68
+ untrack: () => untrack,
69
+ useContext: () => useContext,
70
+ useHydrationData: () => useHydrationData,
71
+ withSSRContext: () => withSSRContext
72
+ });
73
+ module.exports = __toCommonJS(index_exports);
74
+
75
+ // src/lib/server/hydration.ts
76
+ var import_dom = require("@fluixi/dom");
77
+ var hydrating = false;
78
+ var hydrationDataMap = /* @__PURE__ */ new Map();
79
+ function isHydrating() {
80
+ return hydrating;
81
+ }
82
+ function setHydrating(state) {
83
+ hydrating = state;
84
+ }
85
+ function setHydrationData(key, data) {
86
+ hydrationDataMap.set(key, data);
87
+ }
88
+ function getHydrationData(key) {
89
+ return hydrationDataMap.get(key);
90
+ }
91
+ function hasHydrationData(key) {
92
+ return hydrationDataMap.has(key);
93
+ }
94
+ function clearHydrationData() {
95
+ hydrationDataMap.clear();
96
+ }
97
+ function clearHydrationDataKey(key) {
98
+ hydrationDataMap.delete(key);
99
+ }
100
+ function serializeHydrationData() {
101
+ if (hydrationDataMap.size === 0) {
102
+ return "";
103
+ }
104
+ const data = Object.fromEntries(hydrationDataMap);
105
+ const json = JSON.stringify(data);
106
+ return `<script type="application/json" id="__FLUIXI_HYDRATION__">${json}<\/script>`;
107
+ }
108
+ function deserializeHydrationData() {
109
+ if (typeof window === "undefined") {
110
+ return false;
111
+ }
112
+ const script = document.getElementById("__FLUIXI_HYDRATION__");
113
+ if (!script || script.getAttribute("type") !== "application/json") {
114
+ return false;
115
+ }
116
+ try {
117
+ const json = script.textContent || "{}";
118
+ const data = JSON.parse(json);
119
+ for (const [key, value] of Object.entries(data)) {
120
+ hydrationDataMap.set(key, value);
121
+ }
122
+ return true;
123
+ } catch (error) {
124
+ console.error("Failed to deserialize hydration data:", error);
125
+ return false;
126
+ }
127
+ }
128
+ function hydrationMarker(id) {
129
+ return `<!--#${id}-->`;
130
+ }
131
+ function hydrationMarkerStart(id) {
132
+ return `<!--#${id}-->`;
133
+ }
134
+ function hydrationMarkerEnd(id) {
135
+ return `<!--/${id}-->`;
136
+ }
137
+ function createHydratableResource(key, fetcher) {
138
+ return async () => {
139
+ if (isHydrating() || typeof window !== "undefined") {
140
+ const cached = getHydrationData(key);
141
+ if (cached !== void 0) {
142
+ return cached;
143
+ }
144
+ }
145
+ const data = await fetcher();
146
+ if (typeof window === "undefined") {
147
+ setHydrationData(key, data);
148
+ }
149
+ return data;
150
+ };
151
+ }
152
+ function useHydrationData(key, value) {
153
+ const hydrationData = getHydrationData(key);
154
+ if (hydrationData !== void 0) {
155
+ return hydrationData;
156
+ }
157
+ const computedValue = typeof value === "function" ? value() : value;
158
+ if (typeof window === "undefined") {
159
+ setHydrationData(key, computedValue);
160
+ }
161
+ return computedValue;
162
+ }
163
+ function cleanupHydration() {
164
+ if (typeof window === "undefined") {
165
+ return;
166
+ }
167
+ const script = document.getElementById("__FLUIXI_HYDRATION__");
168
+ if (script) {
169
+ script.remove();
170
+ }
171
+ const walker = document.createTreeWalker(
172
+ document.body,
173
+ NodeFilter.SHOW_COMMENT,
174
+ null
175
+ );
176
+ const comments = [];
177
+ let node;
178
+ while (node = walker.nextNode()) {
179
+ const comment = node;
180
+ const text = comment.nodeValue || "";
181
+ if (text.startsWith("#") || text.startsWith("/")) {
182
+ comments.push(comment);
183
+ }
184
+ }
185
+ comments.forEach((comment) => comment.remove());
186
+ clearHydrationData();
187
+ }
188
+ if (typeof window !== "undefined") {
189
+ window.addEventListener("load", () => {
190
+ setTimeout(cleanupHydration, 100);
191
+ });
192
+ }
193
+ function isServerEnvironment() {
194
+ return (0, import_dom.isServer)();
195
+ }
196
+ function isClientEnvironment() {
197
+ return !(0, import_dom.isServer)();
198
+ }
199
+
200
+ // src/lib/server/index.ts
201
+ var import_server = require("@fluixi/server");
202
+ var import_dom2 = require("@fluixi/dom");
203
+
204
+ // src/lib/server/reactive.ts
205
+ function createSignal(value, options) {
206
+ let current = value;
207
+ const read = (() => current);
208
+ const write = (newValue) => {
209
+ if (typeof newValue === "function") {
210
+ current = newValue(current);
211
+ } else {
212
+ current = newValue;
213
+ }
214
+ return current;
215
+ };
216
+ return [read, write];
217
+ }
218
+ function createEffect(fn, value, options) {
219
+ try {
220
+ fn(value);
221
+ } catch (error) {
222
+ console.error("[Fluixi Server] Effect error:", error);
223
+ }
224
+ return { dispose: () => {
225
+ } };
226
+ }
227
+ function createMemo(fn, value, options) {
228
+ const computed = fn(value);
229
+ return (() => computed);
230
+ }
231
+ function createRoot(fn) {
232
+ const cleanups = [];
233
+ const dispose = () => {
234
+ cleanups.forEach((cleanup) => {
235
+ try {
236
+ cleanup();
237
+ } catch (error) {
238
+ console.error("[Fluixi Server] Cleanup error:", error);
239
+ }
240
+ });
241
+ cleanups.length = 0;
242
+ };
243
+ try {
244
+ return fn(dispose);
245
+ } catch (error) {
246
+ dispose();
247
+ throw error;
248
+ }
249
+ }
250
+ function batch(fn) {
251
+ return fn();
252
+ }
253
+ function untrack(fn) {
254
+ return fn();
255
+ }
256
+ var currentCleanups = null;
257
+ function onCleanup(fn) {
258
+ if (currentCleanups) {
259
+ currentCleanups.push(fn);
260
+ }
261
+ }
262
+ var currentOwner = null;
263
+ function getOwner() {
264
+ return currentOwner;
265
+ }
266
+ function runWithOwner(owner, fn) {
267
+ const prev = currentOwner;
268
+ currentOwner = owner;
269
+ try {
270
+ return fn();
271
+ } finally {
272
+ currentOwner = prev;
273
+ }
274
+ }
275
+ var contextMap = /* @__PURE__ */ new Map();
276
+ function createContext(defaultValue) {
277
+ const id = /* @__PURE__ */ Symbol("context");
278
+ const Provider = (props) => {
279
+ const prevValue = contextMap.get(id);
280
+ contextMap.set(id, props.value);
281
+ try {
282
+ return props.children;
283
+ } finally {
284
+ if (prevValue !== void 0) {
285
+ contextMap.set(id, prevValue);
286
+ } else {
287
+ contextMap.delete(id);
288
+ }
289
+ }
290
+ };
291
+ return {
292
+ id,
293
+ Provider,
294
+ defaultValue
295
+ };
296
+ }
297
+ function useContext(context) {
298
+ const value = contextMap.get(context.id);
299
+ return value !== void 0 ? value : context.defaultValue;
300
+ }
301
+ function createComputed(fn) {
302
+ return createEffect(fn);
303
+ }
304
+ function createRenderEffect(fn) {
305
+ return createEffect(fn);
306
+ }
307
+ function createDeferred(fn) {
308
+ return createMemo(fn);
309
+ }
310
+ function createSelector(source) {
311
+ const value = source();
312
+ return (key) => key === value;
313
+ }
314
+ function createResource(source, fetcher, options) {
315
+ return [
316
+ () => void 0,
317
+ {
318
+ mutate: (v) => v,
319
+ refetch: () => {
320
+ }
321
+ }
322
+ ];
323
+ }
324
+ function startTransition(fn) {
325
+ fn();
326
+ }
327
+ var isServer = true;
328
+ var isClient = false;
329
+
330
+ // src/lib/server/index.ts
331
+ var import_dom3 = require("@fluixi/dom");
332
+ var currentSSRContext = null;
333
+ function getSSRContext() {
334
+ return currentSSRContext;
335
+ }
336
+ function setSSRContext(context) {
337
+ currentSSRContext = context;
338
+ }
339
+ function withSSRContext(context, fn) {
340
+ const prev = currentSSRContext;
341
+ currentSSRContext = context;
342
+ try {
343
+ return fn();
344
+ } finally {
345
+ currentSSRContext = prev;
346
+ }
347
+ }
348
+ async function renderToPage(code, options = {}) {
349
+ const content = await renderToString(code);
350
+ return createHtmlDocument(content, options);
351
+ }
352
+ function createHtmlDocument(content, options = {}) {
353
+ const {
354
+ title = "Fluixi App",
355
+ lang = "en",
356
+ stylesheets = [],
357
+ scripts = [],
358
+ head = "",
359
+ bodyAttributes = ""
360
+ } = options;
361
+ const styleTags = stylesheets.map((href) => `<link rel="stylesheet" href="${href}">`).join("\n ");
362
+ const scriptTags = scripts.map((src) => `<script type="module" src="${src}"><\/script>`).join("\n ");
363
+ return `<!DOCTYPE html>
364
+ <html lang="${lang}">
5
365
  <head>
6
366
  <meta charset="UTF-8">
7
367
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
- <title>${n}</title>
9
- ${it}
10
- ${ot}
368
+ <title>${title}</title>
369
+ ${styleTags}
370
+ ${head}
11
371
  </head>
12
- <body${w?" "+w:""}>
13
- ${t}
14
- ${at}
372
+ <body${bodyAttributes ? " " + bodyAttributes : ""}>
373
+ ${content}
374
+ ${scriptTags}
15
375
  </body>
16
- </html>`}function et(){return typeof window>"u"}function nt(){return typeof window<"u"}function xt(t,e){return et()?t():e}function gt(t,e){return nt()?t():e}async function h(t){let e=await(0,v.renderToString)(t),n=l();return e+n}async function rt(t){let e=await(0,v.renderToString)(t),n=l();return e+n}function St(t){return{render:e=>h(()=>t({url:e})),stream:e=>rt(()=>t({url:e})),page:(e,n)=>Z(()=>t({url:e}),n)}}
376
+ </html>`;
377
+ }
378
+ function isClient2() {
379
+ return !(0, import_dom3.isServer)();
380
+ }
381
+ function onServer(fn, fallback) {
382
+ return (0, import_dom3.isServer)() ? fn() : fallback;
383
+ }
384
+ function onClient(fn, fallback) {
385
+ return !(0, import_dom3.isServer)() ? fn() : fallback;
386
+ }
387
+ async function renderToString(code) {
388
+ const html = await (0, import_server.renderToString)(code);
389
+ const script = serializeHydrationData();
390
+ return html + script;
391
+ }
392
+ async function renderToStream(code) {
393
+ const html = await (0, import_server.renderToString)(code);
394
+ const script = serializeHydrationData();
395
+ return html + script;
396
+ }
397
+ function startServer(App) {
398
+ return {
399
+ /** Render the app to a full HTML string (includes hydration data) */
400
+ render: (url) => renderToString(() => App({ url })),
401
+ /** Render the app to a streamable HTML string (includes hydration data) */
402
+ stream: (url) => renderToStream(() => App({ url })),
403
+ /** Render the app to a complete HTML page document */
404
+ page: (url, opts) => renderToPage(() => App({ url }), opts)
405
+ };
406
+ }
@@ -1,5 +1,4 @@
1
1
  /**
2
- * @fileoverview Server-Side Rendering Entry Point for Fluixi
3
2
  * @module @fluixi/core/server
4
3
  *
5
4
  * Implements Unified SSR Engine compatible with Lit and JSX.
@@ -38,19 +37,44 @@ export declare function setSSRContext(context: SSRContext | null): void;
38
37
  export declare function withSSRContext<T>(context: SSRContext, fn: () => T): T;
39
38
  /**
40
39
  * Render complete HTML page
41
- *
42
- * @param {() => any} code - Component function
43
- * @param {DocumentOptions} options - Document options
44
- * @returns {Promise<string>} Complete HTML document
45
40
  */
46
41
  export declare function renderToPage(code: () => any, options?: DocumentOptions): Promise<string>;
47
42
  /**
48
43
  * Create HTML document wrapper
49
44
  */
50
45
  export declare function createHtmlDocument(content: string, options?: DocumentOptions): string;
51
- export declare function isServer(): boolean;
46
+ /**
47
+ * Whether this is a server render.
48
+ *
49
+ * Re-exported from `@fluixi/dom`, which owns the answer: the flag lives on a realm
50
+ * singleton that `renderToString` sets, so it is true for the whole of a server render
51
+ * even in a jsdom process where `window` exists.
52
+ *
53
+ * This used to be a local `typeof window === 'undefined'`, which meant
54
+ * `@fluixi/core/server` and `@fluixi/core` disagreed about the same question, and the
55
+ * local one was wrong in exactly the case that matters. Four copies of that test were
56
+ * the alpha.83 SSR bug; do not add a fifth.
57
+ */
58
+ export { isServer } from '@fluixi/dom';
59
+ /** Whether this is running in a browser, which is the negation of a server render. */
52
60
  export declare function isClient(): boolean;
61
+ /**
62
+ * Run `fn` only during a server render, otherwise take `fallback`.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const secret = onServer(() => process.env.API_KEY, '');
67
+ * ```
68
+ */
53
69
  export declare function onServer<T>(fn: () => T, fallback: T): T;
70
+ /**
71
+ * Run `fn` only in the browser, otherwise take `fallback`.
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * const width = onClient(() => window.innerWidth, 0);
76
+ * ```
77
+ */
54
78
  export declare function onClient<T>(fn: () => T, fallback: T): T;
55
79
  /**
56
80
  * Render component to HTML string
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AAUxB;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,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CAAE,KAAK,GAAG;IAE5D,qEAAqE;kBACvD,MAAM;IACpB,2EAA2E;kBAC7D,MAAM;IACpB,sDAAsD;gBAC1C,MAAM,SAAS,eAAe;EAG7C;AAGD,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,KAAK,EACL,OAAO,EACP,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,QAAQ,IAAI,gBAAgB,EAC5B,QAAQ,IAAI,gBAAgB,GAC7B,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,WAAW,EACX,QAAQ,EACR,MAAM,EACN,aAAa,EACb,SAAS,EACT,OAAO,GACR,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,GACpB,CAAC;AAEF,YAAY,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AAUxB;;GAEG;AACH,MAAM,WAAW,UAAU;IACz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
3
2
  * @module @fluixi/core/server
4
3
  *
5
4
  * Implements Unified SSR Engine compatible with Lit and JSX.
@@ -42,10 +41,6 @@ export function withSSRContext(context, fn) {
42
41
  // ============================================================================
43
42
  /**
44
43
  * Render complete HTML page
45
- *
46
- * @param {() => any} code - Component function
47
- * @param {DocumentOptions} options - Document options
48
- * @returns {Promise<string>} Complete HTML document
49
44
  */
50
45
  export async function renderToPage(code, options = {}) {
51
46
  const content = await renderToString(code);
@@ -80,17 +75,44 @@ export function createHtmlDocument(content, options = {}) {
80
75
  // ============================================================================
81
76
  // ENVIRONMENT DETECTION
82
77
  // ============================================================================
83
- export function isServer() {
84
- return typeof window === 'undefined';
85
- }
78
+ /**
79
+ * Whether this is a server render.
80
+ *
81
+ * Re-exported from `@fluixi/dom`, which owns the answer: the flag lives on a realm
82
+ * singleton that `renderToString` sets, so it is true for the whole of a server render
83
+ * even in a jsdom process where `window` exists.
84
+ *
85
+ * This used to be a local `typeof window === 'undefined'`, which meant
86
+ * `@fluixi/core/server` and `@fluixi/core` disagreed about the same question, and the
87
+ * local one was wrong in exactly the case that matters. Four copies of that test were
88
+ * the alpha.83 SSR bug; do not add a fifth.
89
+ */
90
+ export { isServer } from '@fluixi/dom';
91
+ /** Whether this is running in a browser, which is the negation of a server render. */
86
92
  export function isClient() {
87
- return typeof window !== 'undefined';
93
+ return !domIsServer();
88
94
  }
95
+ /**
96
+ * Run `fn` only during a server render, otherwise take `fallback`.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * const secret = onServer(() => process.env.API_KEY, '');
101
+ * ```
102
+ */
89
103
  export function onServer(fn, fallback) {
90
- return isServer() ? fn() : fallback;
104
+ return domIsServer() ? fn() : fallback;
91
105
  }
106
+ /**
107
+ * Run `fn` only in the browser, otherwise take `fallback`.
108
+ *
109
+ * @example
110
+ * ```ts
111
+ * const width = onClient(() => window.innerWidth, 0);
112
+ * ```
113
+ */
92
114
  export function onClient(fn, fallback) {
93
- return isClient() ? fn() : fallback;
115
+ return !domIsServer() ? fn() : fallback;
94
116
  }
95
117
  // ============================================================================
96
118
  // EXPORTS
@@ -137,5 +159,6 @@ export function startServer(App) {
137
159
  }
138
160
  // Re-export server-mapped reactive primitives
139
161
  export { createSignal, createEffect, createMemo, createRoot, batch, untrack, onCleanup, getOwner, runWithOwner, createContext, useContext, createComputed, createRenderEffect, createDeferred, createSelector, createResource, startTransition, isServer as isServerReactive, isClient as isClientReactive, } from './reactive.js';
162
+ import { isServer as domIsServer } from '@fluixi/dom';
140
163
  // Re-export all hydration utilities
141
164
  export { isHydrating, setHydrating, setHydrationData, getHydrationData, hasHydrationData, clearHydrationData, clearHydrationDataKey, serializeHydrationData, deserializeHydrationData, hydrationMarker, hydrationMarkerStart, hydrationMarkerEnd, createHydratableResource, useHydrationData, cleanupHydration, isServerEnvironment, isClientEnvironment, };