rari 0.13.2 → 0.13.4
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/vite.mjs +1 -1
- package/package.json +10 -10
package/dist/vite.mjs
CHANGED
|
@@ -17,7 +17,7 @@ if (import.meta.hot) {
|
|
|
17
17
|
}`,r}function d(e,t){let n=D(e),r=c(t);if(n){let n=l(e);if(n.length===0)return``;let r=j.relative(M.cwd(),t).replace(S,`/`).replace(w,``).replace(x,`_`).replace(_,``),i=`import { createServerReference } from "rari/runtime/actions";
|
|
18
18
|
`;for(let e of n)e===`default`?i+=`export default createServerReference("default", ${JSON.stringify(r)}, "default");\n`:i+=`export const ${e} = createServerReference("${e}", ${JSON.stringify(r)}, "${e}");\n`;return i}if(r){let n=l(e);if(n.length===0)return``;let r=j.relative(M.cwd(),t).replace(S,`/`).replace(w,``).replace(x,`_`).replace(_,``).replace(Y,``),i=`import { createServerComponentWrapper } from "virtual:rsc-integration.ts";
|
|
19
19
|
`;for(let e of n)e===`default`?i+=`export default createServerComponentWrapper("${r}", ${JSON.stringify(t)});\n`:i+=`export const ${e} = createServerComponentWrapper("${r}_${e}", ${JSON.stringify(t)});\n`;return i}if(!E(e))return e;let i=l(e);if(i.length===0)return``;let a=`import {registerClientReference} from "react-server-dom-rari/server";
|
|
20
|
-
`;for(let e of i){if(e===`default`){let e=`Attempted to call the default export of ${t} from the server but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.`;a+=`export default `,a+=`registerClientReference(function() {`,a+=`throw new Error(${JSON.stringify(e)});`}else{let t=`Attempted to call ${e}() from the server but ${e} is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.`;a+=`export const ${e} = `,a+=`registerClientReference(function() {`,a+=`throw new Error(${JSON.stringify(t)});`}a+=`},`,a+=`${JSON.stringify(t)},`,a+=`${JSON.stringify(e)});\n`}return a}function f(e,t){return!E(e)||l(e).length===0?e:e.replace(tt,``)}function p(e,t){let n=e;for(let[t,r]of Object.entries(o))if(e.startsWith(`${t}/`)){n=e.replace(t,r);break}else if(e===t){n=r;break}let r=j.resolve(j.dirname(t),n),i=[`.tsx`,`.jsx`,`.ts`,`.js`];return te(r,i)||ne(r,i)||`${r}.tsx`}function m(e){return(e.split(`/`).pop()||e).replace(C,``)}let h=!1;async function g(){let e=`http://localhost:${M.env.SERVER_PORT?Number(M.env.SERVER_PORT):Number(M.env.PORT||M.env.RSC_PORT||3e3)}`;try{let t=(await fetch(`${e}/_rari/health`,{signal:AbortSignal.timeout(1e3)})).ok;return h=t,t}catch{return h=!1,!1}}let v=[{name:`rari`,config(t,{command:n}){if(t.define=t.define||{},n===`serve`||M.env.RARI_SERVER_URL||M.env.RARI_HOST){let e=M.env.SERVER_PORT?Number(M.env.SERVER_PORT):Number(M.env.PORT||M.env.RSC_PORT||3e3),n;if(M.env.RARI_SERVER_URL)n=M.env.RARI_SERVER_URL;else if(M.env.RARI_HOST){let t=M.env.RARI_HOST.startsWith(`http`)?M.env.RARI_HOST:`http://${M.env.RARI_HOST}`;n=t.replace(b,``).includes(`:`)?t:`${t}:${e}`}else n=`http://localhost:${e}`;t.define[`import.meta.env.RARI_SERVER_URL`]=JSON.stringify(n)}if(n===`build`){let n=e.projectRoot||M.cwd(),r=j.join(n,`index.html`);if(k.existsSync(r))try{let e=k.readFileSync(r,`utf-8`),n=[];for(let t of e.matchAll(nt)){let e=t[1];if(e.startsWith(`/src/`)&&w.test(e)){let t=e.slice(1),r=j.basename(t,j.extname(t));n.push({path:t,name:r})}}if(n.length>0){t.build=t.build||{},t.build.rolldownOptions=t.build.rolldownOptions||{};let e=t.build.rolldownOptions.input||{main:`./index.html`},r;r=typeof e==`string`?{main:e}:Array.isArray(e)?{main:e[0]||`./index.html`}:{...e},n.forEach(({path:e,name:t})=>{r[t]=`./${e}`}),t.build.rolldownOptions.input=r}}catch(e){console.warn(`[rari] Error parsing index.html for build inputs:`,e)}}t.resolve=t.resolve||{};let r=Array.isArray(t.resolve.dedupe)?t.resolve.dedupe:[],i=[`react`,`react-dom`];t.resolve.dedupe=[...new Set([...r||[],...i])];let a=[];Array.isArray(t.resolve.alias)?a=t.resolve.alias:t.resolve.alias&&typeof t.resolve.alias==`object`&&(a=Object.entries(t.resolve.alias).map(([e,t])=>({find:e,replacement:t})));let o=new Set(a.map(e=>String(e.find)));try{let e=N(import.meta.resolve(`react`)),n=N(import.meta.resolve(`react-dom/client`)),r=N(import.meta.resolve(`react/jsx-runtime`)),i=[];o.has(`react/jsx-runtime`)||i.push({find:`react/jsx-runtime`,replacement:r});try{let e=N(import.meta.resolve(`react/jsx-dev-runtime`));o.has(`react/jsx-dev-runtime`)||i.push({find:`react/jsx-dev-runtime`,replacement:e})}catch(e){e?.code!==`ENOENT`&&console.warn(`[rari] Unexpected error resolving react/jsx-dev-runtime:`,e)}o.has(`react`)||i.push({find:`react`,replacement:e}),o.has(`react-dom/client`)||i.push({find:`react-dom/client`,replacement:n}),i.length>0&&(t.resolve.alias=[...a,...i])}catch(e){e?.code!==`ENOENT`&&console.warn(`[rari] Unexpected error configuring React aliases:`,e)}t.environments=t.environments||{},t.environments.rsc={resolve:{conditions:[`react-server`,`node`,`import`]},...t.environments.rsc},t.environments.ssr={resolve:{conditions:[`node`,`import`]},...t.environments.ssr},t.environments.client={resolve:{conditions:[`browser`,`import`]},...t.environments.client},t.optimizeDeps=t.optimizeDeps||{},t.optimizeDeps.include=t.optimizeDeps.include||[];for(let e of[`react`,`react-dom`,`react-dom/client`,`react-dom/server`,`react/jsx-runtime`,`react/jsx-dev-runtime`])t.optimizeDeps.include.includes(e)||t.optimizeDeps.include.push(e);if(t.optimizeDeps.exclude=t.optimizeDeps.exclude||[],t.optimizeDeps.exclude.includes(`rari`)||t.optimizeDeps.exclude.push(`rari`),n===`build`)for(let e of[`rsc`,`ssr`,`client`]){let n=t.environments[e];n&&n.build&&(n.build.rolldownOptions=n.build.rolldownOptions||{})}t.server=t.server||{},t.server.proxy=t.server.proxy||{};let c=M.env.SERVER_PORT?Number(M.env.SERVER_PORT):Number(M.env.PORT||M.env.RSC_PORT||3e3);if(t.server.proxy[`/api`]={target:`http://localhost:${c}`,changeOrigin:!0,secure:!1,ws:!0},t.server.proxy[`/_rari`]={target:`http://localhost:${c}`,changeOrigin:!0,secure:!1,ws:!0},n===`build`){t.build=t.build||{},t.build.rolldownOptions=t.build.rolldownOptions||{},t.build.rolldownOptions.input||(t.build.rolldownOptions.input={main:`./index.html`}),t.build.rolldownOptions.output=t.build.rolldownOptions.output||{};let e=Array.isArray(t.build.rolldownOptions.output)?t.build.rolldownOptions.output:[t.build.rolldownOptions.output];for(let t of e)t.codeSplitting!==!1&&typeof t.codeSplitting!=`object`&&(t.codeSplitting={}),typeof t.codeSplitting==`object
|
|
20
|
+
`;for(let e of i){if(e===`default`){let e=`Attempted to call the default export of ${t} from the server but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.`;a+=`export default `,a+=`registerClientReference(function() {`,a+=`throw new Error(${JSON.stringify(e)});`}else{let t=`Attempted to call ${e}() from the server but ${e} is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.`;a+=`export const ${e} = `,a+=`registerClientReference(function() {`,a+=`throw new Error(${JSON.stringify(t)});`}a+=`},`,a+=`${JSON.stringify(t)},`,a+=`${JSON.stringify(e)});\n`}return a}function f(e,t){return!E(e)||l(e).length===0?e:e.replace(tt,``)}function p(e,t){let n=e;for(let[t,r]of Object.entries(o))if(e.startsWith(`${t}/`)){n=e.replace(t,r);break}else if(e===t){n=r;break}let r=j.resolve(j.dirname(t),n),i=[`.tsx`,`.jsx`,`.ts`,`.js`];return te(r,i)||ne(r,i)||`${r}.tsx`}function m(e){return(e.split(`/`).pop()||e).replace(C,``)}let h=!1;async function g(){let e=`http://localhost:${M.env.SERVER_PORT?Number(M.env.SERVER_PORT):Number(M.env.PORT||M.env.RSC_PORT||3e3)}`;try{let t=(await fetch(`${e}/_rari/health`,{signal:AbortSignal.timeout(1e3)})).ok;return h=t,t}catch{return h=!1,!1}}let v=[{name:`rari`,config(t,{command:n}){if(t.define=t.define||{},n===`serve`||M.env.RARI_SERVER_URL||M.env.RARI_HOST){let e=M.env.SERVER_PORT?Number(M.env.SERVER_PORT):Number(M.env.PORT||M.env.RSC_PORT||3e3),n;if(M.env.RARI_SERVER_URL)n=M.env.RARI_SERVER_URL;else if(M.env.RARI_HOST){let t=M.env.RARI_HOST.startsWith(`http`)?M.env.RARI_HOST:`http://${M.env.RARI_HOST}`;n=t.replace(b,``).includes(`:`)?t:`${t}:${e}`}else n=`http://localhost:${e}`;t.define[`import.meta.env.RARI_SERVER_URL`]=JSON.stringify(n)}if(n===`build`){let n=e.projectRoot||M.cwd(),r=j.join(n,`index.html`);if(k.existsSync(r))try{let e=k.readFileSync(r,`utf-8`),n=[];for(let t of e.matchAll(nt)){let e=t[1];if(e.startsWith(`/src/`)&&w.test(e)){let t=e.slice(1),r=j.basename(t,j.extname(t));n.push({path:t,name:r})}}if(n.length>0){t.build=t.build||{},t.build.rolldownOptions=t.build.rolldownOptions||{};let e=t.build.rolldownOptions.input||{main:`./index.html`},r;r=typeof e==`string`?{main:e}:Array.isArray(e)?{main:e[0]||`./index.html`}:{...e},n.forEach(({path:e,name:t})=>{r[t]=`./${e}`}),t.build.rolldownOptions.input=r}}catch(e){console.warn(`[rari] Error parsing index.html for build inputs:`,e)}}t.resolve=t.resolve||{};let r=Array.isArray(t.resolve.dedupe)?t.resolve.dedupe:[],i=[`react`,`react-dom`];t.resolve.dedupe=[...new Set([...r||[],...i])];let a=[];Array.isArray(t.resolve.alias)?a=t.resolve.alias:t.resolve.alias&&typeof t.resolve.alias==`object`&&(a=Object.entries(t.resolve.alias).map(([e,t])=>({find:e,replacement:t})));let o=new Set(a.map(e=>String(e.find)));try{let e=N(import.meta.resolve(`react`)),n=N(import.meta.resolve(`react-dom/client`)),r=N(import.meta.resolve(`react/jsx-runtime`)),i=[];o.has(`react/jsx-runtime`)||i.push({find:`react/jsx-runtime`,replacement:r});try{let e=N(import.meta.resolve(`react/jsx-dev-runtime`));o.has(`react/jsx-dev-runtime`)||i.push({find:`react/jsx-dev-runtime`,replacement:e})}catch(e){e?.code!==`ENOENT`&&console.warn(`[rari] Unexpected error resolving react/jsx-dev-runtime:`,e)}o.has(`react`)||i.push({find:`react`,replacement:e}),o.has(`react-dom/client`)||i.push({find:`react-dom/client`,replacement:n}),i.length>0&&(t.resolve.alias=[...a,...i])}catch(e){e?.code!==`ENOENT`&&console.warn(`[rari] Unexpected error configuring React aliases:`,e)}t.environments=t.environments||{},t.environments.rsc={resolve:{conditions:[`react-server`,`node`,`import`]},...t.environments.rsc},t.environments.ssr={resolve:{conditions:[`node`,`import`]},...t.environments.ssr},t.environments.client={resolve:{conditions:[`browser`,`import`]},...t.environments.client},t.optimizeDeps=t.optimizeDeps||{},t.optimizeDeps.include=t.optimizeDeps.include||[];for(let e of[`react`,`react-dom`,`react-dom/client`,`react-dom/server`,`react/jsx-runtime`,`react/jsx-dev-runtime`])t.optimizeDeps.include.includes(e)||t.optimizeDeps.include.push(e);if(t.optimizeDeps.exclude=t.optimizeDeps.exclude||[],t.optimizeDeps.exclude.includes(`rari`)||t.optimizeDeps.exclude.push(`rari`),n===`build`)for(let e of[`rsc`,`ssr`,`client`]){let n=t.environments[e];n&&n.build&&(n.build.rolldownOptions=n.build.rolldownOptions||{})}t.server=t.server||{},t.server.proxy=t.server.proxy||{};let c=M.env.SERVER_PORT?Number(M.env.SERVER_PORT):Number(M.env.PORT||M.env.RSC_PORT||3e3);if(t.server.proxy[`/api`]={target:`http://localhost:${c}`,changeOrigin:!0,secure:!1,ws:!0},t.server.proxy[`/_rari`]={target:`http://localhost:${c}`,changeOrigin:!0,secure:!1,ws:!0},n===`build`){t.build=t.build||{},t.build.rolldownOptions=t.build.rolldownOptions||{},t.build.rolldownOptions.input||(t.build.rolldownOptions.input={main:`./index.html`}),t.build.rolldownOptions.output=t.build.rolldownOptions.output||{};let e=Array.isArray(t.build.rolldownOptions.output)?t.build.rolldownOptions.output:[t.build.rolldownOptions.output];for(let t of e){if(t.codeSplitting!==!1&&typeof t.codeSplitting!=`object`&&(t.codeSplitting={}),typeof t.codeSplitting==`object`){t.codeSplitting.groups=t.codeSplitting.groups||[];let e=t.codeSplitting.groups;t.codeSplitting.groups.push({name(t){if(t.includes(`node_modules`)){for(let n of e)if(n.test){let e=!1;if(typeof n.test==`function`?e=!!n.test(t):n.test instanceof RegExp?e=n.test.test(t):typeof n.test==`string`&&(e=t.includes(n.test)),e)return null}return t.includes(`node_modules/react-dom`)?`react-dom`:t.includes(`node_modules/react`)?`react`:`vendor`}return null}})}t.chunkFileNames||=e=>e.moduleIds?.some(e=>s(e).hasUseServer)?`client/actions/[name]-[hash].js`:e.moduleIds?.some(e=>s(e).hasUseClient)?`client/components/[name]-[hash].js`:`assets/[name]-[hash].js`}}return t.environments&&t.environments.client&&(t.environments.client.build||(t.environments.client.build={}),t.environments.client.build.rolldownOptions||(t.environments.client.build.rolldownOptions={}),t.environments.client.build.rolldownOptions.input||(t.environments.client.build.rolldownOptions.input={})),t},configResolved(e){let t=new Set([`react`,`react-dom`,`react/jsx-runtime`,`react/jsx-dev-runtime`,`react-dom/client`]);if(e.resolve?.alias){let n=e.resolve.alias;Array.isArray(n)?n.forEach(e=>{typeof e.find==`string`&&typeof e.replacement==`string`&&!t.has(e.find)&&(o[e.find]=e.replacement)}):typeof n==`object`&&Object.entries(n).forEach(([e,n])=>{typeof n==`string`&&!t.has(e)&&(o[e]=n)})}},transform(e,r){if(!w.test(r))return null;let i=this.environment;if(E(e)){t.set(r,`client`),n.add(r);let i=e.split(`
|
|
21
21
|
`);for(let e of i){let i=e.match(J);if(!i)continue;let a=i[4];if(!a)continue;let o=p(a,r);k.existsSync(o)&&(t.set(o,`client`),n.add(o))}return f(e,r)}if(t.get(r)===`client`||n.has(r))return f(e,r);if(c(r)){if(t.set(r,`server`),i&&(i.name===`rsc`||i.name===`ssr`))return u(e,r);{let t=d(e,r);return t=`// HMR acceptance for server component
|
|
22
22
|
if (import.meta.hot) {
|
|
23
23
|
import.meta.hot.accept();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rari",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.13.
|
|
4
|
+
"version": "0.13.4",
|
|
5
5
|
"description": "Runtime Accelerated Rendering Infrastructure (rari)",
|
|
6
6
|
"author": "Ryan Skinner",
|
|
7
7
|
"license": "MIT",
|
|
@@ -107,21 +107,21 @@
|
|
|
107
107
|
"react-dom": "^19.2.4"
|
|
108
108
|
},
|
|
109
109
|
"dependencies": {
|
|
110
|
-
"rolldown": "^1.0.0
|
|
110
|
+
"rolldown": "^1.0.0"
|
|
111
111
|
},
|
|
112
112
|
"optionalDependencies": {
|
|
113
|
-
"rari-darwin-arm64": "0.13.
|
|
114
|
-
"rari-darwin-x64": "0.13.
|
|
115
|
-
"rari-linux-arm64": "0.13.
|
|
116
|
-
"rari-linux-x64": "0.13.
|
|
117
|
-
"rari-win32-arm64": "0.13.
|
|
118
|
-
"rari-win32-x64": "0.13.
|
|
113
|
+
"rari-darwin-arm64": "0.13.3",
|
|
114
|
+
"rari-darwin-x64": "0.13.3",
|
|
115
|
+
"rari-linux-arm64": "0.13.3",
|
|
116
|
+
"rari-linux-x64": "0.13.3",
|
|
117
|
+
"rari-win32-arm64": "0.13.3",
|
|
118
|
+
"rari-win32-x64": "0.13.3"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
|
-
"@types/node": "^25.6.
|
|
121
|
+
"@types/node": "^25.6.1",
|
|
122
122
|
"@types/react": "^19.2.14",
|
|
123
123
|
"@types/react-dom": "^19.2.3",
|
|
124
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
124
|
+
"@typescript/native-preview": "^7.0.0-dev.20260507.1",
|
|
125
125
|
"vite-plus": "^0.1.20",
|
|
126
126
|
"@rari/deploy": "0.1.0",
|
|
127
127
|
"@rari/logger": "0.1.0"
|