@bleedingdev/modern-js-runtime-extensions 3.9.0-ultramodern.2 → 3.9.0-ultramodern.20
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/cjs/buildIdentity.js +73 -0
- package/dist/cjs/contextExtensions.js +74 -0
- package/dist/cjs/headRuntime.js +91 -0
- package/dist/cjs/helmetContext.js +54 -0
- package/dist/cjs/index.js +18 -4
- package/dist/cjs/localisedLoaderIdentity.js +51 -0
- package/dist/cjs/localisedUrls/config.js +49 -0
- package/dist/cjs/localisedUrls/index.js +95 -0
- package/dist/cjs/localisedUrls/normalise.js +87 -0
- package/dist/cjs/localisedUrls/pathname.js +68 -0
- package/dist/cjs/localisedUrls/patterns.js +214 -0
- package/dist/cjs/localisedUrls/redirect.js +100 -0
- package/dist/cjs/localisedUrls/resolve.js +78 -0
- package/dist/cjs/localisedUrls/routeIdentity.js +92 -0
- package/dist/cjs/localisedUrls/routes.js +217 -0
- package/dist/cjs/localisedUrls/types.js +18 -0
- package/dist/cjs/prefetchPolicy.js +52 -0
- package/dist/cjs/rendererHead.js +18 -5
- package/dist/cjs/request-policy/browser.js +139 -0
- package/dist/cjs/request-policy/client.js +234 -0
- package/dist/cjs/request-policy/node.js +149 -0
- package/dist/cjs/request-policy/policyCore.js +266 -0
- package/dist/cjs/request-policy/requestContext.js +137 -0
- package/dist/cjs/request-policy/traceparent.js +56 -0
- package/dist/cjs/request-policy/transport.js +234 -0
- package/dist/cjs/request-policy/types.js +57 -0
- package/dist/cjs/routeHydration.js +127 -0
- package/dist/cjs/routerPrefetchPolicy.js +153 -0
- package/dist/cjs/routerProvider.js +105 -0
- package/dist/cjs/routerState.js +175 -0
- package/dist/cjs/routerStatePlugin.js +113 -0
- package/dist/cjs/routerStateTypes.js +18 -0
- package/dist/cjs/rsc-disabled/rscDisabledClientBrowserRuntime.js +69 -0
- package/dist/cjs/rsc-disabled/rscDisabledClientEdgeRuntime.js +61 -0
- package/dist/cjs/rsc-disabled/rscDisabledClientNodeRuntime.js +65 -0
- package/dist/cjs/rsc-disabled/rscDisabledRuntimeError.js +42 -0
- package/dist/cjs/rsc-disabled/rscDisabledServerEdgeRuntime.js +93 -0
- package/dist/cjs/rsc-disabled/rscDisabledServerNodeRuntime.js +101 -0
- package/dist/cjs/runtimeContextProjection.js +112 -0
- package/dist/cjs/server-config/bffRuntime.js +18 -0
- package/dist/cjs/server-config/index.js +18 -0
- package/dist/cjs/server-config/serverTelemetry.js +18 -0
- package/dist/cjs/shellStream.js +34 -2
- package/dist/cjs/workspaceEvents.js +159 -0
- package/dist/esm/buildIdentity.mjs +35 -0
- package/dist/esm/contextExtensions.mjs +33 -0
- package/dist/esm/headRuntime.mjs +43 -0
- package/dist/esm/helmetContext.mjs +13 -0
- package/dist/esm/index.mjs +2 -0
- package/dist/esm/localisedLoaderIdentity.mjs +13 -0
- package/dist/esm/localisedUrls/config.mjs +11 -0
- package/dist/esm/localisedUrls/index.mjs +8 -0
- package/dist/esm/localisedUrls/normalise.mjs +37 -0
- package/dist/esm/localisedUrls/pathname.mjs +24 -0
- package/dist/esm/localisedUrls/patterns.mjs +152 -0
- package/dist/esm/localisedUrls/redirect.mjs +53 -0
- package/dist/esm/localisedUrls/resolve.mjs +37 -0
- package/dist/esm/localisedUrls/routeIdentity.mjs +54 -0
- package/dist/esm/localisedUrls/routes.mjs +176 -0
- package/dist/esm/localisedUrls/types.mjs +0 -0
- package/dist/esm/prefetchPolicy.mjs +11 -0
- package/dist/esm/rendererHead.mjs +14 -5
- package/dist/esm/request-policy/browser.mjs +11 -0
- package/dist/esm/request-policy/client.mjs +195 -0
- package/dist/esm/request-policy/policyCore.mjs +171 -0
- package/dist/esm/request-policy/requestContext.mjs +75 -0
- package/dist/esm/request-policy/traceparent.mjs +18 -0
- package/dist/esm/request-policy/transport.mjs +196 -0
- package/dist/esm/request-policy/types.mjs +10 -0
- package/dist/esm/routeHydration.mjs +77 -0
- package/dist/esm/routerPrefetchPolicy.mjs +115 -0
- package/dist/esm/routerProvider.mjs +58 -0
- package/dist/esm/routerState.mjs +113 -0
- package/dist/esm/routerStatePlugin.mjs +75 -0
- package/dist/esm/routerStateTypes.mjs +0 -0
- package/dist/esm/rsc-disabled/rscDisabledClientBrowserRuntime.mjs +10 -0
- package/dist/esm/rsc-disabled/rscDisabledClientEdgeRuntime.mjs +8 -0
- package/dist/esm/rsc-disabled/rscDisabledClientNodeRuntime.mjs +9 -0
- package/dist/esm/rsc-disabled/rscDisabledRuntimeError.mjs +4 -0
- package/dist/esm/rsc-disabled/rscDisabledServerEdgeRuntime.mjs +16 -0
- package/dist/esm/rsc-disabled/rscDisabledServerNodeRuntime.mjs +18 -0
- package/dist/esm/runtimeContextProjection.mjs +74 -0
- package/dist/esm/server-config/bffRuntime.mjs +0 -0
- package/dist/esm/server-config/index.mjs +0 -0
- package/dist/esm/server-config/serverTelemetry.mjs +0 -0
- package/dist/esm/shellStream.mjs +34 -2
- package/dist/esm/workspaceEvents.mjs +66 -0
- package/dist/esm-node/buildIdentity.mjs +36 -0
- package/dist/esm-node/contextExtensions.mjs +34 -0
- package/dist/esm-node/headRuntime.mjs +44 -0
- package/dist/esm-node/helmetContext.mjs +14 -0
- package/dist/esm-node/index.mjs +2 -0
- package/dist/esm-node/localisedLoaderIdentity.mjs +14 -0
- package/dist/esm-node/localisedUrls/config.mjs +12 -0
- package/dist/esm-node/localisedUrls/index.mjs +9 -0
- package/dist/esm-node/localisedUrls/normalise.mjs +38 -0
- package/dist/esm-node/localisedUrls/pathname.mjs +25 -0
- package/dist/esm-node/localisedUrls/patterns.mjs +153 -0
- package/dist/esm-node/localisedUrls/redirect.mjs +54 -0
- package/dist/esm-node/localisedUrls/resolve.mjs +38 -0
- package/dist/esm-node/localisedUrls/routeIdentity.mjs +55 -0
- package/dist/esm-node/localisedUrls/routes.mjs +177 -0
- package/dist/esm-node/localisedUrls/types.mjs +1 -0
- package/dist/esm-node/prefetchPolicy.mjs +12 -0
- package/dist/esm-node/rendererHead.mjs +14 -5
- package/dist/esm-node/request-policy/browser.mjs +12 -0
- package/dist/esm-node/request-policy/client.mjs +196 -0
- package/dist/esm-node/request-policy/node.mjs +22 -0
- package/dist/esm-node/request-policy/policyCore.mjs +172 -0
- package/dist/esm-node/request-policy/requestContext.mjs +76 -0
- package/dist/esm-node/request-policy/traceparent.mjs +19 -0
- package/dist/esm-node/request-policy/transport.mjs +197 -0
- package/dist/esm-node/request-policy/types.mjs +11 -0
- package/dist/esm-node/routeHydration.mjs +78 -0
- package/dist/esm-node/routerPrefetchPolicy.mjs +116 -0
- package/dist/esm-node/routerProvider.mjs +59 -0
- package/dist/esm-node/routerState.mjs +114 -0
- package/dist/esm-node/routerStatePlugin.mjs +76 -0
- package/dist/esm-node/routerStateTypes.mjs +1 -0
- package/dist/esm-node/rsc-disabled/rscDisabledClientBrowserRuntime.mjs +11 -0
- package/dist/esm-node/rsc-disabled/rscDisabledClientEdgeRuntime.mjs +9 -0
- package/dist/esm-node/rsc-disabled/rscDisabledClientNodeRuntime.mjs +10 -0
- package/dist/esm-node/rsc-disabled/rscDisabledRuntimeError.mjs +5 -0
- package/dist/esm-node/rsc-disabled/rscDisabledServerEdgeRuntime.mjs +17 -0
- package/dist/esm-node/rsc-disabled/rscDisabledServerNodeRuntime.mjs +19 -0
- package/dist/esm-node/runtimeContextProjection.mjs +75 -0
- package/dist/esm-node/server-config/bffRuntime.mjs +1 -0
- package/dist/esm-node/server-config/index.mjs +1 -0
- package/dist/esm-node/server-config/serverTelemetry.mjs +1 -0
- package/dist/esm-node/shellStream.mjs +34 -2
- package/dist/esm-node/workspaceEvents.mjs +67 -0
- package/dist/types/buildIdentity.d.ts +37 -0
- package/dist/types/contextExtensions.d.ts +34 -0
- package/dist/types/headRuntime.d.ts +12 -0
- package/dist/types/helmetCompat.d.ts +1 -1
- package/dist/types/helmetContext.d.ts +10 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/localisedLoaderIdentity.d.ts +10 -0
- package/dist/types/localisedUrls/config.d.ts +9 -0
- package/dist/types/localisedUrls/index.d.ts +10 -0
- package/dist/types/localisedUrls/normalise.d.ts +10 -0
- package/dist/types/localisedUrls/pathname.d.ts +4 -0
- package/dist/types/localisedUrls/patterns.d.ts +11 -0
- package/dist/types/localisedUrls/redirect.d.ts +19 -0
- package/dist/types/localisedUrls/resolve.d.ts +7 -0
- package/dist/types/localisedUrls/routeIdentity.d.ts +22 -0
- package/dist/types/localisedUrls/routes.d.ts +3 -0
- package/dist/types/localisedUrls/types.d.ts +14 -0
- package/dist/types/prefetchPolicy.d.ts +4 -0
- package/dist/types/rendererHead.d.ts +5 -3
- package/dist/types/request-policy/browser.d.ts +10 -0
- package/dist/types/request-policy/client.d.ts +14 -0
- package/dist/types/request-policy/node.d.ts +10 -0
- package/dist/types/request-policy/policyCore.d.ts +107 -0
- package/dist/types/request-policy/requestContext.d.ts +22 -0
- package/dist/types/request-policy/traceparent.d.ts +10 -0
- package/dist/types/request-policy/transport.d.ts +12 -0
- package/dist/types/request-policy/types.d.ts +144 -0
- package/dist/types/routeHydration.d.ts +24 -0
- package/dist/types/routerPrefetchPolicy.d.ts +28 -0
- package/dist/types/routerProvider.d.ts +55 -0
- package/dist/types/routerState.d.ts +17 -0
- package/dist/types/routerStatePlugin.d.ts +19 -0
- package/dist/types/routerStateTypes.d.ts +70 -0
- package/dist/types/rsc-disabled/rscDisabledClientBrowserRuntime.d.ts +9 -0
- package/dist/types/rsc-disabled/rscDisabledClientEdgeRuntime.d.ts +7 -0
- package/dist/types/rsc-disabled/rscDisabledClientNodeRuntime.d.ts +8 -0
- package/dist/types/rsc-disabled/rscDisabledRuntimeError.d.ts +1 -0
- package/dist/types/rsc-disabled/rscDisabledServerEdgeRuntime.d.ts +15 -0
- package/dist/types/rsc-disabled/rscDisabledServerNodeRuntime.d.ts +17 -0
- package/dist/types/runtimeContextProjection.d.ts +30 -0
- package/dist/types/server-config/bffRuntime.d.ts +122 -0
- package/dist/types/server-config/index.d.ts +2 -0
- package/dist/types/server-config/serverTelemetry.d.ts +322 -0
- package/dist/types/workspaceEvents.d.ts +62 -0
- package/package.json +240 -15
- package/rslib.config.mts +17 -2
- package/rstest.config.mts +33 -2
- package/src/buildIdentity.ts +61 -0
- package/src/contextExtensions.ts +81 -0
- package/src/headRuntime.tsx +77 -0
- package/src/helmetCompat.ts +1 -1
- package/src/helmetContext.ts +31 -0
- package/src/index.ts +2 -0
- package/src/localisedLoaderIdentity.ts +30 -0
- package/src/localisedUrls/config.ts +18 -0
- package/src/localisedUrls/index.ts +25 -0
- package/src/localisedUrls/normalise.ts +62 -0
- package/src/localisedUrls/pathname.ts +60 -0
- package/src/localisedUrls/patterns.ts +283 -0
- package/src/localisedUrls/redirect.ts +107 -0
- package/src/localisedUrls/resolve.ts +106 -0
- package/src/localisedUrls/routeIdentity.ts +83 -0
- package/src/localisedUrls/routes.ts +451 -0
- package/src/localisedUrls/types.ts +18 -0
- package/src/prefetchPolicy.ts +33 -0
- package/src/rendererHead.ts +25 -8
- package/src/request-policy/browser.ts +22 -0
- package/src/request-policy/client.ts +404 -0
- package/src/request-policy/node.ts +41 -0
- package/src/request-policy/policyCore.ts +424 -0
- package/src/request-policy/requestContext.ts +149 -0
- package/src/request-policy/traceparent.ts +43 -0
- package/src/request-policy/transport.ts +349 -0
- package/src/request-policy/types.ts +229 -0
- package/src/routeHydration.ts +208 -0
- package/src/routerPrefetchPolicy.ts +195 -0
- package/src/routerProvider.ts +160 -0
- package/src/routerState.ts +220 -0
- package/src/routerStatePlugin.ts +125 -0
- package/src/routerStateTypes.ts +76 -0
- package/src/rsc-disabled/rscDisabledClientBrowserRuntime.ts +10 -0
- package/src/rsc-disabled/rscDisabledClientEdgeRuntime.ts +8 -0
- package/src/rsc-disabled/rscDisabledClientNodeRuntime.ts +9 -0
- package/src/rsc-disabled/rscDisabledRuntimeError.ts +3 -0
- package/src/rsc-disabled/rscDisabledServerEdgeRuntime.ts +16 -0
- package/src/rsc-disabled/rscDisabledServerNodeRuntime.ts +18 -0
- package/src/runtimeContextProjection.ts +105 -0
- package/src/server-config/bffRuntime.ts +136 -0
- package/src/server-config/index.ts +2 -0
- package/src/server-config/serverTelemetry.ts +337 -0
- package/src/shellStream.ts +55 -25
- package/src/workspaceEvents.ts +324 -0
- package/tests/buildIdentity.test.ts +51 -0
- package/tests/contextExtensions.test.ts +27 -0
- package/tests/headRuntime.test.tsx +229 -0
- package/tests/localisedUrls.test.ts +560 -0
- package/tests/rendererHead.test.ts +52 -121
- package/tests/request-policy/browser-policy.test.ts +108 -0
- package/tests/request-policy/client-isolation.test.ts +109 -0
- package/tests/request-policy/node-policy.test.ts +447 -0
- package/tests/request-policy/policyCore.test.ts +129 -0
- package/tests/request-policy/requestContext.test.ts +66 -0
- package/tests/request-policy/requestFactory.outbound-contract.test.ts +290 -0
- package/tests/request-policy/traceparent.test.ts +52 -0
- package/tests/request-policy/transport-retry.test.ts +367 -0
- package/tests/routeHydration.test.ts +180 -0
- package/tests/routerPrefetchPolicy.test.ts +102 -0
- package/tests/routerProvider.test.ts +29 -0
- package/tests/routerState.test.ts +77 -0
- package/tests/routerStatePlugin.test.ts +63 -0
- package/tests/runtimeContextProjection.test.ts +83 -0
- package/tests/safeFailure.test.ts +10 -28
- package/tests/shellStream.test.ts +39 -2
- package/tests/workspaceEvents.test.ts +221 -0
- package/dist/cjs/rscHtmlStream.js +0 -128
- package/dist/esm/rscHtmlStream.mjs +0 -86
- package/dist/esm-node/rscHtmlStream.mjs +0 -87
- package/dist/types/rscHtmlStream.d.ts +0 -4
- package/src/rscHtmlStream.ts +0 -142
- package/tests/rscHtmlStream.test.ts +0 -153
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
applyLocalisedUrlsToRoutes: ()=>applyLocalisedUrlsToRoutes,
|
|
32
|
+
validateLocalisedUrls: ()=>validateLocalisedUrls
|
|
33
|
+
});
|
|
34
|
+
const external_normalise_js_namespaceObject = require("./normalise.js");
|
|
35
|
+
const external_patterns_js_namespaceObject = require("./patterns.js");
|
|
36
|
+
const isLocalisableRoutePath = (path)=>{
|
|
37
|
+
const pathWithoutLocale = (0, external_normalise_js_namespaceObject.stripLeadingLocaleParam)(path);
|
|
38
|
+
if (!pathWithoutLocale || '/' === pathWithoutLocale || '*' === pathWithoutLocale) return false;
|
|
39
|
+
return true;
|
|
40
|
+
};
|
|
41
|
+
const joinPath = (parentPath, routePath)=>{
|
|
42
|
+
if (!isLocalisableRoutePath(routePath)) return parentPath;
|
|
43
|
+
const segment = (0, external_normalise_js_namespaceObject.normaliseRoutePath)((0, external_normalise_js_namespaceObject.stripLeadingLocaleParam)(routePath) || '');
|
|
44
|
+
return (0, external_normalise_js_namespaceObject.normalisePathPattern)(`${parentPath}/${segment}`);
|
|
45
|
+
};
|
|
46
|
+
const isFrameworkInternalRoutePath = (canonicalPath)=>'/_mf' === canonicalPath || canonicalPath.startsWith('/_mf/');
|
|
47
|
+
const legalRouteIdPart = (value)=>value.replace(/[^a-zA-Z0-9_$-]+/g, '_').replace(/^_+|_+$/g, '') || 'index';
|
|
48
|
+
const formatParamSignature = (signature)=>signature.length > 0 ? signature.join(', ') : '(none)';
|
|
49
|
+
const validateLocalisedUrlPatterns = (languages, localisedUrls)=>{
|
|
50
|
+
const physicalPatterns = new Map();
|
|
51
|
+
const claimedPatterns = [];
|
|
52
|
+
const claimPhysicalPattern = (sourcePattern, canonicalPath, source)=>{
|
|
53
|
+
const physicalPattern = (0, external_patterns_js_namespaceObject.getPhysicalPathPattern)(sourcePattern);
|
|
54
|
+
const existing = physicalPatterns.get(physicalPattern);
|
|
55
|
+
if (existing && existing.canonicalPath !== canonicalPath) throw new Error(`localisedUrls["${existing.canonicalPath}"] ${existing.source} and localisedUrls["${canonicalPath}"] ${source} generate the same physical route pattern "${physicalPattern}". Localised route patterns must identify exactly one canonical route.`);
|
|
56
|
+
const overlapping = claimedPatterns.find((claimed)=>claimed.canonicalPath !== canonicalPath && (0, external_patterns_js_namespaceObject.haveEqualPatternSpecificity)(claimed.pattern, sourcePattern) && (0, external_patterns_js_namespaceObject.doPathPatternsOverlap)(claimed.pattern, sourcePattern));
|
|
57
|
+
if (overlapping) throw new Error(`localisedUrls["${overlapping.canonicalPath}"] ${overlapping.source} pattern "${overlapping.pattern}" and localisedUrls["${canonicalPath}"] ${source} pattern "${sourcePattern}" are equal-specificity overlapping route patterns. Localised route patterns must identify exactly one canonical route.`);
|
|
58
|
+
physicalPatterns.set(physicalPattern, {
|
|
59
|
+
canonicalPath,
|
|
60
|
+
source
|
|
61
|
+
});
|
|
62
|
+
claimedPatterns.push({
|
|
63
|
+
canonicalPath,
|
|
64
|
+
pattern: sourcePattern,
|
|
65
|
+
source
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
for (const [canonicalPath, entry] of Object.entries(localisedUrls).sort(([left], [right])=>left < right ? -1 : left > right ? 1 : 0)){
|
|
69
|
+
const canonicalIssue = (0, external_patterns_js_namespaceObject.getPathPatternValidationIssue)(canonicalPath);
|
|
70
|
+
if (canonicalIssue) throw new Error(`localisedUrls["${canonicalPath}"] canonical pattern has ${canonicalIssue}.`);
|
|
71
|
+
const expectedSignature = (0, external_patterns_js_namespaceObject.getPathParamSignature)(canonicalPath);
|
|
72
|
+
const expectedOrderedSignature = (0, external_patterns_js_namespaceObject.getOrderedPathParamSignature)(canonicalPath);
|
|
73
|
+
claimPhysicalPattern(canonicalPath, canonicalPath, 'canonical pattern');
|
|
74
|
+
for (const language of languages){
|
|
75
|
+
const localisedPattern = entry[language];
|
|
76
|
+
if (!localisedPattern) continue;
|
|
77
|
+
const localisedIssue = (0, external_patterns_js_namespaceObject.getPathPatternValidationIssue)(localisedPattern);
|
|
78
|
+
if (localisedIssue) throw new Error(`localisedUrls["${canonicalPath}"].${language} has ${localisedIssue}.`);
|
|
79
|
+
const actualSignature = (0, external_patterns_js_namespaceObject.getPathParamSignature)(localisedPattern);
|
|
80
|
+
if (actualSignature.length !== expectedSignature.length || actualSignature.some((parameter, index)=>parameter !== expectedSignature[index])) throw new Error(`localisedUrls["${canonicalPath}"].${language} must use the same parameter signature as "${canonicalPath}": expected ${formatParamSignature(expectedSignature)}; received ${formatParamSignature(actualSignature)}.`);
|
|
81
|
+
const actualOrderedSignature = (0, external_patterns_js_namespaceObject.getOrderedPathParamSignature)(localisedPattern);
|
|
82
|
+
if (expectedOrderedSignature.some((parameter)=>'*' === parameter || parameter.endsWith('?')) && actualOrderedSignature.some((parameter, index)=>parameter !== expectedOrderedSignature[index])) throw new Error(`localisedUrls["${canonicalPath}"].${language} must keep optional and splat parameters in canonical order: expected ${formatParamSignature(expectedOrderedSignature)}; received ${formatParamSignature(actualOrderedSignature)}.`);
|
|
83
|
+
claimPhysicalPattern(localisedPattern, canonicalPath, `.${language}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
const ensureLocalisedUrlsForPath = (canonicalPath, languages, localisedUrls)=>{
|
|
88
|
+
const entry = localisedUrls[canonicalPath];
|
|
89
|
+
if (!entry) throw new Error(`localisedUrls is enabled, but route "${canonicalPath}" does not define localised URLs for languages: ${languages.join(', ')}. Add localisedUrls["${canonicalPath}"] or set localeDetection.localisedUrls to false.`);
|
|
90
|
+
const missingLanguages = languages.filter((language)=>!entry[language]);
|
|
91
|
+
if (missingLanguages.length > 0) throw new Error(`localisedUrls["${canonicalPath}"] is missing languages: ${missingLanguages.join(', ')}. Every configured language must have a localised URL.`);
|
|
92
|
+
return entry;
|
|
93
|
+
};
|
|
94
|
+
const validateLocalisedUrls = (routes, languages, localisedUrls)=>{
|
|
95
|
+
validateLocalisedUrlPatterns(languages, localisedUrls);
|
|
96
|
+
const visit = (route, parentPath)=>{
|
|
97
|
+
const canonicalPath = joinPath(parentPath, route.path);
|
|
98
|
+
if (isLocalisableRoutePath(route.path) && !isFrameworkInternalRoutePath(canonicalPath)) ensureLocalisedUrlsForPath(canonicalPath, languages, localisedUrls);
|
|
99
|
+
if ('children' in route && route.children) route.children.forEach((child)=>visit(child, canonicalPath));
|
|
100
|
+
};
|
|
101
|
+
routes.forEach((route)=>visit(route, ''));
|
|
102
|
+
};
|
|
103
|
+
const getLocalisedRouteIdSuffixes = (paths)=>{
|
|
104
|
+
const usedSuffixes = new Set();
|
|
105
|
+
return paths.map((path, index)=>{
|
|
106
|
+
if (0 === index) return;
|
|
107
|
+
const baseSuffix = legalRouteIdPart(path);
|
|
108
|
+
let suffix = baseSuffix;
|
|
109
|
+
let disambiguator = 2;
|
|
110
|
+
while(usedSuffixes.has(suffix))suffix = `${baseSuffix}_${disambiguator++}`;
|
|
111
|
+
usedSuffixes.add(suffix);
|
|
112
|
+
return suffix;
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
const getLocalisedRoutePaths = (canonicalPath, parentLocalisedPaths, languages, entry)=>{
|
|
116
|
+
const paths = languages.map((language)=>{
|
|
117
|
+
const fullPath = (0, external_normalise_js_namespaceObject.normalisePathPattern)(entry[language]);
|
|
118
|
+
const parentPath = (0, external_normalise_js_namespaceObject.normalisePathPattern)(parentLocalisedPaths[language] || '/');
|
|
119
|
+
if ('/' === parentPath) return (0, external_normalise_js_namespaceObject.normaliseRoutePath)(fullPath) || void 0;
|
|
120
|
+
const parentPrefix = `${parentPath}/`;
|
|
121
|
+
if (!fullPath.startsWith(parentPrefix)) throw new Error(`localisedUrls["${canonicalPath}"].${language} must be nested under "${parentPath}" because its parent route is localised there.`);
|
|
122
|
+
return (0, external_normalise_js_namespaceObject.normaliseRoutePath)(fullPath.slice(parentPath.length));
|
|
123
|
+
});
|
|
124
|
+
const uniquePaths = Array.from(new Set(paths.filter(Boolean)));
|
|
125
|
+
return uniquePaths;
|
|
126
|
+
};
|
|
127
|
+
const transformLocalisedRoute = (route, parentCanonicalPath, parentLocalisedPaths, languages, localisedUrls, projection)=>{
|
|
128
|
+
const isSplat = '*' === (0, external_normalise_js_namespaceObject.stripLeadingLocaleParam)(route.path);
|
|
129
|
+
const canonicalPath = isSplat ? (0, external_normalise_js_namespaceObject.normalisePathPattern)(`${parentCanonicalPath}/*`) : joinPath(parentCanonicalPath, route.path);
|
|
130
|
+
const localisedUrlEntry = isLocalisableRoutePath(route.path) && !isFrameworkInternalRoutePath(canonicalPath) ? ensureLocalisedUrlsForPath(canonicalPath, languages, localisedUrls) : void 0;
|
|
131
|
+
const routeLocalisedPaths = localisedUrlEntry ? languages.reduce((acc, language)=>{
|
|
132
|
+
acc[language] = (0, external_normalise_js_namespaceObject.normalisePathPattern)(localisedUrlEntry[language]);
|
|
133
|
+
return acc;
|
|
134
|
+
}, {}) : isSplat ? Object.fromEntries(Object.entries(parentLocalisedPaths).map(([language, path])=>[
|
|
135
|
+
language,
|
|
136
|
+
(0, external_normalise_js_namespaceObject.normalisePathPattern)(`${path}/*`)
|
|
137
|
+
])) : parentLocalisedPaths;
|
|
138
|
+
const children = 'children' in route && route.children ? route.children.flatMap((child)=>transformLocalisedRoute(child, canonicalPath, routeLocalisedPaths, languages, localisedUrls, projection)) : void 0;
|
|
139
|
+
const baseRoute = {
|
|
140
|
+
...route,
|
|
141
|
+
...!isFrameworkInternalRoutePath(canonicalPath) ? {
|
|
142
|
+
modernLocalisedRoute: {
|
|
143
|
+
id: route.id,
|
|
144
|
+
path: route.path,
|
|
145
|
+
canonicalPath,
|
|
146
|
+
paths: localisedUrlEntry ?? (isSplat ? routeLocalisedPaths : void 0)
|
|
147
|
+
}
|
|
148
|
+
} : {},
|
|
149
|
+
...children ? {
|
|
150
|
+
children
|
|
151
|
+
} : {}
|
|
152
|
+
};
|
|
153
|
+
if (!localisedUrlEntry) return [
|
|
154
|
+
baseRoute
|
|
155
|
+
];
|
|
156
|
+
const localisedPaths = getLocalisedRoutePaths(canonicalPath, parentLocalisedPaths, languages, localisedUrlEntry);
|
|
157
|
+
if ('canonical' === projection) return [
|
|
158
|
+
baseRoute
|
|
159
|
+
];
|
|
160
|
+
const leadingLocaleParam = (0, external_normalise_js_namespaceObject.getLeadingLocaleParam)(route.path);
|
|
161
|
+
const routeIdPaths = leadingLocaleParam ? localisedPaths.map((path)=>(0, external_normalise_js_namespaceObject.normaliseRoutePath)(`${leadingLocaleParam}/${path}`)) : localisedPaths;
|
|
162
|
+
const routeIdSuffixes = getLocalisedRouteIdSuffixes(routeIdPaths);
|
|
163
|
+
return localisedPaths.map((localisedPath, index)=>cloneRouteWithLocalisedPath(baseRoute, localisedPath, routeIdSuffixes[index], canonicalPath));
|
|
164
|
+
};
|
|
165
|
+
const suffixRouteIds = (route, suffix)=>{
|
|
166
|
+
const children = 'children' in route && route.children ? route.children.map((child)=>suffixRouteIds(child, suffix)) : void 0;
|
|
167
|
+
return {
|
|
168
|
+
...route,
|
|
169
|
+
...route.id ? {
|
|
170
|
+
id: `${route.id}__localised_${suffix}`
|
|
171
|
+
} : {},
|
|
172
|
+
...children ? {
|
|
173
|
+
children
|
|
174
|
+
} : {}
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
const collectRouteIdCounts = (routes, counts = new Map())=>{
|
|
178
|
+
for (const route of routes){
|
|
179
|
+
if (route.id) counts.set(route.id, (counts.get(route.id) ?? 0) + 1);
|
|
180
|
+
if ('children' in route && route.children) collectRouteIdCounts(route.children, counts);
|
|
181
|
+
}
|
|
182
|
+
return counts;
|
|
183
|
+
};
|
|
184
|
+
const validateNoNewRouteIdCollisions = (sourceRoutes, localisedRoutes)=>{
|
|
185
|
+
const sourceCounts = collectRouteIdCounts(sourceRoutes);
|
|
186
|
+
const localisedCounts = collectRouteIdCounts(localisedRoutes);
|
|
187
|
+
for (const [routeId, count] of localisedCounts)if (count > 1 && count > (sourceCounts.get(routeId) ?? 0)) throw new Error(`Localised route expansion generated duplicate route ID "${routeId}". Change the source route ID or localised path so every generated route remains identifiable.`);
|
|
188
|
+
};
|
|
189
|
+
const cloneRouteWithLocalisedPath = (route, path, routeIdSuffix, canonicalPath)=>{
|
|
190
|
+
const leadingLocaleParam = (0, external_normalise_js_namespaceObject.getLeadingLocaleParam)(route.path);
|
|
191
|
+
const localisedPath = leadingLocaleParam ? (0, external_normalise_js_namespaceObject.normaliseRoutePath)(`${leadingLocaleParam}/${path}`) : path;
|
|
192
|
+
const routeWithPath = {
|
|
193
|
+
...route,
|
|
194
|
+
path: localisedPath
|
|
195
|
+
};
|
|
196
|
+
routeWithPath.modernCanonicalPath = canonicalPath;
|
|
197
|
+
return routeIdSuffix ? suffixRouteIds(routeWithPath, routeIdSuffix) : routeWithPath;
|
|
198
|
+
};
|
|
199
|
+
const applyLocalisedUrlsToRoutes = (routes, languages, localisedUrls, projection = 'physical')=>{
|
|
200
|
+
const rootLocalisedPaths = languages.reduce((acc, language)=>{
|
|
201
|
+
acc[language] = '/';
|
|
202
|
+
return acc;
|
|
203
|
+
}, {});
|
|
204
|
+
validateLocalisedUrls(routes, languages, localisedUrls);
|
|
205
|
+
const localisedRoutes = routes.flatMap((route)=>transformLocalisedRoute(route, '', rootLocalisedPaths, languages, localisedUrls, projection));
|
|
206
|
+
validateNoNewRouteIdCollisions(routes, localisedRoutes);
|
|
207
|
+
return localisedRoutes;
|
|
208
|
+
};
|
|
209
|
+
exports.applyLocalisedUrlsToRoutes = __webpack_exports__.applyLocalisedUrlsToRoutes;
|
|
210
|
+
exports.validateLocalisedUrls = __webpack_exports__.validateLocalisedUrls;
|
|
211
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
212
|
+
"applyLocalisedUrlsToRoutes",
|
|
213
|
+
"validateLocalisedUrls"
|
|
214
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
215
|
+
Object.defineProperty(exports, '__esModule', {
|
|
216
|
+
value: true
|
|
217
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.r = (exports1)=>{
|
|
5
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
6
|
+
value: 'Module'
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
var __webpack_exports__ = {};
|
|
14
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
function resolvePreloadFromPrefetch(prefetch, preload) {
|
|
31
|
+
if (void 0 !== preload) return preload;
|
|
32
|
+
if ('none' === prefetch) return false;
|
|
33
|
+
if ('intent' === prefetch || 'render' === prefetch || 'viewport' === prefetch) return prefetch;
|
|
34
|
+
return 'viewport';
|
|
35
|
+
}
|
|
36
|
+
function normalizePreloadBehavior(preload, prefetch) {
|
|
37
|
+
const resolved = resolvePreloadFromPrefetch(prefetch, preload);
|
|
38
|
+
return false === resolved ? 'none' : resolved;
|
|
39
|
+
}
|
|
40
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
41
|
+
normalizePreloadBehavior: ()=>normalizePreloadBehavior,
|
|
42
|
+
resolvePreloadFromPrefetch: ()=>resolvePreloadFromPrefetch
|
|
43
|
+
});
|
|
44
|
+
exports.normalizePreloadBehavior = __webpack_exports__.normalizePreloadBehavior;
|
|
45
|
+
exports.resolvePreloadFromPrefetch = __webpack_exports__.resolvePreloadFromPrefetch;
|
|
46
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
47
|
+
"normalizePreloadBehavior",
|
|
48
|
+
"resolvePreloadFromPrefetch"
|
|
49
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
50
|
+
Object.defineProperty(exports, '__esModule', {
|
|
51
|
+
value: true
|
|
52
|
+
});
|
package/dist/cjs/rendererHead.js
CHANGED
|
@@ -57,8 +57,9 @@ var __webpack_exports__ = {};
|
|
|
57
57
|
"createWebHeadMarkerStripper",
|
|
58
58
|
"default",
|
|
59
59
|
"finishHeadRender",
|
|
60
|
-
"
|
|
60
|
+
"LATE_HEAD_MESSAGE",
|
|
61
61
|
"beginHeadRender",
|
|
62
|
+
"abortHeadRender",
|
|
62
63
|
"completeHeadRender",
|
|
63
64
|
"createHeadChunkProcessor",
|
|
64
65
|
"publishHeadRender",
|
|
@@ -71,6 +72,7 @@ var __webpack_exports__ = {};
|
|
|
71
72
|
const MARKER_SUFFIX = '"></template>';
|
|
72
73
|
const RECORD_ID_WIDTH = 12;
|
|
73
74
|
const MARKER_LENGTH = MARKER_PREFIX.length + 1 + 36 + RECORD_ID_WIDTH + MARKER_SUFFIX.length;
|
|
75
|
+
const LATE_HEAD_MESSAGE = "<Helmet> rendered in a boundary that completed after the shell; head tags dropped. Move it above the Suspense boundary or set server.ssrByEntries[entry].mode to 'string'.";
|
|
74
76
|
const HEAD_STATE = Symbol('modern.rendererHead');
|
|
75
77
|
const getState = (context)=>{
|
|
76
78
|
const headContext = context;
|
|
@@ -91,7 +93,12 @@ var __webpack_exports__ = {};
|
|
|
91
93
|
transaction.nextRecordId += 1;
|
|
92
94
|
return token;
|
|
93
95
|
};
|
|
94
|
-
const
|
|
96
|
+
const dropLateHead = (transaction)=>{
|
|
97
|
+
if (transaction.lateHeadReported) return;
|
|
98
|
+
transaction.lateHeadReported = true;
|
|
99
|
+
transaction.reportLateHead(LATE_HEAD_MESSAGE);
|
|
100
|
+
};
|
|
101
|
+
const beginHeadRender = (context, reportLateHead)=>{
|
|
95
102
|
const state = getState(context);
|
|
96
103
|
state.transaction = {
|
|
97
104
|
recordsByToken: new Map(),
|
|
@@ -100,7 +107,9 @@ var __webpack_exports__ = {};
|
|
|
100
107
|
nextRecordId: 0,
|
|
101
108
|
nonce: globalThis.crypto.randomUUID(),
|
|
102
109
|
previousRecords: state.publishedRecords,
|
|
103
|
-
sealed: false
|
|
110
|
+
sealed: false,
|
|
111
|
+
reportLateHead,
|
|
112
|
+
lateHeadReported: false
|
|
104
113
|
};
|
|
105
114
|
state.publish?.([]);
|
|
106
115
|
};
|
|
@@ -111,7 +120,6 @@ var __webpack_exports__ = {};
|
|
|
111
120
|
const hadPublisher = void 0 !== state.publish;
|
|
112
121
|
state.publish = (records)=>publish(records);
|
|
113
122
|
if (!hadPublisher) state.publish([]);
|
|
114
|
-
if (transaction.sealed) return null;
|
|
115
123
|
const token = createToken(transaction);
|
|
116
124
|
transaction.recordsByToken.set(token, createRecord());
|
|
117
125
|
return {
|
|
@@ -141,7 +149,9 @@ var __webpack_exports__ = {};
|
|
|
141
149
|
const token = html.slice(tokenStart, end);
|
|
142
150
|
if (transaction.recordsByToken.has(token)) {
|
|
143
151
|
stripped += html.slice(cursor, start);
|
|
144
|
-
if (
|
|
152
|
+
if (transaction.sealed) {
|
|
153
|
+
if (!transaction.committedTokens.has(token)) dropLateHead(transaction);
|
|
154
|
+
} else if (!transaction.committedTokens.has(token)) {
|
|
145
155
|
transaction.committedTokens.add(token);
|
|
146
156
|
transaction.committedRecords.push(transaction.recordsByToken.get(token));
|
|
147
157
|
}
|
|
@@ -227,6 +237,7 @@ var __webpack_exports__ = {};
|
|
|
227
237
|
});
|
|
228
238
|
};
|
|
229
239
|
__webpack_require__.d(__webpack_exports__, {}, {
|
|
240
|
+
LATE_HEAD_MESSAGE: LATE_HEAD_MESSAGE,
|
|
230
241
|
abortHeadRender: abortHeadRender,
|
|
231
242
|
beginHeadRender: beginHeadRender,
|
|
232
243
|
collectHeadRecord: collectHeadRecord,
|
|
@@ -238,6 +249,7 @@ var __webpack_exports__ = {};
|
|
|
238
249
|
publishHeadRender: publishHeadRender
|
|
239
250
|
});
|
|
240
251
|
})();
|
|
252
|
+
exports.LATE_HEAD_MESSAGE = __webpack_exports__.LATE_HEAD_MESSAGE;
|
|
241
253
|
exports.abortHeadRender = __webpack_exports__.abortHeadRender;
|
|
242
254
|
exports.beginHeadRender = __webpack_exports__.beginHeadRender;
|
|
243
255
|
exports.collectHeadRecord = __webpack_exports__.collectHeadRecord;
|
|
@@ -248,6 +260,7 @@ exports.createWebHeadMarkerStripper = __webpack_exports__.createWebHeadMarkerStr
|
|
|
248
260
|
exports.finishHeadRender = __webpack_exports__.finishHeadRender;
|
|
249
261
|
exports.publishHeadRender = __webpack_exports__.publishHeadRender;
|
|
250
262
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
263
|
+
"LATE_HEAD_MESSAGE",
|
|
251
264
|
"abortHeadRender",
|
|
252
265
|
"beginHeadRender",
|
|
253
266
|
"collectHeadRecord",
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"./client" (module) {
|
|
4
|
+
module.exports = require("./client.js");
|
|
5
|
+
},
|
|
6
|
+
"./policyCore" (module) {
|
|
7
|
+
module.exports = require("./policyCore.js");
|
|
8
|
+
},
|
|
9
|
+
"./requestContext" (module) {
|
|
10
|
+
module.exports = require("./requestContext.js");
|
|
11
|
+
},
|
|
12
|
+
"./types" (module) {
|
|
13
|
+
module.exports = require("./types.js");
|
|
14
|
+
},
|
|
15
|
+
"@modern-js/create-request/client" (module) {
|
|
16
|
+
module.exports = require("@modern-js/create-request/client");
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
var __webpack_module_cache__ = {};
|
|
20
|
+
function __webpack_require__(moduleId) {
|
|
21
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
22
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
23
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
24
|
+
exports: {}
|
|
25
|
+
};
|
|
26
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
27
|
+
return module.exports;
|
|
28
|
+
}
|
|
29
|
+
(()=>{
|
|
30
|
+
__webpack_require__.n = (module)=>{
|
|
31
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
32
|
+
__webpack_require__.d(getter, {
|
|
33
|
+
a: getter
|
|
34
|
+
});
|
|
35
|
+
return getter;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
(()=>{
|
|
39
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
40
|
+
var define = (defs, kind)=>{
|
|
41
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
[kind]: defs[key]
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
define(getters, "get");
|
|
47
|
+
define(values, "value");
|
|
48
|
+
};
|
|
49
|
+
})();
|
|
50
|
+
(()=>{
|
|
51
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
52
|
+
})();
|
|
53
|
+
(()=>{
|
|
54
|
+
__webpack_require__.r = (exports1)=>{
|
|
55
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
56
|
+
value: 'Module'
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
59
|
+
value: true
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
})();
|
|
63
|
+
var __webpack_exports__ = {};
|
|
64
|
+
(()=>{
|
|
65
|
+
__webpack_require__.r(__webpack_exports__);
|
|
66
|
+
var _modern_js_create_request_client__rspack_import_0 = __webpack_require__("@modern-js/create-request/client");
|
|
67
|
+
var _client__rspack_import_1 = __webpack_require__("./client");
|
|
68
|
+
var _policyCore__rspack_import_2 = __webpack_require__("./policyCore");
|
|
69
|
+
var _requestContext__rspack_import_3 = __webpack_require__("./requestContext");
|
|
70
|
+
var __rspack_reexport = {};
|
|
71
|
+
for(const __rspack_import_key in _requestContext__rspack_import_3)if ([
|
|
72
|
+
"IdentityBindingViolationError",
|
|
73
|
+
"configure",
|
|
74
|
+
"OperationContractViolationError",
|
|
75
|
+
"default",
|
|
76
|
+
"ProducerClientNotInitializedError",
|
|
77
|
+
"ProducerDomainNotConfiguredError",
|
|
78
|
+
"createUploader",
|
|
79
|
+
"createClient",
|
|
80
|
+
"CrossOriginEnvelopePolicyError",
|
|
81
|
+
"createRequest"
|
|
82
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_requestContext__rspack_import_3[__rspack_import_key];
|
|
83
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
84
|
+
var _types__rspack_import_4 = __webpack_require__("./types");
|
|
85
|
+
var __rspack_reexport = {};
|
|
86
|
+
for(const __rspack_import_key in _types__rspack_import_4)if ([
|
|
87
|
+
"IdentityBindingViolationError",
|
|
88
|
+
"configure",
|
|
89
|
+
"OperationContractViolationError",
|
|
90
|
+
"default",
|
|
91
|
+
"ProducerClientNotInitializedError",
|
|
92
|
+
"ProducerDomainNotConfiguredError",
|
|
93
|
+
"createUploader",
|
|
94
|
+
"createClient",
|
|
95
|
+
"CrossOriginEnvelopePolicyError",
|
|
96
|
+
"createRequest"
|
|
97
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_types__rspack_import_4[__rspack_import_key];
|
|
98
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
99
|
+
const createClient = ()=>(0, _client__rspack_import_1.createPolicyClient)((0, _modern_js_create_request_client__rspack_import_0.createClient)(), {
|
|
100
|
+
target: 'browser',
|
|
101
|
+
resolveSourceOrigin: ()=>"u" > typeof window ? window.location.origin : void 0
|
|
102
|
+
});
|
|
103
|
+
const { configure, createRequest, createUploader } = createClient();
|
|
104
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
105
|
+
CrossOriginEnvelopePolicyError: ()=>_policyCore__rspack_import_2.CrossOriginEnvelopePolicyError,
|
|
106
|
+
IdentityBindingViolationError: ()=>_policyCore__rspack_import_2.IdentityBindingViolationError,
|
|
107
|
+
OperationContractViolationError: ()=>_policyCore__rspack_import_2.OperationContractViolationError,
|
|
108
|
+
ProducerClientNotInitializedError: ()=>_policyCore__rspack_import_2.ProducerClientNotInitializedError,
|
|
109
|
+
ProducerDomainNotConfiguredError: ()=>_policyCore__rspack_import_2.ProducerDomainNotConfiguredError
|
|
110
|
+
}, {
|
|
111
|
+
configure: configure,
|
|
112
|
+
createClient: createClient,
|
|
113
|
+
createRequest: createRequest,
|
|
114
|
+
createUploader: createUploader
|
|
115
|
+
});
|
|
116
|
+
})();
|
|
117
|
+
exports.CrossOriginEnvelopePolicyError = __webpack_exports__.CrossOriginEnvelopePolicyError;
|
|
118
|
+
exports.IdentityBindingViolationError = __webpack_exports__.IdentityBindingViolationError;
|
|
119
|
+
exports.OperationContractViolationError = __webpack_exports__.OperationContractViolationError;
|
|
120
|
+
exports.ProducerClientNotInitializedError = __webpack_exports__.ProducerClientNotInitializedError;
|
|
121
|
+
exports.ProducerDomainNotConfiguredError = __webpack_exports__.ProducerDomainNotConfiguredError;
|
|
122
|
+
exports.configure = __webpack_exports__.configure;
|
|
123
|
+
exports.createClient = __webpack_exports__.createClient;
|
|
124
|
+
exports.createRequest = __webpack_exports__.createRequest;
|
|
125
|
+
exports.createUploader = __webpack_exports__.createUploader;
|
|
126
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
127
|
+
"CrossOriginEnvelopePolicyError",
|
|
128
|
+
"IdentityBindingViolationError",
|
|
129
|
+
"OperationContractViolationError",
|
|
130
|
+
"ProducerClientNotInitializedError",
|
|
131
|
+
"ProducerDomainNotConfiguredError",
|
|
132
|
+
"configure",
|
|
133
|
+
"createClient",
|
|
134
|
+
"createRequest",
|
|
135
|
+
"createUploader"
|
|
136
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
137
|
+
Object.defineProperty(exports, '__esModule', {
|
|
138
|
+
value: true
|
|
139
|
+
});
|