@jsenv/navi 0.29.437 → 0.29.439
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/dist/dev/jsenv_navi.js +206 -37
- package/dist/dev/jsenv_navi.js.map +7 -5
- package/dist/jsenv_navi.js +206 -37
- package/dist/jsenv_navi.js.map +7 -5
- package/docs/dynamic_import.md +3 -1
- package/docs/resource.md +29 -10
- package/package.json +1 -1
package/docs/dynamic_import.md
CHANGED
|
@@ -64,7 +64,9 @@ Everything the data layer decides then holds for the code:
|
|
|
64
64
|
without `error: true`.
|
|
65
65
|
- **Fetched once.** A route action left behind is aborted, not reset, and a
|
|
66
66
|
completed one is not run again: coming back to the page renders synchronously,
|
|
67
|
-
only the data is asked for per params.
|
|
67
|
+
only the data is asked for per params. A refresh of the page on screen reruns
|
|
68
|
+
`activeRouteReadsSignal`, which leaves the code out: rerun, it would take a
|
|
69
|
+
page reading it delegated off the screen for a frame.
|
|
68
70
|
- **Fetched ahead**, on intent ([below](#ahead-of-the-render-intent)).
|
|
69
71
|
|
|
70
72
|
## A component inside a page that stays: who asks for its code
|
package/docs/resource.md
CHANGED
|
@@ -165,8 +165,9 @@ keepPageOnScreen({
|
|
|
165
165
|
screens: `GAME.GET` for any game opened, `USER.GET_MANY` for a tab and for
|
|
166
166
|
every search. Kept per resource, that is every game ever opened. The page's
|
|
167
167
|
reads are what navi already runs for it: the route actions asking something for
|
|
168
|
-
the page (`activeRouteActionsSignal
|
|
169
|
-
|
|
168
|
+
the page (`activeRouteActionsSignal`; `activeRouteReadsSignal` is the same set
|
|
169
|
+
without the page's code, what the app reruns when it comes back to the
|
|
170
|
+
foreground), and the compositions the `<List.Items>`
|
|
170
171
|
on screen read. A navigation replaces the slot with the next page's reads.
|
|
171
172
|
|
|
172
173
|
What is kept, for the next document's first run of the same read with the same
|
|
@@ -176,14 +177,19 @@ params:
|
|
|
176
177
|
| --------------------------------------- | ------------------------------------------------------------ |
|
|
177
178
|
| a route action on a resource `GET` | the row, its relations inline |
|
|
178
179
|
| a route action on a resource `GET_MANY` | the rows in order, written the same way |
|
|
180
|
+
| any other route action | its value |
|
|
179
181
|
| a `<List.Items>` reading a `GET_RANGE` | the count and the ranks around the window drawn, rows inline |
|
|
180
182
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
183
|
+
A resource read is kept as rows because its value is ids, and ids name rows the
|
|
184
|
+
next document's store does not hold. The rows re-enter the store. Any other
|
|
185
|
+
route action (a summary, a preview the server composes) holds its answer as its
|
|
186
|
+
value, and that value is what is kept. A route action draws what was kept as its
|
|
187
|
+
provisional value: `data` set while `loading` is `true`, the answer replacing
|
|
188
|
+
it. Some of it will be out of date by then, which is the point: it is on screen
|
|
189
|
+
while the refresh is out. The list finds it as a composition it left
|
|
184
190
|
([list_refresh.md](./list_refresh.md#leaving-the-screen-and-coming-back)): every
|
|
185
191
|
rank stale, one request for the window. Under a network policy answering reads
|
|
186
|
-
from the store,
|
|
192
|
+
from the store, a resource read completes with what was kept
|
|
187
193
|
([network_policy.md](./network_policy.md)).
|
|
188
194
|
|
|
189
195
|
What is not kept, and why:
|
|
@@ -192,11 +198,15 @@ What is not kept, and why:
|
|
|
192
198
|
`.scopedMany()`). Its answer enters the store through its owner: the parent
|
|
193
199
|
row it is nested in, or the store of the owner it is scoped to. It is not rows
|
|
194
200
|
of its own that could be written back alone.
|
|
195
|
-
- **a
|
|
196
|
-
|
|
197
|
-
|
|
201
|
+
- **a value JSON would not bring back as it was.** The slot is written as JSON:
|
|
202
|
+
a function (a page's code is a route action too), a `Date` the callback built,
|
|
203
|
+
a `Map`, a class instance would come back as something else, and a screen
|
|
204
|
+
calling `.getTime()` on a string breaks. Such a value is left out, and its
|
|
205
|
+
route action draws its first load as before. An answer read from JSON is
|
|
206
|
+
plain data already.
|
|
198
207
|
- **a read that is not a route action**: a search typed on the page, a popup's
|
|
199
|
-
own load.
|
|
208
|
+
own load. Declaring which route reads it is what makes a read part of the
|
|
209
|
+
page.
|
|
200
210
|
|
|
201
211
|
A read writes what it shows once it has answered in this document. Until then
|
|
202
212
|
the slot keeps what the previous document kept for it, never what the read
|
|
@@ -207,6 +217,15 @@ it. Between those moments a navigation goes through half-built pages: the route
|
|
|
207
217
|
matched but its list not mounted, or the page left still drawn under a
|
|
208
218
|
transition.
|
|
209
219
|
|
|
220
|
+
**Declare the route actions where the app starts.** A route action that is not
|
|
221
|
+
a resource read is most often an action made from a callback, named
|
|
222
|
+
`"anonymous"`, and a page has several. The next document recognizes it by its
|
|
223
|
+
place among the route actions declared, which the same build declares in the
|
|
224
|
+
same order. A route action declared by a module loaded on demand moves every one
|
|
225
|
+
declared after it. The params are part of the key, so a mix-up needs the same
|
|
226
|
+
place and the same params, and a deploy starts clean anyway (the version in the
|
|
227
|
+
signal's `id`).
|
|
228
|
+
|
|
210
229
|
**The start page.** An installed app launched after being killed opens at its
|
|
211
230
|
start address, not on the page that was left. The reads made while a route of
|
|
212
231
|
`always` matches stay kept once that page is left, until the next visit
|