@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 +4 -3
- package/src/default-fetcher.js +12 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/runtime",
|
|
3
|
-
"version": "0.8.
|
|
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.
|
|
45
|
+
"@uniweb/build": "0.10.0"
|
|
45
46
|
},
|
|
46
47
|
"peerDependencies": {
|
|
47
48
|
"react": "^18.0.0 || ^19.0.0",
|
package/src/default-fetcher.js
CHANGED
|
@@ -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
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
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
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
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.
|