@plitzi/sdk-variables 0.35.10 → 0.36.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.
Files changed (2) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # @plitzi/sdk-variables
2
2
 
3
+ ## 0.36.1
4
+
5
+ ### Patch Changes
6
+
7
+ - v0.36.1
8
+ - Updated dependencies
9
+ - @plitzi/sdk-shared@0.36.1
10
+
11
+ ## 0.36.0
12
+
13
+ ### Minor Changes
14
+
15
+ - - **An `apiContainer` can keep its browser requests in a query cache, the way react-query does.** Moving between
16
+ sections or pages used to ask the API again every time a provider was shown: a provider in a hidden section is
17
+ mounted but disabled, so showing it fired a fresh request, and a page navigation remounted it and did the same.
18
+ With the new `cache: true` an answer is kept for `staleTime` seconds (30 by default) and shared by every cached
19
+ provider asking the same thing — same method, URL, credentials and headers, the token included, so two visitors
20
+ never share one. Past its time the answer is still drawn at once and a fresh one is fetched behind it; an answer
21
+ nobody shows is forgotten after `gcTime` seconds (300 by default). A refused request (`4xx`/`5xx`) is shown but
22
+ never kept. **The cache is off unless an element asks for it**: an uncached provider behaves as before, asking on
23
+ every mount and sharing nothing.
24
+
25
+ The cache is `@plitzi/sdk-shared/queries` (`queryCache`, `useQuery`, `invalidateQueries`,
26
+ `invalidateQueriesForWrite`), a nexus store written with the per-path `ttl` of `@plitzi/nexus` 1.2.0, which every
27
+ consumer now requires. It reacts to the store's own freshness events, so anything that expires a query's path
28
+ makes the providers on screen ask again.
29
+
30
+ An answer stops counting as current before its time when the element's `performQuery` runs (it always asks
31
+ again), when a flow runs the new global `invalidateQueries` step (source `queries`: `elements`, api container ids
32
+ — a container's requests are tagged with its own id — and/or a `url` prefix), and after a write. Both write steps
33
+ gained `invalidateQueries` / `invalidateElements`: a `webHook` sent with anything but `GET`/`HEAD` refreshes the
34
+ requests to its own site by default, a completed `runServerAction` refreshes all of them by default, and either
35
+ can name containers instead or refresh nothing. A `writeRecord` refreshes all. Providers on screen ask again at
36
+ once; the rest when they are next shown. A sign-in, sign-out or change of account drops everything held. Server-driven
37
+ providers and RSC are untouched.
38
+
39
+ - **A `webHook` that reads can be cached** (`cache`, `staleTime`), in the same cache and under the same key as an api
40
+ container asking the same thing. Its declaration now lives beside it (`utility/webHookSpec`) and the authoring
41
+ catalog gathers it instead of keeping a copy. A `HEAD` is no longer sent with a body, which `fetch` refused.
42
+
43
+ - **Step params can pick several elements.** A new param type, `elementIds` (with an `elementType` filter), is drawn
44
+ in the flow editor as a picker: the matching elements of the space to add, and the picked ones as chips to remove —
45
+ an id no element answers to any more is kept and flagged. The value is a list of ids, so nobody types a
46
+ comma-separated list; `invalidateQueries.elements` and the write steps' `invalidateElements` use it, and the MCP
47
+ catalog says which element type each such param takes.
48
+
49
+ - The dev-tools' Store tab lists the paths a store holds with a TTL — how long ago each was written, what is left
50
+ of it, and a button to expire one or all of them. The query cache appears there as "Queries".
51
+
52
+ - `useApi` no longer takes `params`: nothing passed them, and a GET cannot carry a body anyway. A mock now answers
53
+ synchronously, without a loading frame, and a provider whose URL has not resolved asks for nothing.
54
+
55
+ ### Patch Changes
56
+
57
+ - Updated dependencies
58
+ - @plitzi/sdk-shared@0.36.0
59
+
3
60
  ## 0.35.10
4
61
 
5
62
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-variables",
3
- "version": "0.35.10",
3
+ "version": "0.36.1",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist"
@@ -152,7 +152,7 @@
152
152
  },
153
153
  "dependencies": {
154
154
  "@plitzi/plitzi-ui": "^1.6.21",
155
- "@plitzi/sdk-shared": "0.35.10",
155
+ "@plitzi/sdk-shared": "0.36.1",
156
156
  "clsx": "^2.1.1",
157
157
  "zod": "^4.6.4"
158
158
  },