@bleedingdev/modern-js-runtime-extensions 3.9.0-ultramodern.5 → 3.9.0-ultramodern.7
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/routerProvider.js +9 -74
- package/dist/esm/routerProvider.mjs +8 -67
- package/dist/esm-node/routerProvider.mjs +8 -67
- package/dist/types/routerProvider.d.ts +2 -24
- package/dist/types/server-config/bffRuntime.d.ts +2 -2
- package/dist/types/server-config/serverTelemetry.d.ts +27 -27
- package/package.json +4 -4
- package/src/routerProvider.ts +14 -194
- package/src/server-config/bffRuntime.ts +2 -2
- package/src/server-config/serverTelemetry.ts +27 -27
- package/tests/buildIdentity.test.ts +0 -19
- package/tests/contextExtensions.test.ts +0 -44
- package/tests/headRuntime.test.tsx +0 -140
- package/tests/rendererHead.test.ts +0 -41
- package/tests/request-policy/browser-policy.test.ts +0 -500
- package/tests/request-policy/client-isolation.test.ts +0 -40
- package/tests/request-policy/node-policy.test.ts +0 -294
- package/tests/request-policy/policyCore.test.ts +0 -121
- package/tests/request-policy/requestContext.test.ts +8 -22
- package/tests/request-policy/requestFactory.outbound-contract.test.ts +109 -510
- package/tests/request-policy/traceparent.test.ts +2 -5
- package/tests/request-policy/transport-retry.test.ts +44 -47
- package/tests/routerProvider.test.ts +2 -11
- package/tests/routerState.test.ts +0 -79
- package/tests/routerStatePlugin.test.ts +1 -46
- package/tests/runtimeContextProjection.test.ts +0 -52
- package/tests/safeFailure.test.ts +10 -28
- package/tests/workspaceEvents.test.ts +31 -201
- package/tests/nativeSafeFailureCompatibility.test.ts +0 -117
- package/tests/prefetchPolicy.test.ts +0 -51
- package/tests/request-policy/identityBinding.test.ts +0 -75
|
@@ -30,10 +30,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
30
30
|
__webpack_require__.d(__webpack_exports__, {
|
|
31
31
|
createRouterPlugin: ()=>createRouterPlugin,
|
|
32
32
|
createRouterProviderRealm: ()=>createRouterProviderRealm,
|
|
33
|
-
registerRouterProvider: ()=>registerRouterProvider,
|
|
34
33
|
reportUnsupportedProviderRegistryHooks: ()=>reportUnsupportedProviderRegistryHooks,
|
|
35
|
-
resolveRouterProvider: ()=>resolveRouterProvider
|
|
36
|
-
unsafe_resetRouterProvidersForTesting: ()=>unsafe_resetRouterProvidersForTesting
|
|
34
|
+
resolveRouterProvider: ()=>resolveRouterProvider
|
|
37
35
|
});
|
|
38
36
|
const merge_namespaceObject = require("@modern-js/runtime-utils/merge");
|
|
39
37
|
function reportUnsupportedProviderRegistryHooks(providerPlugin, routerProviderRegistryHooks) {
|
|
@@ -62,74 +60,15 @@ function createRouterProviderRealm(registrations) {
|
|
|
62
60
|
names: ()=>providerNames
|
|
63
61
|
});
|
|
64
62
|
}
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
warnedDuplicates: new Set()
|
|
73
|
-
};
|
|
74
|
-
host[REGISTRY_SLOT].duplicateProviders ??= new Set();
|
|
75
|
-
host[REGISTRY_SLOT].warnedDuplicates ??= new Set();
|
|
76
|
-
return host[REGISTRY_SLOT];
|
|
77
|
-
}
|
|
78
|
-
function getLegacyV2Registry() {
|
|
79
|
-
const host = globalThis;
|
|
80
|
-
return host[LEGACY_V2_REGISTRY_SLOT];
|
|
81
|
-
}
|
|
82
|
-
function registerRouterProvider(name, factory, options = {}) {
|
|
83
|
-
const registry = getRegistry();
|
|
84
|
-
const existing = registry.providers.get(name);
|
|
85
|
-
if (void 0 !== existing) {
|
|
86
|
-
if (existing !== factory) registry.duplicateProviders.add(name);
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
if (true === options.isDefault) registry.defaultProvider = name;
|
|
90
|
-
registry.providers.set(name, factory);
|
|
91
|
-
}
|
|
92
|
-
function resolveRouterProvider(framework, options = {}) {
|
|
93
|
-
if (void 0 !== options.realm) {
|
|
94
|
-
const name = framework || options.realm.defaultProvider;
|
|
95
|
-
const realmProviderNames = options.realm.names();
|
|
96
|
-
if (void 0 === name) throw new Error(`[@modern-js/runtime] The app-owned router provider realm does not declare a default provider. Available realm providers: ${realmProviderNames.join(', ') || '(none)'}.`);
|
|
97
|
-
const factory = options.realm.get(name);
|
|
98
|
-
if (void 0 === factory) throw new Error(`[@modern-js/runtime] Router provider "${name}" is not registered in the app-owned router provider realm. Available realm providers: ${realmProviderNames.join(', ') || '(none)'}. Compatibility registry fallback is disabled for app-owned realms.`);
|
|
99
|
-
return factory;
|
|
100
|
-
}
|
|
101
|
-
const registry = getRegistry();
|
|
102
|
-
const legacyV2Registry = getLegacyV2Registry();
|
|
103
|
-
const name = framework || options.localDefault?.name || registry.defaultProvider || legacyV2Registry?.defaultProvider;
|
|
104
|
-
if (void 0 === name) throw new Error('[@modern-js/runtime] No default router provider is registered. This is a bug in the runtime setup.');
|
|
105
|
-
if (void 0 !== options.localDefault && name === options.localDefault.name) return options.localDefault.factory;
|
|
106
|
-
const factory = registry.providers.get(name);
|
|
107
|
-
if (void 0 !== factory) {
|
|
108
|
-
if (registry.duplicateProviders.has(name) && !registry.warnedDuplicates.has(name)) {
|
|
109
|
-
registry.warnedDuplicates.add(name);
|
|
110
|
-
console.warn(`[@modern-js/runtime] The router provider "${name}" was registered more than once with different module instances, and a router wrapper without an app-owned provider realm is resolving the mixed-version compatibility fallback. The fallback is keeping the first registration. Modern router wrappers isolate app-owned realms automatically. For an older wrapper, share the provider runtime between Module Federation host and remotes or upgrade every app to a realm-aware runtime.`);
|
|
111
|
-
}
|
|
112
|
-
return factory;
|
|
113
|
-
}
|
|
114
|
-
const legacyV2Factory = legacyV2Registry?.providers.get(name);
|
|
115
|
-
if (void 0 !== legacyV2Factory) return legacyV2Factory;
|
|
116
|
-
if ('tanstack' === name) throw new Error("[@modern-js/runtime] `runtime.router.framework` is set to \"tanstack\", but no TanStack router provider is registered. Install @modern-js/plugin-tanstack, add `tanstackRouterPlugin()` to the `plugins` array in modern.config.ts, and make sure '@modern-js/plugin-tanstack/runtime' is imported (e.g. in modern.runtime.ts).");
|
|
117
|
-
throw new Error(`[@modern-js/runtime] Unknown router framework "${name}". Registered providers: ${[
|
|
118
|
-
...new Set([
|
|
119
|
-
...registry.providers.keys(),
|
|
120
|
-
...legacyV2Registry?.providers.keys() ?? []
|
|
121
|
-
])
|
|
122
|
-
].join(', ') || '(none)'}. Install and register the plugin that provides this router framework.`);
|
|
123
|
-
}
|
|
124
|
-
function unsafe_resetRouterProvidersForTesting() {
|
|
125
|
-
const host = globalThis;
|
|
126
|
-
delete host[REGISTRY_SLOT];
|
|
127
|
-
delete host[LEGACY_V2_REGISTRY_SLOT];
|
|
63
|
+
function resolveRouterProvider(framework, options) {
|
|
64
|
+
const name = framework || options.realm.defaultProvider;
|
|
65
|
+
const realmProviderNames = options.realm.names();
|
|
66
|
+
if (void 0 === name) throw new Error(`[@modern-js/runtime] The app-owned router provider realm does not declare a default provider. Available realm providers: ${realmProviderNames.join(', ') || '(none)'}.`);
|
|
67
|
+
const factory = options.realm.get(name);
|
|
68
|
+
if (void 0 === factory) throw new Error(`[@modern-js/runtime] Router provider "${name}" is not registered in the app-owned router provider realm. Available realm providers: ${realmProviderNames.join(', ') || '(none)'}.`);
|
|
69
|
+
return factory;
|
|
128
70
|
}
|
|
129
71
|
function createRouterPlugin({ defaultProvider, registryHooks, localProviders = [] }) {
|
|
130
|
-
registerRouterProvider(defaultProvider.name, defaultProvider.factory, {
|
|
131
|
-
isDefault: true
|
|
132
|
-
});
|
|
133
72
|
const realm = createRouterProviderRealm([
|
|
134
73
|
{
|
|
135
74
|
...defaultProvider,
|
|
@@ -153,17 +92,13 @@ function createRouterPlugin({ defaultProvider, registryHooks, localProviders = [
|
|
|
153
92
|
}
|
|
154
93
|
exports.createRouterPlugin = __webpack_exports__.createRouterPlugin;
|
|
155
94
|
exports.createRouterProviderRealm = __webpack_exports__.createRouterProviderRealm;
|
|
156
|
-
exports.registerRouterProvider = __webpack_exports__.registerRouterProvider;
|
|
157
95
|
exports.reportUnsupportedProviderRegistryHooks = __webpack_exports__.reportUnsupportedProviderRegistryHooks;
|
|
158
96
|
exports.resolveRouterProvider = __webpack_exports__.resolveRouterProvider;
|
|
159
|
-
exports.unsafe_resetRouterProvidersForTesting = __webpack_exports__.unsafe_resetRouterProvidersForTesting;
|
|
160
97
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
161
98
|
"createRouterPlugin",
|
|
162
99
|
"createRouterProviderRealm",
|
|
163
|
-
"registerRouterProvider",
|
|
164
100
|
"reportUnsupportedProviderRegistryHooks",
|
|
165
|
-
"resolveRouterProvider"
|
|
166
|
-
"unsafe_resetRouterProvidersForTesting"
|
|
101
|
+
"resolveRouterProvider"
|
|
167
102
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
168
103
|
Object.defineProperty(exports, '__esModule', {
|
|
169
104
|
value: true
|
|
@@ -25,74 +25,15 @@ function createRouterProviderRealm(registrations) {
|
|
|
25
25
|
names: ()=>providerNames
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
warnedDuplicates: new Set()
|
|
36
|
-
};
|
|
37
|
-
host[REGISTRY_SLOT].duplicateProviders ??= new Set();
|
|
38
|
-
host[REGISTRY_SLOT].warnedDuplicates ??= new Set();
|
|
39
|
-
return host[REGISTRY_SLOT];
|
|
40
|
-
}
|
|
41
|
-
function getLegacyV2Registry() {
|
|
42
|
-
const host = globalThis;
|
|
43
|
-
return host[LEGACY_V2_REGISTRY_SLOT];
|
|
44
|
-
}
|
|
45
|
-
function registerRouterProvider(name, factory, options = {}) {
|
|
46
|
-
const registry = getRegistry();
|
|
47
|
-
const existing = registry.providers.get(name);
|
|
48
|
-
if (void 0 !== existing) {
|
|
49
|
-
if (existing !== factory) registry.duplicateProviders.add(name);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
if (true === options.isDefault) registry.defaultProvider = name;
|
|
53
|
-
registry.providers.set(name, factory);
|
|
54
|
-
}
|
|
55
|
-
function resolveRouterProvider(framework, options = {}) {
|
|
56
|
-
if (void 0 !== options.realm) {
|
|
57
|
-
const name = framework || options.realm.defaultProvider;
|
|
58
|
-
const realmProviderNames = options.realm.names();
|
|
59
|
-
if (void 0 === name) throw new Error(`[@modern-js/runtime] The app-owned router provider realm does not declare a default provider. Available realm providers: ${realmProviderNames.join(', ') || '(none)'}.`);
|
|
60
|
-
const factory = options.realm.get(name);
|
|
61
|
-
if (void 0 === factory) throw new Error(`[@modern-js/runtime] Router provider "${name}" is not registered in the app-owned router provider realm. Available realm providers: ${realmProviderNames.join(', ') || '(none)'}. Compatibility registry fallback is disabled for app-owned realms.`);
|
|
62
|
-
return factory;
|
|
63
|
-
}
|
|
64
|
-
const registry = getRegistry();
|
|
65
|
-
const legacyV2Registry = getLegacyV2Registry();
|
|
66
|
-
const name = framework || options.localDefault?.name || registry.defaultProvider || legacyV2Registry?.defaultProvider;
|
|
67
|
-
if (void 0 === name) throw new Error('[@modern-js/runtime] No default router provider is registered. This is a bug in the runtime setup.');
|
|
68
|
-
if (void 0 !== options.localDefault && name === options.localDefault.name) return options.localDefault.factory;
|
|
69
|
-
const factory = registry.providers.get(name);
|
|
70
|
-
if (void 0 !== factory) {
|
|
71
|
-
if (registry.duplicateProviders.has(name) && !registry.warnedDuplicates.has(name)) {
|
|
72
|
-
registry.warnedDuplicates.add(name);
|
|
73
|
-
console.warn(`[@modern-js/runtime] The router provider "${name}" was registered more than once with different module instances, and a router wrapper without an app-owned provider realm is resolving the mixed-version compatibility fallback. The fallback is keeping the first registration. Modern router wrappers isolate app-owned realms automatically. For an older wrapper, share the provider runtime between Module Federation host and remotes or upgrade every app to a realm-aware runtime.`);
|
|
74
|
-
}
|
|
75
|
-
return factory;
|
|
76
|
-
}
|
|
77
|
-
const legacyV2Factory = legacyV2Registry?.providers.get(name);
|
|
78
|
-
if (void 0 !== legacyV2Factory) return legacyV2Factory;
|
|
79
|
-
if ('tanstack' === name) throw new Error("[@modern-js/runtime] `runtime.router.framework` is set to \"tanstack\", but no TanStack router provider is registered. Install @modern-js/plugin-tanstack, add `tanstackRouterPlugin()` to the `plugins` array in modern.config.ts, and make sure '@modern-js/plugin-tanstack/runtime' is imported (e.g. in modern.runtime.ts).");
|
|
80
|
-
throw new Error(`[@modern-js/runtime] Unknown router framework "${name}". Registered providers: ${[
|
|
81
|
-
...new Set([
|
|
82
|
-
...registry.providers.keys(),
|
|
83
|
-
...legacyV2Registry?.providers.keys() ?? []
|
|
84
|
-
])
|
|
85
|
-
].join(', ') || '(none)'}. Install and register the plugin that provides this router framework.`);
|
|
86
|
-
}
|
|
87
|
-
function unsafe_resetRouterProvidersForTesting() {
|
|
88
|
-
const host = globalThis;
|
|
89
|
-
delete host[REGISTRY_SLOT];
|
|
90
|
-
delete host[LEGACY_V2_REGISTRY_SLOT];
|
|
28
|
+
function resolveRouterProvider(framework, options) {
|
|
29
|
+
const name = framework || options.realm.defaultProvider;
|
|
30
|
+
const realmProviderNames = options.realm.names();
|
|
31
|
+
if (void 0 === name) throw new Error(`[@modern-js/runtime] The app-owned router provider realm does not declare a default provider. Available realm providers: ${realmProviderNames.join(', ') || '(none)'}.`);
|
|
32
|
+
const factory = options.realm.get(name);
|
|
33
|
+
if (void 0 === factory) throw new Error(`[@modern-js/runtime] Router provider "${name}" is not registered in the app-owned router provider realm. Available realm providers: ${realmProviderNames.join(', ') || '(none)'}.`);
|
|
34
|
+
return factory;
|
|
91
35
|
}
|
|
92
36
|
function createRouterPlugin({ defaultProvider, registryHooks, localProviders = [] }) {
|
|
93
|
-
registerRouterProvider(defaultProvider.name, defaultProvider.factory, {
|
|
94
|
-
isDefault: true
|
|
95
|
-
});
|
|
96
37
|
const realm = createRouterProviderRealm([
|
|
97
38
|
{
|
|
98
39
|
...defaultProvider,
|
|
@@ -114,4 +55,4 @@ function createRouterPlugin({ defaultProvider, registryHooks, localProviders = [
|
|
|
114
55
|
}
|
|
115
56
|
});
|
|
116
57
|
}
|
|
117
|
-
export { createRouterPlugin, createRouterProviderRealm,
|
|
58
|
+
export { createRouterPlugin, createRouterProviderRealm, reportUnsupportedProviderRegistryHooks, resolveRouterProvider };
|
|
@@ -26,74 +26,15 @@ function createRouterProviderRealm(registrations) {
|
|
|
26
26
|
names: ()=>providerNames
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
warnedDuplicates: new Set()
|
|
37
|
-
};
|
|
38
|
-
host[REGISTRY_SLOT].duplicateProviders ??= new Set();
|
|
39
|
-
host[REGISTRY_SLOT].warnedDuplicates ??= new Set();
|
|
40
|
-
return host[REGISTRY_SLOT];
|
|
41
|
-
}
|
|
42
|
-
function getLegacyV2Registry() {
|
|
43
|
-
const host = globalThis;
|
|
44
|
-
return host[LEGACY_V2_REGISTRY_SLOT];
|
|
45
|
-
}
|
|
46
|
-
function registerRouterProvider(name, factory, options = {}) {
|
|
47
|
-
const registry = getRegistry();
|
|
48
|
-
const existing = registry.providers.get(name);
|
|
49
|
-
if (void 0 !== existing) {
|
|
50
|
-
if (existing !== factory) registry.duplicateProviders.add(name);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (true === options.isDefault) registry.defaultProvider = name;
|
|
54
|
-
registry.providers.set(name, factory);
|
|
55
|
-
}
|
|
56
|
-
function resolveRouterProvider(framework, options = {}) {
|
|
57
|
-
if (void 0 !== options.realm) {
|
|
58
|
-
const name = framework || options.realm.defaultProvider;
|
|
59
|
-
const realmProviderNames = options.realm.names();
|
|
60
|
-
if (void 0 === name) throw new Error(`[@modern-js/runtime] The app-owned router provider realm does not declare a default provider. Available realm providers: ${realmProviderNames.join(', ') || '(none)'}.`);
|
|
61
|
-
const factory = options.realm.get(name);
|
|
62
|
-
if (void 0 === factory) throw new Error(`[@modern-js/runtime] Router provider "${name}" is not registered in the app-owned router provider realm. Available realm providers: ${realmProviderNames.join(', ') || '(none)'}. Compatibility registry fallback is disabled for app-owned realms.`);
|
|
63
|
-
return factory;
|
|
64
|
-
}
|
|
65
|
-
const registry = getRegistry();
|
|
66
|
-
const legacyV2Registry = getLegacyV2Registry();
|
|
67
|
-
const name = framework || options.localDefault?.name || registry.defaultProvider || legacyV2Registry?.defaultProvider;
|
|
68
|
-
if (void 0 === name) throw new Error('[@modern-js/runtime] No default router provider is registered. This is a bug in the runtime setup.');
|
|
69
|
-
if (void 0 !== options.localDefault && name === options.localDefault.name) return options.localDefault.factory;
|
|
70
|
-
const factory = registry.providers.get(name);
|
|
71
|
-
if (void 0 !== factory) {
|
|
72
|
-
if (registry.duplicateProviders.has(name) && !registry.warnedDuplicates.has(name)) {
|
|
73
|
-
registry.warnedDuplicates.add(name);
|
|
74
|
-
console.warn(`[@modern-js/runtime] The router provider "${name}" was registered more than once with different module instances, and a router wrapper without an app-owned provider realm is resolving the mixed-version compatibility fallback. The fallback is keeping the first registration. Modern router wrappers isolate app-owned realms automatically. For an older wrapper, share the provider runtime between Module Federation host and remotes or upgrade every app to a realm-aware runtime.`);
|
|
75
|
-
}
|
|
76
|
-
return factory;
|
|
77
|
-
}
|
|
78
|
-
const legacyV2Factory = legacyV2Registry?.providers.get(name);
|
|
79
|
-
if (void 0 !== legacyV2Factory) return legacyV2Factory;
|
|
80
|
-
if ('tanstack' === name) throw new Error("[@modern-js/runtime] `runtime.router.framework` is set to \"tanstack\", but no TanStack router provider is registered. Install @modern-js/plugin-tanstack, add `tanstackRouterPlugin()` to the `plugins` array in modern.config.ts, and make sure '@modern-js/plugin-tanstack/runtime' is imported (e.g. in modern.runtime.ts).");
|
|
81
|
-
throw new Error(`[@modern-js/runtime] Unknown router framework "${name}". Registered providers: ${[
|
|
82
|
-
...new Set([
|
|
83
|
-
...registry.providers.keys(),
|
|
84
|
-
...legacyV2Registry?.providers.keys() ?? []
|
|
85
|
-
])
|
|
86
|
-
].join(', ') || '(none)'}. Install and register the plugin that provides this router framework.`);
|
|
87
|
-
}
|
|
88
|
-
function unsafe_resetRouterProvidersForTesting() {
|
|
89
|
-
const host = globalThis;
|
|
90
|
-
delete host[REGISTRY_SLOT];
|
|
91
|
-
delete host[LEGACY_V2_REGISTRY_SLOT];
|
|
29
|
+
function resolveRouterProvider(framework, options) {
|
|
30
|
+
const name = framework || options.realm.defaultProvider;
|
|
31
|
+
const realmProviderNames = options.realm.names();
|
|
32
|
+
if (void 0 === name) throw new Error(`[@modern-js/runtime] The app-owned router provider realm does not declare a default provider. Available realm providers: ${realmProviderNames.join(', ') || '(none)'}.`);
|
|
33
|
+
const factory = options.realm.get(name);
|
|
34
|
+
if (void 0 === factory) throw new Error(`[@modern-js/runtime] Router provider "${name}" is not registered in the app-owned router provider realm. Available realm providers: ${realmProviderNames.join(', ') || '(none)'}.`);
|
|
35
|
+
return factory;
|
|
92
36
|
}
|
|
93
37
|
function createRouterPlugin({ defaultProvider, registryHooks, localProviders = [] }) {
|
|
94
|
-
registerRouterProvider(defaultProvider.name, defaultProvider.factory, {
|
|
95
|
-
isDefault: true
|
|
96
|
-
});
|
|
97
38
|
const realm = createRouterProviderRealm([
|
|
98
39
|
{
|
|
99
40
|
...defaultProvider,
|
|
@@ -115,4 +56,4 @@ function createRouterPlugin({ defaultProvider, registryHooks, localProviders = [
|
|
|
115
56
|
}
|
|
116
57
|
});
|
|
117
58
|
}
|
|
118
|
-
export { createRouterPlugin, createRouterProviderRealm,
|
|
59
|
+
export { createRouterPlugin, createRouterProviderRealm, reportUnsupportedProviderRegistryHooks, resolveRouterProvider };
|
|
@@ -32,31 +32,9 @@ export type RouterProviderRealm = Readonly<{
|
|
|
32
32
|
names: () => readonly string[];
|
|
33
33
|
}>;
|
|
34
34
|
export declare function createRouterProviderRealm(registrations: readonly RouterProviderRegistration[]): RouterProviderRealm;
|
|
35
|
-
export declare function
|
|
36
|
-
|
|
37
|
-
}): void;
|
|
38
|
-
export declare function resolveRouterProvider(framework?: string, options?: {
|
|
39
|
-
/**
|
|
40
|
-
* Provider factories owned by the resolving app/runtime wrapper. A realm
|
|
41
|
-
* is the exclusive provider source when supplied because its factories
|
|
42
|
-
* close over the correct app module graph.
|
|
43
|
-
*/
|
|
44
|
-
realm?: RouterProviderRealm;
|
|
45
|
-
/**
|
|
46
|
-
* Legacy single-provider override retained for published wrappers. New
|
|
47
|
-
* integrations should pass an app-owned `realm`, which supports every
|
|
48
|
-
* provider rather than only the default.
|
|
49
|
-
*/
|
|
50
|
-
localDefault?: {
|
|
51
|
-
name: string;
|
|
52
|
-
factory: RouterProviderFactory;
|
|
53
|
-
};
|
|
35
|
+
export declare function resolveRouterProvider(framework: string | undefined, options: {
|
|
36
|
+
realm: RouterProviderRealm;
|
|
54
37
|
}): RouterProviderFactory;
|
|
55
|
-
/**
|
|
56
|
-
* Test-only escape hatch: compatibility registries live on `globalThis`, so
|
|
57
|
-
* unit tests need a way to restore a pristine state between cases.
|
|
58
|
-
*/
|
|
59
|
-
export declare function unsafe_resetRouterProvidersForTesting(): void;
|
|
60
38
|
/** Compose app-owned providers without importing the native runtime graph. */
|
|
61
39
|
export declare function createRouterPlugin<Hooks extends Record<string, unknown>>({ defaultProvider, registryHooks, localProviders, }: {
|
|
62
40
|
defaultProvider: {
|
|
@@ -109,10 +109,10 @@ export interface BffEffectUserConfig {
|
|
|
109
109
|
/**
|
|
110
110
|
* Enforce Effect-native API/runtime modules instead of raw request handlers.
|
|
111
111
|
*
|
|
112
|
-
*
|
|
112
|
+
* Effect API entries must export a `defineEffectBff(...)`
|
|
113
113
|
* definition or a `{ api, layer }` HttpApi module. Raw `handler` exports,
|
|
114
114
|
* default request handlers, and unbranded custom `createHandler` factories
|
|
115
|
-
* are
|
|
115
|
+
* are rejected.
|
|
116
116
|
*
|
|
117
117
|
* @default true
|
|
118
118
|
*/
|
|
@@ -27,17 +27,17 @@ export interface ServerTelemetrySloUserConfig {
|
|
|
27
27
|
*/
|
|
28
28
|
alertCooldownMs?: number;
|
|
29
29
|
}
|
|
30
|
-
export interface
|
|
30
|
+
export interface ServerTelemetryHealthContractGateUserConfig {
|
|
31
31
|
/**
|
|
32
32
|
* Whether this contract gate currently passes.
|
|
33
33
|
*/
|
|
34
34
|
passed: boolean;
|
|
35
35
|
/**
|
|
36
|
-
* Optional failure reason used for
|
|
36
|
+
* Optional failure reason used for health diagnostics.
|
|
37
37
|
*/
|
|
38
38
|
reason?: string;
|
|
39
39
|
}
|
|
40
|
-
export interface
|
|
40
|
+
export interface ServerTelemetrySnapshotObservationUserConfig {
|
|
41
41
|
/**
|
|
42
42
|
* Enable automatic contract gate synchronization from a gate snapshot file.
|
|
43
43
|
*
|
|
@@ -65,14 +65,14 @@ export interface ServerTelemetryCanaryAutopilotUserConfig {
|
|
|
65
65
|
/**
|
|
66
66
|
* Runtime MF fallback signal ingestion.
|
|
67
67
|
*/
|
|
68
|
-
runtimeFallbackSignal?:
|
|
68
|
+
runtimeFallbackSignal?: ServerTelemetryHealthRuntimeFallbackSignalUserConfig;
|
|
69
69
|
/**
|
|
70
70
|
* Optional pluggable state store backend for contract gate snapshots.
|
|
71
71
|
* When omitted, snapshots are read/written from gateSnapshotPath on local disk.
|
|
72
72
|
*/
|
|
73
|
-
stateStore?:
|
|
73
|
+
stateStore?: ServerTelemetrySnapshotObservationStateStoreUserConfig;
|
|
74
74
|
}
|
|
75
|
-
export interface
|
|
75
|
+
export interface ServerTelemetrySnapshotObservationStateStoreUserConfig {
|
|
76
76
|
/**
|
|
77
77
|
* Path or package name of a module that exports
|
|
78
78
|
* `createContractGateSnapshotStore(context)`.
|
|
@@ -83,7 +83,7 @@ export interface ServerTelemetryCanaryAutopilotStateStoreUserConfig {
|
|
|
83
83
|
*/
|
|
84
84
|
options?: Record<string, unknown>;
|
|
85
85
|
}
|
|
86
|
-
export interface
|
|
86
|
+
export interface ServerTelemetryHealthRuntimeFallbackSignalUserConfig {
|
|
87
87
|
/**
|
|
88
88
|
* Enable runtime MF fallback signal ingestion endpoint.
|
|
89
89
|
*
|
|
@@ -119,15 +119,15 @@ export interface ServerTelemetryCanaryRuntimeFallbackSignalUserConfig {
|
|
|
119
119
|
maxBodyBytes?: number;
|
|
120
120
|
/**
|
|
121
121
|
* Optional runtime trust policy for fallback signal ingestion.
|
|
122
|
-
* Use this to restrict who can mutate
|
|
122
|
+
* Use this to restrict who can mutate health contract gates.
|
|
123
123
|
*/
|
|
124
|
-
trustPolicy?:
|
|
124
|
+
trustPolicy?: ServerTelemetryHealthRuntimeFallbackSignalTrustPolicyUserConfig;
|
|
125
125
|
/**
|
|
126
126
|
* Optional request authentication for runtime fallback signal endpoint.
|
|
127
127
|
*/
|
|
128
|
-
auth?:
|
|
128
|
+
auth?: ServerTelemetryHealthRuntimeFallbackSignalAuthUserConfig;
|
|
129
129
|
}
|
|
130
|
-
export interface
|
|
130
|
+
export interface ServerTelemetryHealthRuntimeFallbackSignalAuthUserConfig {
|
|
131
131
|
/**
|
|
132
132
|
* Enable auth guard for runtime fallback signal endpoint.
|
|
133
133
|
*
|
|
@@ -149,7 +149,7 @@ export interface ServerTelemetryCanaryRuntimeFallbackSignalAuthUserConfig {
|
|
|
149
149
|
*/
|
|
150
150
|
expectedValueEnv?: string;
|
|
151
151
|
}
|
|
152
|
-
export interface
|
|
152
|
+
export interface ServerTelemetryHealthRuntimeFallbackSignalTrustPolicyUserConfig {
|
|
153
153
|
/**
|
|
154
154
|
* Allowlist of app names accepted by runtime fallback signal endpoint.
|
|
155
155
|
* Empty means no app-name allowlist check.
|
|
@@ -190,58 +190,58 @@ export interface ServerTelemetryCanaryRuntimeFallbackSignalTrustPolicyUserConfig
|
|
|
190
190
|
*/
|
|
191
191
|
dedupeWindowMs?: number;
|
|
192
192
|
}
|
|
193
|
-
export interface
|
|
193
|
+
export interface ServerTelemetryHealthUserConfig {
|
|
194
194
|
/**
|
|
195
|
-
* Enable
|
|
195
|
+
* Enable telemetry health observation.
|
|
196
196
|
*
|
|
197
197
|
* @default false
|
|
198
198
|
*/
|
|
199
199
|
enabled?: boolean;
|
|
200
200
|
/**
|
|
201
|
-
* Periodic
|
|
201
|
+
* Periodic health evaluation interval in milliseconds.
|
|
202
202
|
*
|
|
203
203
|
* @default 15000
|
|
204
204
|
*/
|
|
205
205
|
evaluationIntervalMs?: number;
|
|
206
206
|
/**
|
|
207
|
-
* Required consecutive healthy evaluations before
|
|
207
|
+
* Required consecutive healthy evaluations before reporting healthy.
|
|
208
208
|
*
|
|
209
209
|
* @default 3
|
|
210
210
|
*/
|
|
211
211
|
minConsecutiveHealthyEvaluations?: number;
|
|
212
212
|
/**
|
|
213
|
-
* Consecutive failing evaluations before
|
|
213
|
+
* Consecutive failing evaluations before reporting unhealthy.
|
|
214
214
|
*
|
|
215
215
|
* @default 2
|
|
216
216
|
*/
|
|
217
|
-
|
|
217
|
+
minConsecutiveFailedEvaluations?: number;
|
|
218
218
|
/**
|
|
219
|
-
* Maximum queue utilization ratio allowed
|
|
219
|
+
* Maximum queue utilization ratio allowed for healthy telemetry.
|
|
220
220
|
*
|
|
221
221
|
* @default 0.8
|
|
222
222
|
*/
|
|
223
223
|
maxQueueUtilization?: number;
|
|
224
224
|
/**
|
|
225
|
-
* Maximum allowed total dropped envelopes
|
|
225
|
+
* Maximum allowed total dropped envelopes for healthy telemetry.
|
|
226
226
|
*
|
|
227
227
|
* @default 0
|
|
228
228
|
*/
|
|
229
229
|
maxTotalDropped?: number;
|
|
230
230
|
/**
|
|
231
|
-
* Maximum allowed unhealthy exporters
|
|
231
|
+
* Maximum allowed unhealthy exporters for healthy telemetry.
|
|
232
232
|
*
|
|
233
233
|
* @default 0
|
|
234
234
|
*/
|
|
235
235
|
maxUnhealthyExporters?: number;
|
|
236
236
|
/**
|
|
237
|
-
* Contract gate map used in
|
|
237
|
+
* Contract gate map used in health evaluations.
|
|
238
238
|
* `true` means passing, `false` means failing.
|
|
239
239
|
*/
|
|
240
|
-
contractGates?: Record<string, boolean |
|
|
240
|
+
contractGates?: Record<string, boolean | ServerTelemetryHealthContractGateUserConfig>;
|
|
241
241
|
/**
|
|
242
|
-
* Contract-gate
|
|
242
|
+
* Contract-gate snapshot observation settings.
|
|
243
243
|
*/
|
|
244
|
-
|
|
244
|
+
snapshotObservation?: ServerTelemetrySnapshotObservationUserConfig;
|
|
245
245
|
}
|
|
246
246
|
export interface ServerTelemetryConfigExtension {
|
|
247
247
|
telemetry?: ServerTelemetryUserConfig;
|
|
@@ -306,9 +306,9 @@ export interface ServerTelemetryUserConfig {
|
|
|
306
306
|
*/
|
|
307
307
|
slo?: ServerTelemetrySloUserConfig;
|
|
308
308
|
/**
|
|
309
|
-
*
|
|
309
|
+
* Telemetry health observation policy.
|
|
310
310
|
*/
|
|
311
|
-
|
|
311
|
+
health?: ServerTelemetryHealthUserConfig;
|
|
312
312
|
exporters?: {
|
|
313
313
|
/**
|
|
314
314
|
* OpenTelemetry HTTP exporter.
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "packages/runtime/runtime-extensions"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"version": "3.9.0-ultramodern.
|
|
14
|
+
"version": "3.9.0-ultramodern.7",
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=26.7.0"
|
|
17
17
|
},
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
},
|
|
275
275
|
"devDependencies": {
|
|
276
276
|
"@loadable/component": "5.16.7",
|
|
277
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.
|
|
277
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.7",
|
|
278
278
|
"@rsbuild/core": "2.2.3",
|
|
279
279
|
"@rslib/core": "1.0.0",
|
|
280
280
|
"@scripts/rstest-config": "2.66.0",
|
|
@@ -303,8 +303,8 @@
|
|
|
303
303
|
}
|
|
304
304
|
},
|
|
305
305
|
"dependencies": {
|
|
306
|
-
"@modern-js/create-request": "npm:@bleedingdev/modern-js-create-request@3.9.0-ultramodern.
|
|
307
|
-
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.0-ultramodern.
|
|
306
|
+
"@modern-js/create-request": "npm:@bleedingdev/modern-js-create-request@3.9.0-ultramodern.7",
|
|
307
|
+
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.0-ultramodern.7",
|
|
308
308
|
"react-helmet-async": "3.0.0"
|
|
309
309
|
},
|
|
310
310
|
"scripts": {
|