@molecule/app-query-solid 1.3.0 → 1.3.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 +5 -3
- package/dist/query-content.d.ts +1 -0
- package/dist/query-content.d.ts.map +1 -1
- package/dist/query-content.jsx +8 -3
- package/dist/query-content.jsx.map +1 -1
- package/dist/types.d.ts +3 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-17T05:19:10.338Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-query-solid
|
|
@@ -551,7 +551,8 @@ interface QueryContentProps<T> {
|
|
|
551
551
|
/**
|
|
552
552
|
* One optional empty branch, exclusive with children. The pure predicate reads the
|
|
553
553
|
* loaded document (an array or an application-owned envelope); render selects the
|
|
554
|
-
* current view's message and recovery action.
|
|
554
|
+
* current view's message and recovery action. A previous key's empty document uses
|
|
555
|
+
* pending/error instead. Omit it to keep empty arrays as data.
|
|
555
556
|
*/
|
|
556
557
|
empty?: {
|
|
557
558
|
when: (data: NonNullable<T>) => boolean
|
|
@@ -559,7 +560,7 @@ interface QueryContentProps<T> {
|
|
|
559
560
|
}
|
|
560
561
|
|
|
561
562
|
/** State from useQuery, or any compatible query observer. */
|
|
562
|
-
query: Pick<QueryState<T>, 'data' | 'status' | 'error'>
|
|
563
|
+
query: Pick<QueryState<T>, 'data' | 'status' | 'error' | 'isPreviousData'>
|
|
563
564
|
/**
|
|
564
565
|
* Mounted only with a real document, including false, zero and an empty list. Runs once
|
|
565
566
|
* per loaded stretch with the document as an accessor (Solid's `<Show>` idiom): a new
|
|
@@ -685,6 +686,7 @@ missing records never mount that branch, so its actions cannot swallow an early
|
|
|
685
686
|
Cached data remains mounted during refresh, including a failed refresh. Status fallbacks
|
|
686
687
|
belong outside the list or record container rendered by `children`, and so does a refresh
|
|
687
688
|
line; the default fallbacks render nothing.
|
|
689
|
+
A previous key's empty or missing document renders pending/error until the current key answers.
|
|
688
690
|
|
|
689
691
|
`children` runs ONCE per loaded stretch and receives the document as an accessor (Solid's
|
|
690
692
|
`<Show>` idiom), so a new document — a cache publication, a refresh, another key's record —
|
package/dist/query-content.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import type { QueryContentProps } from './types.js';
|
|
|
13
13
|
* Cached data remains mounted during refresh, including a failed refresh. Status fallbacks
|
|
14
14
|
* belong outside the list or record container rendered by `children`, and so does a refresh
|
|
15
15
|
* line; the default fallbacks render nothing.
|
|
16
|
+
* A previous key's empty or missing document renders pending/error until the current key answers.
|
|
16
17
|
*
|
|
17
18
|
* `children` runs ONCE per loaded stretch and receives the document as an accessor (Solid's
|
|
18
19
|
* `<Show>` idiom), so a new document — a cache publication, a refresh, another key's record —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-content.d.ts","sourceRoot":"","sources":["../src/query-content.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAc,KAAK,GAAG,EAAQ,MAAM,UAAU,CAAA;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD
|
|
1
|
+
{"version":3,"file":"query-content.d.ts","sourceRoot":"","sources":["../src/query-content.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAc,KAAK,GAAG,EAAQ,MAAM,UAAU,CAAA;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CA4BxE"}
|
package/dist/query-content.jsx
CHANGED
|
@@ -12,6 +12,7 @@ import { createMemo, Show } from 'solid-js';
|
|
|
12
12
|
* Cached data remains mounted during refresh, including a failed refresh. Status fallbacks
|
|
13
13
|
* belong outside the list or record container rendered by `children`, and so does a refresh
|
|
14
14
|
* line; the default fallbacks render nothing.
|
|
15
|
+
* A previous key's empty or missing document renders pending/error until the current key answers.
|
|
15
16
|
*
|
|
16
17
|
* `children` runs ONCE per loaded stretch and receives the document as an accessor (Solid's
|
|
17
18
|
* `<Show>` idiom), so a new document — a cache publication, a refresh, another key's record —
|
|
@@ -32,13 +33,17 @@ export function QueryContent(props) {
|
|
|
32
33
|
const fallback = createMemo(() => {
|
|
33
34
|
const query = props.query;
|
|
34
35
|
const data = query.data;
|
|
36
|
+
if (data === undefined ||
|
|
37
|
+
(query.isPreviousData && (data === null || props.empty?.when(data)))) {
|
|
38
|
+
return query.status === 'error' && props.error
|
|
39
|
+
? props.error(query.error)
|
|
40
|
+
: (props.pending ?? null);
|
|
41
|
+
}
|
|
35
42
|
if (data === null)
|
|
36
43
|
return props.missing ?? null;
|
|
37
44
|
if (data !== undefined)
|
|
38
45
|
return props.empty?.when(data) ? props.empty.render(() => props.query.data) : null;
|
|
39
|
-
return
|
|
40
|
-
? props.error(query.error)
|
|
41
|
-
: (props.pending ?? null);
|
|
46
|
+
return null;
|
|
42
47
|
});
|
|
43
48
|
return (<Show when={loaded()} fallback={fallback()}>
|
|
44
49
|
{(box) => props.children(() => box().data)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-content.jsx","sourceRoot":"","sources":["../src/query-content.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAY,IAAI,EAAE,MAAM,UAAU,CAAA;AAIrD
|
|
1
|
+
{"version":3,"file":"query-content.jsx","source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AC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QACrF,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;IACF,OAAO,CACL,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,CACzC;MAAA,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAC5C;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -37,14 +37,15 @@ export interface QueryContentProps<T> {
|
|
|
37
37
|
/**
|
|
38
38
|
* One optional empty branch, exclusive with children. The pure predicate reads the
|
|
39
39
|
* loaded document (an array or an application-owned envelope); render selects the
|
|
40
|
-
* current view's message and recovery action.
|
|
40
|
+
* current view's message and recovery action. A previous key's empty document uses
|
|
41
|
+
* pending/error instead. Omit it to keep empty arrays as data.
|
|
41
42
|
*/
|
|
42
43
|
empty?: {
|
|
43
44
|
when: (data: NonNullable<T>) => boolean;
|
|
44
45
|
render: NonNullable<QueryContentProps<T>['children']>;
|
|
45
46
|
};
|
|
46
47
|
/** State from useQuery, or any compatible query observer. */
|
|
47
|
-
query: Pick<QueryState<T>, 'data' | 'status' | 'error'>;
|
|
48
|
+
query: Pick<QueryState<T>, 'data' | 'status' | 'error' | 'isPreviousData'>;
|
|
48
49
|
/**
|
|
49
50
|
* Mounted only with a real document, including false, zero and an empty list. Runs once
|
|
50
51
|
* per loaded stretch with the document as an accessor (Solid's `<Show>` idiom): a new
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names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E,WAAW,CAAC,CAAC,CAAC,KAAK,OAAO,CAAA;QACvC,MAAM,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;KACtD,CAAA;IAED,6DAA6D;IAC7D,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,gBAAgB,CAAC,CAAA;IAC1E;;;;OAIG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,CAAA;IACzD,uFAAuF;IACvF,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACrB,qFAAqF;IACrF,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACrB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,GAAG,CAAC,OAAO,CAAA;CACxC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-query-solid",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Solid hooks for @molecule/app-query — read a cached document synchronously, observe it, and prefetch on intent",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-query-solid",
|
|
6
6
|
"type": "module",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@molecule/app-framework-conformance": "0.0.0",
|
|
53
53
|
"@molecule/app-i18n": "1.2.2",
|
|
54
54
|
"@molecule/app-icons": "1.0.4",
|
|
55
|
-
"@molecule/app-query": "1.3.
|
|
55
|
+
"@molecule/app-query": "1.3.2",
|
|
56
56
|
"@molecule/app-query-memory": "1.1.0",
|
|
57
57
|
"@molecule/app-query-tanstack": "1.1.0",
|
|
58
58
|
"@molecule/app-solid": "3.7.1",
|