@lunora/react-native 1.0.0-alpha.34 → 1.0.0-alpha.36

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/index.d.mts CHANGED
@@ -55,7 +55,7 @@ interface CreateLunoraClientOptions extends LunoraClientOptions {
55
55
  }
56
56
  /**
57
57
  * Construct a `LunoraClient` tuned for React Native / Expo — a thin wrapper over
58
- * `new LunoraClient(options)` that fills in the two things a browser gets for
58
+ * `new LunoraClient(options)` that fills in the three things a browser gets for
59
59
  * free but React Native does not.
60
60
  *
61
61
  * First, a durable offline queue: pass `storage` (React Native `AsyncStorage`,
@@ -64,7 +64,12 @@ interface CreateLunoraClientOptions extends LunoraClientOptions {
64
64
  * IndexedDB, which React Native lacks, so without this the queue lives only in
65
65
  * memory and is lost on reload.
66
66
  *
67
- * Second, credentialed requests: pass `getAuthHeaders` and the returned headers
67
+ * Second, a durable read cache: the same `storage` also backs the query cache
68
+ * through `createAsyncStorageQueryCache`, so cached reads render immediately
69
+ * after a restart while the socket reconnects — mirroring the browser's
70
+ * IndexedDB-backed default.
71
+ *
72
+ * Third, credentialed requests: pass `getAuthHeaders` and the returned headers
68
73
  * ride both the HTTP RPC path and the WebSocket upgrade, since React Native has
69
74
  * no cookie jar to attach a session implicitly.
70
75
  *
package/dist/index.d.ts CHANGED
@@ -55,7 +55,7 @@ interface CreateLunoraClientOptions extends LunoraClientOptions {
55
55
  }
56
56
  /**
57
57
  * Construct a `LunoraClient` tuned for React Native / Expo — a thin wrapper over
58
- * `new LunoraClient(options)` that fills in the two things a browser gets for
58
+ * `new LunoraClient(options)` that fills in the three things a browser gets for
59
59
  * free but React Native does not.
60
60
  *
61
61
  * First, a durable offline queue: pass `storage` (React Native `AsyncStorage`,
@@ -64,7 +64,12 @@ interface CreateLunoraClientOptions extends LunoraClientOptions {
64
64
  * IndexedDB, which React Native lacks, so without this the queue lives only in
65
65
  * memory and is lost on reload.
66
66
  *
67
- * Second, credentialed requests: pass `getAuthHeaders` and the returned headers
67
+ * Second, a durable read cache: the same `storage` also backs the query cache
68
+ * through `createAsyncStorageQueryCache`, so cached reads render immediately
69
+ * after a restart while the socket reconnects — mirroring the browser's
70
+ * IndexedDB-backed default.
71
+ *
72
+ * Third, credentialed requests: pass `getAuthHeaders` and the returned headers
68
73
  * ride both the HTTP RPC path and the WebSocket upgrade, since React Native has
69
74
  * no cookie jar to attach a session implicitly.
70
75
  *
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{createLunoraClient as o}from"./packem_shared/createLunoraClient-C_r92Czw.mjs";export*from"@lunora/react";export{o as createLunoraClient};
1
+ import{createLunoraClient as o}from"./packem_shared/createLunoraClient-DriS3kEf.mjs";export*from"@lunora/react";export{o as createLunoraClient};
@@ -0,0 +1 @@
1
+ import{LunoraClient as h,createAsyncStorageQueryCache as d,createAsyncStoragePersistence as u}from"@lunora/client";const f=(r,t)=>(c,e)=>{const s=t();if(!s)return r(c,e);const o=new Headers(s);return e?.headers&&new Headers(e.headers).forEach((n,a)=>{o.set(a,n)}),r(c,{...e,headers:o})},i=(r,t)=>class extends r{constructor(e,s){const o=t();super(e,s,o?{headers:o}:void 0)}},k=r=>{const{getAuthHeaders:t,storage:c,...e}=r,s=t&&e.fetch===void 0&&typeof fetch=="function"?f(fetch.bind(globalThis),t):e.fetch,o=t&&e.WebSocket===void 0&&typeof WebSocket=="function"?i(WebSocket,t):e.WebSocket;return new h({...e,persistence:e.persistence??(c?u({storage:c}):void 0),queryCache:e.queryCache??(c?d({storage:c}):void 0),fetch:s,WebSocket:o})};export{k as createLunoraClient,f as withAuthHeaders,i as withAuthWebSocket};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/react-native",
3
- "version": "1.0.0-alpha.34",
3
+ "version": "1.0.0-alpha.36",
4
4
  "description": "React Native / Expo integration for Lunora: an AsyncStorage-backed client factory, the useQuery/useMutation/useSubscription hooks, and a one-call better-auth Expo client",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -50,8 +50,8 @@
50
50
  "access": "public"
51
51
  },
52
52
  "dependencies": {
53
- "@lunora/client": "1.0.0-alpha.54",
54
- "@lunora/react": "1.0.0-alpha.59"
53
+ "@lunora/client": "1.0.0-alpha.56",
54
+ "@lunora/react": "1.0.0-alpha.61"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "@better-auth/expo": "^1.6.23",
@@ -1 +0,0 @@
1
- import{LunoraClient as h,createAsyncStoragePersistence as d}from"@lunora/client";const u=(c,t)=>(r,e)=>{const s=t();if(!s)return c(r,e);const o=new Headers(s);return e?.headers&&new Headers(e.headers).forEach((n,a)=>{o.set(a,n)}),c(r,{...e,headers:o})},f=(c,t)=>class extends c{constructor(e,s){const o=t();super(e,s,o?{headers:o}:void 0)}},S=c=>{const{getAuthHeaders:t,storage:r,...e}=c,s=t&&e.fetch===void 0&&typeof fetch=="function"?u(fetch.bind(globalThis),t):e.fetch,o=t&&e.WebSocket===void 0&&typeof WebSocket=="function"?f(WebSocket,t):e.WebSocket;return new h({...e,persistence:e.persistence??(r?d({storage:r}):void 0),fetch:s,WebSocket:o})};export{S as createLunoraClient,u as withAuthHeaders,f as withAuthWebSocket};