@carats/ssr 0.0.5 → 0.0.6

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 (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{getPageComponent as c,renderPage as m}from"@carats/render";import{init as f,transpile as g}from"jjsx";function y(a,n){f();async function l(e){let{component:s,params:t}=c.call(a,e.url.replace("/api","")),o=Object.keys(n).find(r=>r.endsWith(`${s.name}.api.ts`));return o?await n[o].default({...e,params:t}):s.defaultProps||{...e,params:t}}async function p(e){let{suspense:{error:s}}=a,{component:t,params:o}=c.call(a,e.url),i=await l(e),r=t.head||"";r+=`
2
- <script>window.ssp=${JSON.stringify({for:t.name,data:i})}</script>`,r=r.trim();let u=await m.call(a,t,i);try{return{html:u,head:r}}catch(d){return{html:g(s(d)),head:r}}}return{render:p,getServerProps:l,facets:a,hallmarks:n}}export{y as default};
1
+ import{getPageComponent as u,renderPage as d}from"@carats/render";import{init as f,transpile as g}from"jjsx";function h(a,s){f();async function i(r){let{component:o,params:e,hallmark:c}=u.call(a,r.url.replace("/api","")),n=Object.keys(s).find(l=>l.endsWith(`${c}.cara.ts`));return n?await s[n].default({...r,params:e}):o.defaultProps||{...r,params:e}}async function m(r){let{suspense:{error:o}}=a,{component:e,params:c}=u.call(a,r.url),n=await i(r),t=e.head||"";t+=`
2
+ <script>window.ssp=${JSON.stringify({for:e.name,data:n})}</script>`,t=t.trim();let l=await d.call(a,e,n);try{return{html:l,head:t}}catch(p){return{html:g(o(p)),head:t}}}return{render:m,getServerProps:i,facets:a,hallmarks:s}}export{h as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carats/ssr",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "SSR module for Carats",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@carats/core": "^0.0.12",
18
- "@carats/render": "^0.0.4",
18
+ "@carats/render": "^0.0.5",
19
19
  "jjsx": "^3.3.0",
20
20
  "vite": "^8.0.2"
21
21
  }