@uniweb/runtime 0.8.0 → 0.8.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/runtime",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Minimal runtime for loading Uniweb foundations",
5
5
  "type": "module",
6
6
  "exports": {
@@ -8,7 +8,8 @@
8
8
  "./ssr": "./dist/ssr.js",
9
9
  "./provider": "./src/RuntimeProvider.jsx",
10
10
  "./setup": "./src/setup.js",
11
- "./foundation-loader": "./src/foundation-loader.js"
11
+ "./foundation-loader": "./src/foundation-loader.js",
12
+ "./default-fetcher": "./src/default-fetcher.js"
12
13
  },
13
14
  "files": [
14
15
  "src",
@@ -41,7 +42,7 @@
41
42
  "@vitejs/plugin-react": "^4.5.2",
42
43
  "vite": "^7.3.1",
43
44
  "vitest": "^2.0.0",
44
- "@uniweb/build": "0.9.5"
45
+ "@uniweb/build": "0.10.0"
45
46
  },
46
47
  "peerDependencies": {
47
48
  "react": "^18.0.0 || ^19.0.0",
@@ -28,19 +28,19 @@
28
28
  * Every key is optional. When the config is empty, behavior is byte-for-byte
29
29
  * identical to a plain `fetch()` with JSON parsing.
30
30
  *
31
- * Not exported from @uniweb/runtime's public surface: foundations never
32
- * need to reach for this. If a foundation wants to compose the default
33
- * behavior with middleware, its choices are:
31
+ * Exported from a subpath — `@uniweb/runtime/default-fetcher` for
32
+ * runtime-level callers (the editor's preview iframe, custom runtime
33
+ * harnesses). **Foundations should not import this.** A foundation that
34
+ * wants plain URL + JSON behavior simply omits its own fetcher; the
35
+ * runtime installs this one automatically. A foundation that needs
36
+ * auth / retry / response normalization declares a named transport
37
+ * and composes `@uniweb/fetchers` middleware around its own `resolve()`.
34
38
  *
35
- * - Don't declare a fetcher. The runtime's default already handles
36
- * plain URL + JSON responses (and the site-level vocabulary).
37
- * - Declare a custom fetcher and write its own `fetch()` call. When it
38
- * needs auth / retry / response normalization, compose @uniweb/fetchers
39
- * primitives around its own resolve function.
40
- *
41
- * There is intentionally no "reuse the default and wrap it" path — doing
42
- * so would duplicate this code into every foundation bundle. Custom
43
- * fetchers own their transport; the default exists for sites without one.
39
+ * There is intentionally no "reuse the default and wrap it" path for
40
+ * foundations doing so would duplicate this code into every foundation
41
+ * bundle. The subpath export exists specifically for preview-mode shells
42
+ * that need to delegate *non-authenticated* requests to a default-fetcher
43
+ * instance while intercepting authenticated ones via their own transport.
44
44
  *
45
45
  * Intentional omissions: credentials / secrets are NOT part of the vocabulary.
46
46
  * Any value the framework puts into the served HTML is public to the browser.