@bleedingdev/modern-js-server-runtime-extensions 3.9.3-ultramodern.9 → 3.11.3-ultramodern.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/cjs/backend-federation-security/index.js +7 -8
- package/dist/cjs/backend-federation-security/node.js +1 -1
- package/dist/cjs/bff-policy/operationIdentity.js +2 -3
- package/dist/cjs/mfCache.js +6 -7
- package/dist/cjs/runtime-fallback-signal/model.js +9 -10
- package/dist/cjs/static-serving/responders.js +7 -4
- package/dist/cjs/telemetry/envelope.js +9 -9
- package/dist/cjs/telemetry/exporters.js +4 -4
- package/dist/cjs/telemetry/registryTypes.js +2 -2
- package/dist/esm-node/static-serving/responders.mjs +7 -4
- package/dist/types/serverConfig.d.ts +1 -1
- package/dist/types/telemetry/runtimeEndpoints.d.ts +2 -13
- package/dist/types-esm/serverConfig.d.mts +1 -1
- package/dist/types-esm/telemetry/runtimeEndpoints.d.mts +2 -13
- package/package.json +15 -15
- package/src/serverConfig.ts +5 -0
- package/src/static-serving/responders.ts +7 -4
- package/src/telemetry/runtimeEndpoints.ts +2 -2
|
@@ -308,14 +308,13 @@ async function loadVerifiedBackendFederationEntry(options) {
|
|
|
308
308
|
});
|
|
309
309
|
return evaluateBackendFederationCommonJsEntry(options.remote, bytes, options.evaluateCommonJs);
|
|
310
310
|
}
|
|
311
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
312
|
-
BackendFederationRemoteEntryError:
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
evaluateBackendFederationCommonJsEntry: evaluateBackendFederationCommonJsEntry
|
|
311
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
312
|
+
BackendFederationRemoteEntryError: BackendFederationRemoteEntryError,
|
|
313
|
+
evaluateBackendFederationCommonJsEntry: evaluateBackendFederationCommonJsEntry,
|
|
314
|
+
loadBoundedBackendFederationResource: loadBoundedBackendFederationResource,
|
|
315
|
+
loadVerifiedBackendFederationEntry: loadVerifiedBackendFederationEntry,
|
|
316
|
+
redactBackendFederationUrl: redactBackendFederationUrl,
|
|
317
|
+
resolveBackendFederationRemoteEntryVerification: resolveBackendFederationRemoteEntryVerification
|
|
319
318
|
});
|
|
320
319
|
exports.BackendFederationRemoteEntryError = __webpack_exports__.BackendFederationRemoteEntryError;
|
|
321
320
|
exports.evaluateBackendFederationCommonJsEntry = __webpack_exports__.evaluateBackendFederationCommonJsEntry;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
|
|
3
|
-
return "u" < typeof document ?
|
|
3
|
+
return "u" < typeof document ? require('url'.replace('', '')).pathToFileURL(__filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
4
4
|
}();
|
|
5
5
|
var __webpack_require__ = {};
|
|
6
6
|
(()=>{
|
|
@@ -56,11 +56,10 @@ async function digestOperationContract(operation, requestId) {
|
|
|
56
56
|
const digest = await globalThis.crypto.subtle.digest('SHA-256', new TextEncoder().encode(serializeOperationContract(operation, requestId)));
|
|
57
57
|
return Array.from(new Uint8Array(digest), (value)=>value.toString(16).padStart(2, '0')).join('');
|
|
58
58
|
}
|
|
59
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
60
|
-
digestOperationContract: ()=>digestOperationContract
|
|
61
|
-
}, {
|
|
59
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
62
60
|
DEFAULT_OPERATION_VERSION: DEFAULT_OPERATION_VERSION,
|
|
63
61
|
deriveOperationVersion: deriveOperationVersion,
|
|
62
|
+
digestOperationContract: digestOperationContract,
|
|
64
63
|
serializeOperationContract: serializeOperationContract,
|
|
65
64
|
stableOperationStringify: stableOperationStringify
|
|
66
65
|
});
|
package/dist/cjs/mfCache.js
CHANGED
|
@@ -87,13 +87,12 @@ const injectMfAssetCacheHeadersPlugin = ()=>({
|
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
91
|
-
getRequestPathname:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
injectMfAssetCacheHeadersPlugin: injectMfAssetCacheHeadersPlugin
|
|
90
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
91
|
+
getRequestPathname: getRequestPathname,
|
|
92
|
+
injectMfAssetCacheHeadersPlugin: injectMfAssetCacheHeadersPlugin,
|
|
93
|
+
isMfManifestAsset: isMfManifestAsset,
|
|
94
|
+
isMfRemoteEntryAsset: isMfRemoteEntryAsset,
|
|
95
|
+
resolveMfAssetCacheHeaders: resolveMfAssetCacheHeaders
|
|
97
96
|
});
|
|
98
97
|
exports.getRequestPathname = __webpack_exports__.getRequestPathname;
|
|
99
98
|
exports.injectMfAssetCacheHeadersPlugin = __webpack_exports__.injectMfAssetCacheHeadersPlugin;
|
|
@@ -99,15 +99,7 @@ function parseRuntimeFallbackSignalPayloadFromRawBody(rawBody, maxBodyBytes) {
|
|
|
99
99
|
if (!payload || 'object' != typeof payload || Array.isArray(payload)) throw createRuntimeSignalError('runtime fallback signal body must be a JSON object', 'INVALID_PAYLOAD');
|
|
100
100
|
return payload;
|
|
101
101
|
}
|
|
102
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
103
|
-
createRuntimeSignalError: ()=>createRuntimeSignalError,
|
|
104
|
-
getRuntimeSignalErrorStatusCode: ()=>getRuntimeSignalErrorStatusCode,
|
|
105
|
-
normalizeRuntimeSignalAppName: ()=>normalizeRuntimeSignalAppName,
|
|
106
|
-
normalizeRuntimeSignalOrigin: ()=>normalizeRuntimeSignalOrigin,
|
|
107
|
-
normalizeRuntimeSignalRuntimeDigest: ()=>normalizeRuntimeSignalRuntimeDigest,
|
|
108
|
-
parseRuntimeFallbackSignalPayload: ()=>parseRuntimeFallbackSignalPayload,
|
|
109
|
-
parseRuntimeFallbackSignalPayloadFromRawBody: ()=>parseRuntimeFallbackSignalPayloadFromRawBody
|
|
110
|
-
}, {
|
|
102
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
111
103
|
DEFAULT_RUNTIME_FALLBACK_AUTH_HEADER: DEFAULT_RUNTIME_FALLBACK_AUTH_HEADER,
|
|
112
104
|
DEFAULT_RUNTIME_FALLBACK_FAILURE_HOLD_MS: DEFAULT_RUNTIME_FALLBACK_FAILURE_HOLD_MS,
|
|
113
105
|
DEFAULT_RUNTIME_FALLBACK_GATE_NAME: DEFAULT_RUNTIME_FALLBACK_GATE_NAME,
|
|
@@ -116,7 +108,14 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
116
108
|
DEFAULT_RUNTIME_FALLBACK_TRUST_DEDUPE_WINDOW_MS: DEFAULT_RUNTIME_FALLBACK_TRUST_DEDUPE_WINDOW_MS,
|
|
117
109
|
DEFAULT_RUNTIME_FALLBACK_TRUST_MAX_SIGNALS_PER_WINDOW: DEFAULT_RUNTIME_FALLBACK_TRUST_MAX_SIGNALS_PER_WINDOW,
|
|
118
110
|
DEFAULT_RUNTIME_FALLBACK_TRUST_WINDOW_MS: DEFAULT_RUNTIME_FALLBACK_TRUST_WINDOW_MS,
|
|
119
|
-
DEFAULT_RUNTIME_STATUS_ENDPOINT: DEFAULT_RUNTIME_STATUS_ENDPOINT
|
|
111
|
+
DEFAULT_RUNTIME_STATUS_ENDPOINT: DEFAULT_RUNTIME_STATUS_ENDPOINT,
|
|
112
|
+
createRuntimeSignalError: createRuntimeSignalError,
|
|
113
|
+
getRuntimeSignalErrorStatusCode: getRuntimeSignalErrorStatusCode,
|
|
114
|
+
normalizeRuntimeSignalAppName: normalizeRuntimeSignalAppName,
|
|
115
|
+
normalizeRuntimeSignalOrigin: normalizeRuntimeSignalOrigin,
|
|
116
|
+
normalizeRuntimeSignalRuntimeDigest: normalizeRuntimeSignalRuntimeDigest,
|
|
117
|
+
parseRuntimeFallbackSignalPayload: parseRuntimeFallbackSignalPayload,
|
|
118
|
+
parseRuntimeFallbackSignalPayloadFromRawBody: parseRuntimeFallbackSignalPayloadFromRawBody
|
|
120
119
|
});
|
|
121
120
|
exports.DEFAULT_RUNTIME_FALLBACK_AUTH_HEADER = __webpack_exports__.DEFAULT_RUNTIME_FALLBACK_AUTH_HEADER;
|
|
122
121
|
exports.DEFAULT_RUNTIME_FALLBACK_FAILURE_HOLD_MS = __webpack_exports__.DEFAULT_RUNTIME_FALLBACK_FAILURE_HOLD_MS;
|
|
@@ -88,16 +88,19 @@ function createStaticExtensionResponders() {
|
|
|
88
88
|
const patchManifest = (0, external_staticModuleFederation_js_namespaceObject.isModuleFederationManifestRequest)(requestPath) && !(0, external_staticModuleFederation_js_namespaceObject.isBackendModuleFederationManifestRequest)(requestPath);
|
|
89
89
|
if (!patchManifest && !remoteEntry) return respondPrecompressedAsset(context, asset, serve);
|
|
90
90
|
const response = await serve({
|
|
91
|
-
contentLength: true
|
|
91
|
+
contentLength: true,
|
|
92
|
+
revalidate: false
|
|
92
93
|
});
|
|
93
94
|
if (!response) return null;
|
|
95
|
+
const { headers } = context.res;
|
|
94
96
|
const bytes = Buffer.from(await response.arrayBuffer());
|
|
95
97
|
const patched = patchManifest ? (0, external_staticModuleFederation_js_namespaceObject.patchModuleFederationManifestPublicPath)(context, bytes, pathPrefix) : (0, external_staticModuleFederation_js_namespaceObject.patchModuleFederationRemoteEntryPublicPath)(context, bytes, pathPrefix);
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
headers.delete('ETag');
|
|
99
|
+
headers.set('Content-Length', String(patched.byteLength));
|
|
100
|
+
if ('.cjs' === external_node_path_default().extname(asset.filename).toLowerCase()) headers.set('Content-Type', "text/javascript; charset=UTF-8");
|
|
98
101
|
return new Response(Uint8Array.from(patched), {
|
|
99
102
|
status: response.status,
|
|
100
|
-
headers
|
|
103
|
+
headers
|
|
101
104
|
});
|
|
102
105
|
}
|
|
103
106
|
async function serveGenerated(context, root) {
|
|
@@ -190,15 +190,15 @@ function toTelemetryEnvelope(event, input) {
|
|
|
190
190
|
}
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
194
|
-
buildDroppedEnvelope:
|
|
195
|
-
buildQueueDepthEnvelope:
|
|
196
|
-
buildQueueUtilizationEnvelope:
|
|
197
|
-
buildStartupProbeEnvelope:
|
|
198
|
-
clamp:
|
|
199
|
-
isRecord:
|
|
200
|
-
redactObject:
|
|
201
|
-
toTelemetryEnvelope:
|
|
193
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
194
|
+
buildDroppedEnvelope: buildDroppedEnvelope,
|
|
195
|
+
buildQueueDepthEnvelope: buildQueueDepthEnvelope,
|
|
196
|
+
buildQueueUtilizationEnvelope: buildQueueUtilizationEnvelope,
|
|
197
|
+
buildStartupProbeEnvelope: buildStartupProbeEnvelope,
|
|
198
|
+
clamp: clamp,
|
|
199
|
+
isRecord: isRecord,
|
|
200
|
+
redactObject: redactObject,
|
|
201
|
+
toTelemetryEnvelope: toTelemetryEnvelope
|
|
202
202
|
});
|
|
203
203
|
exports.buildDroppedEnvelope = __webpack_exports__.buildDroppedEnvelope;
|
|
204
204
|
exports.buildQueueDepthEnvelope = __webpack_exports__.buildQueueDepthEnvelope;
|
|
@@ -130,10 +130,10 @@ function warnOnMetricsOtlpEndpoint(endpoint) {
|
|
|
130
130
|
if (!endpoint || !endpoint.includes('/v1/metrics')) return;
|
|
131
131
|
console.warn(`[telemetry] OTLP endpoint "${endpoint}" looks like a metrics path. UltraModern telemetry exporter expects log-style envelopes (default: ${DEFAULT_OTLP_ENDPOINT}).`);
|
|
132
132
|
}
|
|
133
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
134
|
-
createOtlpTelemetryExporter:
|
|
135
|
-
createVictoriaMetricsTelemetryExporter:
|
|
136
|
-
warnOnMetricsOtlpEndpoint:
|
|
133
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
134
|
+
createOtlpTelemetryExporter: createOtlpTelemetryExporter,
|
|
135
|
+
createVictoriaMetricsTelemetryExporter: createVictoriaMetricsTelemetryExporter,
|
|
136
|
+
warnOnMetricsOtlpEndpoint: warnOnMetricsOtlpEndpoint
|
|
137
137
|
});
|
|
138
138
|
exports.createOtlpTelemetryExporter = __webpack_exports__.createOtlpTelemetryExporter;
|
|
139
139
|
exports.createVictoriaMetricsTelemetryExporter = __webpack_exports__.createVictoriaMetricsTelemetryExporter;
|
|
@@ -34,8 +34,8 @@ class TelemetryStartupHealthError extends Error {
|
|
|
34
34
|
this.failedExporters = failedExporters;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
38
|
-
TelemetryStartupHealthError:
|
|
37
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
38
|
+
TelemetryStartupHealthError: TelemetryStartupHealthError
|
|
39
39
|
});
|
|
40
40
|
exports.TelemetryStartupHealthError = __webpack_exports__.TelemetryStartupHealthError;
|
|
41
41
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
@@ -47,16 +47,19 @@ function createStaticExtensionResponders() {
|
|
|
47
47
|
const patchManifest = isModuleFederationManifestRequest(requestPath) && !isBackendModuleFederationManifestRequest(requestPath);
|
|
48
48
|
if (!patchManifest && !remoteEntry) return respondPrecompressedAsset(context, asset, serve);
|
|
49
49
|
const response = await serve({
|
|
50
|
-
contentLength: true
|
|
50
|
+
contentLength: true,
|
|
51
|
+
revalidate: false
|
|
51
52
|
});
|
|
52
53
|
if (!response) return null;
|
|
54
|
+
const { headers } = context.res;
|
|
53
55
|
const bytes = Buffer.from(await response.arrayBuffer());
|
|
54
56
|
const patched = patchManifest ? patchModuleFederationManifestPublicPath(context, bytes, pathPrefix) : patchModuleFederationRemoteEntryPublicPath(context, bytes, pathPrefix);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
headers.delete('ETag');
|
|
58
|
+
headers.set('Content-Length', String(patched.byteLength));
|
|
59
|
+
if ('.cjs' === node_path.extname(asset.filename).toLowerCase()) headers.set('Content-Type', "text/javascript; charset=UTF-8");
|
|
57
60
|
return new Response(Uint8Array.from(patched), {
|
|
58
61
|
status: response.status,
|
|
59
|
-
headers
|
|
62
|
+
headers
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
65
|
async function serveGenerated(context, root) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BffRuntimeUserConfig, BffRuntimeFramework as CanonicalBffRuntimeFramework, ServerSourceConfigExtension, ServerTelemetryConfigExtension } from '@modern-js/runtime-extensions/server-config';
|
|
2
2
|
import type { BffUserConfig, ServerUserConfig } from '@modern-js/server-core';
|
|
3
|
+
export type { BffEffectDataPlatformUserConfig, BffEffectOpenApiUserConfig, } from '@modern-js/runtime-extensions/server-config';
|
|
3
4
|
type BffConfigExtension = Omit<BffRuntimeUserConfig, 'runtimeFramework'>;
|
|
4
5
|
type ForkBffRuntimeRegistry = Record<Exclude<CanonicalBffRuntimeFramework, 'hono'>, true>;
|
|
5
6
|
declare module '@modern-js/plugin/server' {
|
|
@@ -16,4 +17,3 @@ declare module '@modern-js/server-core' {
|
|
|
16
17
|
}
|
|
17
18
|
export type UltramodernBffUserConfig = Omit<BffUserConfig, keyof BffRuntimeUserConfig> & BffRuntimeUserConfig;
|
|
18
19
|
export type UltramodernServerUserConfig = ServerUserConfig & ServerTelemetryConfigExtension;
|
|
19
|
-
export {};
|
|
@@ -12,24 +12,13 @@ export declare const createRuntimeFallbackSignalMiddleware: (signalConfig: Runti
|
|
|
12
12
|
path: string;
|
|
13
13
|
method: 'post';
|
|
14
14
|
order: 'pre';
|
|
15
|
-
handler: (c: Context<ServerEnv>) => Promise<
|
|
16
|
-
ok: true;
|
|
17
|
-
}, 202, "json">) | (Response & import("hono").TypedResponse<{
|
|
18
|
-
ok: false;
|
|
19
|
-
error: string;
|
|
20
|
-
}, 400 | 401 | 403 | 413 | 429 | 500, "json">)>;
|
|
15
|
+
handler: (c: Context<ServerEnv>) => Promise<Response>;
|
|
21
16
|
};
|
|
22
17
|
export declare const createRuntimeStatusMiddleware: ({ registry, healthMonitor, runtimeFallbackSignalConfig, runtimeStatusAuthConfig, }: RuntimeStatusMiddlewareOptions) => {
|
|
23
18
|
name: string;
|
|
24
19
|
path: string;
|
|
25
20
|
method: 'get';
|
|
26
21
|
order: 'pre';
|
|
27
|
-
handler: (c: Context<ServerEnv>) => Promise<
|
|
28
|
-
ok: true;
|
|
29
|
-
timestamp: number;
|
|
30
|
-
}, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
|
|
31
|
-
ok: false;
|
|
32
|
-
error: string;
|
|
33
|
-
}, 400 | 401 | 403 | 413 | 429 | 500, "json">)>;
|
|
22
|
+
handler: (c: Context<ServerEnv>) => Promise<Response>;
|
|
34
23
|
};
|
|
35
24
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BffRuntimeUserConfig, BffRuntimeFramework as CanonicalBffRuntimeFramework, ServerSourceConfigExtension, ServerTelemetryConfigExtension } from '@modern-js/runtime-extensions/server-config';
|
|
2
2
|
import type { BffUserConfig, ServerUserConfig } from '@modern-js/server-core';
|
|
3
|
+
export type { BffEffectDataPlatformUserConfig, BffEffectOpenApiUserConfig, } from '@modern-js/runtime-extensions/server-config';
|
|
3
4
|
type BffConfigExtension = Omit<BffRuntimeUserConfig, 'runtimeFramework'>;
|
|
4
5
|
type ForkBffRuntimeRegistry = Record<Exclude<CanonicalBffRuntimeFramework, 'hono'>, true>;
|
|
5
6
|
declare module '@modern-js/plugin/server' {
|
|
@@ -16,4 +17,3 @@ declare module '@modern-js/server-core' {
|
|
|
16
17
|
}
|
|
17
18
|
export type UltramodernBffUserConfig = Omit<BffUserConfig, keyof BffRuntimeUserConfig> & BffRuntimeUserConfig;
|
|
18
19
|
export type UltramodernServerUserConfig = ServerUserConfig & ServerTelemetryConfigExtension;
|
|
19
|
-
export {};
|
|
@@ -12,24 +12,13 @@ export declare const createRuntimeFallbackSignalMiddleware: (signalConfig: Runti
|
|
|
12
12
|
path: string;
|
|
13
13
|
method: 'post';
|
|
14
14
|
order: 'pre';
|
|
15
|
-
handler: (c: Context<ServerEnv>) => Promise<
|
|
16
|
-
ok: true;
|
|
17
|
-
}, 202, "json">) | (Response & import("hono").TypedResponse<{
|
|
18
|
-
ok: false;
|
|
19
|
-
error: string;
|
|
20
|
-
}, 400 | 401 | 403 | 413 | 429 | 500, "json">)>;
|
|
15
|
+
handler: (c: Context<ServerEnv>) => Promise<Response>;
|
|
21
16
|
};
|
|
22
17
|
export declare const createRuntimeStatusMiddleware: ({ registry, healthMonitor, runtimeFallbackSignalConfig, runtimeStatusAuthConfig, }: RuntimeStatusMiddlewareOptions) => {
|
|
23
18
|
name: string;
|
|
24
19
|
path: string;
|
|
25
20
|
method: 'get';
|
|
26
21
|
order: 'pre';
|
|
27
|
-
handler: (c: Context<ServerEnv>) => Promise<
|
|
28
|
-
ok: true;
|
|
29
|
-
timestamp: number;
|
|
30
|
-
}, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
|
|
31
|
-
ok: false;
|
|
32
|
-
error: string;
|
|
33
|
-
}, 400 | 401 | 403 | 413 | 429 | 500, "json">)>;
|
|
22
|
+
handler: (c: Context<ServerEnv>) => Promise<Response>;
|
|
34
23
|
};
|
|
35
24
|
export {};
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.
|
|
20
|
+
"version": "3.11.3-ultramodern.10",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"exports": {
|
|
@@ -216,25 +216,25 @@
|
|
|
216
216
|
}
|
|
217
217
|
},
|
|
218
218
|
"engines": {
|
|
219
|
-
"node": ">=26.
|
|
219
|
+
"node": ">=26.13.1"
|
|
220
220
|
},
|
|
221
221
|
"dependencies": {
|
|
222
|
-
"@modern-js/create-request": "npm:@bleedingdev/modern-js-create-request@3.
|
|
223
|
-
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.
|
|
224
|
-
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.
|
|
225
|
-
"@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.
|
|
226
|
-
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.
|
|
227
|
-
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.
|
|
228
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.
|
|
229
|
-
"@swc/helpers": "^0.5.
|
|
222
|
+
"@modern-js/create-request": "npm:@bleedingdev/modern-js-create-request@3.11.3-ultramodern.10",
|
|
223
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.11.3-ultramodern.10",
|
|
224
|
+
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.11.3-ultramodern.10",
|
|
225
|
+
"@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.11.3-ultramodern.10",
|
|
226
|
+
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.11.3-ultramodern.10",
|
|
227
|
+
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.11.3-ultramodern.10",
|
|
228
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.11.3-ultramodern.10",
|
|
229
|
+
"@swc/helpers": "^0.5.24",
|
|
230
230
|
"reflect-metadata": "^0.2.2"
|
|
231
231
|
},
|
|
232
232
|
"devDependencies": {
|
|
233
|
-
"@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.
|
|
234
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.
|
|
235
|
-
"@rslib/core": "1.0.
|
|
236
|
-
"@scripts/rstest-config": "2.66.
|
|
237
|
-
"@types/node": "^26.6.
|
|
233
|
+
"@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.11.3-ultramodern.10",
|
|
234
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.11.3-ultramodern.10",
|
|
235
|
+
"@rslib/core": "1.0.7",
|
|
236
|
+
"@scripts/rstest-config": "2.66.7",
|
|
237
|
+
"@types/node": "^26.6.6",
|
|
238
238
|
"esbuild": "^0.28.2",
|
|
239
239
|
"zod": "^4.6.7"
|
|
240
240
|
},
|
package/src/serverConfig.ts
CHANGED
|
@@ -7,6 +7,11 @@ import type {
|
|
|
7
7
|
} from '@modern-js/runtime-extensions/server-config';
|
|
8
8
|
import type { BffUserConfig, ServerUserConfig } from '@modern-js/server-core';
|
|
9
9
|
|
|
10
|
+
export type {
|
|
11
|
+
BffEffectDataPlatformUserConfig,
|
|
12
|
+
BffEffectOpenApiUserConfig,
|
|
13
|
+
} from '@modern-js/runtime-extensions/server-config';
|
|
14
|
+
|
|
10
15
|
type BffConfigExtension = Omit<BffRuntimeUserConfig, 'runtimeFramework'>;
|
|
11
16
|
|
|
12
17
|
type ForkBffRuntimeRegistry = Record<
|
|
@@ -98,21 +98,24 @@ export function createStaticExtensionResponders(): ServerStaticPluginOptions {
|
|
|
98
98
|
if (!patchManifest && !remoteEntry) {
|
|
99
99
|
return respondPrecompressedAsset(context, asset, serve);
|
|
100
100
|
}
|
|
101
|
-
const response = await serve({ contentLength: true });
|
|
101
|
+
const response = await serve({ contentLength: true, revalidate: false });
|
|
102
102
|
if (!response) {
|
|
103
103
|
return null;
|
|
104
104
|
}
|
|
105
|
+
const { headers } = context.res;
|
|
105
106
|
const bytes = Buffer.from(await response.arrayBuffer());
|
|
106
107
|
const patched = patchManifest
|
|
107
108
|
? patchModuleFederationManifestPublicPath(context, bytes, pathPrefix)
|
|
108
109
|
: patchModuleFederationRemoteEntryPublicPath(context, bytes, pathPrefix);
|
|
109
|
-
|
|
110
|
+
// Native validators describe the original file, not the rewritten bytes.
|
|
111
|
+
headers.delete('ETag');
|
|
112
|
+
headers.set('Content-Length', String(patched.byteLength));
|
|
110
113
|
if (path.extname(asset.filename).toLowerCase() === '.cjs') {
|
|
111
|
-
|
|
114
|
+
headers.set('Content-Type', 'text/javascript; charset=UTF-8');
|
|
112
115
|
}
|
|
113
116
|
return new Response(Uint8Array.from(patched), {
|
|
114
117
|
status: response.status,
|
|
115
|
-
headers
|
|
118
|
+
headers,
|
|
116
119
|
});
|
|
117
120
|
}
|
|
118
121
|
|
|
@@ -48,7 +48,7 @@ export const createRuntimeFallbackSignalMiddleware = (
|
|
|
48
48
|
path: signalConfig.endpoint,
|
|
49
49
|
method: 'post' as const,
|
|
50
50
|
order: 'pre' as const,
|
|
51
|
-
handler: async (c: Context<ServerEnv>) => {
|
|
51
|
+
handler: async (c: Context<ServerEnv>): Promise<Response> => {
|
|
52
52
|
try {
|
|
53
53
|
enforceRuntimeFallbackSignalAuth(c, signalConfig);
|
|
54
54
|
const { payload } = await parseRuntimeFallbackSignalPayload(
|
|
@@ -94,7 +94,7 @@ export const createRuntimeStatusMiddleware = ({
|
|
|
94
94
|
path: DEFAULT_RUNTIME_STATUS_ENDPOINT,
|
|
95
95
|
method: 'get' as const,
|
|
96
96
|
order: 'pre' as const,
|
|
97
|
-
handler: async (c: Context<ServerEnv>) => {
|
|
97
|
+
handler: async (c: Context<ServerEnv>): Promise<Response> => {
|
|
98
98
|
try {
|
|
99
99
|
// Telemetry/health/trust internals are only disclosed to
|
|
100
100
|
// authenticated callers. Without a configured auth token the
|