@bleedingdev/modern-js-app-tools 3.5.0-ultramodern.98 → 3.8.1-ultramodern.1

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 (334) hide show
  1. package/bin/modern-bundle-docs.js +7 -0
  2. package/dist/cjs/builder/generator/createBuilderProviderConfig.js +5 -1
  3. package/dist/cjs/builder/generator/getBuilderEnvironments.js +80 -11
  4. package/dist/cjs/bundleDocs.js +114 -0
  5. package/dist/cjs/commands/build.js +2 -1
  6. package/dist/cjs/commands/deploy.js +4 -2
  7. package/dist/cjs/commands/index.js +0 -4
  8. package/dist/cjs/config/default.js +2 -0
  9. package/dist/cjs/index.js +56 -15
  10. package/dist/cjs/plugins/analyze/index.js +2 -2
  11. package/dist/cjs/plugins/analyze/utils.js +3 -2
  12. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/index.js +1 -1
  13. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.js +94 -18
  14. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +1 -0
  15. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +14 -0
  16. package/dist/cjs/plugins/initialize/index.js +4 -3
  17. package/dist/cjs/plugins/serverBuild.js +3 -2
  18. package/dist/cjs/ultramodern-release-envelope/framework-output.js +109 -57
  19. package/dist/esm/builder/generator/createBuilderProviderConfig.mjs +5 -1
  20. package/dist/esm/builder/generator/getBuilderEnvironments.mjs +70 -10
  21. package/dist/esm/bundleDocs.mjs +62 -0
  22. package/dist/esm/commands/build.mjs +2 -1
  23. package/dist/esm/commands/deploy.mjs +4 -2
  24. package/dist/esm/commands/index.mjs +0 -4
  25. package/dist/esm/config/default.mjs +2 -0
  26. package/dist/esm/index.mjs +15 -1
  27. package/dist/esm/plugins/analyze/index.mjs +2 -2
  28. package/dist/esm/plugins/analyze/utils.mjs +3 -2
  29. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +1 -1
  30. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +93 -18
  31. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +1 -0
  32. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +14 -0
  33. package/dist/esm/plugins/initialize/index.mjs +4 -3
  34. package/dist/esm/plugins/serverBuild.mjs +3 -2
  35. package/dist/esm/ultramodern-release-envelope/framework-output.mjs +107 -58
  36. package/dist/esm-node/builder/generator/createBuilderProviderConfig.mjs +5 -1
  37. package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +70 -10
  38. package/dist/esm-node/bundleDocs.mjs +63 -0
  39. package/dist/esm-node/commands/build.mjs +2 -1
  40. package/dist/esm-node/commands/deploy.mjs +4 -2
  41. package/dist/esm-node/commands/index.mjs +0 -4
  42. package/dist/esm-node/config/default.mjs +2 -0
  43. package/dist/esm-node/index.mjs +15 -1
  44. package/dist/esm-node/plugins/analyze/index.mjs +2 -2
  45. package/dist/esm-node/plugins/analyze/utils.mjs +3 -2
  46. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +1 -1
  47. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +93 -18
  48. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +1 -0
  49. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +14 -0
  50. package/dist/esm-node/plugins/initialize/index.mjs +4 -3
  51. package/dist/esm-node/plugins/serverBuild.mjs +3 -2
  52. package/dist/esm-node/ultramodern-release-envelope/framework-output.mjs +107 -58
  53. package/dist/types/builder/generator/getBuilderEnvironments.d.ts +29 -0
  54. package/dist/types/bundleDocs.d.ts +20 -0
  55. package/dist/types/commands/deploy.d.ts +2 -1
  56. package/dist/types/index.d.ts +4 -1
  57. package/dist/types/plugins/analyze/utils.d.ts +1 -1
  58. package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.d.ts +1 -1
  59. package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.d.mts +1 -1
  60. package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.d.mts +13 -0
  61. package/dist/types/types/config/dev.d.ts +6 -0
  62. package/dist/types/ultramodern-release-envelope/framework-output.d.ts +1 -0
  63. package/docs/apis/app/commands.md +231 -0
  64. package/docs/apis/app/hooks/api/lambda.md +9 -0
  65. package/docs/apis/app/hooks/config/favicon.md +24 -0
  66. package/docs/apis/app/hooks/config/html.md +5 -0
  67. package/docs/apis/app/hooks/config/icon.md +24 -0
  68. package/docs/apis/app/hooks/config/mock.md +6 -0
  69. package/docs/apis/app/hooks/config/public.md +26 -0
  70. package/docs/apis/app/hooks/config/upload.md +50 -0
  71. package/docs/apis/app/hooks/modern-config.md +5 -0
  72. package/docs/apis/app/hooks/server/server.md +5 -0
  73. package/docs/apis/app/hooks/shared.md +3 -0
  74. package/docs/apis/app/hooks/src/app.md +30 -0
  75. package/docs/apis/app/hooks/src/entry.md +34 -0
  76. package/docs/apis/app/hooks/src/entry.server.md +51 -0
  77. package/docs/apis/app/hooks/src/modern.runtime.md +5 -0
  78. package/docs/apis/app/hooks/src/routes.md +86 -0
  79. package/docs/apis/app/hooks/src/server.md +3 -0
  80. package/docs/apis/app/runtime/bff/use-backend-context.md +27 -0
  81. package/docs/apis/app/runtime/core/create-root.md +19 -0
  82. package/docs/apis/app/runtime/core/render.md +39 -0
  83. package/docs/apis/app/runtime/core/runtime-context.md +156 -0
  84. package/docs/apis/app/runtime/router/router.md +283 -0
  85. package/docs/apis/app/runtime/ssr/no-ssr.md +35 -0
  86. package/docs/apis/app/runtime/ssr/renderStreaming.md +67 -0
  87. package/docs/apis/app/runtime/ssr/renderString.md +60 -0
  88. package/docs/apis/app/runtime/ssr/requestHandler.md +44 -0
  89. package/docs/apis/app/runtime/utility/css-in-js.md +40 -0
  90. package/docs/apis/app/runtime/utility/head.md +35 -0
  91. package/docs/apis/app/runtime/utility/loadable.md +82 -0
  92. package/docs/community/blog/2022-0708-updates.md +91 -0
  93. package/docs/community/blog/2022-0910-updates.md +76 -0
  94. package/docs/community/blog/overview.md +63 -0
  95. package/docs/community/blog/v2-release-note.md +238 -0
  96. package/docs/community/blog/v3-release-note.md +622 -0
  97. package/docs/community/contributing-guide.md +252 -0
  98. package/docs/community/releases.md +23 -0
  99. package/docs/community/showcase.md +24 -0
  100. package/docs/community/team.md +14 -0
  101. package/docs/configure/app/bff/cross-project.md +20 -0
  102. package/docs/configure/app/bff/effect.md +313 -0
  103. package/docs/configure/app/bff/prefix.md +29 -0
  104. package/docs/configure/app/bff/runtime-framework.md +26 -0
  105. package/docs/configure/app/builder-plugins.md +66 -0
  106. package/docs/configure/app/dev/asset-prefix.md +13 -0
  107. package/docs/configure/app/dev/before-start-url.md +17 -0
  108. package/docs/configure/app/dev/client.md +41 -0
  109. package/docs/configure/app/dev/hmr.md +10 -0
  110. package/docs/configure/app/dev/host.md +18 -0
  111. package/docs/configure/app/dev/https.md +77 -0
  112. package/docs/configure/app/dev/lazy-compilation.md +39 -0
  113. package/docs/configure/app/dev/live-reload.md +10 -0
  114. package/docs/configure/app/dev/mock-dir.md +31 -0
  115. package/docs/configure/app/dev/progress-bar.md +19 -0
  116. package/docs/configure/app/dev/server.md +124 -0
  117. package/docs/configure/app/dev/setup-middlewares.md +32 -0
  118. package/docs/configure/app/dev/start-url.md +48 -0
  119. package/docs/configure/app/dev/watch-files.md +27 -0
  120. package/docs/configure/app/dev/write-to-disk.md +10 -0
  121. package/docs/configure/app/experiments/source-build.md +31 -0
  122. package/docs/configure/app/html/app-icon.md +28 -0
  123. package/docs/configure/app/html/crossorigin.md +10 -0
  124. package/docs/configure/app/html/favicon.md +16 -0
  125. package/docs/configure/app/html/inject.md +10 -0
  126. package/docs/configure/app/html/meta.md +24 -0
  127. package/docs/configure/app/html/mount-id.md +10 -0
  128. package/docs/configure/app/html/output-structure.md +10 -0
  129. package/docs/configure/app/html/script-loading.md +10 -0
  130. package/docs/configure/app/html/tags.md +15 -0
  131. package/docs/configure/app/html/template-parameters.md +33 -0
  132. package/docs/configure/app/html/template.md +10 -0
  133. package/docs/configure/app/html/title.md +18 -0
  134. package/docs/configure/app/output/asset-prefix.md +11 -0
  135. package/docs/configure/app/output/assets-retry.md +77 -0
  136. package/docs/configure/app/output/charset.md +10 -0
  137. package/docs/configure/app/output/clean-dist-path.md +16 -0
  138. package/docs/configure/app/output/convert-to-rem.md +79 -0
  139. package/docs/configure/app/output/copy.md +10 -0
  140. package/docs/configure/app/output/css-modules.md +48 -0
  141. package/docs/configure/app/output/data-uri-limit.md +26 -0
  142. package/docs/configure/app/output/disable-css-module-extension.md +55 -0
  143. package/docs/configure/app/output/disable-inline-runtime-chunk.md +41 -0
  144. package/docs/configure/app/output/disable-svgr.md +18 -0
  145. package/docs/configure/app/output/disable-ts-checker.md +49 -0
  146. package/docs/configure/app/output/dist-path.md +43 -0
  147. package/docs/configure/app/output/enable-asset-manifest.md +36 -0
  148. package/docs/configure/app/output/enable-css-module-tsdeclaration.md +28 -0
  149. package/docs/configure/app/output/enable-inline-route-manifests.md +16 -0
  150. package/docs/configure/app/output/externals.md +20 -0
  151. package/docs/configure/app/output/filename-hash.md +10 -0
  152. package/docs/configure/app/output/filename.md +55 -0
  153. package/docs/configure/app/output/inject-styles.md +10 -0
  154. package/docs/configure/app/output/inline-scripts.md +29 -0
  155. package/docs/configure/app/output/inline-styles.md +29 -0
  156. package/docs/configure/app/output/legal-comments.md +18 -0
  157. package/docs/configure/app/output/minify.md +22 -0
  158. package/docs/configure/app/output/override-browserslist.md +22 -0
  159. package/docs/configure/app/output/polyfill.md +12 -0
  160. package/docs/configure/app/output/source-map.md +30 -0
  161. package/docs/configure/app/output/split-route-chunks.md +16 -0
  162. package/docs/configure/app/output/ssg.md +81 -0
  163. package/docs/configure/app/output/ssgByEntries.md +90 -0
  164. package/docs/configure/app/output/svg-default-export.md +30 -0
  165. package/docs/configure/app/output/temp-dir.md +20 -0
  166. package/docs/configure/app/performance/build-cache.md +44 -0
  167. package/docs/configure/app/performance/chunk-split.md +40 -0
  168. package/docs/configure/app/performance/dns-prefetch.md +15 -0
  169. package/docs/configure/app/performance/preconnect.md +16 -0
  170. package/docs/configure/app/performance/prefetch.md +21 -0
  171. package/docs/configure/app/performance/preload.md +23 -0
  172. package/docs/configure/app/performance/print-file-size.md +40 -0
  173. package/docs/configure/app/performance/profile.md +10 -0
  174. package/docs/configure/app/performance/remove-console.md +10 -0
  175. package/docs/configure/app/performance/remove-moment-locale.md +10 -0
  176. package/docs/configure/app/performance/rsdoctor.md +38 -0
  177. package/docs/configure/app/plugins.md +59 -0
  178. package/docs/configure/app/resolve/alias-strategy.md +10 -0
  179. package/docs/configure/app/resolve/alias.md +9 -0
  180. package/docs/configure/app/resolve/condition-names.md +13 -0
  181. package/docs/configure/app/resolve/dedupe.md +9 -0
  182. package/docs/configure/app/resolve/extensions.md +13 -0
  183. package/docs/configure/app/runtime/0-intro.md +58 -0
  184. package/docs/configure/app/runtime/plugins.md +58 -0
  185. package/docs/configure/app/runtime/router.md +35 -0
  186. package/docs/configure/app/security/check-syntax.md +69 -0
  187. package/docs/configure/app/security/nonce.md +15 -0
  188. package/docs/configure/app/security/sri.md +20 -0
  189. package/docs/configure/app/server/base-url.md +26 -0
  190. package/docs/configure/app/server/port.md +18 -0
  191. package/docs/configure/app/server/public-routes.md +22 -0
  192. package/docs/configure/app/server/routes.md +86 -0
  193. package/docs/configure/app/server/rsc.md +22 -0
  194. package/docs/configure/app/server/ssr-by-entries.md +25 -0
  195. package/docs/configure/app/server/ssr.md +80 -0
  196. package/docs/configure/app/server/tsconfig-path.md +59 -0
  197. package/docs/configure/app/source/alias-strategy.md +14 -0
  198. package/docs/configure/app/source/alias.md +23 -0
  199. package/docs/configure/app/source/config-dir.md +20 -0
  200. package/docs/configure/app/source/decorators.md +25 -0
  201. package/docs/configure/app/source/define.md +16 -0
  202. package/docs/configure/app/source/disable-default-entries.md +28 -0
  203. package/docs/configure/app/source/enable-async-entry.md +54 -0
  204. package/docs/configure/app/source/enable-async-pre-entry.md +26 -0
  205. package/docs/configure/app/source/entries-dir.md +35 -0
  206. package/docs/configure/app/source/entries.md +179 -0
  207. package/docs/configure/app/source/exclude.md +10 -0
  208. package/docs/configure/app/source/global-vars.md +106 -0
  209. package/docs/configure/app/source/include.md +36 -0
  210. package/docs/configure/app/source/main-entry-name.md +24 -0
  211. package/docs/configure/app/source/pre-entry.md +10 -0
  212. package/docs/configure/app/source/react-compiler.md +68 -0
  213. package/docs/configure/app/source/transform-import.md +27 -0
  214. package/docs/configure/app/split-chunks.md +17 -0
  215. package/docs/configure/app/tools/autoprefixer.md +44 -0
  216. package/docs/configure/app/tools/bundler-chain.md +26 -0
  217. package/docs/configure/app/tools/css-extract.md +33 -0
  218. package/docs/configure/app/tools/css-loader.md +17 -0
  219. package/docs/configure/app/tools/dev-server.md +113 -0
  220. package/docs/configure/app/tools/html-plugin.md +41 -0
  221. package/docs/configure/app/tools/less.md +81 -0
  222. package/docs/configure/app/tools/lightningcss-loader.md +35 -0
  223. package/docs/configure/app/tools/minify-css.md +53 -0
  224. package/docs/configure/app/tools/postcss.md +34 -0
  225. package/docs/configure/app/tools/rspack.md +10 -0
  226. package/docs/configure/app/tools/sass.md +78 -0
  227. package/docs/configure/app/tools/style-loader.md +10 -0
  228. package/docs/configure/app/tools/swc.md +65 -0
  229. package/docs/configure/app/tools/ts-checker.md +116 -0
  230. package/docs/configure/app/usage.md +276 -0
  231. package/docs/guides/advanced-features/bff/cross-project.md +109 -0
  232. package/docs/guides/advanced-features/bff/data-platform.md +116 -0
  233. package/docs/guides/advanced-features/bff/extend-server.md +120 -0
  234. package/docs/guides/advanced-features/bff/frameworks.md +243 -0
  235. package/docs/guides/advanced-features/bff/function.md +318 -0
  236. package/docs/guides/advanced-features/bff/operators.md +554 -0
  237. package/docs/guides/advanced-features/bff/sdk.md +116 -0
  238. package/docs/guides/advanced-features/bff/upload.md +101 -0
  239. package/docs/guides/advanced-features/bff.md +18 -0
  240. package/docs/guides/advanced-features/build-performance.md +130 -0
  241. package/docs/guides/advanced-features/compatibility.md +120 -0
  242. package/docs/guides/advanced-features/international/advanced.md +128 -0
  243. package/docs/guides/advanced-features/international/api.md +267 -0
  244. package/docs/guides/advanced-features/international/best-practices.md +286 -0
  245. package/docs/guides/advanced-features/international/configuration.md +228 -0
  246. package/docs/guides/advanced-features/international/locale-detection.md +126 -0
  247. package/docs/guides/advanced-features/international/quick-start.md +128 -0
  248. package/docs/guides/advanced-features/international/resource-loading.md +154 -0
  249. package/docs/guides/advanced-features/international/routing.md +173 -0
  250. package/docs/guides/advanced-features/international.md +27 -0
  251. package/docs/guides/advanced-features/low-level.md +46 -0
  252. package/docs/guides/advanced-features/page-performance/code-split.md +77 -0
  253. package/docs/guides/advanced-features/page-performance/inline-assets.md +159 -0
  254. package/docs/guides/advanced-features/page-performance/optimize-bundle.md +97 -0
  255. package/docs/guides/advanced-features/page-performance/react-compiler.md +51 -0
  256. package/docs/guides/advanced-features/server-monitor/logger.md +41 -0
  257. package/docs/guides/advanced-features/server-monitor/metrics.md +58 -0
  258. package/docs/guides/advanced-features/server-monitor/monitors.md +242 -0
  259. package/docs/guides/advanced-features/source-build.md +164 -0
  260. package/docs/guides/advanced-features/web-server.md +288 -0
  261. package/docs/guides/basic-features/alias.md +102 -0
  262. package/docs/guides/basic-features/css/css-in-js.md +72 -0
  263. package/docs/guides/basic-features/css/css-modules.md +212 -0
  264. package/docs/guides/basic-features/css/css.md +27 -0
  265. package/docs/guides/basic-features/css/tailwindcss.md +27 -0
  266. package/docs/guides/basic-features/data/data-cache.md +510 -0
  267. package/docs/guides/basic-features/data/data-fetch.md +415 -0
  268. package/docs/guides/basic-features/data/data-write.md +227 -0
  269. package/docs/guides/basic-features/debug/mock.md +109 -0
  270. package/docs/guides/basic-features/debug/proxy.md +21 -0
  271. package/docs/guides/basic-features/debug/rsdoctor.md +47 -0
  272. package/docs/guides/basic-features/debug/using-storybook.md +112 -0
  273. package/docs/guides/basic-features/deploy.md +458 -0
  274. package/docs/guides/basic-features/env-vars.md +177 -0
  275. package/docs/guides/basic-features/html.md +255 -0
  276. package/docs/guides/basic-features/output-files.md +141 -0
  277. package/docs/guides/basic-features/render/before-render.md +108 -0
  278. package/docs/guides/basic-features/render/overview.md +47 -0
  279. package/docs/guides/basic-features/render/rsc.md +516 -0
  280. package/docs/guides/basic-features/render/ssg.md +228 -0
  281. package/docs/guides/basic-features/render/ssr-cache.md +201 -0
  282. package/docs/guides/basic-features/render/ssr.md +321 -0
  283. package/docs/guides/basic-features/render/streaming-ssr.md +264 -0
  284. package/docs/guides/basic-features/routes/config-routes.md +426 -0
  285. package/docs/guides/basic-features/routes/routes.md +524 -0
  286. package/docs/guides/basic-features/static-assets/json-files.md +120 -0
  287. package/docs/guides/basic-features/static-assets/svg-assets.md +168 -0
  288. package/docs/guides/basic-features/static-assets/wasm-assets.md +62 -0
  289. package/docs/guides/basic-features/static-assets.md +160 -0
  290. package/docs/guides/basic-features/testing/playwright.md +120 -0
  291. package/docs/guides/basic-features/testing/rstest.md +251 -0
  292. package/docs/guides/concept/builder.md +37 -0
  293. package/docs/guides/concept/entries.md +319 -0
  294. package/docs/guides/concept/server.md +35 -0
  295. package/docs/guides/get-started/ai-coding-agents.md +58 -0
  296. package/docs/guides/get-started/glossary.md +63 -0
  297. package/docs/guides/get-started/introduction.md +40 -0
  298. package/docs/guides/get-started/quick-start.md +269 -0
  299. package/docs/guides/get-started/tech-stack.md +91 -0
  300. package/docs/guides/get-started/ultramodern.md +440 -0
  301. package/docs/guides/get-started/upgrade.md +118 -0
  302. package/docs/guides/topic-detail/module-federation/application.md +116 -0
  303. package/docs/guides/topic-detail/module-federation/deploy.md +104 -0
  304. package/docs/guides/topic-detail/module-federation/i18n.md +670 -0
  305. package/docs/guides/topic-detail/module-federation/introduce.md +35 -0
  306. package/docs/guides/topic-detail/module-federation/ssr.md +182 -0
  307. package/docs/guides/topic-detail/module-federation/usage.md +219 -0
  308. package/docs/guides/troubleshooting/builder.md +110 -0
  309. package/docs/guides/troubleshooting/cli.md +35 -0
  310. package/docs/guides/troubleshooting/dependencies.md +119 -0
  311. package/docs/guides/troubleshooting/hmr.md +144 -0
  312. package/docs/guides/upgrade/config.md +954 -0
  313. package/docs/guides/upgrade/entry.md +463 -0
  314. package/docs/guides/upgrade/other.md +183 -0
  315. package/docs/guides/upgrade/overview.md +33 -0
  316. package/docs/guides/upgrade/tailwindcss.md +91 -0
  317. package/docs/guides/upgrade/web-server.md +109 -0
  318. package/docs/index.md +33 -0
  319. package/docs/llms.txt +290 -0
  320. package/docs/plugin/cli-plugins/api.md +573 -0
  321. package/docs/plugin/cli-plugins/life-cycle.md +2 -0
  322. package/docs/plugin/introduction.md +152 -0
  323. package/docs/plugin/official/cli-plugins/plugin-bff.md +5 -0
  324. package/docs/plugin/official/cli-plugins/plugin-ssg.md +5 -0
  325. package/docs/plugin/official/cli-plugins/plugin-styled-components.md +5 -0
  326. package/docs/plugin/official/cli-plugins.md +4 -0
  327. package/docs/plugin/plugin-system.md +238 -0
  328. package/docs/plugin/runtime-plugins/api.md +194 -0
  329. package/docs/plugin/runtime-plugins/life-cycle.md +2 -0
  330. package/docs/plugin/server-plugins/api.md +209 -0
  331. package/docs/plugin/server-plugins/life-cycle.md +13 -0
  332. package/docs/tutorials/examples/csr-auth.md +9 -0
  333. package/docs/tutorials/foundations/introduction.md +16 -0
  334. package/package.json +63 -22
