@modern-js/runtime 3.8.3 → 3.9.0
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.
|
@@ -146,8 +146,7 @@ const applyExternalsPlugin = (child, compiler)=>{
|
|
|
146
146
|
]).apply(child);
|
|
147
147
|
};
|
|
148
148
|
const generateEntryCode = (docPath, _entryName)=>{
|
|
149
|
-
const
|
|
150
|
-
const esmRuntimeAPI = runtimeAPI.replace("cjs", "esm").replace(/.js$/, '.mjs');
|
|
149
|
+
const esmRuntimeAPI = require.resolve('@modern-js/runtime/document');
|
|
151
150
|
return `import React from 'react';
|
|
152
151
|
import ReactDomServer from 'react-dom/server';
|
|
153
152
|
import Document from ${JSON.stringify(docPath)};
|
|
@@ -48,7 +48,7 @@ const processCommentPlaceholders = (html)=>{
|
|
|
48
48
|
return html.replace(new RegExp(`${DOCUMENT_COMMENT_PLACEHOLDER_START}([\\s\\S]*?)${DOCUMENT_COMMENT_PLACEHOLDER_END}`, 'g'), (_scriptStr, $1)=>`${decodeHtmlEntities(decodeURIComponent($1))}`);
|
|
49
49
|
};
|
|
50
50
|
const requireFromString = (code, filename)=>{
|
|
51
|
-
const m = new module_0.Module(filename,
|
|
51
|
+
const m = new module_0.Module(filename, void 0);
|
|
52
52
|
m.filename = filename;
|
|
53
53
|
m.paths = module_0.Module._nodeModulePaths(path.dirname(filename));
|
|
54
54
|
m._compile(code, filename);
|
|
@@ -101,8 +101,7 @@ const applyExternalsPlugin = (child, compiler)=>{
|
|
|
101
101
|
]).apply(child);
|
|
102
102
|
};
|
|
103
103
|
const generateEntryCode = (docPath, _entryName)=>{
|
|
104
|
-
const
|
|
105
|
-
const esmRuntimeAPI = runtimeAPI.replace("cjs", "esm").replace(/.js$/, '.mjs');
|
|
104
|
+
const esmRuntimeAPI = require.resolve('@modern-js/runtime/document');
|
|
106
105
|
return `import React from 'react';
|
|
107
106
|
import ReactDomServer from 'react-dom/server';
|
|
108
107
|
import Document from ${JSON.stringify(docPath)};
|
|
@@ -50,7 +50,7 @@ const processCommentPlaceholders = (html)=>{
|
|
|
50
50
|
return html.replace(new RegExp(`${DOCUMENT_COMMENT_PLACEHOLDER_START}([\\s\\S]*?)${DOCUMENT_COMMENT_PLACEHOLDER_END}`, 'g'), (_scriptStr, $1)=>`${decodeHtmlEntities(decodeURIComponent($1))}`);
|
|
51
51
|
};
|
|
52
52
|
const requireFromString = (code, filename)=>{
|
|
53
|
-
const m = new module_0.Module(filename,
|
|
53
|
+
const m = new module_0.Module(filename, void 0);
|
|
54
54
|
m.filename = filename;
|
|
55
55
|
m.paths = module_0.Module._nodeModulePaths(path.dirname(filename));
|
|
56
56
|
m._compile(code, filename);
|
|
@@ -103,8 +103,7 @@ const applyExternalsPlugin = (child, compiler)=>{
|
|
|
103
103
|
]).apply(child);
|
|
104
104
|
};
|
|
105
105
|
const generateEntryCode = (docPath, _entryName)=>{
|
|
106
|
-
const
|
|
107
|
-
const esmRuntimeAPI = runtimeAPI.replace("cjs", "esm").replace(/.js$/, '.mjs');
|
|
106
|
+
const esmRuntimeAPI = require.resolve('@modern-js/runtime/document');
|
|
108
107
|
return `import React from 'react';
|
|
109
108
|
import ReactDomServer from 'react-dom/server';
|
|
110
109
|
import Document from ${JSON.stringify(docPath)};
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.
|
|
18
|
+
"version": "3.9.0",
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=20"
|
|
21
21
|
},
|
|
@@ -215,12 +215,12 @@
|
|
|
215
215
|
"isbot": "3.8.0",
|
|
216
216
|
"react-helmet": "^6.1.0",
|
|
217
217
|
"react-is": "^18.3.1",
|
|
218
|
-
"@modern-js/plugin": "3.
|
|
219
|
-
"@modern-js/
|
|
220
|
-
"@modern-js/
|
|
221
|
-
"@modern-js/utils": "3.
|
|
222
|
-
"@modern-js/types": "3.
|
|
223
|
-
"@modern-js/
|
|
218
|
+
"@modern-js/plugin": "3.9.0",
|
|
219
|
+
"@modern-js/render": "3.9.0",
|
|
220
|
+
"@modern-js/plugin-data-loader": "3.9.0",
|
|
221
|
+
"@modern-js/runtime-utils": "3.9.0",
|
|
222
|
+
"@modern-js/types": "3.9.0",
|
|
223
|
+
"@modern-js/utils": "3.9.0"
|
|
224
224
|
},
|
|
225
225
|
"peerDependencies": {
|
|
226
226
|
"react": ">=18.3.1",
|
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
"react-dom": "^19.2.8",
|
|
241
241
|
"ts-node": "^10.9.2",
|
|
242
242
|
"typescript": "^5",
|
|
243
|
-
"@modern-js/app-tools": "3.
|
|
243
|
+
"@modern-js/app-tools": "3.9.0",
|
|
244
244
|
"@modern-js/rslib": "2.68.10",
|
|
245
245
|
"@scripts/rstest-config": "2.66.0"
|
|
246
246
|
},
|