houdini-adapter-cloudflare 1.2.10 → 1.2.11
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/build/worker.cjs +4 -4
- package/build/worker.js +4 -4
- package/package.json +2 -2
package/build/worker.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var S=Object.create;var
|
|
1
|
+
"use strict";var S=Object.create;var i=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var L=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},d=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of b(t))!H.call(e,s)&&s!==r&&i(e,s,{get:()=>t[s],enumerable:!(n=E(t,s))||n.enumerable});return e};var l=(e,t,r)=>(r=e!=null?S(v(e)):{},d(t||!e||!e.__esModule?i(r,"default",{value:e,enumerable:!0}):r,e)),U=e=>d(i({},"__esModule",{value:!0}),e);var $={};L($,{default:()=>T});module.exports=U($);var p=require("react-streaming/server"),f=require("../$houdini/plugins/houdini-react/runtime"),h=l(require("../$houdini/plugins/houdini-react/runtime/manifest"),1),u=require("../$houdini/plugins/houdini-react/runtime/routing/lib/match"),m=l(require("../$houdini/plugins/houdini-react/units/render/App"),1),_=require("../$houdini/runtime/cache/cache.js"),g=require("../$houdini/runtime/lib/config"),a=require("../$houdini/runtime/router/server"),R=require("react/jsx-runtime"),w=(0,g.getCurrentConfig)(),k=w.plugins?.["houdini-react"]??{},y=k.auth?.sessionKeys??[],A={async fetch(e,t,r){let n=new URL(e.url).pathname;if(n.startsWith("/assets/")||n==="/favicon.ico")return await t.ASSETS.fetch(e);let s=await C(e);return s||await P(e)}};async function C(e){let t=new Response,r=!1;if(await(0,a.handle_request)({config:w,session_keys:y,url:new URL(e.url).pathname,redirect:(n,s)=>{let o=t.headers;t=Response.redirect(s,n);for(let[c,x]of Object.entries(o))t.headers.set(c,x)},set_header(n,s){t.headers.set(n,s.toString())},get_header:n=>e.headers.get(n)??void 0,next(){r=!1}}),r)return t}async function P(e){let t=new URL(e.url).pathname,r=await(0,a.get_session)(e.headers,y),[n]=(0,u.find_match)(h.default,t,!0);if(!n)throw new Error("no match");let s=new _.Cache({disabled:!1}),{readable:o,injectToStream:c}=await(0,p.renderToStream)((0,R.jsx)(m.default,{loaded_queries:{},loaded_artifacts:{},initialURL:t,cache:s,session:r,assetPrefix:"/assets",...(0,f.router_cache)()}),{userAgent:"Vite"});return c(`
|
|
2
2
|
<script>
|
|
3
|
-
window.__houdini__initial__cache__ = ${
|
|
3
|
+
window.__houdini__initial__cache__ = ${s.serialize()};
|
|
4
4
|
window.__houdini__initial__session__ = ${JSON.stringify(r)};
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<!-- add a virtual module that hydrates the client and sets up the initial pending cache -->
|
|
8
|
-
<script type="module" src="/assets/pages/${
|
|
9
|
-
`),new Response(
|
|
8
|
+
<script type="module" src="/assets/pages/${n.id}.js" async=""></script>
|
|
9
|
+
`),new Response(o)}var T=A;
|
package/build/worker.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{renderToStream as l}from"react-streaming/server";import{router_cache as p}from"../$houdini/plugins/houdini-react/runtime";import f from"../$houdini/plugins/houdini-react/runtime/manifest";import{find_match as h}from"../$houdini/plugins/houdini-react/runtime/routing/lib/match";import u from"../$houdini/plugins/houdini-react/units/render/App";import{Cache as m}from"../$houdini/runtime/cache/cache.js";import{getCurrentConfig as _}from"../$houdini/runtime/lib/config";import{handle_request as g,get_session as w}from"../$houdini/runtime/router/server";import{jsx as E}from"react/jsx-runtime";var o=_(),y=o.plugins?.["houdini-react"]??{},c=y.auth?.sessionKeys??[],R={async fetch(t,r,n){let e=new URL(t.url).pathname;if(e.startsWith("/assets/")||e==="/favicon.ico")return await r.ASSETS.fetch(t);let s=await x(t);return s||await S(t)}};async function x(t){let r=new Response,n=!1;if(await g({config:o,session_keys:c,url:new URL(t.url).pathname,redirect:(e,s)=>{let i=r.headers;r=Response.redirect(s,e);for(let[a,d]of Object.entries(i))r.headers.set(a,d)},set_header(e,s){r.headers.set(e,s.toString())},get_header:e=>t.headers.get(e)??void 0,next(){n=!1}}),n)return r}async function S(t){let r=new URL(t.url).pathname,n=await w(t.headers,c),[e]=h(f,r,!0);if(!e)throw new Error("no match");let s=new m({disabled:!1}),{readable:i,injectToStream:a}=await l(E(u,{loaded_queries:{},loaded_artifacts:{},initialURL:r,cache:s,session:n,assetPrefix:"/assets",...p()}),{userAgent:"Vite"});return a(`
|
|
2
2
|
<script>
|
|
3
3
|
window.__houdini__initial__cache__ = ${s.serialize()};
|
|
4
|
-
window.__houdini__initial__session__ = ${JSON.stringify(
|
|
4
|
+
window.__houdini__initial__session__ = ${JSON.stringify(n)};
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<!-- add a virtual module that hydrates the client and sets up the initial pending cache -->
|
|
8
|
-
<script type="module" src="/assets/pages/${
|
|
9
|
-
`),new Response(
|
|
8
|
+
<script type="module" src="/assets/pages/${e.id}.js" async=""></script>
|
|
9
|
+
`),new Response(i)}var P=R;export{P as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "houdini-adapter-cloudflare",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.11",
|
|
4
4
|
"description": "The adapter for deploying your Houdini application to Cloudflare Pages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"houdini",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"react": "^18.2.0",
|
|
33
33
|
"react-dom": "^18.2.0",
|
|
34
34
|
"react-streaming": "^0.3.14",
|
|
35
|
-
"houdini": "^1.2.
|
|
35
|
+
"houdini": "^1.2.11"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"build"
|