@bleedingdev/modern-js-ultramodern-app-tools 3.11.3-ultramodern.1 → 3.11.3-ultramodern.11

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.
Files changed (49) hide show
  1. package/dist/cjs/native-composition/module-federation-renderer-plugin.js +1 -1
  2. package/dist/cjs/native-composition/native-development.js +1 -1
  3. package/dist/cjs/native-composition/native-entry-command.js +3 -3
  4. package/dist/cjs/native-composition/native-infrastructure.js +1 -1
  5. package/dist/cjs/native-composition/native-module-federation.js +4 -2
  6. package/dist/cjs/native-composition/native-prerender.js +1 -1
  7. package/dist/cjs/native-composition/native-server-plugin.js +3 -1
  8. package/dist/cjs/native-composition/redact-config.js +3 -3
  9. package/dist/cjs/native-composition/renderer-profile.js +1 -1
  10. package/dist/cjs/native-composition/renderer-registration.js +1 -1
  11. package/dist/cjs/native-composition/server-plugin-resolution.js +1 -1
  12. package/dist/cjs/native-composition/type-checker.js +2 -0
  13. package/dist/cjs/renderers/react/adapter.js +1 -1
  14. package/dist/cjs/renderers/react/build-metadata.js +1 -1
  15. package/dist/cjs/renderers/react/composition.js +1 -1
  16. package/dist/cjs/renderers/react/module-federation-recovery-plugin.js +1 -1
  17. package/dist/cjs/renderers/react/module-federation.js +1 -1
  18. package/dist/cjs/renderers/react/profile.js +6 -6
  19. package/dist/cjs/renderers/react/redact-integration-plugin.js +24 -47
  20. package/dist/cjs/renderers/react/router-bindings.js +4 -4
  21. package/dist/cjs/renderers/react/rsc-disabled-plugin.js +2 -2
  22. package/dist/esm/native-composition/native-module-federation.mjs +3 -1
  23. package/dist/esm/native-composition/native-prerender.mjs +1 -1
  24. package/dist/esm/native-composition/native-server-plugin.mjs +2 -0
  25. package/dist/esm/native-composition/type-checker.mjs +2 -0
  26. package/dist/esm/renderers/react/adapter.mjs +1 -1
  27. package/dist/esm/renderers/react/profile.mjs +6 -6
  28. package/dist/esm/renderers/react/redact-integration-plugin.mjs +21 -47
  29. package/dist/esm/renderers/react/router-bindings.mjs +4 -4
  30. package/dist/esm-node/native-composition/native-module-federation.mjs +3 -1
  31. package/dist/esm-node/native-composition/native-prerender.mjs +1 -1
  32. package/dist/esm-node/native-composition/native-server-plugin.mjs +2 -0
  33. package/dist/esm-node/native-composition/type-checker.mjs +2 -0
  34. package/dist/esm-node/renderers/react/adapter.mjs +1 -1
  35. package/dist/esm-node/renderers/react/profile.mjs +6 -6
  36. package/dist/esm-node/renderers/react/redact-integration-plugin.mjs +21 -47
  37. package/dist/esm-node/renderers/react/router-bindings.mjs +4 -4
  38. package/dist/types/renderers/react/redact-integration-plugin.d.ts +4 -3
  39. package/dist/types/renderers/react/types.d.ts +1 -1
  40. package/dist/types-esm/renderers/react/redact-integration-plugin.d.mts +4 -3
  41. package/dist/types-esm/renderers/react/types.d.mts +1 -1
  42. package/package.json +118 -47
  43. package/src/native-composition/native-module-federation.ts +12 -2
  44. package/src/native-composition/native-server-plugin.ts +2 -0
  45. package/src/native-composition/type-checker.ts +2 -0
  46. package/src/renderers/react/profile.ts +6 -6
  47. package/src/renderers/react/redact-integration-plugin.ts +59 -59
  48. package/src/renderers/react/router-bindings.ts +4 -4
  49. package/src/renderers/react/types.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
