@uniweb/runtime 0.18.1 → 0.19.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 (2) hide show
  1. package/package.json +3 -3
  2. package/src/isolate-api.js +46 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/runtime",
3
- "version": "0.18.1",
3
+ "version": "0.19.0",
4
4
  "description": "Minimal runtime for loading Uniweb foundations",
5
5
  "type": "module",
6
6
  "exports": {
@@ -36,7 +36,7 @@
36
36
  "node": ">=20.19"
37
37
  },
38
38
  "dependencies": {
39
- "@uniweb/core": "^0.24.0",
39
+ "@uniweb/core": "^0.24.1",
40
40
  "@uniweb/theming": "^0.1.15"
41
41
  },
42
42
  "devDependencies": {
@@ -44,7 +44,7 @@
44
44
  "esbuild": "^0.21.0 || ^0.23.0 || ^0.24.0 || ^0.25.0 || ^0.27.0",
45
45
  "vite": "^7.3.1",
46
46
  "vitest": "^4.1.7",
47
- "@uniweb/build": "0.42.0"
47
+ "@uniweb/build": "0.42.1"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "react": "^19.0.0",
@@ -41,7 +41,7 @@
41
41
  *
42
42
  * ⚠️ **The tempting fix is the dangerous one.** Stamping the current version
43
43
  * (`0.16.0`) would satisfy every check and be **false**: backend reads
44
- * `isolateApiFloor` from the channel index and refuses to serve a site below it,
44
+ * `minUsable` from the channel index and refuses to serve a site below it,
45
45
  * so a floor of 0.16.0 would promise an export that 0.16.0 does not contain —
46
46
  * and a host at the floor is entitled to skip feature detection. That is a
47
47
  * guarantee broken in the one direction the floor exists to prevent.
@@ -55,7 +55,7 @@
55
55
  * 1. land the export stamped `UNRELEASED` — the floor does not move;
56
56
  * 2. publish (Diego; agents never publish);
57
57
  * 3. replace `UNRELEASED` with the version that publish produced — the floor
58
- * moves here, and the runtime channel's `isolateApiFloor` follows at the
58
+ * moves here, and the runtime channel's `minUsable` follows at the
59
59
  * next channel publish;
60
60
  * 4. tell backend, which holds the number and must ratchet it.
61
61
  *
@@ -110,10 +110,51 @@ export const ISOLATE_API = Object.freeze({
110
110
  })
111
111
 
112
112
  /**
113
- * The runtime version at or above which EVERY name in `ISOLATE_API` is exported —
114
- * the absolute floor a host may rely on with no feature detection.
115
113
  */
116
- export const ISOLATE_API_FLOOR = Object.values(ISOLATE_API)
114
+ /**
115
+ * ⭐ A RUNTIME BELOW THIS CANNOT TALK TO THE CURRENT RECORDS SERVICE, whatever it
116
+ * exports — so it is a floor for a reason the API map cannot express.
117
+ *
118
+ * `0.18.0` is the first runtime that sends `whole`. Every earlier one sends
119
+ * `depth` on **every** records question, briefs included; `depth` is now an
120
+ * unknown field at the door, and an unknown field is a **protocol violation —
121
+ * a whole-request `400`**. ⇒ On a site pinned below this, **every** live-records
122
+ * fetch fails: the corpus walk a host makes AND the fetches a page render
123
+ * issues. Loud, per key, with a sentence — but total.
124
+ *
125
+ * ⛔ **Why this belongs in the same number rather than beside it.** The floor's
126
+ * job AT ITS CONSUMER is *"never publish a site below this"* — the publisher
127
+ * reads it and refuses a lower version. That behaviour does not care WHY a
128
+ * version is unusable, and a second number to read and compose would be one more
129
+ * thing to miss, failing silently when missed.
130
+ *
131
+ * ⚠️ **The name is now slightly narrow, and that is a deliberate trade.** What
132
+ * ships in the channel index is `isolateApiFloor`, which a consumer already polls
133
+ * and ratchets; renaming it is a cross-lane change for a word, while the contract
134
+ * it carries — the minimum a site may be published at — is unchanged and is what
135
+ * matters. Read it as *the absolute runtime floor*, of which the API map is one
136
+ * input.
137
+ *
138
+ * ⇒ **Raise this when a runtime change makes an older one unable to speak to a
139
+ * shipped peer.** Not for a feature, not for a fix — for an incompatibility.
140
+ */
141
+ export const WIRE_FLOOR = '0.18.0'
142
+
143
+ /**
144
+ * ⭐ **THE MINIMUM RUNTIME VERSION A SITE MAY BE PUBLISHED AT.** At or above it,
145
+ * every name in `ISOLATE_API` is exported AND the runtime can speak to the
146
+ * current records service; below it, a runtime **does not work** — not "is
147
+ * unsupported".
148
+ *
149
+ * ⛔ **Named `ISOLATE_API_FLOOR` until 2026-09-06, and the name was wrong twice
150
+ * over**: the API map is only one of its inputs, and "floor" said nothing about
151
+ * what falls below it. *[Diego: "I wasn't convinced by `isolateApiFloor` when it
152
+ * was introduced."]* ⭐ **`usable` is a claim of FACT, and it is chosen to resist
153
+ * a drift** — raise this for an incompatibility, never for a feature, a fix or a
154
+ * preference, and a name that says *usable* makes the wrong reason read wrong.
155
+ * On the wire it is `minUsable`.
156
+ */
157
+ export const MIN_USABLE_RUNTIME = [WIRE_FLOOR, ...Object.values(ISOLATE_API)]
117
158
  .filter((v) => v !== UNRELEASED)
118
159
  .reduce((max, v) => (compareVersions(v, max) > 0 ? v : max), '0.0.0')
119
160