@uniweb/runtime 0.9.6 → 0.9.8

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.
@@ -1,2 +1 @@
1
1
  import{r as O}from"./index-CxUeIbEw.js";var y={exports:{}},n={};var o;function S(){if(o)return n;o=1;var u=O();function g(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var i={d:{f:c,r:function(){throw Error(g(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},m=Symbol.for("react.portal");function v(r,e,t){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:a==null?null:""+a,children:r,containerInfo:e,implementation:t}}var f=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}return n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,n.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(g(299));return v(r,e,null,t)},n.flushSync=function(r){var e=f.T,t=i.p;try{if(f.T=null,i.p=2,r)return r()}finally{f.T=e,i.p=t,i.d.f()}},n.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,i.d.C(r,e))},n.prefetchDNS=function(r){typeof r=="string"&&i.d.D(r)},n.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,a=d(t,e.crossOrigin),s=typeof e.integrity=="string"?e.integrity:void 0,l=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?i.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:a,integrity:s,fetchPriority:l}):t==="script"&&i.d.X(r,{crossOrigin:a,integrity:s,fetchPriority:l,nonce:typeof e.nonce=="string"?e.nonce:void 0})}},n.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=d(e.as,e.crossOrigin);i.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&i.d.M(r)},n.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,a=d(t,e.crossOrigin);i.d.L(r,t,{crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}},n.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=d(e.as,e.crossOrigin);i.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else i.d.m(r)},n.requestFormReset=function(r){i.d.r(r)},n.unstable_batchedUpdates=function(r,e){return r(e)},n.useFormState=function(r,e,t){return f.H.useFormState(r,e,t)},n.useFormStatus=function(){return f.H.useHostTransitionStatus()},n.version="19.2.5",n}var _;function T(){if(_)return y.exports;_=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(g){console.error(g)}}return u(),y.exports=S(),y.exports}export{T as r};
2
- //# sourceMappingURL=index-VvOM7xKK.js.map
@@ -1,2 +1 @@
1
1
  import{g as v}from"./_commonjsHelpers-CqkleIqs.js";var n={exports:{}},e={};var i;function l(){if(i)return e;i=1;var a=Symbol.for("react.transitional.element"),R=Symbol.for("react.fragment");function o(p,r,t){var s=null;if(t!==void 0&&(s=""+t),r.key!==void 0&&(s=""+r.key),"key"in r){t={};for(var u in r)u!=="key"&&(t[u]=r[u])}else t=r;return r=t.ref,{$$typeof:a,type:p,key:s,ref:r!==void 0?r:null,props:t}}return e.Fragment=R,e.jsx=o,e.jsxs=o,e}var x;function E(){return x||(x=1,n.exports=l()),n.exports}var d=E();const m=v(d);export{m as a,d as j};
2
- //# sourceMappingURL=jsx-runtime-0PlsXv6K.js.map
@@ -18,7 +18,7 @@
18
18
  }
19
19
  }
20
20
  </script>
21
- <script type="module" crossorigin src="/assets/index-C-EVgXSD.js"></script>
21
+ <script type="module" crossorigin src="/assets/index-Dfiy0YWz.js"></script>
22
22
  <link rel="modulepreload" crossorigin href="/assets/_commonjsHelpers-CqkleIqs.js">
23
23
  <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-0PlsXv6K.js">
24
24
  <link rel="modulepreload" crossorigin href="/assets/index-CxUeIbEw.js">
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.9.6",
3
- "entry": "assets/index-C-EVgXSD.js",
2
+ "version": "0.9.8",
3
+ "entry": "assets/index-Dfiy0YWz.js",
4
4
  "preloads": [
5
5
  "assets/_commonjsHelpers-CqkleIqs.js",
6
6
  "assets/index-VvOM7xKK.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/runtime",
3
- "version": "0.9.6",
3
+ "version": "0.9.8",
4
4
  "description": "Minimal runtime for loading Uniweb foundations",
5
5
  "type": "module",
6
6
  "exports": {
@@ -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.16.12"
47
+ "@uniweb/build": "0.16.18"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "react": "^19.0.0",
@@ -105,22 +105,26 @@ export async function loadFoundation(source) {
105
105
  export async function loadExtensions(urls) {
106
106
  if (!urls?.length) return []
107
107
 
108
- // Resolve extension URLs against base path for subdirectory deployments
109
- // e.g., /effects/foundation.js /templates/extensions/effects/foundation.js
110
- const basePath = import.meta.env?.BASE_URL || '/'
111
- function resolveUrl(source) {
112
- if (basePath === '/') return source
113
- if (typeof source === 'string' && source.startsWith('/')) {
114
- return basePath + source.slice(1)
115
- }
116
- if (typeof source === 'object' && source.url?.startsWith('/')) {
117
- return { ...source, url: basePath + source.url.slice(1) }
118
- }
119
- return source
120
- }
121
-
108
+ // No base resolution here, deliberately: a module URL that reaches the
109
+ // runtime is FINAL. `loadFoundation()` anchors a root-relative URL to the
110
+ // document origin (which HOST serves it) and nothing else, so an extension
111
+ // and the primary foundation resolve by exactly one rule.
112
+ //
113
+ // This used to prefix root-relative URLs with `import.meta.env.BASE_URL`
114
+ // while the primary — which reaches `loadFoundation()` straight from
115
+ // `initRuntime()` — did not, so one string resolved to two places depending
116
+ // on which slot it sat in. Two reasons that was wrong: a module URL is a
117
+ // SERVE LOCATION, not a path under the site's mount point (a host may serve
118
+ // a site under one subpath and serve its foundation from an entirely
119
+ // different root, so prefixing would corrupt it); and
120
+ // BASE_URL is a build-time constant of whichever bundle the runtime shipped
121
+ // in, which `setup.js buildDefaultFetcher()` had already ruled the wrong
122
+ // authority for the sibling problem.
123
+ //
124
+ // The deployment base is now applied by the producer, which knows it:
125
+ // `@uniweb/build` → `src/site/extension-urls.js`.
122
126
  const results = await Promise.allSettled(
123
- urls.map((url) => loadFoundation(resolveUrl(url))),
127
+ urls.map((url) => loadFoundation(url)),
124
128
  )
125
129
 
126
130
  const loaded = []