@alxia/react-router 0.9.0 → 0.11.0

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 (100) hide show
  1. package/README.md +301 -13
  2. package/dist/chunks/index-59vhfj6n.js +10 -0
  3. package/dist/chunks/index-59vhfj6n.js.map +10 -0
  4. package/dist/chunks/index-5gqcpyyg.js +34 -0
  5. package/dist/chunks/index-5gqcpyyg.js.map +10 -0
  6. package/dist/chunks/{index-zqa30gr7.js → index-9xv2a8et.js} +7 -38
  7. package/dist/chunks/index-9xv2a8et.js.map +11 -0
  8. package/dist/chunks/index-mppz0806.js +119 -0
  9. package/dist/chunks/index-mppz0806.js.map +11 -0
  10. package/dist/chunks/index-rfr02vg4.js +40 -0
  11. package/dist/chunks/index-rfr02vg4.js.map +10 -0
  12. package/dist/chunks/index-zdbqzcjp.js +97 -0
  13. package/dist/chunks/index-zdbqzcjp.js.map +12 -0
  14. package/dist/errors/api-error.d.ts +86 -0
  15. package/dist/errors/api-error.d.ts.map +1 -0
  16. package/dist/errors/api-errors.d.ts +96 -0
  17. package/dist/errors/api-errors.d.ts.map +1 -0
  18. package/dist/errors/call-failure.d.ts +45 -0
  19. package/dist/errors/call-failure.d.ts.map +1 -0
  20. package/dist/errors/catalogue-check.d.ts +24 -0
  21. package/dist/errors/catalogue-check.d.ts.map +1 -0
  22. package/dist/errors/catalogue-read.d.ts +33 -0
  23. package/dist/errors/catalogue-read.d.ts.map +1 -0
  24. package/dist/errors/catalogue.d.ts +59 -0
  25. package/dist/errors/catalogue.d.ts.map +1 -0
  26. package/dist/errors/code-resolver.d.ts +44 -0
  27. package/dist/errors/code-resolver.d.ts.map +1 -0
  28. package/dist/errors/describe-refusal.d.ts +6 -0
  29. package/dist/errors/describe-refusal.d.ts.map +1 -0
  30. package/dist/errors/describe.d.ts +3 -0
  31. package/dist/errors/describe.d.ts.map +1 -0
  32. package/dist/errors/fetcher-result.d.ts +21 -0
  33. package/dist/errors/fetcher-result.d.ts.map +1 -0
  34. package/dist/errors/form-errors.d.ts +8 -0
  35. package/dist/errors/form-errors.d.ts.map +1 -0
  36. package/dist/errors/index.d.ts +15 -0
  37. package/dist/errors/index.d.ts.map +1 -0
  38. package/dist/errors/index.js +602 -0
  39. package/dist/errors/index.js.map +29 -0
  40. package/dist/errors/json-actions.d.ts +38 -0
  41. package/dist/errors/json-actions.d.ts.map +1 -0
  42. package/dist/errors/log.d.ts +8 -0
  43. package/dist/errors/log.d.ts.map +1 -0
  44. package/dist/errors/message-values.d.ts +11 -0
  45. package/dist/errors/message-values.d.ts.map +1 -0
  46. package/dist/errors/messages.d.ts +63 -0
  47. package/dist/errors/messages.d.ts.map +1 -0
  48. package/dist/errors/page-path.d.ts +9 -0
  49. package/dist/errors/page-path.d.ts.map +1 -0
  50. package/dist/errors/provider.d.ts +20 -0
  51. package/dist/errors/provider.d.ts.map +1 -0
  52. package/dist/errors/request-id.d.ts +5 -0
  53. package/dist/errors/request-id.d.ts.map +1 -0
  54. package/dist/errors/route-error.d.ts +31 -0
  55. package/dist/errors/route-error.d.ts.map +1 -0
  56. package/dist/errors/standard-schema.d.ts +34 -0
  57. package/dist/errors/standard-schema.d.ts.map +1 -0
  58. package/dist/errors/submit-form.d.ts +16 -0
  59. package/dist/errors/submit-form.d.ts.map +1 -0
  60. package/dist/errors/use-json-fetcher.d.ts +18 -0
  61. package/dist/errors/use-json-fetcher.d.ts.map +1 -0
  62. package/dist/pwa/build/build-worker.d.ts +41 -0
  63. package/dist/pwa/build/build-worker.d.ts.map +1 -0
  64. package/dist/pwa/build/index.d.ts +9 -0
  65. package/dist/pwa/build/index.d.ts.map +1 -0
  66. package/dist/pwa/build/index.js +9 -0
  67. package/dist/pwa/build/index.js.map +9 -0
  68. package/dist/pwa/build/precache.d.ts +17 -0
  69. package/dist/pwa/build/precache.d.ts.map +1 -0
  70. package/dist/pwa/index.js +34 -134
  71. package/dist/pwa/index.js.map +4 -8
  72. package/dist/pwa/react/index.js +1 -1
  73. package/dist/pwa/worker/index.d.ts +9 -0
  74. package/dist/pwa/worker/index.d.ts.map +1 -0
  75. package/dist/pwa/worker/index.js +144 -0
  76. package/dist/pwa/worker/index.js.map +12 -0
  77. package/dist/pwa/worker/injected.d.ts +15 -0
  78. package/dist/pwa/worker/injected.d.ts.map +1 -0
  79. package/dist/pwa/worker/plan.d.ts +65 -0
  80. package/dist/pwa/worker/plan.d.ts.map +1 -0
  81. package/dist/pwa/worker/scope.d.ts +18 -0
  82. package/dist/pwa/worker/scope.d.ts.map +1 -0
  83. package/dist/pwa/worker/start-worker.d.ts +17 -0
  84. package/dist/pwa/worker/start-worker.d.ts.map +1 -0
  85. package/dist/vite/index.d.ts +10 -0
  86. package/dist/vite/index.d.ts.map +1 -1
  87. package/dist/vite/index.js +49 -3
  88. package/dist/vite/index.js.map +6 -5
  89. package/dist/vite/runtime.d.ts +1 -1
  90. package/dist/vite/runtime.d.ts.map +1 -1
  91. package/dist/vite/worker.d.ts +16 -0
  92. package/dist/vite/worker.d.ts.map +1 -0
  93. package/docs/README.md +3 -2
  94. package/docs/guide/errors.md +838 -0
  95. package/docs/guide/how-it-works.md +7 -1
  96. package/docs/guide/pwa.md +372 -211
  97. package/docs/roadmap.md +38 -5
  98. package/docs/troubleshooting.md +689 -3
  99. package/package.json +56 -4
  100. package/dist/chunks/index-zqa30gr7.js.map +0 -12
package/docs/roadmap.md CHANGED
@@ -11,14 +11,12 @@ Nothing in progress.
11
11
 
12
12
  ## Next
13
13
 
14
- - **The service worker and its build.** A worker of Workbox strategies over
15
- `cachingFor` and `isStorable`, and the build that writes it, reading
16
- `precacheList` and possibly run by `/vite`'s `alxia()`, with the `workbox-*`
17
- packages as optional peers. Until it ships, the worker and its build stay
18
- the app's.
14
+ Nothing planned.
19
15
 
20
16
  ## Later
21
17
 
18
+ - **`service-worker.js` served revalidated with no setup.** Today the app
19
+ adds `noCache` for `SERVICE_WORKER_URL` itself.
22
20
  - **A check of an offline page's policy.** The offline page declares its
23
21
  Content-Security-Policy in a `<meta>`; a check would read the page and
24
22
  confirm that each inline script and style is allowed by its hash.
@@ -55,6 +53,41 @@ Nothing in progress.
55
53
 
56
54
  ## Shipped
57
55
 
56
+ ### 0.11.0
57
+
58
+ - **`@alxia/react-router/errors`: an API's refusals, worded for the page.**
59
+ A server's GraphQL refusals (`<module>.errors.<slug>`, `params`, `fields`)
60
+ are worded from its error catalogue in the page's language, for forms,
61
+ fetchers, loaders and the error page, with no UI. You get the shape of a
62
+ refusal, the request id and `nextOf`, the catalogue store
63
+ (`createApiMessages`), the form checks' resolver (`apiCodeResolver`), the
64
+ provider (`ApiMessagesProvider`) and the wording of a refusal
65
+ (`createApiErrors`: message, fields and status), the route helpers
66
+ (`routeError`, `errorRequestId`) and the actions' helpers (`fetcherResult`,
67
+ `fetcherRefusal`, `submitForm`), the JSON actions (`jsonActions`:
68
+ `readJson` with its same-origin CSRF check, `requireJsonPost`, and
69
+ `readInput` over a Standard Schema) with their fetcher hook
70
+ (`useJsonFetcher`), the catalogue's refresh (`createErrorCatalogue`: read
71
+ on first use with a bounded wait, checked against the API's versions once
72
+ per TTL, `warm()` at startup, `clientMessages()` for the root), and the
73
+ failures of a call (`apiCallFailure`, `operationName`) ([guide](guide/errors.md)).
74
+
75
+ ### 0.10.0
76
+
77
+ - **`@alxia/react-router/pwa/worker`.** `startWorker({ contract })` is the
78
+ whole service worker on Workbox: the precache, a page load always from the
79
+ network with the offline page when it fails, hashed bundles cache-first,
80
+ other static files stale-while-revalidate, and the update applied on
81
+ request. An app's `app/service-worker.ts` is a few lines; the `workbox-*`
82
+ packages are optional peers ([guide](guide/pwa.md)).
83
+ - **`@alxia/react-router/pwa/build`.** `buildWorker({ file })` bundles the
84
+ worker after `react-router build`, with the precache list written in: the
85
+ offline page, every route's code and the fonts you name.
86
+ - **`alxia({ worker })`.** With `app/service-worker.ts` in the app,
87
+ `react-router build` writes `build/client/service-worker.js` itself, with
88
+ no script to add; `worker` names another file, tunes the build or turns
89
+ it off.
90
+
58
91
  ### 0.9.0
59
92
 
60
93
  - **`@alxia/react-router/pwa`.** The code with no UI an installable app