@jsenv/navi 0.30.9 → 0.30.11

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/actions.md CHANGED
@@ -277,8 +277,9 @@ at best, a gesture late in a popup. It is for a parameter chosen inside the
277
277
  component and dying with it. Outside a component,
278
278
  `actionRunEffect(action, () => …)` is that same run declared once — it runs on
279
279
  the first truthy params, reruns when they change (unless the action declared
280
- `keep` and still holds the answer for the new ones), aborts when they go
281
- false — and the machinery `routeAction` is built on.
280
+ `keep` and still holds the answer for the new ones, or only a prerun asked for
281
+ them: that answer was read ahead for this arrival and is taken as it is), aborts
282
+ when they go false — and the machinery `routeAction` is built on.
282
283
 
283
284
  **Which of the two it is, is decided by the parameter, not by what draws it.**
284
285
  If the parameter is in the address — a path param, a search param bound to a
@@ -311,6 +312,8 @@ It needs no `<Loading>`, and its failure reaches no boundary: nothing on screen
311
312
  asked for a prerun, so the owner's `{ run: true }` asks again, once, when it
312
313
  reads it. A failure of the owner's own run is shown, and asked again by a
313
314
  `rerun()`, never by a render. A head start still running is the owner's wait.
315
+ A write that would ask a read again drops a head start instead: the owner
316
+ finds it idle and asks for itself.
314
317
 
315
318
  `{ onLoad }` is what the screen does with the data **once, when it becomes
316
319
  known** — seed the fields someone is about to edit, focus something, remember
@@ -250,7 +250,9 @@ A `RouteTravel` page not visited yet can only be built by the address moving, si
250
250
  a route's actions ask only while it matches. So the address moves once the hand has
251
251
  really pulled, 16px, and the page fills in under the finger. Before that its pane
252
252
  is empty and the box's background shows, unless `renderNeighbour` says what stands
253
- there. See
253
+ there. What the page reads can be asked for before the hand arrives
254
+ (`<RouteTravel prefetch>`, or `route.preload(params)`): it is still built under the
255
+ finger, but from answers already there, so it shows no wait. See
254
256
  [navigation.md](./navigation.md#tabs-that-travel-routetravel).
255
257
 
256
258
  Both tell what follows them how far the row has come. `SlideContainer` writes
@@ -172,6 +172,7 @@ stays on the action, and a failed action is run again by whatever asks next —
172
172
  arrival, which shows its own failure, and every later hover alike.
173
173
 
174
174
  From code: `route.preload()` for a route about to be navigated to,
175
+ `route.preload(params)` to also ask the reads its params decide,
175
176
  `preloadUrl(url)` for an address. A press that computes its destination has
176
177
  nothing to preload — the navigation itself asks.
177
178
 
@@ -592,6 +592,26 @@ since the browser moves the row whatever the main thread is doing. So it renders
592
592
  with the page, and is worth keeping light. It is not the page: its route does not
593
593
  match yet, so it asks for nothing.
594
594
 
595
+ **What a neighbour reads can be asked for ahead**, with `prefetch`. At rest, once
596
+ the page on screen has its answers and has painted them, the box asks what the
597
+ route actions of the next page will ask, then those of the previous one. The page
598
+ is still built under the finger, but from answers already there: no wait shows.
599
+ Off by default, since every page one stops on then costs the reads of two more.
600
+
601
+ ```jsx
602
+ <RouteTravel routes={pages} renderNeighbour={renderNeighbour} prefetch>
603
+ <PlayerPage />
604
+ </RouteTravel>
605
+ ```
606
+
607
+ It is `route.preload(params)` for each of them: every route action of the route
608
+ reads its params as if the address were `route.buildUrl(params)` (a weak state not
609
+ given reads its default, any other one not given keeps what it holds), and the
610
+ instance prerun is the one the arrival runs. A row driven by hand calls it the same
611
+ way. Don't prerun the actions yourself: their params getters would then be written
612
+ twice, and once one of them changes, the prefetch asks for an instance the arrival
613
+ does not run.
614
+
595
615
  **The box has a height, or the document scrolls.** Pages may scroll themselves in a
596
616
  box the page gives a height to. If the document is what scrolls, it goes on doing
597
617
  so, and a page brought in stands where the reader is looking; what is lost is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.30.9",
3
+ "version": "0.30.11",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {