@jsenv/navi 0.29.437 → 0.29.438

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/docs/resource.md CHANGED
@@ -176,14 +176,19 @@ params:
176
176
  | --------------------------------------- | ------------------------------------------------------------ |
177
177
  | a route action on a resource `GET` | the row, its relations inline |
178
178
  | a route action on a resource `GET_MANY` | the rows in order, written the same way |
179
+ | any other route action | its value |
179
180
  | a `<List.Items>` reading a `GET_RANGE` | the count and the ranks around the window drawn, rows inline |
180
181
 
181
- The `GET` and the `GET_MANY` draw it as their provisional value: `data` set
182
- while `loading` is `true`, the answer replacing it. The list finds it as a
183
- composition it left
182
+ A resource read is kept as rows because its value is ids, and ids name rows the
183
+ next document's store does not hold. The rows re-enter the store. Any other
184
+ route action (a summary, a preview the server composes) holds its answer as its
185
+ value, and that value is what is kept. A route action draws what was kept as its
186
+ provisional value: `data` set while `loading` is `true`, the answer replacing
187
+ it. Some of it will be out of date by then, which is the point: it is on screen
188
+ while the refresh is out. The list finds it as a composition it left
184
189
  ([list_refresh.md](./list_refresh.md#leaving-the-screen-and-coming-back)): every
185
190
  rank stale, one request for the window. Under a network policy answering reads
186
- from the store, the kept answer answers the read
191
+ from the store, a resource read completes with what was kept
187
192
  ([network_policy.md](./network_policy.md)).
188
193
 
189
194
  What is not kept, and why:
@@ -192,11 +197,15 @@ What is not kept, and why:
192
197
  `.scopedMany()`). Its answer enters the store through its owner: the parent
193
198
  row it is nested in, or the store of the owner it is scoped to. It is not rows
194
199
  of its own that could be written back alone.
195
- - **a plain `createAction`** (a summary, a count the server computes). Its value
196
- is whatever the callback returns, with no store to give it a shape to write
197
- and to read back. A page's code is a route action too, and it is a function.
200
+ - **a value JSON would not bring back as it was.** The slot is written as JSON:
201
+ a function (a page's code is a route action too), a `Date` the callback built,
202
+ a `Map`, a class instance would come back as something else, and a screen
203
+ calling `.getTime()` on a string breaks. Such a value is left out, and its
204
+ route action draws its first load as before. An answer read from JSON is
205
+ plain data already.
198
206
  - **a read that is not a route action**: a search typed on the page, a popup's
199
- own load.
207
+ own load. Declaring which route reads it is what makes a read part of the
208
+ page.
200
209
 
201
210
  A read writes what it shows once it has answered in this document. Until then
202
211
  the slot keeps what the previous document kept for it, never what the read
@@ -207,6 +216,15 @@ it. Between those moments a navigation goes through half-built pages: the route
207
216
  matched but its list not mounted, or the page left still drawn under a
208
217
  transition.
209
218
 
219
+ **Declare the route actions where the app starts.** A route action that is not
220
+ a resource read is most often an action made from a callback, named
221
+ `"anonymous"`, and a page has several. The next document recognizes it by its
222
+ place among the route actions declared, which the same build declares in the
223
+ same order. A route action declared by a module loaded on demand moves every one
224
+ declared after it. The params are part of the key, so a mix-up needs the same
225
+ place and the same params, and a deploy starts clean anyway (the version in the
226
+ signal's `id`).
227
+
210
228
  **The start page.** An installed app launched after being killed opens at its
211
229
  start address, not on the page that was left. The reads made while a route of
212
230
  `always` matches stay kept once that page is left, until the next visit
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.29.437",
3
+ "version": "0.29.438",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {