@raf-query/react 0.7.7 → 0.7.8
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/CHANGELOG.md +11 -1
- package/dist/client.mjs +2 -3
- package/dist/use-query.mjs +4 -5
- package/package.json +2 -2
- package/dist/cast.mjs +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.7.8](https://github.com/KATT/raf-query/compare/0.7.7...0.7.8) (2026-10-14)
|
|
4
|
+
|
|
5
|
+
* inline type assertions next to their SAFETY comments ([#104](https://github.com/KATT/raf-query/issues/104)) ([53fdbdb](https://github.com/KATT/raf-query/commit/53fdbdbfdcb146799b145faadb579bbb45e19139))
|
|
6
|
+
* **release:** skip npm publish when packages did not change ([#101](https://github.com/KATT/raf-query/issues/101)) ([4c6c315](https://github.com/KATT/raf-query/commit/4c6c3156224cfb74a62f6c6e5505c30da7400289)), references [#80](https://github.com/KATT/raf-query/issues/80)
|
|
7
|
+
* say the route waits for the post and comments stream in after ([#102](https://github.com/KATT/raf-query/issues/102)) ([3d0c5f4](https://github.com/KATT/raf-query/commit/3d0c5f4c089921fc178b374179dc23bafdbe899c))
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **examples:** start prefetch off and link whole issue rows ([#105](https://github.com/KATT/raf-query/issues/105)) ([cf83077](https://github.com/KATT/raf-query/commit/cf8307701abc6e6ff50304b7245e3bc2af929f3a))
|
|
12
|
+
|
|
3
13
|
## [0.7.7](https://github.com/KATT/raf-query/compare/0.7.6...0.7.7) (2026-10-14)
|
|
4
14
|
|
|
5
|
-
|
|
15
|
+
- **examples:** placeholder for the Effect example's Vercel project ([#100](https://github.com/KATT/raf-query/issues/100)) ([0142c6e](https://github.com/KATT/raf-query/commit/0142c6ef9448631c6239fff4a4ddf16db02b35de))
|
|
6
16
|
|
|
7
17
|
## [0.7.6](https://github.com/KATT/raf-query/compare/0.7.5...0.7.6) (2026-10-14)
|
|
8
18
|
|
package/dist/client.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { unsafeCast } from "./cast.mjs";
|
|
2
1
|
import { QueryCache } from "@raf-query/core";
|
|
3
2
|
import { Context, Effect, Exit, Layer, Option, Predicate, Scope } from "effect";
|
|
4
3
|
//#region src/client.ts
|
|
@@ -8,7 +7,7 @@ import { Context, Effect, Exit, Layer, Option, Predicate, Scope } from "effect";
|
|
|
8
7
|
* provides them.
|
|
9
8
|
*/
|
|
10
9
|
function provided(effect) {
|
|
11
|
-
return
|
|
10
|
+
return effect;
|
|
12
11
|
}
|
|
13
12
|
/**
|
|
14
13
|
* Run a verb that waits on a request. A cancelled request rejects with an
|
|
@@ -22,7 +21,7 @@ function runLoad(effect) {
|
|
|
22
21
|
}
|
|
23
22
|
/** `ensure` / `fetch` arguments, forwarded to the cache's same verb. */
|
|
24
23
|
function loadArgs(input, options) {
|
|
25
|
-
return
|
|
24
|
+
return [input, options];
|
|
26
25
|
}
|
|
27
26
|
/**
|
|
28
27
|
* The query cache, with Promise methods. Create one per request on the
|
package/dist/use-query.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { unsafeCast } from "./cast.mjs";
|
|
3
2
|
import { useQueryClient } from "./provider.mjs";
|
|
4
3
|
import { assertSent } from "./browser-requests.mjs";
|
|
5
4
|
import { Query, QueryObserver } from "@raf-query/core";
|
|
@@ -22,10 +21,10 @@ function commandFor(effect) {
|
|
|
22
21
|
}
|
|
23
22
|
/** `tracked`, with the observer's command Effects as Promise functions. */
|
|
24
23
|
function withPromiseCommands(tracked) {
|
|
25
|
-
return
|
|
24
|
+
return new Proxy(tracked, { get: (target, name, receiver) => {
|
|
26
25
|
if (name === "fetchNextPage" || name === "fetchPreviousPage" || name === "refetch") return commandFor(target[name]);
|
|
27
26
|
return Reflect.get(target, name, receiver);
|
|
28
|
-
} })
|
|
27
|
+
} });
|
|
29
28
|
}
|
|
30
29
|
function storeFor(query, options) {
|
|
31
30
|
const observer = QueryObserver.makeUnsafe(query, options);
|
|
@@ -65,8 +64,8 @@ function useQuery(factory, handle, options = {}) {
|
|
|
65
64
|
]);
|
|
66
65
|
QueryObserver.trackProp(observer, "promise");
|
|
67
66
|
const controls = withPromiseCommands(QueryObserver.trackResult(observer, result));
|
|
68
|
-
if (handle.ensured === true) return
|
|
69
|
-
return
|
|
67
|
+
if (handle.ensured === true) return [use(result.promise), controls];
|
|
68
|
+
return [result.promise, controls];
|
|
70
69
|
}
|
|
71
70
|
//#endregion
|
|
72
71
|
export { queryFor, useQuery };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raf-query/react",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.8",
|
|
4
4
|
"description": "React bindings for raf-query, a render-as-you-fetch query library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"query",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@raf-query/core": "0.7.
|
|
49
|
+
"@raf-query/core": "0.7.8"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@tanstack/react-router": "^1.170.0",
|
package/dist/cast.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
//#region src/cast.ts
|
|
2
|
-
/**
|
|
3
|
-
* The one place a value's static type is replaced. Every call site states
|
|
4
|
-
* the invariant that makes it sound in a `SAFETY:` comment.
|
|
5
|
-
*/
|
|
6
|
-
function unsafeCast(value) {
|
|
7
|
-
return value;
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
10
|
-
export { unsafeCast };
|