@bleedingdev/modern-js-runtime-renderer-extensions 3.9.0-ultramodern.11 → 3.9.0-ultramodern.13
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/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "packages/runtime/renderer-extensions"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"version": "3.9.0-ultramodern.
|
|
14
|
+
"version": "3.9.0-ultramodern.13",
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=26.7.0"
|
|
17
17
|
},
|
|
@@ -36,23 +36,23 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.0-ultramodern.
|
|
40
|
-
"@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.9.0-ultramodern.
|
|
39
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.0-ultramodern.13",
|
|
40
|
+
"@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.9.0-ultramodern.13"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@modern-js/render": "npm:@bleedingdev/modern-js-render@3.9.0-ultramodern.
|
|
44
|
-
"@modern-js/tsconfig": "npm:@bleedingdev/modern-js-tsconfig@3.9.0-ultramodern.
|
|
45
|
-
"@rslib/core": "1.0.
|
|
43
|
+
"@modern-js/render": "npm:@bleedingdev/modern-js-render@3.9.0-ultramodern.13",
|
|
44
|
+
"@modern-js/tsconfig": "npm:@bleedingdev/modern-js-tsconfig@3.9.0-ultramodern.13",
|
|
45
|
+
"@rslib/core": "1.0.2",
|
|
46
46
|
"@scripts/rstest-config": "2.66.0",
|
|
47
|
-
"@testing-library/dom": "^10.4.
|
|
47
|
+
"@testing-library/dom": "^10.4.2",
|
|
48
48
|
"@testing-library/react": "^16.3.3",
|
|
49
|
-
"@types/node": "^26.
|
|
50
|
-
"@types/react": "^19.
|
|
51
|
-
"@types/react-dom": "^19.
|
|
49
|
+
"@types/node": "^26.6.2",
|
|
50
|
+
"@types/react": "^19.3.0",
|
|
51
|
+
"@types/react-dom": "^19.3.0",
|
|
52
52
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
53
53
|
"esbuild": "^0.28.2",
|
|
54
|
-
"react": "^19.
|
|
55
|
-
"react-dom": "^19.
|
|
54
|
+
"react": "^19.3.0",
|
|
55
|
+
"react-dom": "^19.3.0",
|
|
56
56
|
"typescript": "^7.0.2"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
@@ -44,7 +44,7 @@ const buildWorkerShellBeforeTemplate = (template: string, options: any) =>
|
|
|
44
44
|
lifecycle: lifecycleFor(options),
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
import {
|
|
47
|
+
import { applyRouterServerPrepareResult } from '@modern-js/runtime-extensions/router-state';
|
|
48
48
|
import { CHUNK_CSS_PLACEHOLDER } from '../../plugin-runtime/src/core/server/constants';
|
|
49
49
|
import { buildShellBeforeTemplate as nativeBuildShellBeforeTemplate } from '../../plugin-runtime/src/core/server/stream/beforeTemplate';
|
|
50
50
|
import { buildShellBeforeTemplate as nativeBuildWorkerShellBeforeTemplate } from '../../plugin-runtime/src/core/server/stream/beforeTemplate.worker';
|
|
@@ -53,9 +53,9 @@ const withRouterSnapshot = (
|
|
|
53
53
|
runtimeContext: Record<string, unknown>,
|
|
54
54
|
serverSnapshot: Record<string, unknown>,
|
|
55
55
|
) => {
|
|
56
|
-
|
|
57
|
-
framework: 'react-router',
|
|
58
|
-
serverSnapshot,
|
|
56
|
+
applyRouterServerPrepareResult(runtimeContext as any, {
|
|
57
|
+
state: { framework: 'react-router' },
|
|
58
|
+
snapshot: serverSnapshot,
|
|
59
59
|
});
|
|
60
60
|
return runtimeContext;
|
|
61
61
|
};
|
|
@@ -180,9 +180,9 @@ import { LoadableCollector as NativeLoadableCollector } from '../../plugin-runti
|
|
|
180
180
|
|
|
181
181
|
const createRuntimeContextWithMatchedRoutes = (matchedRouteIds: string[]) => {
|
|
182
182
|
const runtimeContext = {} as any;
|
|
183
|
-
|
|
184
|
-
framework: 'react-router',
|
|
185
|
-
|
|
183
|
+
applyRouterServerPrepareResult(runtimeContext, {
|
|
184
|
+
state: { framework: 'react-router' },
|
|
185
|
+
snapshot: { matchedRouteIds },
|
|
186
186
|
});
|
|
187
187
|
return runtimeContext;
|
|
188
188
|
};
|
|
@@ -57,7 +57,7 @@ const createDataCollector = (options: any) => {
|
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
import {
|
|
60
|
+
import { applyRouterServerPrepareResult } from '@modern-js/runtime-extensions/router-state';
|
|
61
61
|
import { RenderLevel } from '../../plugin-runtime/src/core/constants';
|
|
62
62
|
import { SSR_DATA_PLACEHOLDER } from '../../plugin-runtime/src/core/server/constants';
|
|
63
63
|
import { buildShellAfterTemplate as nativeBuildShellAfterTemplate } from '../../plugin-runtime/src/core/server/stream/afterTemplate';
|
|
@@ -67,9 +67,9 @@ const withRouterSnapshot = (
|
|
|
67
67
|
runtimeContext: Record<string, unknown>,
|
|
68
68
|
serverSnapshot: Record<string, unknown>,
|
|
69
69
|
) => {
|
|
70
|
-
|
|
71
|
-
framework: 'react-router',
|
|
72
|
-
serverSnapshot,
|
|
70
|
+
applyRouterServerPrepareResult(runtimeContext as any, {
|
|
71
|
+
state: { framework: 'react-router' },
|
|
72
|
+
snapshot: serverSnapshot,
|
|
73
73
|
});
|
|
74
74
|
return runtimeContext;
|
|
75
75
|
};
|
|
@@ -160,9 +160,9 @@ const createRuntimeContext = (options: { withRouterBootstrap: boolean }) => {
|
|
|
160
160
|
};
|
|
161
161
|
|
|
162
162
|
if (options.withRouterBootstrap) {
|
|
163
|
-
|
|
164
|
-
framework: 'react-router',
|
|
165
|
-
|
|
163
|
+
applyRouterServerPrepareResult(runtimeContext as any, {
|
|
164
|
+
state: { framework: 'react-router' },
|
|
165
|
+
snapshot: {
|
|
166
166
|
hydrationScripts: [TSR_BOOTSTRAP],
|
|
167
167
|
},
|
|
168
168
|
});
|
|
@@ -267,7 +267,6 @@ const createScripts = (options?: {
|
|
|
267
267
|
loaderData?: Record<string, unknown>;
|
|
268
268
|
errors?: Record<string, unknown>;
|
|
269
269
|
};
|
|
270
|
-
hydrationScript?: string;
|
|
271
270
|
hydrationScripts?: string[];
|
|
272
271
|
};
|
|
273
272
|
}) => {
|
|
@@ -283,9 +282,9 @@ const createScripts = (options?: {
|
|
|
283
282
|
__i18nData__: {},
|
|
284
283
|
} as any;
|
|
285
284
|
if (options?.routerServerSnapshot) {
|
|
286
|
-
|
|
287
|
-
framework: 'react-router',
|
|
288
|
-
|
|
285
|
+
applyRouterServerPrepareResult(runtimeContext, {
|
|
286
|
+
state: { framework: 'react-router' },
|
|
287
|
+
snapshot: options.routerServerSnapshot,
|
|
289
288
|
});
|
|
290
289
|
}
|
|
291
290
|
|
|
@@ -352,7 +351,7 @@ describe('SSR data script generation', () => {
|
|
|
352
351
|
loaderData: { route: { ok: true } },
|
|
353
352
|
errors: {},
|
|
354
353
|
},
|
|
355
|
-
|
|
354
|
+
hydrationScripts: ['<script>window.__ROUTER_SSR__ = true;</script>'],
|
|
356
355
|
},
|
|
357
356
|
}),
|
|
358
357
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRouteHydrationScriptTags as createTags } from '@modern-js/runtime-extensions';
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
applyRouterServerPrepareResult,
|
|
4
4
|
getRouterMatchedRouteIds,
|
|
5
5
|
} from '@modern-js/runtime-extensions/router-state';
|
|
6
6
|
|
|
@@ -19,9 +19,9 @@ const createRouteHydrationScriptTags = (
|
|
|
19
19
|
describe('route hydration script serialization', () => {
|
|
20
20
|
it('quotes and escapes asset and nonce attributes', () => {
|
|
21
21
|
const runtimeContext = {} as any;
|
|
22
|
-
|
|
23
|
-
framework: 'react-router',
|
|
24
|
-
|
|
22
|
+
applyRouterServerPrepareResult(runtimeContext, {
|
|
23
|
+
state: { framework: 'react-router' },
|
|
24
|
+
snapshot: { matchedRouteIds: ['route-a'] },
|
|
25
25
|
});
|
|
26
26
|
runtimeContext.routeManifest = {
|
|
27
27
|
routeAssets: {
|