@bleedingdev/modern-js-ultramodern-app-tools 3.9.3-ultramodern.14 → 3.9.3-ultramodern.16
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/README.md +5 -3
- package/dist/cjs/renderers/react/module-federation.js +3 -1
- package/dist/cjs/renderers/react/redact-integration-plugin.js +1 -1
- package/dist/esm/renderers/react/module-federation.mjs +3 -1
- package/dist/esm/renderers/react/redact-integration-plugin.mjs +1 -1
- package/dist/esm-node/renderers/react/module-federation.mjs +3 -1
- package/dist/esm-node/renderers/react/redact-integration-plugin.mjs +1 -1
- package/dist/types/renderers/react/module-federation.d.ts +6 -3
- package/dist/types-esm/renderers/react/module-federation.d.mts +6 -3
- package/package.json +32 -32
- package/src/renderers/react/module-federation.ts +12 -4
- package/src/renderers/react/redact-integration-plugin.ts +1 -1
package/README.md
CHANGED
|
@@ -59,9 +59,11 @@ post-hydration IDs, namespace-sensitive segments and deferred reveal ordering.
|
|
|
59
59
|
Federated hosts and remotes must choose the same runtime. Their existing
|
|
60
60
|
renderer manifest contract publishes the effective runtime and hydration
|
|
61
61
|
identity (Redact `0.2.1`, or actual React for opt-out/RSC), and rejects mismatches
|
|
62
|
-
before remote initialization.
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
before remote initialization. Redact publishes under React's own share keys
|
|
63
|
+
(`react`, `react-dom`, JSX runtimes), once each, so hosts that govern those
|
|
64
|
+
singletons keep working. Each key carries Redact's real version with strict
|
|
65
|
+
matching, not a React 19 version, and direct Redact imports consume the same
|
|
66
|
+
singletons. The React authoring
|
|
65
67
|
profile continues to describe React's API/compiler, not the runtime override.
|
|
66
68
|
|
|
67
69
|
## Native application imports
|
|
@@ -79,6 +79,8 @@ function withReactRuntimeShared(shared, compatibility, require1 = (0, external_n
|
|
|
79
79
|
else if (entry && 'object' == typeof entry) Object.assign(result, entry);
|
|
80
80
|
const redacted = '@tanstack/redact' === compatibility.runtime.name;
|
|
81
81
|
const aliases = redacted ? (0, external_redact_integration_plugin_js_namespaceObject.resolveRedactAliases)(require1) : {};
|
|
82
|
+
const reactSpelling = new Map();
|
|
83
|
+
for (const [request, target] of Object.entries(external_redact_integration_plugin_js_namespaceObject.REDACT_ALIASES))if (!reactSpelling.has(target)) reactSpelling.set(target, request);
|
|
82
84
|
const requests = redacted ? Object.keys(aliases).map((key)=>key.slice(0, -1)) : [
|
|
83
85
|
'react',
|
|
84
86
|
'react-dom',
|
|
@@ -87,7 +89,7 @@ function withReactRuntimeShared(shared, compatibility, require1 = (0, external_n
|
|
|
87
89
|
'react/jsx-dev-runtime'
|
|
88
90
|
];
|
|
89
91
|
for (const request of requests){
|
|
90
|
-
const shareKey = redacted ? external_redact_integration_plugin_js_namespaceObject.REDACT_ALIASES[request] ?? request : request;
|
|
92
|
+
const shareKey = redacted ? reactSpelling.get(external_redact_integration_plugin_js_namespaceObject.REDACT_ALIASES[request] ?? request) ?? request : request;
|
|
91
93
|
const version = !redacted && request.startsWith('react-dom') ? compatibility.profile.hydration.version : compatibility.runtime.version;
|
|
92
94
|
const previous = result[request];
|
|
93
95
|
if (previous && 'object' == typeof previous && 'shareKey' in previous && previous.shareKey !== request && previous.shareKey !== shareKey) throw (0, renderer_contract_namespaceObject.rendererFederationError)(`conflicting runtime shareKey for ${request}; React and Redact containers cannot mix.`);
|
|
@@ -93,7 +93,7 @@ const frameworkDirectory = ()=>(0, renderer_installed_profile_js_namespaceObject
|
|
|
93
93
|
const REDACT_PATCH_MARKER = '// ultramodern-redact-patch: v1';
|
|
94
94
|
function assertRedactPatch(read = external_node_fs_namespaceObject.readFileSync) {
|
|
95
95
|
const stream = external_node_path_default().join(external_node_path_default().dirname(frameworkRequire.resolve('@tanstack/redact/server')), 'stream.js');
|
|
96
|
-
if (read(stream, 'utf8').split(/\r?\n/, 1)[0] !== REDACT_PATCH_MARKER) throw new Error(`[ultramodern] @tanstack/redact@0.2.1 requires the UltraModern reviewed SSR patch (${REDACT_PATCH_MARKER}) in ${stream}. Install the framework's npm:@bleedingdev/tanstack-redact@0.2.
|
|
96
|
+
if (read(stream, 'utf8').split(/\r?\n/, 1)[0] !== REDACT_PATCH_MARKER) throw new Error(`[ultramodern] @tanstack/redact@0.2.1 requires the UltraModern reviewed SSR patch (${REDACT_PATCH_MARKER}) in ${stream}. Install the framework's npm:@bleedingdev/tanstack-redact@0.2.2 dependency; unpatched Redact must not ship. Set redact: false to use real React instead.`);
|
|
97
97
|
}
|
|
98
98
|
function redactArtifactDigest(directory = external_node_path_default().resolve(external_node_path_default().dirname(frameworkRequire.resolve('@tanstack/redact')), '..')) {
|
|
99
99
|
const hash = (0, external_node_crypto_namespaceObject.createHash)('sha256');
|
|
@@ -43,6 +43,8 @@ function withReactRuntimeShared(shared, compatibility, require = createRequire(i
|
|
|
43
43
|
else if (entry && 'object' == typeof entry) Object.assign(result, entry);
|
|
44
44
|
const redacted = '@tanstack/redact' === compatibility.runtime.name;
|
|
45
45
|
const aliases = redacted ? resolveRedactAliases(require) : {};
|
|
46
|
+
const reactSpelling = new Map();
|
|
47
|
+
for (const [request, target] of Object.entries(REDACT_ALIASES))if (!reactSpelling.has(target)) reactSpelling.set(target, request);
|
|
46
48
|
const requests = redacted ? Object.keys(aliases).map((key)=>key.slice(0, -1)) : [
|
|
47
49
|
'react',
|
|
48
50
|
'react-dom',
|
|
@@ -51,7 +53,7 @@ function withReactRuntimeShared(shared, compatibility, require = createRequire(i
|
|
|
51
53
|
'react/jsx-dev-runtime'
|
|
52
54
|
];
|
|
53
55
|
for (const request of requests){
|
|
54
|
-
const shareKey = redacted ? REDACT_ALIASES[request] ?? request : request;
|
|
56
|
+
const shareKey = redacted ? reactSpelling.get(REDACT_ALIASES[request] ?? request) ?? request : request;
|
|
55
57
|
const version = !redacted && request.startsWith('react-dom') ? compatibility.profile.hydration.version : compatibility.runtime.version;
|
|
56
58
|
const previous = result[request];
|
|
57
59
|
if (previous && 'object' == typeof previous && 'shareKey' in previous && previous.shareKey !== request && previous.shareKey !== shareKey) throw rendererFederationError(`conflicting runtime shareKey for ${request}; React and Redact containers cannot mix.`);
|
|
@@ -38,7 +38,7 @@ const frameworkDirectory = ()=>readRendererFrameworkPackage({
|
|
|
38
38
|
const REDACT_PATCH_MARKER = '// ultramodern-redact-patch: v1';
|
|
39
39
|
function assertRedactPatch(read = readFileSync) {
|
|
40
40
|
const stream = node_path.join(node_path.dirname(frameworkRequire.resolve('@tanstack/redact/server')), 'stream.js');
|
|
41
|
-
if (read(stream, 'utf8').split(/\r?\n/, 1)[0] !== REDACT_PATCH_MARKER) throw new Error(`[ultramodern] @tanstack/redact@0.2.1 requires the UltraModern reviewed SSR patch (${REDACT_PATCH_MARKER}) in ${stream}. Install the framework's npm:@bleedingdev/tanstack-redact@0.2.
|
|
41
|
+
if (read(stream, 'utf8').split(/\r?\n/, 1)[0] !== REDACT_PATCH_MARKER) throw new Error(`[ultramodern] @tanstack/redact@0.2.1 requires the UltraModern reviewed SSR patch (${REDACT_PATCH_MARKER}) in ${stream}. Install the framework's npm:@bleedingdev/tanstack-redact@0.2.2 dependency; unpatched Redact must not ship. Set redact: false to use real React instead.`);
|
|
42
42
|
}
|
|
43
43
|
function redactArtifactDigest(directory = node_path.resolve(node_path.dirname(frameworkRequire.resolve('@tanstack/redact')), '..')) {
|
|
44
44
|
const hash = createHash('sha256');
|
|
@@ -44,6 +44,8 @@ function withReactRuntimeShared(shared, compatibility, require = createRequire(i
|
|
|
44
44
|
else if (entry && 'object' == typeof entry) Object.assign(result, entry);
|
|
45
45
|
const redacted = '@tanstack/redact' === compatibility.runtime.name;
|
|
46
46
|
const aliases = redacted ? resolveRedactAliases(require) : {};
|
|
47
|
+
const reactSpelling = new Map();
|
|
48
|
+
for (const [request, target] of Object.entries(REDACT_ALIASES))if (!reactSpelling.has(target)) reactSpelling.set(target, request);
|
|
47
49
|
const requests = redacted ? Object.keys(aliases).map((key)=>key.slice(0, -1)) : [
|
|
48
50
|
'react',
|
|
49
51
|
'react-dom',
|
|
@@ -52,7 +54,7 @@ function withReactRuntimeShared(shared, compatibility, require = createRequire(i
|
|
|
52
54
|
'react/jsx-dev-runtime'
|
|
53
55
|
];
|
|
54
56
|
for (const request of requests){
|
|
55
|
-
const shareKey = redacted ? REDACT_ALIASES[request] ?? request : request;
|
|
57
|
+
const shareKey = redacted ? reactSpelling.get(REDACT_ALIASES[request] ?? request) ?? request : request;
|
|
56
58
|
const version = !redacted && request.startsWith('react-dom') ? compatibility.profile.hydration.version : compatibility.runtime.version;
|
|
57
59
|
const previous = result[request];
|
|
58
60
|
if (previous && 'object' == typeof previous && 'shareKey' in previous && previous.shareKey !== request && previous.shareKey !== shareKey) throw rendererFederationError(`conflicting runtime shareKey for ${request}; React and Redact containers cannot mix.`);
|
|
@@ -39,7 +39,7 @@ const frameworkDirectory = ()=>readRendererFrameworkPackage({
|
|
|
39
39
|
const REDACT_PATCH_MARKER = '// ultramodern-redact-patch: v1';
|
|
40
40
|
function assertRedactPatch(read = readFileSync) {
|
|
41
41
|
const stream = node_path.join(node_path.dirname(frameworkRequire.resolve('@tanstack/redact/server')), 'stream.js');
|
|
42
|
-
if (read(stream, 'utf8').split(/\r?\n/, 1)[0] !== REDACT_PATCH_MARKER) throw new Error(`[ultramodern] @tanstack/redact@0.2.1 requires the UltraModern reviewed SSR patch (${REDACT_PATCH_MARKER}) in ${stream}. Install the framework's npm:@bleedingdev/tanstack-redact@0.2.
|
|
42
|
+
if (read(stream, 'utf8').split(/\r?\n/, 1)[0] !== REDACT_PATCH_MARKER) throw new Error(`[ultramodern] @tanstack/redact@0.2.1 requires the UltraModern reviewed SSR patch (${REDACT_PATCH_MARKER}) in ${stream}. Install the framework's npm:@bleedingdev/tanstack-redact@0.2.2 dependency; unpatched Redact must not ship. Set redact: false to use real React instead.`);
|
|
43
43
|
}
|
|
44
44
|
function redactArtifactDigest(directory = node_path.resolve(node_path.dirname(frameworkRequire.resolve('@tanstack/redact')), '..')) {
|
|
45
45
|
const hash = createHash('sha256');
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { type RendererFederationCompatibility } from '@modern-js/federation-runtime/renderer-contract';
|
|
2
2
|
import { type ReactRuntimeConfig } from '../../native-composition/redact-config.js';
|
|
3
3
|
export declare function resolveReactFederationCompatibility(config?: ReactRuntimeConfig, require?: NodeJS.Require): RendererFederationCompatibility;
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
/** Redact keeps React's share keys, so hosts that govern `react`, `react-dom`
|
|
5
|
+
* and JSX singletons see one entry each. Each key carries Redact's own version
|
|
6
|
+
* with strict matching: a real React container (or another Redact version)
|
|
7
|
+
* fails the version check, and the manifest contract rejects mixed runtimes
|
|
8
|
+
* before remote init. Direct `@tanstack/redact*` imports consume the same
|
|
9
|
+
* singleton as their first React spelling.
|
|
7
10
|
*/
|
|
8
11
|
export declare function withReactRuntimeShared(shared: unknown, compatibility: RendererFederationCompatibility, require?: NodeJS.Require): Record<string, unknown>;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { type RendererFederationCompatibility } from '@modern-js/federation-runtime/renderer-contract';
|
|
2
2
|
import { type ReactRuntimeConfig } from '../../native-composition/redact-config.mjs';
|
|
3
3
|
export declare function resolveReactFederationCompatibility(config?: ReactRuntimeConfig, require?: NodeJS.Require): RendererFederationCompatibility;
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
/** Redact keeps React's share keys, so hosts that govern `react`, `react-dom`
|
|
5
|
+
* and JSX singletons see one entry each. Each key carries Redact's own version
|
|
6
|
+
* with strict matching: a real React container (or another Redact version)
|
|
7
|
+
* fails the version check, and the manifest contract rejects mixed runtimes
|
|
8
|
+
* before remote init. Direct `@tanstack/redact*` imports consume the same
|
|
9
|
+
* singleton as their first React spelling.
|
|
7
10
|
*/
|
|
8
11
|
export declare function withReactRuntimeShared(shared: unknown, compatibility: RendererFederationCompatibility, require?: NodeJS.Require): Record<string, unknown>;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "packages/solutions/ultramodern-app-tools"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"version": "3.9.3-ultramodern.
|
|
14
|
+
"version": "3.9.3-ultramodern.16",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
17
|
"src",
|
|
@@ -149,39 +149,39 @@
|
|
|
149
149
|
"node": ">=26.12.0"
|
|
150
150
|
},
|
|
151
151
|
"dependencies": {
|
|
152
|
-
"@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.9.3-ultramodern.
|
|
153
|
-
"@modern-js/app-tools-extensions": "npm:@bleedingdev/modern-js-app-tools-extensions@3.9.3-ultramodern.
|
|
154
|
-
"@modern-js/backend-federation-contracts": "npm:@bleedingdev/modern-js-backend-federation-contracts@3.9.3-ultramodern.
|
|
155
|
-
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.9.3-ultramodern.
|
|
156
|
-
"@modern-js/federation-runtime": "npm:@bleedingdev/modern-js-federation-runtime@3.9.3-ultramodern.
|
|
157
|
-
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.3-ultramodern.
|
|
158
|
-
"@modern-js/plugin-bff-build-extensions": "npm:@bleedingdev/modern-js-plugin-bff-build-extensions@3.9.3-ultramodern.
|
|
159
|
-
"@modern-js/renderer-core": "npm:@bleedingdev/modern-js-renderer-core@3.9.3-ultramodern.
|
|
160
|
-
"@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.9.3-ultramodern.
|
|
161
|
-
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.3-ultramodern.
|
|
162
|
-
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.9.3-ultramodern.
|
|
163
|
-
"@modern-js/server-runtime-extensions": "npm:@bleedingdev/modern-js-server-runtime-extensions@3.9.3-ultramodern.
|
|
164
|
-
"@modern-js/surface-resolution": "npm:@bleedingdev/modern-js-surface-resolution@3.9.3-ultramodern.
|
|
165
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.3-ultramodern.
|
|
166
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.3-ultramodern.
|
|
152
|
+
"@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.9.3-ultramodern.16",
|
|
153
|
+
"@modern-js/app-tools-extensions": "npm:@bleedingdev/modern-js-app-tools-extensions@3.9.3-ultramodern.16",
|
|
154
|
+
"@modern-js/backend-federation-contracts": "npm:@bleedingdev/modern-js-backend-federation-contracts@3.9.3-ultramodern.16",
|
|
155
|
+
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.9.3-ultramodern.16",
|
|
156
|
+
"@modern-js/federation-runtime": "npm:@bleedingdev/modern-js-federation-runtime@3.9.3-ultramodern.16",
|
|
157
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.3-ultramodern.16",
|
|
158
|
+
"@modern-js/plugin-bff-build-extensions": "npm:@bleedingdev/modern-js-plugin-bff-build-extensions@3.9.3-ultramodern.16",
|
|
159
|
+
"@modern-js/renderer-core": "npm:@bleedingdev/modern-js-renderer-core@3.9.3-ultramodern.16",
|
|
160
|
+
"@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.9.3-ultramodern.16",
|
|
161
|
+
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.3-ultramodern.16",
|
|
162
|
+
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.9.3-ultramodern.16",
|
|
163
|
+
"@modern-js/server-runtime-extensions": "npm:@bleedingdev/modern-js-server-runtime-extensions@3.9.3-ultramodern.16",
|
|
164
|
+
"@modern-js/surface-resolution": "npm:@bleedingdev/modern-js-surface-resolution@3.9.3-ultramodern.16",
|
|
165
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.3-ultramodern.16",
|
|
166
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.3-ultramodern.16",
|
|
167
167
|
"@rsbuild/core": "2.2.13",
|
|
168
|
-
"@tanstack/redact": "npm:@bleedingdev/tanstack-redact@0.2.
|
|
168
|
+
"@tanstack/redact": "npm:@bleedingdev/tanstack-redact@0.2.2",
|
|
169
169
|
"@types/babel__core": "^7.20.5",
|
|
170
170
|
"prettier": "~3.9.10",
|
|
171
171
|
"react": "^19.3.1",
|
|
172
172
|
"rsbuild-redact-plugin": "0.1.0"
|
|
173
173
|
},
|
|
174
174
|
"devDependencies": {
|
|
175
|
-
"@modern-js/i18n-integration": "npm:@bleedingdev/modern-js-i18n-integration@3.9.3-ultramodern.
|
|
176
|
-
"@modern-js/plugin-bff": "npm:@bleedingdev/modern-js-plugin-bff@3.9.3-ultramodern.
|
|
177
|
-
"@modern-js/plugin-tanstack": "npm:@bleedingdev/modern-js-plugin-tanstack@3.9.3-ultramodern.
|
|
178
|
-
"@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.9.3-ultramodern.
|
|
179
|
-
"@modern-js/renderer-octane": "npm:@bleedingdev/modern-js-renderer-octane@3.9.3-ultramodern.
|
|
180
|
-
"@modern-js/renderer-solid": "npm:@bleedingdev/modern-js-renderer-solid@3.9.3-ultramodern.
|
|
181
|
-
"@modern-js/runtime": "npm:@bleedingdev/modern-js-runtime@3.9.3-ultramodern.
|
|
182
|
-
"@modern-js/runtime-renderer-extensions": "npm:@bleedingdev/modern-js-runtime-renderer-extensions@3.9.3-ultramodern.
|
|
183
|
-
"@modern-js/server": "npm:@bleedingdev/modern-js-server@3.9.3-ultramodern.
|
|
184
|
-
"@modern-js/tsconfig": "npm:@bleedingdev/modern-js-tsconfig@3.9.3-ultramodern.
|
|
175
|
+
"@modern-js/i18n-integration": "npm:@bleedingdev/modern-js-i18n-integration@3.9.3-ultramodern.16",
|
|
176
|
+
"@modern-js/plugin-bff": "npm:@bleedingdev/modern-js-plugin-bff@3.9.3-ultramodern.16",
|
|
177
|
+
"@modern-js/plugin-tanstack": "npm:@bleedingdev/modern-js-plugin-tanstack@3.9.3-ultramodern.16",
|
|
178
|
+
"@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.9.3-ultramodern.16",
|
|
179
|
+
"@modern-js/renderer-octane": "npm:@bleedingdev/modern-js-renderer-octane@3.9.3-ultramodern.16",
|
|
180
|
+
"@modern-js/renderer-solid": "npm:@bleedingdev/modern-js-renderer-solid@3.9.3-ultramodern.16",
|
|
181
|
+
"@modern-js/runtime": "npm:@bleedingdev/modern-js-runtime@3.9.3-ultramodern.16",
|
|
182
|
+
"@modern-js/runtime-renderer-extensions": "npm:@bleedingdev/modern-js-runtime-renderer-extensions@3.9.3-ultramodern.16",
|
|
183
|
+
"@modern-js/server": "npm:@bleedingdev/modern-js-server@3.9.3-ultramodern.16",
|
|
184
|
+
"@modern-js/tsconfig": "npm:@bleedingdev/modern-js-tsconfig@3.9.3-ultramodern.16",
|
|
185
185
|
"@octanejs/rspack-plugin": "https://github.com/BleedingDev/octane/releases/download/ultramodern-octane-2383d2ab1e70/octanejs-rspack-plugin-0.2.4.tgz",
|
|
186
186
|
"@rsbuild/plugin-svgr": "2.0.5",
|
|
187
187
|
"@rslib/core": "1.0.3",
|
|
@@ -241,11 +241,11 @@
|
|
|
241
241
|
"ultramodern": "bin/ultramodern.mjs"
|
|
242
242
|
},
|
|
243
243
|
"peerDependencies": {
|
|
244
|
-
"@modern-js/i18n-integration": "3.9.3-ultramodern.
|
|
245
|
-
"@modern-js/renderer-octane": "3.9.3-ultramodern.
|
|
246
|
-
"@modern-js/renderer-solid": "3.9.3-ultramodern.
|
|
247
|
-
"@modern-js/runtime": "3.9.3-ultramodern.
|
|
248
|
-
"@modern-js/runtime-renderer-extensions": "3.9.3-ultramodern.
|
|
244
|
+
"@modern-js/i18n-integration": "3.9.3-ultramodern.16",
|
|
245
|
+
"@modern-js/renderer-octane": "3.9.3-ultramodern.16",
|
|
246
|
+
"@modern-js/renderer-solid": "3.9.3-ultramodern.16",
|
|
247
|
+
"@modern-js/runtime": "3.9.3-ultramodern.16",
|
|
248
|
+
"@modern-js/runtime-renderer-extensions": "3.9.3-ultramodern.16",
|
|
249
249
|
"@rsbuild/plugin-svgr": "2.0.5",
|
|
250
250
|
"typescript": "7.0.2"
|
|
251
251
|
},
|
|
@@ -60,9 +60,12 @@ export function resolveReactFederationCompatibility(
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
63
|
+
/** Redact keeps React's share keys, so hosts that govern `react`, `react-dom`
|
|
64
|
+
* and JSX singletons see one entry each. Each key carries Redact's own version
|
|
65
|
+
* with strict matching: a real React container (or another Redact version)
|
|
66
|
+
* fails the version check, and the manifest contract rejects mixed runtimes
|
|
67
|
+
* before remote init. Direct `@tanstack/redact*` imports consume the same
|
|
68
|
+
* singleton as their first React spelling.
|
|
66
69
|
*/
|
|
67
70
|
export function withReactRuntimeShared(
|
|
68
71
|
shared: unknown,
|
|
@@ -76,6 +79,9 @@ export function withReactRuntimeShared(
|
|
|
76
79
|
}
|
|
77
80
|
const redacted = compatibility.runtime.name === '@tanstack/redact';
|
|
78
81
|
const aliases = redacted ? resolveRedactAliases(require) : {};
|
|
82
|
+
const reactSpelling = new Map<string, string>();
|
|
83
|
+
for (const [request, target] of Object.entries(REDACT_ALIASES))
|
|
84
|
+
if (!reactSpelling.has(target)) reactSpelling.set(target, request);
|
|
79
85
|
const requests = redacted
|
|
80
86
|
? Object.keys(aliases).map(key => key.slice(0, -1))
|
|
81
87
|
: [
|
|
@@ -87,7 +93,9 @@ export function withReactRuntimeShared(
|
|
|
87
93
|
];
|
|
88
94
|
for (const request of requests) {
|
|
89
95
|
const shareKey = redacted
|
|
90
|
-
? (
|
|
96
|
+
? (reactSpelling.get(
|
|
97
|
+
REDACT_ALIASES[request as keyof typeof REDACT_ALIASES] ?? request,
|
|
98
|
+
) ?? request)
|
|
91
99
|
: request;
|
|
92
100
|
const version =
|
|
93
101
|
!redacted && request.startsWith('react-dom')
|
|
@@ -61,7 +61,7 @@ export function assertRedactPatch(read = readFileSync): void {
|
|
|
61
61
|
);
|
|
62
62
|
if (read(stream, 'utf8').split(/\r?\n/, 1)[0] !== REDACT_PATCH_MARKER) {
|
|
63
63
|
throw new Error(
|
|
64
|
-
`[ultramodern] @tanstack/redact@0.2.1 requires the UltraModern reviewed SSR patch (${REDACT_PATCH_MARKER}) in ${stream}. Install the framework's npm:@bleedingdev/tanstack-redact@0.2.
|
|
64
|
+
`[ultramodern] @tanstack/redact@0.2.1 requires the UltraModern reviewed SSR patch (${REDACT_PATCH_MARKER}) in ${stream}. Install the framework's npm:@bleedingdev/tanstack-redact@0.2.2 dependency; unpatched Redact must not ship. Set redact: false to use real React instead.`,
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
67
|
}
|