remote-components 0.4.8 → 0.4.10
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/dist/{chunk-JZRA6DPE.js → chunk-3PR3SWYZ.js} +7 -54
- package/dist/chunk-3PR3SWYZ.js.map +1 -0
- package/dist/{chunk-I7VKDF3E.cjs → chunk-6PZEDIAK.cjs} +5 -52
- package/dist/chunk-6PZEDIAK.cjs.map +1 -0
- package/dist/{chunk-FF4SXSSG.js → chunk-GR5FN73U.js} +3 -3
- package/dist/{chunk-EW5O3Q24.cjs → chunk-HZP4FWPG.cjs} +23 -23
- package/dist/{chunk-EW5O3Q24.cjs.map → chunk-HZP4FWPG.cjs.map} +1 -1
- package/dist/{chunk-WGSS7TJP.js → chunk-M6ACTSVB.js} +2 -2
- package/dist/{chunk-VJO4PTWG.js → chunk-N6AJM72A.js} +6 -6
- package/dist/chunk-N6AJM72A.js.map +1 -0
- package/dist/{chunk-O4ED3BUP.cjs → chunk-OSSMJQFE.cjs} +19 -19
- package/dist/{chunk-YJJFRORQ.cjs → chunk-PCHSF5LH.cjs} +315 -74
- package/dist/chunk-PCHSF5LH.cjs.map +1 -0
- package/dist/{chunk-KCUEMMYL.js → chunk-RHRDUJ3K.js} +3 -3
- package/dist/{chunk-KAFPXSRI.cjs → chunk-RZ224NSH.cjs} +18 -18
- package/dist/{chunk-STMO56U2.js → chunk-VFK4HGZT.js} +264 -23
- package/dist/chunk-VFK4HGZT.js.map +1 -0
- package/dist/{chunk-4MLJE6UP.cjs → chunk-XWRB6CEA.cjs} +3 -3
- package/dist/config/nextjs.cjs +5 -5
- package/dist/config/nextjs.cjs.map +1 -1
- package/dist/config/nextjs.js +1 -1
- package/dist/config/nextjs.js.map +1 -1
- package/dist/host/html.cjs +19 -19
- package/dist/host/html.js +7 -7
- package/dist/host/nextjs/app/client-only.cjs +11 -11
- package/dist/host/nextjs/app/client-only.js +6 -6
- package/dist/host/nextjs/pages/client-only.cjs +42 -24
- package/dist/host/nextjs/pages/client-only.cjs.map +1 -1
- package/dist/host/nextjs/pages/client-only.d.ts +1 -1
- package/dist/host/nextjs/pages/client-only.js +42 -24
- package/dist/host/nextjs/pages/client-only.js.map +1 -1
- package/dist/host/react.cjs +7 -7
- package/dist/host/react.js +6 -6
- package/dist/internal/config/webpack/apply-shared-modules.cjs +8 -0
- package/dist/internal/config/webpack/apply-shared-modules.cjs.map +1 -1
- package/dist/internal/config/webpack/apply-shared-modules.d.ts +6 -1
- package/dist/internal/config/webpack/apply-shared-modules.js +10 -0
- package/dist/internal/config/webpack/apply-shared-modules.js.map +1 -1
- package/dist/internal/config/webpack/provider-adapter.cjs +85 -0
- package/dist/internal/config/webpack/provider-adapter.cjs.map +1 -0
- package/dist/internal/config/webpack/provider-adapter.d.ts +7 -0
- package/dist/internal/config/webpack/provider-adapter.js +64 -0
- package/dist/internal/config/webpack/provider-adapter.js.map +1 -0
- package/dist/internal/config/webpack/shared-module-resolver.cjs +73 -0
- package/dist/internal/config/webpack/shared-module-resolver.cjs.map +1 -0
- package/dist/internal/config/webpack/shared-module-resolver.d.ts +35 -0
- package/dist/internal/config/webpack/shared-module-resolver.js +50 -0
- package/dist/internal/config/webpack/shared-module-resolver.js.map +1 -0
- package/dist/internal/host/shared/provider.cjs +188 -0
- package/dist/internal/host/shared/provider.cjs.map +1 -0
- package/dist/internal/host/shared/provider.d.ts +71 -0
- package/dist/internal/host/shared/provider.js +161 -0
- package/dist/internal/host/shared/provider.js.map +1 -0
- package/dist/internal/host/shared/shared-broker.cjs +0 -30
- package/dist/internal/host/shared/shared-broker.cjs.map +1 -1
- package/dist/internal/host/shared/shared-broker.d.ts +1 -7
- package/dist/internal/host/shared/shared-broker.js +0 -29
- package/dist/internal/host/shared/shared-broker.js.map +1 -1
- package/dist/internal/host/shared/shared-module-resolver.cjs +7 -29
- package/dist/internal/host/shared/shared-module-resolver.cjs.map +1 -1
- package/dist/internal/host/shared/shared-module-resolver.d.ts +13 -34
- package/dist/internal/host/shared/shared-module-resolver.js +5 -29
- package/dist/internal/host/shared/shared-module-resolver.js.map +1 -1
- package/dist/internal/runtime/loaders/component-loader.cjs +3 -2
- package/dist/internal/runtime/loaders/component-loader.cjs.map +1 -1
- package/dist/internal/runtime/loaders/component-loader.js +2 -4
- package/dist/internal/runtime/loaders/component-loader.js.map +1 -1
- package/dist/internal/runtime/turbopack/shared-modules.cjs +13 -19
- package/dist/internal/runtime/turbopack/shared-modules.cjs.map +1 -1
- package/dist/internal/runtime/turbopack/shared-modules.js +17 -21
- package/dist/internal/runtime/turbopack/shared-modules.js.map +1 -1
- package/dist/{turbopack-XDIGB4GI.js → turbopack-6BSS3SYN.js} +5 -5
- package/dist/turbopack-6BSS3SYN.js.map +1 -0
- package/dist/{turbopack-RXVSOWF7.cjs → turbopack-UMJ7SLJL.cjs} +12 -12
- package/dist/{turbopack-RXVSOWF7.cjs.map → turbopack-UMJ7SLJL.cjs.map} +1 -1
- package/dist/{webpack-3QXPAZN4.js → webpack-4QYGIVE6.js} +9 -7
- package/dist/webpack-4QYGIVE6.js.map +1 -0
- package/dist/{webpack-HKD7RZRE.cjs → webpack-65BVWX2U.cjs} +13 -11
- package/dist/webpack-65BVWX2U.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-I7VKDF3E.cjs.map +0 -1
- package/dist/chunk-JZRA6DPE.js.map +0 -1
- package/dist/chunk-STMO56U2.js.map +0 -1
- package/dist/chunk-VJO4PTWG.js.map +0 -1
- package/dist/chunk-YJJFRORQ.cjs.map +0 -1
- package/dist/turbopack-XDIGB4GI.js.map +0 -1
- package/dist/webpack-3QXPAZN4.js.map +0 -1
- package/dist/webpack-HKD7RZRE.cjs.map +0 -1
- /package/dist/{chunk-FF4SXSSG.js.map → chunk-GR5FN73U.js.map} +0 -0
- /package/dist/{chunk-WGSS7TJP.js.map → chunk-M6ACTSVB.js.map} +0 -0
- /package/dist/{chunk-O4ED3BUP.cjs.map → chunk-OSSMJQFE.cjs.map} +0 -0
- /package/dist/{chunk-KCUEMMYL.js.map → chunk-RHRDUJ3K.js.map} +0 -0
- /package/dist/{chunk-KAFPXSRI.cjs.map → chunk-RZ224NSH.cjs.map} +0 -0
- /package/dist/{chunk-4MLJE6UP.cjs.map → chunk-XWRB6CEA.cjs.map} +0 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkHZP4FWPGcjs = require('./chunk-HZP4FWPG.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunk3AX5WLZDcjs = require('./chunk-3AX5WLZD.cjs');
|
|
@@ -21,7 +21,7 @@ var _chunkN3SQTOSEcjs = require('./chunk-N3SQTOSE.cjs');
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunk6PZEDIAKcjs = require('./chunk-6PZEDIAK.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
var _chunkZ2SLBFQLcjs = require('./chunk-Z2SLBFQL.cjs');
|
|
@@ -92,7 +92,7 @@ function setAttributesFromProps(el, props) {
|
|
|
92
92
|
function useResolveClientUrl(prop, urlHref) {
|
|
93
93
|
const { resolveClientUrl: contextValue } = _context.useRemoteComponentsContext.call(void 0, );
|
|
94
94
|
const raw = _nullishCoalesce(prop, () => ( contextValue));
|
|
95
|
-
return _react.useMemo.call(void 0, () =>
|
|
95
|
+
return _react.useMemo.call(void 0, () => _chunkHZP4FWPGcjs.bindResolveClientUrl.call(void 0, raw, urlHref), [raw, urlHref]);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
// src/host/react/hooks/use-shadow-root.ts
|
|
@@ -154,7 +154,7 @@ function getRemoteComponentHtml(html) {
|
|
|
154
154
|
return ssrRemoteComponentContainer.innerHTML;
|
|
155
155
|
}
|
|
156
156
|
const remoteComponentContainer = temp.querySelectorAll(
|
|
157
|
-
`div[data-bundle][data-route][data-runtime][id^="${
|
|
157
|
+
`div[data-bundle][data-route][data-runtime][id^="${_chunk6PZEDIAKcjs.DEFAULT_COMPONENT_NAME}"],div[data-bundle][data-route],div#__next,remote-component:not([src])`
|
|
158
158
|
);
|
|
159
159
|
if (remoteComponentContainer.length > 0) {
|
|
160
160
|
return `${Array.from(temp.querySelectorAll("link,script")).map((link) => link.outerHTML).join("")}${Array.from(remoteComponentContainer).map((container) => container.outerHTML).join("")}`;
|
|
@@ -179,7 +179,7 @@ function ConsumeRemoteComponent({
|
|
|
179
179
|
mode = "open",
|
|
180
180
|
reset,
|
|
181
181
|
credentials: credentialsProp,
|
|
182
|
-
name: nameProp =
|
|
182
|
+
name: nameProp = _chunk6PZEDIAKcjs.DEFAULT_COMPONENT_NAME,
|
|
183
183
|
shared: sharedProp,
|
|
184
184
|
children,
|
|
185
185
|
onBeforeLoad,
|
|
@@ -195,22 +195,22 @@ function ConsumeRemoteComponent({
|
|
|
195
195
|
const credentials = _nullishCoalesce(_nullishCoalesce(credentialsProp, () => ( contextCredentials)), () => ( "same-origin"));
|
|
196
196
|
const shared = _nullishCoalesce(_nullishCoalesce(sharedProp, () => ( contextShared)), () => ( {}));
|
|
197
197
|
const emitter = _react.useMemo.call(void 0,
|
|
198
|
-
() =>
|
|
198
|
+
() => _chunkHZP4FWPGcjs.makeReactEmitter.call(void 0, { onBeforeLoad, onLoad, onError, onChange }),
|
|
199
199
|
[onBeforeLoad, onLoad, onError, onChange]
|
|
200
200
|
);
|
|
201
201
|
const name = _react.useMemo.call(void 0,
|
|
202
|
-
() =>
|
|
202
|
+
() => _chunkHZP4FWPGcjs.resolveNameFromSrc.call(void 0, src, nameProp),
|
|
203
203
|
[src, nameProp]
|
|
204
204
|
);
|
|
205
205
|
const [data, setData] = _react.useState.call(void 0,
|
|
206
206
|
null
|
|
207
207
|
);
|
|
208
|
-
const url = _react.useMemo.call(void 0, () =>
|
|
208
|
+
const url = _react.useMemo.call(void 0, () => _chunkHZP4FWPGcjs.getClientOrServerUrl.call(void 0, src, DUMMY_FALLBACK), [src]);
|
|
209
209
|
const resolveClientUrl = useResolveClientUrl(resolveClientUrlProp, url.href);
|
|
210
210
|
const id = url.origin === (typeof location !== "undefined" ? location.origin : DUMMY_FALLBACK) ? url.pathname : url.href;
|
|
211
|
-
const keySuffix = `${
|
|
211
|
+
const keySuffix = `${_chunk6PZEDIAKcjs.escapeString.call(void 0, id)}_${_chunk6PZEDIAKcjs.escapeString.call(void 0,
|
|
212
212
|
_nullishCoalesce(_optionalChain([data, 'optionalAccess', _5 => _5.name]), () => ( name))
|
|
213
|
-
)}_${
|
|
213
|
+
)}_${_chunk6PZEDIAKcjs.escapeString.call(void 0, instanceId)}`;
|
|
214
214
|
const [remoteComponent, setRemoteComponent] = _react.useState.call(void 0, null);
|
|
215
215
|
const { shadowRoot, shadowRootContainerRef } = useShadowRoot({
|
|
216
216
|
isolate,
|
|
@@ -236,7 +236,7 @@ function ConsumeRemoteComponent({
|
|
|
236
236
|
return elements;
|
|
237
237
|
})() : []
|
|
238
238
|
);
|
|
239
|
-
const hostStateRef = _react.useRef.call(void 0,
|
|
239
|
+
const hostStateRef = _react.useRef.call(void 0, _chunkHZP4FWPGcjs.createHostState.call(void 0, ));
|
|
240
240
|
const componentHydrationHtml = _react.useRef.call(void 0, null);
|
|
241
241
|
const prevRemoteComponentContainerRef = _react.useRef.call(void 0, null);
|
|
242
242
|
const unmountRef = _react.useRef.call(void 0, null);
|
|
@@ -302,7 +302,7 @@ function ConsumeRemoteComponent({
|
|
|
302
302
|
_nullishCoalesce(_optionalChain([resolveClientUrl, 'optionalCall', _29 => _29(url.href)]), () => ( url.href)),
|
|
303
303
|
location.href
|
|
304
304
|
);
|
|
305
|
-
const res = await
|
|
305
|
+
const res = await _chunkHZP4FWPGcjs.fetchWithHooks.call(void 0, resolvedUrl, fetchInit, {
|
|
306
306
|
onRequest,
|
|
307
307
|
onResponse,
|
|
308
308
|
abortController: hostStateRef.current.abortController
|
|
@@ -321,7 +321,7 @@ function ConsumeRemoteComponent({
|
|
|
321
321
|
const userShared = await shared;
|
|
322
322
|
if (signal.aborted)
|
|
323
323
|
return;
|
|
324
|
-
const prepared =
|
|
324
|
+
const prepared = _chunkHZP4FWPGcjs.preparePipeline.call(void 0, {
|
|
325
325
|
html,
|
|
326
326
|
name,
|
|
327
327
|
url,
|
|
@@ -362,7 +362,7 @@ function ConsumeRemoteComponent({
|
|
|
362
362
|
href: new URL(_nullishCoalesce(link.getAttribute("href"), () => ( link.href)), url).href,
|
|
363
363
|
...link.getAttributeNames().reduce((acc, key) => {
|
|
364
364
|
if (key !== "href") {
|
|
365
|
-
acc[_nullishCoalesce(
|
|
365
|
+
acc[_nullishCoalesce(_chunk6PZEDIAKcjs.attrToProp[key], () => ( key))] = _nullishCoalesce(link.getAttribute(key), () => ( ""));
|
|
366
366
|
}
|
|
367
367
|
return acc;
|
|
368
368
|
}, {})
|
|
@@ -424,7 +424,7 @@ function ConsumeRemoteComponent({
|
|
|
424
424
|
});
|
|
425
425
|
self.__next_s = prevNextScripts;
|
|
426
426
|
}
|
|
427
|
-
const rscName = rsc ? `__remote_component_rsc_${
|
|
427
|
+
const rscName = rsc ? `__remote_component_rsc_${_chunk6PZEDIAKcjs.escapeString.call(void 0, id)}_${_chunk6PZEDIAKcjs.escapeString.call(void 0,
|
|
428
428
|
remoteName
|
|
429
429
|
)}` : void 0;
|
|
430
430
|
if (rsc) {
|
|
@@ -497,7 +497,7 @@ function ConsumeRemoteComponent({
|
|
|
497
497
|
}
|
|
498
498
|
hostStateRef.current.stage = "loaded";
|
|
499
499
|
} else {
|
|
500
|
-
const result = await
|
|
500
|
+
const result = await _chunkHZP4FWPGcjs.loadPrepared.call(void 0, {
|
|
501
501
|
prepared,
|
|
502
502
|
url,
|
|
503
503
|
signal,
|
|
@@ -566,8 +566,8 @@ function ConsumeRemoteComponent({
|
|
|
566
566
|
const metadataJson = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "script", { "data-remote-component": true, type: "application/json", children: JSON.stringify({
|
|
567
567
|
name: _optionalChain([data, 'optionalAccess', _33 => _33.name]) || name,
|
|
568
568
|
bundle: _optionalChain([data, 'optionalAccess', _34 => _34.bundle]) || "default",
|
|
569
|
-
route: _optionalChain([data, 'optionalAccess', _35 => _35.route]) ||
|
|
570
|
-
runtime: hostStateRef.current.prevIsRemoteComponent ?
|
|
569
|
+
route: _optionalChain([data, 'optionalAccess', _35 => _35.route]) || _chunk6PZEDIAKcjs.DEFAULT_ROUTE,
|
|
570
|
+
runtime: hostStateRef.current.prevIsRemoteComponent ? _chunk6PZEDIAKcjs.RUNTIME_SCRIPT : _optionalChain([data, 'optionalAccess', _36 => _36.runtime]) || _chunk6PZEDIAKcjs.RUNTIME_WEBPACK
|
|
571
571
|
}) });
|
|
572
572
|
const resetStyle = reset ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { "data-remote-components-reset": "react", children: `:host { all: initial; }` }) : null;
|
|
573
573
|
const linksToRender = _optionalChain([data, 'optionalAccess', _37 => _37.links, 'optionalAccess', _38 => _38.map, 'call', _39 => _39((link) => /* @__PURE__ */ _react.createElement.call(void 0,
|
|
@@ -679,4 +679,4 @@ function ConsumeRemoteComponent({
|
|
|
679
679
|
|
|
680
680
|
|
|
681
681
|
exports.useRemoteNavigate = useRemoteNavigate; exports.ConsumeRemoteComponent = ConsumeRemoteComponent;
|
|
682
|
-
//# sourceMappingURL=chunk-
|
|
682
|
+
//# sourceMappingURL=chunk-OSSMJQFE.cjs.map
|