@@ -0,0 +1,440 @@
1
+ # UltraModern.js 3.0 vs Modern.js 3.0
2
+
3
+ This page compares **UltraModern.js 3.0** with the Modern.js 3.x line this fork tracks. The baseline is the current merged Modern.js `release-v3.x` baseline, not a frozen patch-version snapshot.
4
+
5
+ UltraModern.js 3.0 is our SuperApp framework forked from Modern.js. It keeps the Modern.js plugin/runtime mental model where that helps adoption, but it is positioned as a separate framework for Effect HttpApi-first HTTP APIs, TanStack Router, SSR, Module Federation, and independently deployable Micro Verticals.
6
+
7
+ ## Design Principles
8
+
9
+ - Keep deltas explicit and auditable.
10
+ - Keep upstream Modern.js merge compatibility explicit: generic Modern.js runtime
11
+ code can remain where it belongs, while UltraModern-generated surfaces stay
12
+ strict.
13
+ - Add platform-level contracts only where they improve cross-team reliability.
14
+ - Keep escape hatches explicit and outside the generated HTTP API path.
15
+
16
+ ## Compatibility Contract
17
+
18
+ UltraModern.js 3.0 keeps:
19
+
20
+ - Modern.js app/config/plugin mental model.
21
+ - Existing project structure and command flow.
22
+ - Progressive adoption path (apps can stay mostly unchanged).
23
+
24
+ UltraModern.js additions are designed as the default product surface for new SuperApps. The framework direction is Effect + TanStack + SSR + Micro Verticals, and generated HTTP API work uses that direction by default instead of preserving parallel raw-handler layouts.
25
+ Existing Modern.js apps can migrate gradually; once an API surface is generated
26
+ or migrated as UltraModern HTTP API, it must use the strict Effect HttpApi path.
27
+
28
+ ## Intentional Differences (v3 line)
29
+
30
+ | Area | Modern.js 3.0 baseline | UltraModern.js 3.0 |
31
+ | ------------------------------- | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
32
+ | Build diagnostics | RsDoctor is generally opt-in | Adds a first-class `performance.rsdoctor` config surface (opt-in; the earlier default-on behavior and diagnostics contract artifact were reverted) |
33
+ | Output and static serving | Precompression behavior is app-defined | Enables `output.precompress` by default and serves `.br` / `.gz` variants via `Accept-Encoding` negotiation |
34
+ | BFF runtime and contracts | Standard BFF runtime/client generation | Adds `requestId`-aware producer isolation, fail-fast initialization checks, and operation/trace correlation headers |
35
+ | BFF runtime choices | Standard request-handler oriented BFF paths | Uses Effect `HttpApi` as the only generated HTTP API path (`api/index.ts`, `shared/api.ts`, `src/api/*`) and rejects raw handlers, manual parsing, manual `Response` construction, and Hono server imports in generated workspaces |
36
+ | Telemetry standardization | Observability wiring is often app-specific | Adds framework-level telemetry pipeline with OTLP/VictoriaMetrics exporters, redaction, batching, and backpressure controls |
37
+ | App-level MF SSR handshake | No dedicated super-app app-level stability contract focus | Adds `server.ssr.moduleFederationAppSSR` plus integration-tested env/config handshake |
38
+ | MF vertical loading reliability | Retry/fallback patterns are often implemented per app | Adds deterministic timeout/network/contract-error reliability matrix and distributed OTEL continuity tests |
39
+ | Module onboarding governance | No module-certification evidence profile in baseline | Adds module SDK contracts, boundary anti-pattern guards, and release/module certification gate workflows |
40
+ | Router runtime | Default runtime path centers on React Router | Adds first-class TanStack Router runtime/CLI path (React Router remains supported) |
41
+ | Scaffolding templates | Default create templates center on React Router starter path | Generates a SuperApp workspace by default with TanStack, Effect, Module Federation, i18n, Tailwind, Cloudflare, and ownership contracts |
42
+ | Workspace preset enforcement | No generated UltraModern preset gate workflow | Generated workspaces include `.github/workflows/ultramodern-workspace-gates.yml`, `pnpm check`, primitive local gates, and generated contract validation |
43
+
44
+ ## What We Intentionally Do Not Change
45
+
46
+ - We do not hide the fork behind legacy Modern.js branding.
47
+ - We do not optimize for generic Modern.js defaults when they conflict with SuperApp reliability.
48
+ - We do not delete generic Modern.js Hono/file-convention runtime support just
49
+ to enforce UltraModern policy; the enforcement lives in UltraModern
50
+ generator, config, checks, and generated workspaces.
51
+ - Generated UltraModern API work uses the Effect runtime only; raw Hono/function handlers are not part of the generated API architecture.
52
+ - We make incompatible scaffold changes when they remove architecture drift.
53
+
54
+ ## Migration Guide
55
+
56
+ For teams already on Modern.js 3.0 or an older BleedingDev UltraModern scaffold, the adoption path is to move API work onto the strict Effect HttpApi surface instead of preserving older raw handler layouts.
57
+
58
+ 1. Keep existing Modern.js apps running as-is while they are outside the generated UltraModern surface. TanStack Router is the preferred path for new scaffolds and incremental route adoption, but route migration can happen on the team's schedule.
59
+ 2. Use `bff.runtimeFramework: 'effect'` with `bff.effect.strictEffectApproach: true` for API work. Entries live at `api/index.ts`, contracts live at `shared/api.ts`, clients live under `src/api/*`, and request/response/error shapes come from Effect `Schema` plus `HttpApi`.
60
+ 3. Treat raw handlers, `api/lambda/**`, manual `Response` construction, and manual request parsing as migration defects in generated or migrated UltraModern workspaces.
61
+ 4. The public preset now ships with explicit release and certification gates. Generated workspaces include `.github/workflows/ultramodern-workspace-gates.yml`, so `pnpm check` and `pnpm build` stay part of the local adoption contract from day one while CI runs the primitive gates as parallel matrix jobs.
62
+
63
+ For an older generated workspace, migrate by treating the published cohort as
64
+ the source of truth:
65
+
66
+ ```bash
67
+ pnpm dlx @bleedingdev/modern-js-create@latest --help
68
+ pnpm dlx @bleedingdev/modern-js-create@latest catalog --vertical --dry-run
69
+ pnpm dlx @bleedingdev/modern-js-create@latest catalog --vertical
70
+ mise install
71
+ mise exec -- pnpm install
72
+ mise exec -- pnpm check
73
+ mise exec -- pnpm build
74
+ ```
75
+
76
+ ### Migrating to `3.5.0-ultramodern.18`
77
+
78
+ Use `3.5.0-ultramodern.18` or newer for localized Cloudflare SSR workspaces.
79
+ This cohort moves bare locale-root redirects into the framework-owned
80
+ Cloudflare Worker entry and the i18n server runtime. A request for `/` is
81
+ redirected server-side with `302` to the negotiated locale path, for example
82
+ `/cs` for `Accept-Language: cs-CZ` or `/en` for English and fallback traffic.
83
+
84
+ Existing generated workspaces should upgrade the whole BleedingDev Modern
85
+ package cohort together:
86
+
87
+ ```bash
88
+ pnpm dlx @bleedingdev/modern-js-create@3.5.0-ultramodern.18 ultramodern \
89
+ migrate-strict-effect --version 3.5.0-ultramodern.18
90
+ pnpm install
91
+ pnpm check
92
+ pnpm build
93
+ pnpm cloudflare:build
94
+ ```
95
+
96
+ For deployed Cloudflare Workers, redeploy after the cohort update and verify
97
+ the root response before accepting the migration:
98
+
99
+ ```bash
100
+ curl -I -H 'Accept-Language: cs-CZ,cs;q=0.9,en;q=0.1' https://<worker-host>/
101
+ ```
102
+
103
+ The expected response is `302` with `Location: /cs` or the matching locale,
104
+ `Cache-Control: private, no-store`, and `Vary` covering the locale detection
105
+ headers. Following the redirect should return the SSR locale page with the
106
+ matching document language and i18n SSR data.
107
+
108
+ Do not fix older root `404` responses by adding app-owned root route files,
109
+ client-side redirects, custom navigation wrappers, Cloudflare Worker
110
+ postprocessing, generated output edits, or local redirect shims. If `/` still
111
+ returns `404` after upgrading, confirm the production build log shows
112
+ `Modern.js Framework v3.5.0-ultramodern.18` or newer and redeploy the Worker.
113
+
114
+ Strict generated API migration requires `3.5.0-ultramodern.10` or newer.
115
+ `3.4.0-ultramodern.20` and earlier cohorts do not include this full direct
116
+ `api/index.ts` generator, generated `.mts` checks, strict Oxlint boundary rule
117
+ set, Effect cohort overrides, and strict Effect migration command. Agents that
118
+ cannot install that BleedingDev cohort yet should use the local Modern.js
119
+ workspace for migration validation; otherwise pin `3.5.0-ultramodern.10` or
120
+ newer with `--ultramodern-package-version`.
121
+
122
+ Before hand-editing package aliases or generated metadata, run the framework
123
+ migration command from the target workspace:
124
+
125
+ ```bash
126
+ pnpm dlx @bleedingdev/modern-js-create@3.5.0-ultramodern.10 ultramodern \
127
+ migrate-strict-effect --version 3.5.0-ultramodern.10
128
+ pnpm api:check
129
+ pnpm contract:check
130
+ ```
131
+
132
+ The command updates `.modernjs/ultramodern.json`, root
133
+ `modernjs.packageSource`, generated Modern package aliases, framework-owned
134
+ toolchain pins, direct topology API metadata, strict Effect pnpm
135
+ overrides/trust policy, and the pnpm lockfile. Remaining failures are source
136
+ migration work: move code to `shared/api.ts`, `api/index.ts`, and
137
+ `src/api/*-client.ts`, then delete `api/effect`, `api/lambda`, `shared/effect`,
138
+ and `src/effect`.
139
+
140
+ Generated strict Effect workspaces pin the compatible Effect cohort with pnpm
141
+ overrides: `effect@4.0.0-beta.107`, `@effect/opentelemetry@4.0.0-beta.107`,
142
+ and `@effect/vitest@4.0.0-beta.107`. Do not add app-local direct Effect
143
+ versions that disagree with those overrides. The strict 24-hour release-age
144
+ gate applies to installed packages; this cohort carries no Effect age
145
+ exemption, and override-only `@effect/vitest` is not an installed approval
146
+ target. Independently, exact `trustPolicyExclude` entries for `effect`
147
+ and `@effect/opentelemetry` cover their trusted-publisher to provenance
148
+ metadata transition; they are not release-age approvals.
149
+
150
+ ### Current generated dependency baseline
151
+
152
+ | Surface | Pin |
153
+ | ------------------------------ | --------------------------------------------------------------------------------------------------- |
154
+ | Effect runtime and test cohort | `effect`, `@effect/opentelemetry`, and `@effect/vitest`: `4.0.0-beta.107` |
155
+ | Effect compiler | `@effect/tsgo@0.36.2` |
156
+ | TanStack Router | `@tanstack/react-router@1.170.25`, `@tanstack/router-core@1.171.21`, `@tanstack/history@1.162.1` |
157
+ | Module Federation | `bridge-react`, `manifest`, `modern-js-v3`, and `rspack`: `2.8.2`; `@module-federation/node@2.7.49` |
158
+ | React Router | `react-router@7.18.2` |
159
+ | Node and package tooling | Node `26.7.0`, `@types/node@^26.2.0`, pnpm `11.21.0` |
160
+
161
+ Gradual migration means old, unmigrated Modern.js apps can keep their existing
162
+ runtime until they are converted. Once a surface is generated or migrated as
163
+ UltraModern HTTP API, it uses Effect HttpApi only; do not keep Hono, lambda
164
+ handlers, or raw request handlers inside that UltraModern API surface.
165
+
166
+ When migrating a generated workspace that already has nested Effect API files, make the
167
+ move explicit and do not keep compatibility aliases:
168
+
169
+ 1. Move each vertical server entry from `verticals/<id>/api/effect/index.ts` to
170
+ `verticals/<id>/api/index.ts`.
171
+ 2. Move each shared API contract from `verticals/<id>/shared/effect/api.ts` to
172
+ `verticals/<id>/shared/api.ts`.
173
+ 3. Move generated clients from `verticals/<id>/src/effect/*-client.ts` to
174
+ `verticals/<id>/src/api/*-client.ts`.
175
+ 4. Move shell API aggregates from `apps/shell-super-app/src/effect/*` to
176
+ `apps/shell-super-app/src/api/*`.
177
+ 5. Update imports and package exports to use `./api`, `./api/client`, and
178
+ `@<workspace>/<vertical>/api/client`; remove `./effect/client`,
179
+ `./shared/effect/api`, and shared Effect API packages.
180
+ 6. Update every vertical `modern.config.ts` to use
181
+ `bff.effect.entry: './api/index'` and
182
+ `bff.effect.strictEffectApproach: true`.
183
+ 7. Update topology so API metadata lives directly under `api` with
184
+ `api.bff.strictEffectApproach: true`; do not keep `api.effect`.
185
+ 8. Run `pnpm api:check`,
186
+ `scripts/validate-ultramodern-workspace.mts`, `pnpm check`, and
187
+ `pnpm build`.
188
+
189
+ If a migration fails, fix the owning generated contract, topology, package
190
+ exports, or API module. Do not add app-level aliases, raw request handlers,
191
+ manual `Response` construction, local type casts, or package shims to make the
192
+ old layout pass.
193
+
194
+ Effect RPC, WebSockets, and other transports should be added as explicit
195
+ transport surfaces when needed. They do not make raw request handlers valid
196
+ inside generated HTTP API modules.
197
+
198
+ Strict API tests should exercise the `HttpApi` contract. Use
199
+ `createEffectBffTestHandler` from `@modern-js/plugin-bff/effect-edge` for
200
+ edge-compatible proof tests; if you manually compose a web handler, provide
201
+ `HttpServer.layerServices` beside your API group layer before calling
202
+ `HttpRouter.toWebHandler`.
203
+
204
+ For dynamic origin CORS predicates inside strict Effect HTTP APIs, prefer
205
+ `HttpRouter.middleware(Effect.succeed(HttpMiddleware.cors(...)))`.
206
+ `HttpRouter.middleware(...)` returns a `Layer` directly in the pinned Effect
207
+ cohort; do not read a `.layer` property from it.
208
+
209
+ Use one package-source strategy per repo. The published BleedingDev create
210
+ package defaults to `--ultramodern-package-source=install` and records the
211
+ exact cohort in `.modernjs/ultramodern.json`. Keep `--workspace` only for local
212
+ monorepo testing against unreleased packages. Release proof and CI should pin
213
+ the exact cohort with `--ultramodern-package-version` when a repo must prove a
214
+ specific published framework version.
215
+
216
+ Older repos with nested Effect entries and `verbatimModuleSyntax` should update to
217
+ the latest BleedingDev cohort instead of adding app-level `"type": "module"`
218
+ metadata, Module Federation shims, or custom server wrappers. The framework BFF
219
+ compiler normalizes CommonJS server output while generated app packages keep
220
+ stable TypeScript 7 so Module Federation DTS generation and TS-Go checks use
221
+ the same modern compiler lane.
222
+
223
+ Cloudflare SSR deploys are also split by runtime responsibility: `.output` is an
224
+ ESM module-worker package, while `.output/worker` remains a CommonJS package
225
+ scope for the worker bundles emitted by Modern.js SSR builds. Do not fix older
226
+ repos by hand-editing generated worker output; upgrade the framework cohort and
227
+ rerun the generated validation instead.
228
+
229
+ After installing the new cohort, run the generated
230
+ `scripts/validate-ultramodern-workspace.mts` contract check before accepting
231
+ manual edits. Fix topology, ownership, package-source, local overlay, generated
232
+ contract, Tailwind prefix, or Module Federation conflicts in the owning files
233
+ instead of patching generated output by hand.
234
+
235
+ Cloudflare D1 bindings are first-class on `deploy.worker.d1Databases`; use that
236
+ config instead of app-local postprocessing when a generated app owns D1
237
+ migrations. Cloudflare public output excludes server-only `api` and `shared`
238
+ directories by default, and generated Modern/Rspack output roots, temp
239
+ directories, and caches are isolated per app, build target, and Rspack
240
+ environment so local `build`, `cloudflare:build`, and multi-environment
241
+ compilers do not share mutable build state.
242
+
243
+ ## Human Workflow
244
+
245
+ The public BleedingDev create package has one supported generated product. The
246
+ default command creates a production-ready UltraModern SuperApp workspace with
247
+ `presetUltramodern(...)`, SSR, TanStack Router, Tailwind CSS v4, i18n, Effect
248
+ BFF, Module Federation topology, generated quality gates, and Cloudflare deploy
249
+ basics:
250
+
251
+ ```bash
252
+ pnpm dlx @bleedingdev/modern-js-create myapp
253
+ cd myapp
254
+ mise install
255
+ mise exec -- pnpm install
256
+ mise exec -- pnpm check
257
+ ```
258
+
259
+ The workspace starts from a shell and generated platform contracts. It does not
260
+ generate a demo domain by default. Add real business MicroVerticals when they
261
+ become real ownership boundaries:
262
+
263
+ ```bash
264
+ pnpm dlx @bleedingdev/modern-js-create transportation --vertical
265
+ pnpm dlx @bleedingdev/modern-js-create food-delivery --vertical
266
+ pnpm dlx @bleedingdev/modern-js-create payments --vertical
267
+ pnpm dlx @bleedingdev/modern-js-create maps --vertical
268
+ mise exec -- pnpm check
269
+ ```
270
+
271
+ The `--vertical` command mutates the current workspace. It creates the vertical
272
+ package and updates topology metadata, ownership records, shell Module
273
+ Federation wiring, local development overlays, package dependencies, generated
274
+ contracts, ports, route-owned i18n, CSS isolation, and the vertical-owned Effect
275
+ BFF/client surface.
276
+
277
+ ### Generator Automation
278
+
279
+ Automation can use explicit MicroVertical syntax instead of relying on the
280
+ positional form:
281
+
282
+ ```bash
283
+ pnpm dlx @bleedingdev/modern-js-create --vertical=transportation
284
+ pnpm dlx @bleedingdev/modern-js-create --vertical-name transportation
285
+ pnpm dlx @bleedingdev/modern-js-create transportation --vertical --dry-run
286
+ pnpm dlx @bleedingdev/modern-js-create transportation --vertical \
287
+ --codesmith-overlay ./generators/vertical-overlay
288
+ ```
289
+
290
+ The BleedingDev package defaults to installing the published package cohort.
291
+ Use `--workspace` or `--ultramodern-package-source=workspace` for local monorepo
292
+ testing. Release proof and package-source automation can also pass
293
+ `--ultramodern-package-source=install`,
294
+ `--ultramodern-package-version`, `--ultramodern-package-registry`,
295
+ `--ultramodern-package-scope`, and
296
+ `--ultramodern-package-name-prefix`.
297
+
298
+ The supported public generator import is:
299
+
300
+ ```ts
301
+ import {
302
+ addUltramodernVertical,
303
+ generateUltramodernWorkspace,
304
+ planUltramodernVertical,
305
+ } from '@modern-js/create/ultramodern-workspace';
306
+
307
+ const workspace = generateUltramodernWorkspace({
308
+ targetDir: '/tmp/my-workspace',
309
+ packageName: 'my-workspace',
310
+ modernVersion: '3.4.0',
311
+ });
312
+
313
+ const plan = planUltramodernVertical({
314
+ workspaceRoot: workspace.workspaceRoot,
315
+ name: 'transportation',
316
+ modernVersion: '3.4.0',
317
+ });
318
+
319
+ addUltramodernVertical({
320
+ workspaceRoot: workspace.workspaceRoot,
321
+ name: 'transportation',
322
+ modernVersion: '3.4.0',
323
+ overlays: [{ generator: './generators/vertical-overlay' }],
324
+ });
325
+ ```
326
+
327
+ The public result includes the workspace root, package source, created apps,
328
+ created paths, rewritten paths, assigned ports, Module Federation names, API
329
+ prefixes, generated contract path, and warnings. MicroVertical dry-run
330
+ returns the same shape plus `dryRun`, `selectedPort`, `moduleFederationRemote`,
331
+ `apiPrefix`, `jsonMutations`, `shellDependencyChanges`, and
332
+ `generatedContractChanges`; it prints JSON from the CLI and writes no files.
333
+
334
+ CodeSmith consumers can use the adapter subpath:
335
+
336
+ ```ts
337
+ import ultramodernCodeSmith from '@modern-js/create/ultramodern-workspace/codesmith';
338
+
339
+ await ultramodernCodeSmith({
340
+ config: {
341
+ mode: 'vertical',
342
+ name: 'transportation',
343
+ workspaceRoot: process.cwd(),
344
+ dryRun: true,
345
+ logResult: true,
346
+ },
347
+ });
348
+ ```
349
+
350
+ Validation runs before the first write and reports the owning contract when a
351
+ vertical name is missing or invalid, an existing topology already owns the app
352
+ ID/path/package suffix/port/Module Federation name/API prefix/manifest key, a
353
+ workspace JSON contract is missing or not an object, or a Tailwind prefix would
354
+ collide. Fix the workspace contract or choose a different vertical name before
355
+ rerunning.
356
+
357
+ Overlays are explicit CodeSmith generators that run after base workspace or
358
+ MicroVertical generation. They extend generated output; they do not replace,
359
+ inherit, or shadow the base templates. The generator and CodeSmith adapter are
360
+ plain Node generator surfaces. The package build emits declaration files through
361
+ the TS-Go toolchain. Generated app packages keep stable `typescript` on TS7 so
362
+ Module Federation DTS generation and TS-Go use the same compiler lane; runtime
363
+ code does not depend on compiler internals.
364
+
365
+ ### Runtime Contracts
366
+
367
+ Generated apps and verticals keep SSR on the normal Modern.js path. SuperApp
368
+ workspaces add `server.ssr.moduleFederationAppSSR` when Module Federation SSR is
369
+ needed, but the flag remains an explicit contract rather than a requirement for
370
+ every app.
371
+
372
+ Each app emits `src/routes/ultramodern-route-metadata` with
373
+ `ultramodernLocalisedUrls`. The i18n plugin reads that map in
374
+ `localeDetection.localisedUrls`; this is the explicit non-empty map that enables
375
+ translated path segments on top of `localePathRedirect`. The i18n plugin also
376
+ serves dynamic backend JSON from `/locales/{{lng}}/{{ns}}.json`. The route owner
377
+ changes localized paths and locale resource JSON together.
378
+
379
+ JSON-LD is optional route metadata, not inferred output. Private and
380
+ non-indexable routes emit no JSON-LD by default. Public route owners can add
381
+ `jsonLd` beside localized paths and use the generated
382
+ `src/routes/ultramodern-jsonld.ts` helpers for common schema.org shapes.
383
+
384
+ The generated contract writes `.modernjs/ultramodern.json` with a
385
+ `cssFederation` section:
386
+
387
+ - `packages/shared-design-tokens` owns the shared token layer and exports `./tokens.css`.
388
+ - Shell CSS owns only shell base and overlay layers under `[data-app-id="shell-super-app"]`.
389
+ - Each vertical owns one CSS layer, for example `[data-app-id="vertical-transportation"]` with app-local class prefixes.
390
+ - Tailwind CSS v4 is local to each generated app through `@rsbuild/plugin-tailwindcss`; shared base styles must not be duplicated by verticals.
391
+ - SSR first paint requires shared token CSS and app-owned CSS to be emitted by Modern/Rspack assets. Vertical CSS is loaded through manifest ownership, not copied into shell source.
392
+
393
+ Version switching must select UI, API, CSS, i18n JSON, and MF manifest evidence from the same vertical build marker. A shell render that only changes the UI marker is not enough.
394
+
395
+ ### Validation And Deploy
396
+
397
+ Local gates:
398
+
399
+ ```bash
400
+ mise exec -- pnpm check
401
+ mise exec -- pnpm build
402
+ mise exec -- pnpm cloudflare:build
403
+ ```
404
+
405
+ Generated workspaces include `scripts/proof-cloudflare-version.mjs` for live
406
+ Cloudflare and Zephyr proof:
407
+
408
+ ```bash
409
+ ULTRAMODERN_PUBLIC_URL_SHELL_SUPER_APP=https://shell-super-app.example.workers.dev \
410
+ ULTRAMODERN_PUBLIC_URL_TRANSPORTATION=https://transportation.example.workers.dev \
411
+ ULTRAMODERN_PUBLIC_URL_PAYMENTS=https://payments.example.workers.dev \
412
+ mise exec -- pnpm cloudflare:proof --require-public-urls
413
+ ```
414
+
415
+ Live Cloudflare and Zephyr proof requires public Worker URLs and Zephyr credentials. Without those, the repo can validate generated contracts, local builds, local Cloudflare output, dry-run Zephyr evidence plans, and local evidence schemas, but it cannot prove shell-driven live version selection.
416
+
417
+ BleedingDev packages are published through GitHub Actions trusted publishing.
418
+ The public workflow is tokenless; do not publish packages manually from a
419
+ developer machine.
420
+
421
+ ## Baseline Switches (Opt-out)
422
+
423
+ The generated `presetUltramodern(...)` starter enables strict platform contracts. Use these env switches to opt out per app or per environment:
424
+
425
+ - `MODERN_BASELINE_ENABLE_MF_SSR` (default: `true`): Enables app-level MF SSR baseline contract (`server.ssr.mode: 'stream'` + `moduleFederationAppSSR`). Disable when the app does not use app-level MF SSR, or when you need plain SSR/CSR behavior first.
426
+ - `MODERN_BASELINE_ENABLE_BFF_REQUEST_ID` (default: `true`): Enables default BFF producer identity contract (`bff.requestId`). Disable when the app does not need cross-project producer isolation.
427
+ - `MODERN_BASELINE_ENABLE_TELEMETRY_EXPORTERS` (default: `true`): Enables telemetry exporters in baseline config. Disable when the environment has no telemetry backend yet.
428
+ - `MODERN_BASELINE_APP_ID` (default: `basename(process.cwd())`): Overrides baseline `bff.requestId` identity. Set this when you need a fixed platform-wide producer ID convention.
429
+ - `MODERN_TELEMETRY_OTLP_ENDPOINT` (default: `http://127.0.0.1:4318/v1/logs`): OTLP exporter endpoint. Override when you route telemetry through a different collector endpoint.
430
+ - `MODERN_TELEMETRY_VICTORIA_ENDPOINT` (default: `http://127.0.0.1:8428/api/v1/import/prometheus`): VictoriaMetrics exporter endpoint. Override when you use a different VM ingress endpoint.
431
+ - `MODERN_TELEMETRY_FAIL_LOUD_STARTUP` (default: `true`): Fails startup if configured exporters fail startup health checks. Disable in local/dev environments where temporary telemetry outage should not block boot.
432
+
433
+ ## Related Docs
434
+
435
+ - [BFF Runtime Frameworks](/guides/advanced-features/bff/frameworks.md)
436
+ - [BFF Data Platform](/guides/advanced-features/bff/data-platform.md)
437
+ - [BFF Effect Runtime Config](/configure/app/bff/effect.md)
438
+ - [Module Federation SSR](/guides/topic-detail/module-federation/ssr.md)
439
+ - [performance.rsdoctor](/configure/app/performance/rsdoctor.md)
440
+ - [server.ssr](/configure/app/server/ssr.md)
@@ -0,0 +1,118 @@
1
+ # Upgrading
2
+
3
+
4
+ ## Manual Upgrade
5
+
6
+ All Modern.js official packages are released with a **uniform version number**, so when upgrading, you need to update all `@modern-js/**` packages to the target version uniformly.
7
+
8
+ ### Upgrade Steps
9
+
10
+ 1. **Check the latest version**
11
+
12
+ You can check the latest version of Modern.js through the following methods:
13
+
14
+ - Visit [npm](https://www.npmjs.com/package/@modern-js/app-tools) to check the latest version of `@modern-js/app-tools`
15
+ - Check [GitHub Releases](https://github.com/web-infra-dev/modern.js/releases)
16
+
17
+ According to the [Release Note](https://github.com/web-infra-dev/modern.js/releases) on the official website, developers can also manually upgrade the project to the desired version.
18
+
19
+ 2. **Update package.json**
20
+
21
+ In the project's `package.json`, update all `@modern-js/**` packages to the target version. For example:
22
+
23
+ ```json title="package.json"
24
+ {
25
+ "dependencies": {
26
+ "@modern-js/app-tools": "3.0.0",
27
+ "@modern-js/runtime": "3.0.0"
28
+ },
29
+ "devDependencies": {
30
+ "@modern-js/types": "3.0.0"
31
+ }
32
+ }
33
+ ```
34
+
35
+ 3. **Reinstall dependencies**
36
+
37
+ After updating `package.json`, reinstall dependencies:
38
+
39
+
40
+ ```sh [npm]
41
+ npm install
42
+ ```
43
+
44
+ ```sh [yarn]
45
+ yarn install
46
+ ```
47
+
48
+ ```sh [pnpm]
49
+ pnpm install
50
+ ```
51
+
52
+ ```sh [bun]
53
+ bun install
54
+ ```
55
+
56
+ ```sh [deno]
57
+ deno install
58
+ ```
59
+
60
+ :::tip
61
+ When upgrading, you need to upgrade all packages provided by Modern.js uniformly, rather than upgrading individual dependencies. Ensure that all `@modern-js/**` packages have the same version number.
62
+ :::
63
+
64
+ ## Version Management Strategy
65
+
66
+ In Modern.js projects, we recommend that all officially provided dependencies use fixed version, and avoid using `^` or `~` for range declarations. For example:
67
+
68
+ ```json
69
+ {
70
+ "dependencies": {
71
+ "@modern-js/app-tools": "x.y.z"
72
+ }
73
+ }
74
+ ```
75
+
76
+ This ensures that the versions of dependencies are fully determined, thereby guaranteeing build consistency and predictability.
77
+
78
+ ## Lock nested dependency
79
+
80
+ When a nested dependency of the project has a problem and Modern.js cannot be updated immediately, you can use the package manager to lock the version of the nested dependency.
81
+
82
+ ### pnpm
83
+
84
+ For projects using pnpm, add the following configuration to `pnpm-workspace.yaml` in the **root directory** of the project, and then run `pnpm install` again:
85
+
86
+ ```yaml title="pnpm-workspace.yaml"
87
+ overrides:
88
+ package-name: ^1.0.0
89
+ ```
90
+
91
+ ### Yarn
92
+
93
+ For projects using Yarn, add the following configuration to the `package.json` in the **root directory** of the project, and then run `yarn install` again:
94
+
95
+ ```json title="package.json"
96
+ {
97
+ "resolutions": {
98
+ "package-name": "^1.0.0"
99
+ }
100
+ }
101
+ ```
102
+
103
+ ### Npm
104
+
105
+ For projects using Npm, add the following configuration to the `package.json` in the **root directory** of the project, and then run `npm install` again:
106
+
107
+ ```json title="package.json"
108
+ {
109
+ "overrides": {
110
+ "package-name": "^1.0.0"
111
+ }
112
+ }
113
+ ```
114
+
115
+ :::info
116
+ For Monorepo repositories, lock dependency versions in the package-manager configuration at the project root. The override affects every package in the Monorepo.
117
+
118
+ :::
@@ -0,0 +1,116 @@
1
+ # Application-Level Modules
2
+
3
+ Modern.js provides runtime APIs to quickly export application-level Module Federation modules from your application.
4
+
5
+ We use the application created in [Using Module Federation](/guides/topic-detail/module-federation/usage.md) as an example to further explain how to import application-level modules.
6
+
7
+ ## Exporting Modules from Producer
8
+
9
+ Unlike directly exporting component-level modules, we need to create a separate entry for application-level modules to be exported via `Module Federation`.
10
+
11
+ We create the `src/export-App.tsx` file:
12
+
13
+ :::note
14
+ The filename can be arbitrary; Modern.js does not enforce a specific naming convention.
15
+ :::
16
+
17
+ ```ts title="src/export-App.tsx"
18
+ import '@modern-js/runtime/registry/index'; // This line must be included, it will import micro frontend runtime dependencies by default
19
+ import { render } from '@modern-js/runtime/browser';
20
+ import { createRoot } from '@modern-js/runtime/react';
21
+ import { createBridgeComponent } from '@module-federation/modern-js-v3/react-v19';
22
+
23
+ const ModernRoot = createRoot();
24
+ export const provider = createBridgeComponent({
25
+ rootComponent: ModernRoot,
26
+ render: (Component, dom) => render(Component, dom),
27
+ });
28
+
29
+ export default provider;
30
+ ```
31
+
32
+ :::note
33
+ Please select the corresponding import path based on the React version used in your project:
34
+
35
+ - **React 19**: Use `@module-federation/modern-js-v3/react-v19`
36
+ - **React 18**: Use `@module-federation/modern-js-v3/react-v18`
37
+
38
+ You can check the React version in your project's `package.json` file to determine which import path to use.
39
+ :::
40
+
41
+ This file will pass the root component of the `main` entry application to the Bridge API and render it to the specified node via Bridge's render function.
42
+
43
+ Next, we configure `module-federation.config.ts` to modify the export to `src/export-App.tsx`:
44
+
45
+ ```ts title="module-federation.config.ts"
46
+ import { createModuleFederationConfig } from '@module-federation/modern-js-v3';
47
+
48
+ export default createModuleFederationConfig({
49
+ name: 'remote',
50
+ manifest: {
51
+ filePath: 'static',
52
+ },
53
+ filename: 'static/remoteEntry.js',
54
+ exposes: {
55
+ './app': './src/export-App.tsx',
56
+ },
57
+ shared: {
58
+ react: { singleton: true },
59
+ 'react-dom': { singleton: true },
60
+ },
61
+ });
62
+ ```
63
+
64
+ :::info
65
+ [`createBridgeComponent`](https://module-federation.io/guide/bridge/overview#core-apis) is used to export application-level modules. Modern.js related APIs can be found at [createRoot](/apis/app/runtime/core/create-root.md) and [render](/apis/app/runtime/core/render.md).
66
+ :::
67
+
68
+ ## Using Modules in Consumer
69
+
70
+ We then modify the consumer configuration by removing the previously created `src/routes/remote/page.tsx` route file.
71
+
72
+ We want all routes that access `/remote` to enter the aforementioned application-level module, so we add `src/routes/remote/$.tsx` instead.
73
+
74
+ :::note
75
+ If you are not familiar with the capabilities of `$.tsx`, please read [Wildcard Routes](/guides/basic-features/routes/routes.md#wildcard-routes).
76
+ :::
77
+
78
+ ```tsx title="src/routes/remote/$.tsx"
79
+ import { createRemoteAppComponent } from '@module-federation/modern-js-v3/react';
80
+ import { loadRemote } from '@module-federation/modern-js-v3/runtime';
81
+
82
+ const ErrorBoundary = (info?: { error: { message: string } }) => {
83
+ return (
84
+ <div>
85
+ <h2>This is ErrorBoundary Component, Something went wrong:</h2>
86
+ <pre style={{ color: 'red' }}>{info?.error.message}</pre>
87
+ </div>
88
+ );
89
+ };
90
+ const Loading = <div>loading...</div>;
91
+ const RemoteApp = createRemoteAppComponent({
92
+ loader: () => loadRemote('remote/app'),
93
+ fallback: ErrorBoundary,
94
+ loading: Loading,
95
+ });
96
+
97
+ export default RemoteApp;
98
+ ```
99
+
100
+ :::info
101
+ [`createRemoteAppComponent`](https://module-federation.io/guide/bridge/overview#core-apis) is used to load application-level modules.
102
+ :::
103
+
104
+ ## Start the Application
105
+
106
+ Now, both the producer and consumer applications are set up. We can run `modern dev` locally to start both applications.
107
+
108
+ After startup, when the consumer application accesses the `/remote` route, it will enter the producer application. Accessing `http://localhost:8080/remote` will display a complete page of the producer's remote module in the browser.
109
+
110
+ You can create new route files in the producer application and add route navigation in the code. These functionalities will also work as expected.
111
+
112
+ You can refer to the example here: [Modern.js & Module Federation Application-Level Modules](https://github.com/web-infra-dev/modern.js/tree/main/examples/module-federation/app-export).
113
+
114
+ ## Related Documentation
115
+
116
+ - [Module Federation Bridge](https://module-federation.io/guide/bridge/overview)