react-fate 1.6.0 → 1.6.1

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/README.md CHANGED
@@ -65,7 +65,7 @@ _[Learn more](/docs/guide/getting-started.md) about fate's core concepts or crea
65
65
  Create a new fate app with Vite+:
66
66
 
67
67
  ```bash
68
- vp create fate my-app
68
+ vp create fate
69
69
  ```
70
70
 
71
71
  Explore the [fate stack](https://stack.fate.technology) to see the tools included in your new project.
@@ -128,14 +128,6 @@ yarn add @nkzw/fate
128
128
 
129
129
  :::
130
130
 
131
- > [!WARNING]
132
- >
133
- > **_fate_** is currently in alpha and not production ready. If something doesn't work for you, please open a pull request.
134
-
135
- If you'd like to try the example app in GitHub Codespaces, click the button below:
136
-
137
- [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?repo=nkzw-tech/fate)
138
-
139
131
  ## Core Concepts
140
132
 
141
133
  **_fate_** has a minimal API surface and is aimed at reducing data fetching complexity.
@@ -1926,13 +1918,13 @@ Use the GraphQL transport when your backend already exposes GraphQL and you want
1926
1918
  Create a client for an existing GraphQL server with:
1927
1919
 
1928
1920
  ```bash
1929
- vp create fate my-app --template graphql-client
1921
+ vp create fate -- --template graphql-client
1930
1922
  ```
1931
1923
 
1932
1924
  Create a full GraphQL + Prisma example app with:
1933
1925
 
1934
1926
  ```bash
1935
- vp create fate my-app --template graphql
1927
+ vp create fate -- --template graphql
1936
1928
  ```
1937
1929
 
1938
1930
  The client-only template is the smallest reference for the integration. It contains a `src/fate/graphql.ts` file that maps your GraphQL schema to fate views and roots.
@@ -3005,13 +2997,13 @@ setup without copying its adapter glue.
3005
2997
  For a new Void app, start from the Void template. It includes the client, Void routes, Drizzle setup, live transport, auth wiring, and generated fate client setup.
3006
2998
 
3007
2999
  ```sh
3008
- vp create fate my-app --template void
3000
+ vp create fate -- --template void
3009
3001
  ```
3010
3002
 
3011
3003
  Use Vue instead of React with:
3012
3004
 
3013
3005
  ```sh
3014
- vp create fate my-app --template void --framework vue
3006
+ vp create fate -- --template void --framework vue
3015
3007
  ```
3016
3008
 
3017
3009
  ### Existing Project
@@ -3280,7 +3272,7 @@ Deploy fate directly to your own Cloudflare account with [Void](/docs/integratio
3280
3272
  ### New Project
3281
3273
 
3282
3274
  ```sh
3283
- vp create fate my-app --template void
3275
+ vp create fate -- my-app --template void
3284
3276
  cd my-app
3285
3277
  vp run dev:setup
3286
3278
  vp run dev
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **FateClient**(`__namedParameters`): `Element`
4
4
 
5
- Defined in: [react-fate/src/context.tsx:17](https://github.com/nkzw-tech/fate/blob/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/react-fate/src/context.tsx#L17)
5
+ Defined in: [react-fate/src/context.tsx:17](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/react-fate/src/context.tsx#L17)
6
6
 
7
7
  Provider component that supplies a configured `FateClient` to React hooks.
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **useFateClient**\<`T`\>(): `FateClient`\<`T`\[`0`\], `T`\[`1`\]\>
4
4
 
5
- Defined in: [react-fate/src/context.tsx:30](https://github.com/nkzw-tech/fate/blob/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/react-fate/src/context.tsx#L30)
5
+ Defined in: [react-fate/src/context.tsx:30](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/react-fate/src/context.tsx#L30)
6
6
 
7
7
  Returns the nearest `FateClient` from context.
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **useListView**\<`C`\>(`selection`, `connection`): \[`ConnectionItems`\<`ResolvedConnection`\<`C`\>\>, `LoadMoreFn` \| `null`, `LoadMoreFn` \| `null`\]
4
4
 
5
- Defined in: [react-fate/src/useListView.tsx:19](https://github.com/nkzw-tech/fate/blob/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/react-fate/src/useListView.tsx#L19)
5
+ Defined in: [react-fate/src/useListView.tsx:19](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/react-fate/src/useListView.tsx#L19)
6
6
 
7
7
  Subscribes to a connection field, returning the current items and pagination
8
8
  helpers to load the next or previous page.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **useLiveListView**\<`C`\>(`selection`, `connection`): \[`ConnectionItems`\<`ResolvedConnection`\<`C`\>\>, `LoadMoreFn` \| `null`, `LoadMoreFn` \| `null`\]
4
4
 
5
- Defined in: [react-fate/src/useLiveListView.tsx:19](https://github.com/nkzw-tech/fate/blob/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/react-fate/src/useLiveListView.tsx#L19)
5
+ Defined in: [react-fate/src/useLiveListView.tsx:19](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/react-fate/src/useLiveListView.tsx#L19)
6
6
 
7
7
  Subscribes to a connection field, returning live-updating items and pagination
8
8
  helpers to load the next or previous page.
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **useLiveView**\<`V`, `R`\>(`view`, `ref`): `R` *extends* `null` ? `null` : `Readonly`\<`ViewSelection`\<`V`\> *extends* `Selection`\<`ViewEntityWithTypename`\<`V`\>\> ? `Mask`\<`ViewEntityWithTypename`\<`V`\>, \{ \[K in string \| number \| symbol as K extends "\_\_typename" ? never : K\]?: DeferrableSelectionFieldValue\<ViewEntityWithTypename\<V\>, K\> \} & `object` & `SelectionViewSpread`\<`ViewEntityWithTypename`\<`V`\>\> & `ViewSelection`\<`V`\>\> : `ViewEntityWithTypename`\<`V`\> & `object`\>
6
6
 
7
- Defined in: [react-fate/src/useLiveView.tsx:27](https://github.com/nkzw-tech/fate/blob/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/react-fate/src/useLiveView.tsx#L27)
7
+ Defined in: [react-fate/src/useLiveView.tsx:27](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/react-fate/src/useLiveView.tsx#L27)
8
8
 
9
9
  Resolves a reference against a view and subscribes to live server updates for
10
10
  that selection.
@@ -43,7 +43,7 @@ const post = useLiveView(PostView, postRef);
43
43
 
44
44
  > **useLiveView**\<`V`, `R`\>(`view`, `ref`): `R` *extends* `null` ? `null` : `Readonly`\<`ViewSelection`\<`V`\> *extends* `Selection`\<`ViewEntityWithTypename`\<`V`\>\> ? `Mask`\<`ViewEntityWithTypename`\<`V`\>, \{ \[K in string \| number \| symbol as K extends "\_\_typename" ? never : K\]?: DeferrableSelectionFieldValue\<ViewEntityWithTypename\<V\>, K\> \} & `object` & `SelectionViewSpread`\<`ViewEntityWithTypename`\<`V`\>\> & `ViewSelection`\<`V`\>\> : `ViewEntityWithTypename`\<`V`\> & `object`\>
45
45
 
46
- Defined in: [react-fate/src/useLiveView.tsx:31](https://github.com/nkzw-tech/fate/blob/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/react-fate/src/useLiveView.tsx#L31)
46
+ Defined in: [react-fate/src/useLiveView.tsx:31](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/react-fate/src/useLiveView.tsx#L31)
47
47
 
48
48
  Resolves a reference against a view and subscribes to live server updates for
49
49
  that selection.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **useRequest**\<`R`, `O`\>(`request`, `options?`): `RequestResult`\<`O`, `R`\>
4
4
 
5
- Defined in: [react-fate/src/useRequest.tsx:25](https://github.com/nkzw-tech/fate/blob/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/react-fate/src/useRequest.tsx#L25)
5
+ Defined in: [react-fate/src/useRequest.tsx:25](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/react-fate/src/useRequest.tsx#L25)
6
6
 
7
7
  Declares the data a screen needs and kicks off fetching, suspending while the
8
8
  request resolves.
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **useView**\<`V`, `R`\>(`view`, `ref`): `R` *extends* `null` ? `null` : `Readonly`\<`ViewSelection`\<`V`\> *extends* `Selection`\<`ViewEntityWithTypename`\<`V`\>\> ? `Mask`\<`ViewEntityWithTypename`\<`V`\>, \{ \[K in string \| number \| symbol as K extends "\_\_typename" ? never : K\]?: DeferrableSelectionFieldValue\<ViewEntityWithTypename\<V\>, K\> \} & `object` & `SelectionViewSpread`\<`ViewEntityWithTypename`\<`V`\>\> & `ViewSelection`\<`V`\>\> : `ViewEntityWithTypename`\<`V`\> & `object`\>
6
6
 
7
- Defined in: [react-fate/src/useView.tsx:40](https://github.com/nkzw-tech/fate/blob/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/react-fate/src/useView.tsx#L40)
7
+ Defined in: [react-fate/src/useView.tsx:40](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/react-fate/src/useView.tsx#L40)
8
8
 
9
9
  Resolves a reference against a view and subscribes to updates for that selection.
10
10
 
@@ -42,7 +42,7 @@ const post = useView(PostView, postRef);
42
42
 
43
43
  > **useView**\<`V`, `R`\>(`view`, `ref`): `R` *extends* `null` ? `null` : `Readonly`\<`ViewSelection`\<`V`\> *extends* `Selection`\<`ViewEntityWithTypename`\<`V`\>\> ? `Mask`\<`ViewEntityWithTypename`\<`V`\>, \{ \[K in string \| number \| symbol as K extends "\_\_typename" ? never : K\]?: DeferrableSelectionFieldValue\<ViewEntityWithTypename\<V\>, K\> \} & `object` & `SelectionViewSpread`\<`ViewEntityWithTypename`\<`V`\>\> & `ViewSelection`\<`V`\>\> : `ViewEntityWithTypename`\<`V`\> & `object`\>
44
44
 
45
- Defined in: [react-fate/src/useView.tsx:44](https://github.com/nkzw-tech/fate/blob/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/react-fate/src/useView.tsx#L44)
45
+ Defined in: [react-fate/src/useView.tsx:44](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/react-fate/src/useView.tsx#L44)
46
46
 
47
47
  Resolves a reference against a view and subscribes to updates for that selection.
48
48
 
@@ -80,7 +80,7 @@ const post = useView(PostView, postRef);
80
80
 
81
81
  > **useView**\<`V`\>(`view`, `ref`): `Readonly`\<`ViewSelection`\<`V`\> *extends* `Selection`\<`ViewEntityWithTypename`\<`V`\>\> ? `Mask`\<`ViewEntityWithTypename`\<`V`\>, \{ \[K in string \| number \| symbol as K extends "\_\_typename" ? never : K\]?: DeferrableSelectionFieldValue\<ViewEntityWithTypename\<V\>, K\> \} & `object` & `SelectionViewSpread`\<`ViewEntityWithTypename`\<`V`\>\> & `ViewSelection`\<`V`\>\> : `ViewEntityWithTypename`\<`V`\> & `object`\> \| `null`
82
82
 
83
- Defined in: [react-fate/src/useView.tsx:48](https://github.com/nkzw-tech/fate/blob/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/react-fate/src/useView.tsx#L48)
83
+ Defined in: [react-fate/src/useView.tsx:48](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/react-fate/src/useView.tsx#L48)
84
84
 
85
85
  Resolves a reference against a view and subscribes to updates for that selection.
86
86
 
@@ -5,7 +5,7 @@
5
5
  Create a new fate app with Vite+:
6
6
 
7
7
  ```bash
8
- vp create fate my-app
8
+ vp create fate
9
9
  ```
10
10
 
11
11
  Explore the [fate stack](https://stack.fate.technology) to see the tools included in your new project.
@@ -67,11 +67,3 @@ yarn add @nkzw/fate
67
67
  ```
68
68
 
69
69
  :::
70
-
71
- > [!WARNING]
72
- >
73
- > **_fate_** is currently in alpha and not production ready. If something doesn't work for you, please open a pull request.
74
-
75
- If you'd like to try the example app in GitHub Codespaces, click the button below:
76
-
77
- [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?repo=nkzw-tech/fate)
@@ -5,7 +5,7 @@ Deploy fate directly to your own Cloudflare account with [Void](void.md). The Vo
5
5
  ## New Project
6
6
 
7
7
  ```sh
8
- vp create fate my-app --template void
8
+ vp create fate -- my-app --template void
9
9
  cd my-app
10
10
  vp run dev:setup
11
11
  vp run dev
@@ -9,13 +9,13 @@ Use the GraphQL transport when your backend already exposes GraphQL and you want
9
9
  Create a client for an existing GraphQL server with:
10
10
 
11
11
  ```bash
12
- vp create fate my-app --template graphql-client
12
+ vp create fate -- --template graphql-client
13
13
  ```
14
14
 
15
15
  Create a full GraphQL + Prisma example app with:
16
16
 
17
17
  ```bash
18
- vp create fate my-app --template graphql
18
+ vp create fate -- --template graphql
19
19
  ```
20
20
 
21
21
  The client-only template is the smallest reference for the integration. It contains a `src/fate/graphql.ts` file that maps your GraphQL schema to fate views and roots.
@@ -10,13 +10,13 @@ setup without copying its adapter glue.
10
10
  For a new Void app, start from the Void template. It includes the client, Void routes, Drizzle setup, live transport, auth wiring, and generated fate client setup.
11
11
 
12
12
  ```sh
13
- vp create fate my-app --template void
13
+ vp create fate -- --template void
14
14
  ```
15
15
 
16
16
  Use Vue instead of React with:
17
17
 
18
18
  ```sh
19
- vp create fate my-app --template void --framework vue
19
+ vp create fate -- --template void --framework vue
20
20
  ```
21
21
 
22
22
  ## Existing Project
package/lib/index.mjs CHANGED
@@ -145,8 +145,8 @@ function useView(view, ref) {
145
145
  }
146
146
  const subscriptions = /* @__PURE__ */ new Map();
147
147
  const onChange = () => {
148
- updateSubscriptions();
149
148
  onStoreChange();
149
+ updateSubscriptions();
150
150
  };
151
151
  const subscribe = (entityId, paths) => {
152
152
  if (!subscriptions.has(entityId)) subscriptions.set(entityId, client.store.subscribe(entityId, paths, onChange));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-fate",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "fate is a modern data client for React.",
5
5
  "homepage": "https://github.com/nkzw-tech/fate",
6
6
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  }
41
41
  },
42
42
  "dependencies": {
43
- "@nkzw/fate": "1.6.0"
43
+ "@nkzw/fate": "1.6.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/react": "19.3.0",