- return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ return "u" < typeof document ? require('url'.replace('', '')).pathToFileURL(__filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_require__ = {};
6
6
  (()=>{
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
- return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ return "u" < typeof document ? require('url'.replace('', '')).pathToFileURL(__filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_require__ = {};
6
6
  (()=>{
@@ -50,9 +50,9 @@ function nativeEntryCommandPlugin() {
50
50
  }
51
51
  };
52
52
  }
53
- __webpack_require__.d(__webpack_exports__, {
54
- createRouteGenerationCommand: ()=>createRouteGenerationCommand,
55
- nativeEntryCommandPlugin: ()=>nativeEntryCommandPlugin
53
+ __webpack_require__.d(__webpack_exports__, {}, {
54
+ createRouteGenerationCommand: createRouteGenerationCommand,
55
+ nativeEntryCommandPlugin: nativeEntryCommandPlugin
56
56
  });
57
57
  exports.createRouteGenerationCommand = __webpack_exports__.createRouteGenerationCommand;
58
58
  exports.nativeEntryCommandPlugin = __webpack_exports__.nativeEntryCommandPlugin;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
- return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ return "u" < typeof document ? require('url'.replace('', '')).pathToFileURL(__filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_require__ = {};
6
6
  (()=>{
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
- return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ return "u" < typeof document ? require('url'.replace('', '')).pathToFileURL(__filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_require__ = {};
6
6
  (()=>{
@@ -698,9 +698,11 @@ function nativeModuleFederationPlugin(renderer) {
698
698
  await splitClientEntries(chain, internalDirectory);
699
699
  });
700
700
  api.modifyRspackConfig(async (config, { environment })=>{
701
+ if ('client' !== environment.name && 'server' !== environment.name) return;
701
702
  const authored = await load();
703
+ const enabled = authored && ('client' === environment.name || serverRendered(authored));
704
+ if ('object' == typeof config.cache && 'persistent' === config.cache.type) config.cache.version = `${config.cache.version ?? ''}-ultramodern-mf-${enabled ? 'on' : 'off'}`;
702
705
  if (!authored) return;
703
- if ('client' !== environment.name && 'server' !== environment.name) return;
704
706
  const context = api.getAppContext();
705
707
  const address = context.builder?.context.devServer;
706
708
  if ('dev' === context.command && address) {
@@ -191,7 +191,7 @@ function markPrerenderedDocument(html) {
191
191
  const marker = `<meta name="${data_namespaceObject.PRERENDERED_DOCUMENT_META}" content="static-data">`;
192
192
  let close = -1;
193
193
  let templates = 0;
194
- for (const match of html.matchAll(/<(script|style|title|textarea|noscript|xmp|iframe|noembed|noframes)\b(?:"[^"]*"|'[^']*'|[^>"'])*>[\s\S]*?<\/\1\s*>|<!--[\s\S]*?-->|<\/(head|template)\s*>|<[a-z][^\s/>]*(?:"[^"]*"|'[^']*'|[^>"'])*>/giu)){
194
+ for (const match of html.matchAll(/<(script|style|title|textarea|noscript|xmp|iframe|noembed|noframes)\b(?:"[^"]*"|'[^']*'|[^>"'])*>[\s\S]*?<\/\1\s*>|<\x21--[\s\S]*?--\x3e|<\/(head|template)\s*>|<[a-z][^\s/>]*(?:"[^"]*"|'[^']*'|[^>"'])*>/giu)){
195
195
  const token = match[0];
196
196
  if (/^<template\b/iu.test(token)) templates += 1;
197
197
  else if (match[2]?.toLowerCase() === 'template') templates = Math.max(0, templates - 1);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
- return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ return "u" < typeof document ? require('url'.replace('', '')).pathToFileURL(__filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_require__ = {};
6
6
  (()=>{
@@ -53,6 +53,7 @@ const identity_namespaceObject = require("@modern-js/renderer-core/identity");
53
53
  const server_namespaceObject = require("@modern-js/renderer-core/server");
54
54
  const fileReader_namespaceObject = require("@modern-js/runtime-utils/fileReader");
55
55
  const server_runtime_extensions_namespaceObject = require("@modern-js/server-runtime-extensions");
56
+ const render_resources_namespaceObject = require("@modern-js/server-runtime-extensions/render-resources");
56
57
  const node_namespaceObject = require("@modern-js/server-runtime-extensions/static-serving/node");
57
58
  const utils_namespaceObject = require("@modern-js/utils");
58
59
  const universal_namespaceObject = require("@modern-js/utils/universal");
@@ -324,6 +325,7 @@ function nativeServerPlugin(options) {
324
325
  return {
325
326
  name: '@modern-js/native-node-server',
326
327
  usePlugins: [
328
+ (0, render_resources_namespaceObject.injectRenderResourcesPlugin)(),
327
329
  ...options.resolveDevelopmentSnapshot ? [] : [
328
330
  (0, server_runtime_extensions_namespaceObject.injectMfAssetCacheHeadersPlugin)(),
329
331
  (0, node_namespaceObject.injectStaticServingPlugin)()
@@ -36,9 +36,9 @@ function usesRedact(config) {
36
36
  validateRedactConfig(config.redact);
37
37
  return false !== config.redact && !config.server?.rsc;
38
38
  }
39
- __webpack_require__.d(__webpack_exports__, {
40
- usesRedact: ()=>usesRedact,
41
- validateRedactConfig: ()=>validateRedactConfig
39
+ __webpack_require__.d(__webpack_exports__, {}, {
40
+ usesRedact: usesRedact,
41
+ validateRedactConfig: validateRedactConfig
42
42
  });
43
43
  exports.usesRedact = __webpack_exports__.usesRedact;
44
44
  exports.validateRedactConfig = __webpack_exports__.validateRedactConfig;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
- return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ return "u" < typeof document ? require('url'.replace('', '')).pathToFileURL(__filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_require__ = {};
6
6
  (()=>{
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
- return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ return "u" < typeof document ? require('url'.replace('', '')).pathToFileURL(__filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_require__ = {};
6
6
  (()=>{
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
- return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ return "u" < typeof document ? require('url'.replace('', '')).pathToFileURL(__filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_require__ = {};
6
6
  (()=>{
@@ -42,6 +42,7 @@ __webpack_require__.d(__webpack_exports__, {
42
42
  });
43
43
  const external_node_path_namespaceObject = require("node:path");
44
44
  var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
45
+ const native_server_compiler_namespaceObject = require("@modern-js/app-tools-extensions/native-server-compiler");
45
46
  const native_type_checker_namespaceObject = require("@modern-js/app-tools-extensions/native-type-checker");
46
47
  const external_renderer_profile_js_namespaceObject = require("./renderer-profile.js");
47
48
  const rendererTypeCheckerOptions = (renderer)=>({
@@ -61,6 +62,7 @@ const rendererTypeCheckerPlugin = (renderer)=>({
61
62
  setup (api) {
62
63
  api.config(()=>({
63
64
  tools: {
65
+ serverCompiler: native_server_compiler_namespaceObject.nativeServerCompiler,
64
66
  tsChecker: rendererTypeCheckerOptions(renderer),
65
67
  bundlerChain (chain, utils) {
66
68
  const pluginId = utils.CHAIN_ID.PLUGIN.TS_CHECKER;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
- return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ return "u" < typeof document ? require('url'.replace('', '')).pathToFileURL(__filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_require__ = {};
6
6
  (()=>{
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
- return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ return "u" < typeof document ? require('url'.replace('', '')).pathToFileURL(__filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_require__ = {};
6
6
  (()=>{
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
- return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ return "u" < typeof document ? require('url'.replace('', '')).pathToFileURL(__filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_require__ = {};
6
6
  (()=>{
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
- return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ return "u" < typeof document ? require('url'.replace('', '')).pathToFileURL(__filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_require__ = {};
6
6
  (()=>{
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
- return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ return "u" < typeof document ? require('url'.replace('', '')).pathToFileURL(__filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_require__ = {};
6
6
  (()=>{
@@ -31,7 +31,7 @@ const reactProfile = {
31
31
  renderer: 'react',
32
32
  status: 'stable',
33
33
  protocolVersion: 1,
34
- minimumNode: '26.12.0',
34
+ minimumNode: '26.13.1',
35
35
  hmr: {
36
36
  editedBoundary: 'may-reset',
37
37
  unaffectedComponents: 'preserved',
@@ -49,9 +49,9 @@ const reactProfile = {
49
49
  },
50
50
  router: {
51
51
  name: 'react-router',
52
- version: '7.18.4',
52
+ version: '8.5.1',
53
53
  coreName: 'react-router',
54
- coreVersion: '7.18.4'
54
+ coreVersion: '8.5.1'
55
55
  },
56
56
  sourceExtensions: [
57
57
  '.tsx',
@@ -63,14 +63,14 @@ const reactProfile = {
63
63
  dependencies: {
64
64
  react: '19.3.1',
65
65
  'react-dom': '19.3.1',
66
- '@modern-js/runtime': '3.9.0',
66
+ '@modern-js/runtime': '3.11.3',
67
67
  '@modern-js/i18n-integration': '3.8.3',
68
68
  '@modern-js/runtime-renderer-extensions': '3.8.3',
69
69
  '@rsbuild/plugin-react': '2.1.1',
70
70
  '@rsbuild/plugin-svgr': '2.0.5',
71
71
  '@loadable/component': '5.16.7',
72
- 'react-helmet-async': '3.0.0',
73
- 'react-router': '7.18.4'
72
+ 'react-helmet-async': '3.1.0',
73
+ 'react-router': '8.5.1'
74
74
  },
75
75
  capabilities: {
76
76
  worker: true,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
- return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ return "u" < typeof document ? require('url'.replace('', '')).pathToFileURL(__filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_require__ = {};
6
6
  (()=>{
@@ -47,6 +47,7 @@ __webpack_require__.d(__webpack_exports__, {
47
47
  createRedactBuilderPlugin: ()=>createRedactBuilderPlugin,
48
48
  mergeRedactAliases: ()=>mergeRedactAliases,
49
49
  redactArtifactDigest: ()=>redactArtifactDigest,
50
+ redactRuntimeIdentity: ()=>redactRuntimeIdentity,
50
51
  resolveRedactAliases: ()=>resolveRedactAliases,
51
52
  ultramodernRedactIntegrationPlugin: ()=>ultramodernRedactIntegrationPlugin,
52
53
  usesRedact: ()=>redact_config_js_namespaceObject.usesRedact,
@@ -57,9 +58,7 @@ const external_node_fs_namespaceObject = require("node:fs");
57
58
  const external_node_module_namespaceObject = require("node:module");
58
59
  const external_node_path_namespaceObject = require("node:path");
59
60
  var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
60
- const external_node_url_namespaceObject = require("node:url");
61
61
  const utils_namespaceObject = require("@modern-js/utils");
62
- const external_rsbuild_redact_plugin_namespaceObject = require("rsbuild-redact-plugin");
63
62
  const redact_config_js_namespaceObject = require("../../native-composition/redact-config.js");
64
63
  const renderer_installed_profile_js_namespaceObject = require("../../native-composition/renderer-installed-profile.js");
65
64
  const REDACT_ALIASES = {
@@ -86,14 +85,17 @@ const REDACT_ALIASES = {
86
85
  'use-sync-external-store/shim/with-selector.js': '@tanstack/redact'
87
86
  };
88
87
  const frameworkRequire = (0, external_node_module_namespaceObject.createRequire)(__rslib_import_meta_url__);
89
- const frameworkDirectory = ()=>(0, renderer_installed_profile_js_namespaceObject.readRendererFrameworkPackage)({
90
- specifier: '@modern-js/ultramodern-app-tools',
91
- filename: (0, external_node_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__)
92
- }).directory;
88
+ function redactRuntimeIdentity(require1 = frameworkRequire) {
89
+ const owner = (0, renderer_installed_profile_js_namespaceObject.readRendererFrameworkPackage)({
90
+ specifier: '@tanstack/redact',
91
+ filename: require1.resolve('@tanstack/redact')
92
+ });
93
+ return `${owner.name}@${owner.version}`;
94
+ }
93
95
  const REDACT_PATCH_MARKER = '// ultramodern-redact-patch: v1';
94
- function assertRedactPatch(read = external_node_fs_namespaceObject.readFileSync) {
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.2 dependency; unpatched Redact must not ship. Set redact: false to use real React instead.`);
96
+ function assertRedactPatch(read = external_node_fs_namespaceObject.readFileSync, require1 = frameworkRequire) {
97
+ const stream = external_node_path_default().join(external_node_path_default().dirname(require1.resolve('@tanstack/redact/server')), 'stream.js');
98
+ if (read(stream, 'utf8').split(/\r?\n/, 1)[0] !== REDACT_PATCH_MARKER) throw new Error(`[ultramodern] ${redactRuntimeIdentity(require1)} requires the UltraModern reviewed SSR patch (${REDACT_PATCH_MARKER}) in ${stream}. Install the framework's npm:@bleedingdev/tanstack-redact@0.3.2 dependency; unpatched Redact must not ship. Set redact: false to use real React instead.`);
97
99
  }
98
100
  function redactArtifactDigest(directory = external_node_path_default().resolve(external_node_path_default().dirname(frameworkRequire.resolve('@tanstack/redact')), '..')) {
99
101
  const hash = (0, external_node_crypto_namespaceObject.createHash)('sha256');
@@ -168,6 +170,7 @@ function bundleRedactRuntime(externals) {
168
170
  }
169
171
  function createRedactBuilderPlugin(config, testing = {}) {
170
172
  const enabled = (0, redact_config_js_namespaceObject.usesRedact)(config);
173
+ const require1 = testing.require ?? frameworkRequire;
171
174
  return {
172
175
  name: enabled ? 'ultramodern:react:redact' : 'ultramodern:react:runtime-cache',
173
176
  setup (api) {
@@ -185,12 +188,12 @@ function createRedactBuilderPlugin(config, testing = {}) {
185
188
  cacheDigest: [
186
189
  ...options.cacheDigest ?? [],
187
190
  ...enabled ? [
188
- '@tanstack/redact@0.2.1',
191
+ redactRuntimeIdentity(require1),
189
192
  REDACT_PATCH_MARKER,
190
- redactArtifactDigest(),
193
+ redactArtifactDigest(external_node_path_default().resolve(external_node_path_default().dirname(require1.resolve('@tanstack/redact')), '..')),
191
194
  `redact-view-transitions:${viewTransitions}`
192
195
  ] : [
193
- `react@${frameworkRequire('react/package.json').version}`,
196
+ `react@${require1('react/package.json').version}`,
194
197
  'ultramodern:real-react-cache:v1'
195
198
  ]
196
199
  ]
@@ -199,47 +202,19 @@ function createRedactBuilderPlugin(config, testing = {}) {
199
202
  };
200
203
  });
201
204
  if (!enabled) return;
202
- const isCsr = ()=>Object.entries(api.getNormalizedConfig().environments).every(([name, env])=>'web' === env.output.target && 'workerSSR' !== name);
203
- const publicApplied = new WeakSet();
204
- const publicPlugin = (0, external_rsbuild_redact_plugin_namespaceObject.pluginRedact)({
205
- resolveFrom: frameworkDirectory(),
206
- viewTransitions
207
- });
208
- publicPlugin.setup({
209
- ...api,
210
- modifyRspackConfig (hook) {
211
- const handler = 'function' == typeof hook ? hook : hook.handler;
212
- api.modifyRspackConfig({
213
- order: 'post',
214
- async handler (rspackConfig, utils) {
215
- if (!isCsr()) return;
216
- const isolated = {
217
- ...rspackConfig,
218
- resolve: {
219
- ...rspackConfig.resolve,
220
- alias: {}
221
- }
222
- };
223
- await handler(isolated, utils);
224
- if (Object.hasOwn(isolated.resolve.alias, 'react$')) publicApplied.add(rspackConfig);
225
- rspackConfig.resolve ??= {};
226
- rspackConfig.resolve.alias = mergeRedactAliases(rspackConfig.resolve.alias, isolated.resolve.alias);
227
- rspackConfig.plugins = isolated.plugins;
228
- }
229
- });
230
- }
231
- });
205
+ const reactVersion = require1('react/package.json').version;
206
+ if ('string' != typeof reactVersion || !reactVersion.startsWith('19.')) throw new Error(`[ultramodern] Redact requires React 19; found ${String(reactVersion)}. Set redact: false to use real React instead.`);
232
207
  api.modifyRspackConfig({
233
208
  order: 'post',
234
209
  handler (rspackConfig, { rspack, environment }) {
235
- (testing.assertPatch ?? assertRedactPatch)();
236
- const aliases = resolveRedactAliases();
210
+ (testing.assertPatch ?? (()=>assertRedactPatch(external_node_fs_namespaceObject.readFileSync, require1)))();
211
+ const aliases = resolveRedactAliases(require1);
237
212
  rspackConfig.resolve ??= {};
238
213
  rspackConfig.resolve.alias = mergeRedactAliases(rspackConfig.resolve.alias, aliases);
239
214
  rspackConfig.externals = bundleRedactRuntime(rspackConfig.externals);
240
215
  rspackConfig.plugins ??= [];
241
- if (!publicApplied.has(rspackConfig) && !viewTransitions) {
242
- const feature = external_node_path_default().resolve(external_node_path_default().dirname(frameworkRequire.resolve('@tanstack/redact')), '../dom/features/view-transition/index.js');
216
+ if (!viewTransitions) {
217
+ const feature = external_node_path_default().resolve(external_node_path_default().dirname(require1.resolve('@tanstack/redact')), '../dom/features/view-transition/index.js');
243
218
  rspackConfig.plugins.push(new rspack.NormalModuleReplacementPlugin(/[\\/]features[\\/]view-transition[\\/]index\.js$/, (data)=>{
244
219
  if (data.createData?.resource === feature) data.createData.resource = external_node_path_default().join(external_node_path_default().dirname(feature), 'stub.js');
245
220
  }));
@@ -280,6 +255,7 @@ exports.bundleRedactRuntime = __webpack_exports__.bundleRedactRuntime;
280
255
  exports.createRedactBuilderPlugin = __webpack_exports__.createRedactBuilderPlugin;
281
256
  exports.mergeRedactAliases = __webpack_exports__.mergeRedactAliases;
282
257
  exports.redactArtifactDigest = __webpack_exports__.redactArtifactDigest;
258
+ exports.redactRuntimeIdentity = __webpack_exports__.redactRuntimeIdentity;
283
259
  exports.resolveRedactAliases = __webpack_exports__.resolveRedactAliases;
284
260
  exports.ultramodernRedactIntegrationPlugin = __webpack_exports__.ultramodernRedactIntegrationPlugin;
285
261
  exports.usesRedact = __webpack_exports__.usesRedact;
@@ -292,6 +268,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
292
268
  "createRedactBuilderPlugin",
293
269
  "mergeRedactAliases",
294
270
  "redactArtifactDigest",
271
+ "redactRuntimeIdentity",
295
272
  "resolveRedactAliases",
296
273
  "ultramodernRedactIntegrationPlugin",
297
274
  "usesRedact",
@@ -51,16 +51,16 @@ const TANSTACK_OWNER = '@modern-js/plugin-tanstack';
51
51
  const DECLARED_REACT_ROUTER = Object.freeze({
52
52
  framework: 'react-router',
53
53
  name: 'react-router',
54
- version: '7.18.4',
54
+ version: '8.5.1',
55
55
  coreName: 'react-router',
56
- coreVersion: '7.18.4'
56
+ coreVersion: '8.5.1'
57
57
  });
58
58
  const DECLARED_TANSTACK_ROUTER = Object.freeze({
59
59
  framework: 'tanstack',
60
60
  name: '@tanstack/react-router',
61
- version: '1.170.44',
61
+ version: '1.170.46',
62
62
  coreName: '@tanstack/router-core',
63
- coreVersion: '1.171.37'
63
+ coreVersion: '1.171.39'
64
64
  });
65
65
  function readInstalledPackage(fromDirectory, name) {
66
66
  let manifestFile;
@@ -105,8 +105,8 @@ function rscDisabledRuntimePlugin() {
105
105
  }
106
106
  };
107
107
  }
108
- __webpack_require__.d(__webpack_exports__, {
109
- rscDisabledRuntimePlugin: ()=>rscDisabledRuntimePlugin
108
+ __webpack_require__.d(__webpack_exports__, {}, {
109
+ rscDisabledRuntimePlugin: rscDisabledRuntimePlugin
110
110
  });
111
111
  exports.rscDisabledRuntimePlugin = __webpack_exports__.rscDisabledRuntimePlugin;
112
112
  for(var __rspack_i in __webpack_exports__)if (-1 === [
@@ -630,9 +630,11 @@ function nativeModuleFederationPlugin(renderer) {
630
630
  await splitClientEntries(chain, internalDirectory);
631
631
  });
632
632
  api.modifyRspackConfig(async (config, { environment })=>{
633
+ if ('client' !== environment.name && 'server' !== environment.name) return;
633
634
  const authored = await load();
635
+ const enabled = authored && ('client' === environment.name || serverRendered(authored));
636
+ if ('object' == typeof config.cache && 'persistent' === config.cache.type) config.cache.version = `${config.cache.version ?? ''}-ultramodern-mf-${enabled ? 'on' : 'off'}`;
634
637
  if (!authored) return;
635
- if ('client' !== environment.name && 'server' !== environment.name) return;
636
638
  const context = api.getAppContext();
637
639
  const address = context.builder?.context.devServer;
638
640
  if ('dev' === context.command && address) {
@@ -140,7 +140,7 @@ function markPrerenderedDocument(html) {
140
140
  const marker = `<meta name="${PRERENDERED_DOCUMENT_META}" content="static-data">`;
141
141
  let close = -1;
142
142
  let templates = 0;
143
- for (const match of html.matchAll(/<(script|style|title|textarea|noscript|xmp|iframe|noembed|noframes)\b(?:"[^"]*"|'[^']*'|[^>"'])*>[\s\S]*?<\/\1\s*>|<!--[\s\S]*?-->|<\/(head|template)\s*>|<[a-z][^\s/>]*(?:"[^"]*"|'[^']*'|[^>"'])*>/giu)){
143
+ for (const match of html.matchAll(/<(script|style|title|textarea|noscript|xmp|iframe|noembed|noframes)\b(?:"[^"]*"|'[^']*'|[^>"'])*>[\s\S]*?<\/\1\s*>|<\x21--[\s\S]*?--\x3e|<\/(head|template)\s*>|<[a-z][^\s/>]*(?:"[^"]*"|'[^']*'|[^>"'])*>/giu)){
144
144
  const token = match[0];
145
145
  if (/^<template\b/iu.test(token)) templates += 1;
146
146
  else if (match[2]?.toLowerCase() === 'template') templates = Math.max(0, templates - 1);
@@ -5,6 +5,7 @@ import { RENDERER_IDENTITY_HEADER, assertRendererIdentity, identityCacheKey, ser
5
5
  import { dispatchNativeNodeRequest, rejectNativeRscRequest, validateNativeClientAssetManifest } from "@modern-js/renderer-core/server";
6
6
  import { fileReader } from "@modern-js/runtime-utils/fileReader";
7
7
  import { injectMfAssetCacheHeadersPlugin } from "@modern-js/server-runtime-extensions";
8
+ import { injectRenderResourcesPlugin } from "@modern-js/server-runtime-extensions/render-resources";
8
9
  import { injectStaticServingPlugin } from "@modern-js/server-runtime-extensions/static-serving/node";
9
10
  import { getEntryOptions } from "@modern-js/utils";
10
11
  import { cutNameByHyphen } from "@modern-js/utils/universal";
@@ -276,6 +277,7 @@ function nativeServerPlugin(options) {
276
277
  return {
277
278
  name: '@modern-js/native-node-server',
278
279
  usePlugins: [
280
+ injectRenderResourcesPlugin(),
279
281
  ...options.resolveDevelopmentSnapshot ? [] : [
280
282
  injectMfAssetCacheHeadersPlugin(),
281
283
  injectStaticServingPlugin()
@@ -1,4 +1,5 @@
1
1
  import node_path from "node:path";
2
+ import { nativeServerCompiler } from "@modern-js/app-tools-extensions/native-server-compiler";
2
3
  import { configureUltramodernTypeChecker, resolveNativeTypeCheckerCommand } from "@modern-js/app-tools-extensions/native-type-checker";
3
4
  import { resolveCandidateRendererProfile } from "./renderer-profile.mjs";
4
5
  const rendererTypeCheckerOptions = (renderer)=>({
@@ -18,6 +19,7 @@ const rendererTypeCheckerPlugin = (renderer)=>({
18
19
  setup (api) {
19
20
  api.config(()=>({
20
21
  tools: {
22
+ serverCompiler: nativeServerCompiler,
21
23
  tsChecker: rendererTypeCheckerOptions(renderer),
22
24
  bundlerChain (chain, utils) {
23
25
  const pluginId = utils.CHAIN_ID.PLUGIN.TS_CHECKER;
@@ -48,6 +48,6 @@ const reactRendererAdapter = defineRendererAdapter({
48
48
  request: '@modern-js/i18n-integration'
49
49
  }
50
50
  ],
51
- compose: compose
51
+ compose
52
52
  });
53
53
  export { reactRendererAdapter };
@@ -2,7 +2,7 @@ const reactProfile = {
2
2
  renderer: 'react',
3
3
  status: 'stable',
4
4
  protocolVersion: 1,
5
- minimumNode: '26.12.0',
5
+ minimumNode: '26.13.1',
6
6
  hmr: {
7
7
  editedBoundary: 'may-reset',
8
8
  unaffectedComponents: 'preserved',
@@ -20,9 +20,9 @@ const reactProfile = {
20
20
  },
21
21
  router: {
22
22
  name: 'react-router',
23
- version: '7.18.4',
23
+ version: '8.5.1',
24
24
  coreName: 'react-router',
25
- coreVersion: '7.18.4'
25
+ coreVersion: '8.5.1'
26
26
  },
27
27
  sourceExtensions: [
28
28
  '.tsx',
@@ -34,14 +34,14 @@ const reactProfile = {
34
34
  dependencies: {
35
35
  react: '19.3.1',
36
36
  'react-dom': '19.3.1',
37
- '@modern-js/runtime': '3.9.0',
37
+ '@modern-js/runtime': '3.11.3',
38
38
  '@modern-js/i18n-integration': '3.8.3',
39
39
  '@modern-js/runtime-renderer-extensions': '3.8.3',
40
40
  '@rsbuild/plugin-react': '2.1.1',
41
41
  '@rsbuild/plugin-svgr': '2.0.5',
42
42
  '@loadable/component': '5.16.7',
43
- 'react-helmet-async': '3.0.0',
44
- 'react-router': '7.18.4'
43
+ 'react-helmet-async': '3.1.0',
44
+ 'react-router': '8.5.1'
45
45
  },
46
46
  capabilities: {
47
47
  worker: true,