@bleedingdev/modern-js-runtime 3.5.0-ultramodern.15 → 3.5.0-ultramodern.17
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/cli/ssr/index.js +1 -2
- package/dist/cjs/core/context/runtime.js +2 -1
- package/dist/esm/cli/ssr/index.mjs +1 -2
- package/dist/esm/core/context/runtime.mjs +4 -3
- package/dist/esm-node/cli/ssr/index.mjs +1 -2
- package/dist/esm-node/core/context/runtime.mjs +4 -3
- package/dist/types/core/context/runtime.d.ts +1 -2
- package/package.json +9 -9
|
@@ -129,14 +129,13 @@ const ssrBuilderPlugin = (modernAPI, outputModule, exportLoadablePath)=>({
|
|
|
129
129
|
const hasServerRendering = hasServerRenderingConfig(userConfig);
|
|
130
130
|
const hasModuleFederationRuntimeMarker = hasServerRendering && shouldUseModuleFederationNodeOutput(config);
|
|
131
131
|
const hasExplicitMfSsrFlag = isModuleFederationAppSSREnabled(userConfig);
|
|
132
|
-
const isCloudflareWorkerSSR = 'workerSSR' === name && userConfig.deploy?.target === 'cloudflare';
|
|
133
132
|
const requireExplicitMfSsrFlag = 'true' === process.env.MODERN_MF_APP_SSR_REQUIRE_EXPLICIT;
|
|
134
133
|
if (hasServerRendering && hasModuleFederationRuntimeMarker && !hasExplicitMfSsrFlag) {
|
|
135
134
|
const warningMessage = '[modernjs][mf-ssr] Module Federation SSR was auto-detected from runtime markers. Set server.ssr.moduleFederationAppSSR=true explicitly in host and remotes to avoid heuristic drift.';
|
|
136
135
|
if (requireExplicitMfSsrFlag) throw new Error(`${warningMessage} (enforced by MODERN_MF_APP_SSR_REQUIRE_EXPLICIT=true)`);
|
|
137
136
|
console.warn(warningMessage);
|
|
138
137
|
}
|
|
139
|
-
const isModuleFederationAppSSR = hasServerRendering && hasExplicitMfSsrFlag
|
|
138
|
+
const isModuleFederationAppSSR = hasServerRendering && hasExplicitMfSsrFlag;
|
|
140
139
|
const ssrEnv = userConfig.deploy?.worker?.ssr || userConfig.server?.rsc ? 'edge' : 'node';
|
|
141
140
|
const appContext = modernAPI.getAppContext();
|
|
142
141
|
const { appDirectory, entrypoints } = appContext;
|
|
@@ -34,9 +34,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
34
34
|
getInitialContext: ()=>getInitialContext,
|
|
35
35
|
useRuntimeContext: ()=>external_public_js_namespaceObject.useRuntimeContext
|
|
36
36
|
});
|
|
37
|
+
const external_react_namespaceObject = require("react");
|
|
37
38
|
const external_public_js_namespaceObject = require("./public.js");
|
|
38
39
|
const ROUTE_MANIFEST = '_MODERNJS_ROUTE_MANIFEST';
|
|
39
|
-
const InternalRuntimeContext =
|
|
40
|
+
const InternalRuntimeContext = (0, external_react_namespaceObject.createContext)({});
|
|
40
41
|
const getInitialContext = (isBrowser = true, routeManifest)=>{
|
|
41
42
|
const requestContext = {
|
|
42
43
|
request: {},
|
|
@@ -84,14 +84,13 @@ const ssrBuilderPlugin = (modernAPI, outputModule, exportLoadablePath)=>({
|
|
|
84
84
|
const hasServerRendering = hasServerRenderingConfig(userConfig);
|
|
85
85
|
const hasModuleFederationRuntimeMarker = hasServerRendering && shouldUseModuleFederationNodeOutput(config);
|
|
86
86
|
const hasExplicitMfSsrFlag = isModuleFederationAppSSREnabled(userConfig);
|
|
87
|
-
const isCloudflareWorkerSSR = 'workerSSR' === name && userConfig.deploy?.target === 'cloudflare';
|
|
88
87
|
const requireExplicitMfSsrFlag = 'true' === process.env.MODERN_MF_APP_SSR_REQUIRE_EXPLICIT;
|
|
89
88
|
if (hasServerRendering && hasModuleFederationRuntimeMarker && !hasExplicitMfSsrFlag) {
|
|
90
89
|
const warningMessage = '[modernjs][mf-ssr] Module Federation SSR was auto-detected from runtime markers. Set server.ssr.moduleFederationAppSSR=true explicitly in host and remotes to avoid heuristic drift.';
|
|
91
90
|
if (requireExplicitMfSsrFlag) throw new Error(`${warningMessage} (enforced by MODERN_MF_APP_SSR_REQUIRE_EXPLICIT=true)`);
|
|
92
91
|
console.warn(warningMessage);
|
|
93
92
|
}
|
|
94
|
-
const isModuleFederationAppSSR = hasServerRendering && hasExplicitMfSsrFlag
|
|
93
|
+
const isModuleFederationAppSSR = hasServerRendering && hasExplicitMfSsrFlag;
|
|
95
94
|
const ssrEnv = userConfig.deploy?.worker?.ssr || userConfig.server?.rsc ? 'edge' : 'node';
|
|
96
95
|
const appContext = modernAPI.getAppContext();
|
|
97
96
|
const { appDirectory, entrypoints } = appContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createContext } from "react";
|
|
2
2
|
const ROUTE_MANIFEST = '_MODERNJS_ROUTE_MANIFEST';
|
|
3
|
-
const InternalRuntimeContext =
|
|
3
|
+
const InternalRuntimeContext = createContext({});
|
|
4
4
|
const getInitialContext = (isBrowser = true, routeManifest)=>{
|
|
5
5
|
const requestContext = {
|
|
6
6
|
request: {},
|
|
@@ -13,4 +13,5 @@ const getInitialContext = (isBrowser = true, routeManifest)=>{
|
|
|
13
13
|
context: requestContext
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
export {
|
|
16
|
+
export { ReactRuntimeContext, RuntimeContext, useRuntimeContext } from "./public.mjs";
|
|
17
|
+
export { InternalRuntimeContext, getInitialContext };
|
|
@@ -86,14 +86,13 @@ const ssrBuilderPlugin = (modernAPI, outputModule, exportLoadablePath)=>({
|
|
|
86
86
|
const hasServerRendering = hasServerRenderingConfig(userConfig);
|
|
87
87
|
const hasModuleFederationRuntimeMarker = hasServerRendering && shouldUseModuleFederationNodeOutput(config);
|
|
88
88
|
const hasExplicitMfSsrFlag = isModuleFederationAppSSREnabled(userConfig);
|
|
89
|
-
const isCloudflareWorkerSSR = 'workerSSR' === name && userConfig.deploy?.target === 'cloudflare';
|
|
90
89
|
const requireExplicitMfSsrFlag = 'true' === process.env.MODERN_MF_APP_SSR_REQUIRE_EXPLICIT;
|
|
91
90
|
if (hasServerRendering && hasModuleFederationRuntimeMarker && !hasExplicitMfSsrFlag) {
|
|
92
91
|
const warningMessage = '[modernjs][mf-ssr] Module Federation SSR was auto-detected from runtime markers. Set server.ssr.moduleFederationAppSSR=true explicitly in host and remotes to avoid heuristic drift.';
|
|
93
92
|
if (requireExplicitMfSsrFlag) throw new Error(`${warningMessage} (enforced by MODERN_MF_APP_SSR_REQUIRE_EXPLICIT=true)`);
|
|
94
93
|
console.warn(warningMessage);
|
|
95
94
|
}
|
|
96
|
-
const isModuleFederationAppSSR = hasServerRendering && hasExplicitMfSsrFlag
|
|
95
|
+
const isModuleFederationAppSSR = hasServerRendering && hasExplicitMfSsrFlag;
|
|
97
96
|
const ssrEnv = userConfig.deploy?.worker?.ssr || userConfig.server?.rsc ? 'edge' : 'node';
|
|
98
97
|
const appContext = modernAPI.getAppContext();
|
|
99
98
|
const { appDirectory, entrypoints } = appContext;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import {
|
|
2
|
+
import { createContext } from "react";
|
|
3
3
|
const ROUTE_MANIFEST = '_MODERNJS_ROUTE_MANIFEST';
|
|
4
|
-
const InternalRuntimeContext =
|
|
4
|
+
const InternalRuntimeContext = createContext({});
|
|
5
5
|
const getInitialContext = (isBrowser = true, routeManifest)=>{
|
|
6
6
|
const requestContext = {
|
|
7
7
|
request: {},
|
|
@@ -14,4 +14,5 @@ const getInitialContext = (isBrowser = true, routeManifest)=>{
|
|
|
14
14
|
context: requestContext
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
export {
|
|
17
|
+
export { ReactRuntimeContext, RuntimeContext, useRuntimeContext } from "./public.mjs";
|
|
18
|
+
export { InternalRuntimeContext, getInitialContext };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Context } from 'react';
|
|
2
1
|
import { type RequestContext, type TRuntimeContext } from './public';
|
|
3
2
|
export type InternalSSRContext = {
|
|
4
3
|
request: RequestContext['request'] & {
|
|
@@ -19,5 +18,5 @@ export interface TInternalRuntimeContext extends TRuntimeContext {
|
|
|
19
18
|
_internalContext?: any;
|
|
20
19
|
_internalRouterBaseName?: any;
|
|
21
20
|
}
|
|
22
|
-
export declare const InternalRuntimeContext: Context<TInternalRuntimeContext>;
|
|
21
|
+
export declare const InternalRuntimeContext: import("react").Context<TInternalRuntimeContext>;
|
|
23
22
|
export declare const getInitialContext: (isBrowser?: boolean, routeManifest?: Record<string, unknown>) => TInternalRuntimeContext;
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.5.0-ultramodern.
|
|
20
|
+
"version": "3.5.0-ultramodern.17",
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=20"
|
|
23
23
|
},
|
|
@@ -240,12 +240,12 @@
|
|
|
240
240
|
"react-helmet": "^6.1.0",
|
|
241
241
|
"react-helmet-async": "3.0.0",
|
|
242
242
|
"react-is": "^19.2.7",
|
|
243
|
-
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.5.0-ultramodern.
|
|
244
|
-
"@modern-js/
|
|
245
|
-
"@modern-js/
|
|
246
|
-
"@modern-js/
|
|
247
|
-
"@modern-js/
|
|
248
|
-
"@modern-js/
|
|
243
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.5.0-ultramodern.17",
|
|
244
|
+
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.5.0-ultramodern.17",
|
|
245
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.5.0-ultramodern.17",
|
|
246
|
+
"@modern-js/render": "npm:@bleedingdev/modern-js-render@3.5.0-ultramodern.17",
|
|
247
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.5.0-ultramodern.17",
|
|
248
|
+
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.5.0-ultramodern.17"
|
|
249
249
|
},
|
|
250
250
|
"peerDependencies": {
|
|
251
251
|
"react": "^19.2.7",
|
|
@@ -265,8 +265,8 @@
|
|
|
265
265
|
"react-dom": "^19.2.7",
|
|
266
266
|
"ts-node": "^10.9.2",
|
|
267
267
|
"typescript": "^6.0.3",
|
|
268
|
-
"@
|
|
269
|
-
"@
|
|
268
|
+
"@scripts/rstest-config": "2.66.0",
|
|
269
|
+
"@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.5.0-ultramodern.17"
|
|
270
270
|
},
|
|
271
271
|
"sideEffects": false,
|
|
272
272
|
"publishConfig": {
|