@ecopages/core 0.2.0-alpha.2 → 0.2.0-alpha.20

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 (391) hide show
  1. package/CHANGELOG.md +26 -64
  2. package/README.md +212 -14
  3. package/package.json +116 -66
  4. package/src/adapters/README.md +39 -0
  5. package/src/adapters/abstract/application-adapter.d.ts +28 -2
  6. package/src/adapters/abstract/application-adapter.js +14 -2
  7. package/src/adapters/abstract/router-adapter.d.ts +1 -1
  8. package/src/adapters/abstract/server-adapter.d.ts +2 -2
  9. package/src/adapters/bun/client-bridge.d.ts +1 -1
  10. package/src/adapters/bun/create-app.d.ts +4 -12
  11. package/src/adapters/bun/create-app.js +4 -5
  12. package/src/adapters/bun/hmr-manager.d.ts +80 -21
  13. package/src/adapters/bun/hmr-manager.js +168 -62
  14. package/src/adapters/bun/index.d.ts +2 -3
  15. package/src/adapters/bun/index.js +3 -3
  16. package/src/adapters/bun/server-adapter.d.ts +5 -5
  17. package/src/adapters/bun/server-adapter.js +40 -34
  18. package/src/adapters/bun/server-lifecycle.d.ts +28 -17
  19. package/src/adapters/bun/server-lifecycle.js +34 -62
  20. package/src/{create-app.d.ts → adapters/create-app.d.ts} +9 -6
  21. package/src/{create-app.js → adapters/create-app.js} +4 -4
  22. package/src/adapters/index.d.ts +2 -6
  23. package/src/adapters/index.js +2 -8
  24. package/src/adapters/node/create-app.d.ts +6 -9
  25. package/src/adapters/node/create-app.js +12 -6
  26. package/src/adapters/node/node-client-bridge.d.ts +1 -1
  27. package/src/adapters/node/node-hmr-manager.d.ts +89 -18
  28. package/src/adapters/node/node-hmr-manager.js +185 -95
  29. package/src/adapters/node/server-adapter.d.ts +6 -35
  30. package/src/adapters/node/server-adapter.js +44 -105
  31. package/src/adapters/node/static-content-server.d.ts +37 -1
  32. package/src/adapters/node/static-content-server.js +29 -1
  33. package/src/adapters/shared/application-adapter.d.ts +1 -1
  34. package/src/{define-api-handler.d.ts → adapters/shared/define-api-handler.d.ts} +1 -1
  35. package/src/adapters/shared/explicit-static-route-matcher.d.ts +2 -2
  36. package/src/adapters/shared/explicit-static-route-matcher.js +4 -1
  37. package/src/adapters/shared/file-route-middleware-pipeline.d.ts +1 -1
  38. package/src/adapters/shared/file-route-middleware-pipeline.js +1 -0
  39. package/src/adapters/shared/fs-server-response-factory.d.ts +2 -2
  40. package/src/adapters/shared/fs-server-response-factory.js +1 -1
  41. package/src/adapters/shared/fs-server-response-matcher.d.ts +8 -12
  42. package/src/adapters/shared/fs-server-response-matcher.js +10 -18
  43. package/src/adapters/shared/hmr-entrypoint-registrar.d.ts +55 -0
  44. package/src/adapters/shared/hmr-entrypoint-registrar.js +87 -0
  45. package/src/adapters/shared/hmr-html-response.d.ts +22 -0
  46. package/src/adapters/shared/hmr-html-response.js +32 -0
  47. package/src/adapters/shared/render-context.d.ts +2 -1
  48. package/src/adapters/shared/render-context.js +6 -3
  49. package/src/adapters/shared/runtime-bootstrap.d.ts +38 -0
  50. package/src/adapters/shared/runtime-bootstrap.js +43 -0
  51. package/src/adapters/shared/server-adapter.d.ts +13 -3
  52. package/src/adapters/shared/server-adapter.js +42 -5
  53. package/src/adapters/shared/server-route-handler.d.ts +4 -4
  54. package/src/adapters/shared/server-route-handler.js +6 -15
  55. package/src/adapters/shared/server-static-builder.d.ts +38 -6
  56. package/src/adapters/shared/server-static-builder.js +64 -10
  57. package/src/build/README.md +107 -0
  58. package/src/build/build-adapter.d.ts +168 -3
  59. package/src/build/build-adapter.js +604 -16
  60. package/src/build/build-manifest.d.ts +27 -0
  61. package/src/build/build-manifest.js +30 -0
  62. package/src/build/dev-build-coordinator.d.ts +72 -0
  63. package/src/build/dev-build-coordinator.js +154 -0
  64. package/src/build/esbuild-build-adapter.d.ts +15 -6
  65. package/src/build/esbuild-build-adapter.js +189 -74
  66. package/src/build/runtime-build-executor.d.ts +14 -0
  67. package/src/build/runtime-build-executor.js +22 -0
  68. package/src/build/runtime-specifier-alias-plugin.d.ts +15 -0
  69. package/src/build/runtime-specifier-alias-plugin.js +35 -0
  70. package/src/build/runtime-specifier-aliases.d.ts +5 -0
  71. package/src/build/runtime-specifier-aliases.js +95 -0
  72. package/src/config/README.md +36 -0
  73. package/src/config/config-builder.d.ts +52 -27
  74. package/src/config/config-builder.js +260 -49
  75. package/src/{constants.d.ts → config/constants.d.ts} +13 -0
  76. package/src/{constants.js → config/constants.js} +4 -0
  77. package/src/declarations.d.ts +19 -14
  78. package/src/dev/sc-server.d.ts +1 -1
  79. package/src/dev/sc-server.js +1 -1
  80. package/src/eco/README.md +70 -16
  81. package/src/eco/eco.browser.d.ts +2 -0
  82. package/src/eco/eco.browser.js +83 -0
  83. package/src/eco/eco.js +32 -57
  84. package/src/eco/eco.types.d.ts +12 -4
  85. package/src/eco/eco.utils.d.ts +1 -40
  86. package/src/eco/eco.utils.js +5 -35
  87. package/src/eco/global-injector-map.d.ts +1 -1
  88. package/src/eco/lazy-injector-map.d.ts +1 -1
  89. package/src/hmr/README.md +26 -0
  90. package/src/hmr/client/hmr-runtime.d.ts +1 -6
  91. package/src/hmr/client/hmr-runtime.js +30 -7
  92. package/src/hmr/hmr-strategy.d.ts +16 -13
  93. package/src/hmr/hmr-strategy.js +22 -7
  94. package/src/hmr/hmr.postcss.test.e2e.d.ts +1 -0
  95. package/src/hmr/hmr.postcss.test.e2e.js +31 -0
  96. package/src/hmr/hmr.test.e2e.js +26 -33
  97. package/src/hmr/strategies/default-hmr-strategy.d.ts +2 -2
  98. package/src/hmr/strategies/default-hmr-strategy.js +1 -1
  99. package/src/hmr/strategies/js-hmr-strategy.d.ts +46 -43
  100. package/src/hmr/strategies/js-hmr-strategy.js +72 -73
  101. package/src/index.browser.d.ts +2 -2
  102. package/src/index.browser.js +1 -1
  103. package/src/index.d.ts +4 -3
  104. package/src/index.js +16 -5
  105. package/src/integrations/ghtml/ghtml-renderer.d.ts +7 -2
  106. package/src/integrations/ghtml/ghtml-renderer.js +33 -30
  107. package/src/integrations/ghtml/ghtml.constants.d.ts +1 -0
  108. package/src/integrations/ghtml/ghtml.constants.js +4 -0
  109. package/src/integrations/ghtml/ghtml.plugin.d.ts +2 -6
  110. package/src/integrations/ghtml/ghtml.plugin.js +3 -4
  111. package/src/plugins/README.md +35 -0
  112. package/src/plugins/alias-resolver-plugin.js +17 -3
  113. package/src/plugins/eco-component-meta-plugin.d.ts +14 -1
  114. package/src/plugins/eco-component-meta-plugin.js +27 -21
  115. package/src/plugins/foreign-jsx-override-plugin.d.ts +31 -0
  116. package/src/plugins/foreign-jsx-override-plugin.js +35 -0
  117. package/src/plugins/integration-plugin.d.ts +145 -28
  118. package/src/plugins/integration-plugin.js +109 -13
  119. package/src/plugins/processor.d.ts +15 -2
  120. package/src/plugins/processor.js +16 -2
  121. package/src/plugins/runtime-capability.d.ts +9 -0
  122. package/src/plugins/source-transform.d.ts +46 -0
  123. package/src/plugins/source-transform.js +71 -0
  124. package/src/route-renderer/GRAPH.md +64 -98
  125. package/src/route-renderer/README.md +67 -46
  126. package/src/route-renderer/orchestration/boundary-planning.service.d.ts +25 -0
  127. package/src/route-renderer/orchestration/boundary-planning.service.js +97 -0
  128. package/src/route-renderer/orchestration/component-render-context.d.ts +83 -0
  129. package/src/route-renderer/orchestration/component-render-context.js +147 -0
  130. package/src/route-renderer/orchestration/integration-renderer.d.ts +554 -0
  131. package/src/route-renderer/orchestration/integration-renderer.js +957 -0
  132. package/src/route-renderer/orchestration/queued-boundary-runtime.service.d.ts +89 -0
  133. package/src/route-renderer/orchestration/queued-boundary-runtime.service.js +155 -0
  134. package/src/route-renderer/orchestration/render-execution.service.d.ts +43 -0
  135. package/src/route-renderer/orchestration/render-execution.service.js +106 -0
  136. package/src/{eco/eco.utils.ts → route-renderer/orchestration/render-output.utils.d.ts} +10 -53
  137. package/src/route-renderer/orchestration/render-output.utils.js +65 -0
  138. package/src/route-renderer/{render-preparation.service.d.ts → orchestration/render-preparation.service.d.ts} +18 -10
  139. package/src/route-renderer/{render-preparation.service.js → orchestration/render-preparation.service.js} +115 -17
  140. package/src/route-renderer/orchestration/route-shell-composer.service.d.ts +50 -0
  141. package/src/route-renderer/orchestration/route-shell-composer.service.js +81 -0
  142. package/src/route-renderer/orchestration/template-serialization.d.ts +38 -0
  143. package/src/route-renderer/orchestration/template-serialization.js +45 -0
  144. package/src/route-renderer/{dependency-resolver.d.ts → page-loading/dependency-resolver.d.ts} +15 -4
  145. package/src/route-renderer/{dependency-resolver.js → page-loading/dependency-resolver.js} +28 -12
  146. package/src/route-renderer/page-loading/page-module-loader.d.ts +90 -0
  147. package/src/route-renderer/{page-module-loader.js → page-loading/page-module-loader.js} +39 -14
  148. package/src/route-renderer/route-renderer.d.ts +45 -4
  149. package/src/route-renderer/route-renderer.js +38 -3
  150. package/src/router/README.md +97 -0
  151. package/src/router/client/link-intent.d.ts +53 -0
  152. package/src/router/client/link-intent.js +34 -0
  153. package/src/router/client/link-intent.test.browser.d.ts +1 -0
  154. package/src/router/client/link-intent.test.browser.js +43 -0
  155. package/src/router/client/navigation-coordinator.d.ts +149 -0
  156. package/src/router/client/navigation-coordinator.js +215 -0
  157. package/src/router/{fs-router-scanner.d.ts → server/fs-router-scanner.d.ts} +3 -3
  158. package/src/router/{fs-router-scanner.js → server/fs-router-scanner.js} +14 -8
  159. package/src/router/{fs-router.d.ts → server/fs-router.d.ts} +1 -1
  160. package/src/router/{fs-router.js → server/fs-router.js} +1 -1
  161. package/src/services/README.md +29 -0
  162. package/src/services/assets/asset-processing-service/asset-processing.service.d.ts +120 -0
  163. package/src/services/{asset-processing-service → assets/asset-processing-service}/asset-processing.service.js +91 -10
  164. package/src/services/{asset-processing-service → assets/asset-processing-service}/asset.factory.d.ts +1 -1
  165. package/src/services/{asset-processing-service → assets/asset-processing-service}/asset.factory.js +2 -2
  166. package/src/services/{asset-processing-service → assets/asset-processing-service}/assets.types.d.ts +2 -1
  167. package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.d.ts +55 -0
  168. package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.js +48 -0
  169. package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.d.ts +20 -0
  170. package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.js +41 -0
  171. package/src/services/assets/asset-processing-service/index.d.ts +5 -0
  172. package/src/services/assets/asset-processing-service/index.js +5 -0
  173. package/src/services/{asset-processing-service → assets/asset-processing-service}/processor.interface.d.ts +2 -2
  174. package/src/services/{asset-processing-service → assets/asset-processing-service}/processor.registry.d.ts +2 -2
  175. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/base/base-processor.d.ts +1 -1
  176. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/base/base-processor.js +9 -4
  177. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/base/base-script-processor.d.ts +5 -4
  178. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/base/base-script-processor.js +15 -23
  179. package/src/services/assets/asset-processing-service/processors/index.d.ts +5 -0
  180. package/src/services/assets/asset-processing-service/processors/index.js +5 -0
  181. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/script/content-script.processor.d.ts +2 -2
  182. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/script/content-script.processor.js +1 -1
  183. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/script/file-script.processor.d.ts +4 -3
  184. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/script/file-script.processor.js +16 -4
  185. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/script/node-module-script.processor.d.ts +3 -3
  186. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/script/node-module-script.processor.js +6 -5
  187. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/stylesheet/content-stylesheet.processor.d.ts +2 -2
  188. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/stylesheet/content-stylesheet.processor.js +1 -1
  189. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/stylesheet/file-stylesheet.processor.d.ts +2 -2
  190. package/src/services/{asset-processing-service → assets/asset-processing-service}/processors/stylesheet/file-stylesheet.processor.js +5 -2
  191. package/src/services/assets/browser-bundle.service.d.ts +32 -0
  192. package/src/services/assets/browser-bundle.service.js +33 -0
  193. package/src/services/{page-request-cache-coordinator.service.d.ts → cache/page-request-cache-coordinator.service.d.ts} +2 -2
  194. package/src/services/{page-request-cache-coordinator.service.js → cache/page-request-cache-coordinator.service.js} +3 -1
  195. package/src/services/html/html-rewriter-provider.service.d.ts +37 -0
  196. package/src/services/html/html-rewriter-provider.service.js +68 -0
  197. package/src/services/html/html-transformer.service.d.ts +77 -0
  198. package/src/services/html/html-transformer.service.js +215 -0
  199. package/src/services/invalidation/development-invalidation.service.d.ts +74 -0
  200. package/src/services/invalidation/development-invalidation.service.js +190 -0
  201. package/src/services/module-loading/app-module-loader.service.d.ts +28 -0
  202. package/src/services/module-loading/app-module-loader.service.js +35 -0
  203. package/src/services/module-loading/app-server-module-transpiler.service.d.ts +24 -0
  204. package/src/services/module-loading/app-server-module-transpiler.service.js +109 -0
  205. package/src/services/module-loading/host-module-loader-registry.d.ts +4 -0
  206. package/src/services/module-loading/host-module-loader-registry.js +15 -0
  207. package/src/services/module-loading/module-loading-types.d.ts +2 -0
  208. package/src/services/module-loading/node-bootstrap-plugin.d.ts +42 -0
  209. package/src/services/module-loading/node-bootstrap-plugin.js +204 -0
  210. package/src/services/module-loading/page-module-import.service.d.ts +76 -0
  211. package/src/services/module-loading/page-module-import.service.js +173 -0
  212. package/src/services/module-loading/server-module-transpiler.service.d.ts +72 -0
  213. package/src/services/module-loading/server-module-transpiler.service.js +64 -0
  214. package/src/services/runtime-state/dev-graph.service.d.ts +118 -0
  215. package/src/services/runtime-state/dev-graph.service.js +162 -0
  216. package/src/services/runtime-state/entrypoint-dependency-graph.service.d.ts +41 -0
  217. package/src/services/runtime-state/entrypoint-dependency-graph.service.js +85 -0
  218. package/src/services/runtime-state/runtime-specifier-registry.service.d.ts +69 -0
  219. package/src/services/runtime-state/runtime-specifier-registry.service.js +37 -0
  220. package/src/services/runtime-state/server-invalidation-state.service.d.ts +26 -0
  221. package/src/services/runtime-state/server-invalidation-state.service.js +35 -0
  222. package/src/services/{schema-validation-service.d.ts → validation/schema-validation-service.d.ts} +1 -1
  223. package/src/static-site-generator/README.md +26 -0
  224. package/src/static-site-generator/static-site-generator.d.ts +50 -3
  225. package/src/static-site-generator/static-site-generator.js +71 -5
  226. package/src/{internal-types.d.ts → types/internal-types.d.ts} +53 -22
  227. package/src/types/internal-types.js +0 -0
  228. package/src/{public-types.d.ts → types/public-types.d.ts} +146 -21
  229. package/src/types/public-types.js +0 -0
  230. package/src/utils/html-escaping.d.ts +7 -0
  231. package/src/utils/html-escaping.js +6 -0
  232. package/src/utils/locals-utils.d.ts +1 -1
  233. package/src/utils/parse-cli-args.d.ts +4 -1
  234. package/src/utils/parse-cli-args.js +16 -1
  235. package/src/utils/resolve-work-dir.d.ts +11 -0
  236. package/src/utils/resolve-work-dir.js +31 -0
  237. package/src/watchers/project-watcher.d.ts +40 -24
  238. package/src/watchers/project-watcher.js +129 -92
  239. package/src/watchers/project-watcher.test-helpers.d.ts +2 -2
  240. package/src/watchers/project-watcher.test-helpers.js +1 -0
  241. package/src/adapters/abstract/application-adapter.ts +0 -337
  242. package/src/adapters/abstract/router-adapter.ts +0 -30
  243. package/src/adapters/abstract/server-adapter.ts +0 -79
  244. package/src/adapters/bun/client-bridge.ts +0 -62
  245. package/src/adapters/bun/create-app.ts +0 -189
  246. package/src/adapters/bun/define-api-handler.d.ts +0 -61
  247. package/src/adapters/bun/define-api-handler.ts +0 -114
  248. package/src/adapters/bun/hmr-manager.ts +0 -281
  249. package/src/adapters/bun/index.ts +0 -3
  250. package/src/adapters/bun/server-adapter.ts +0 -492
  251. package/src/adapters/bun/server-lifecycle.ts +0 -154
  252. package/src/adapters/index.ts +0 -6
  253. package/src/adapters/node/create-app.ts +0 -179
  254. package/src/adapters/node/index.d.ts +0 -4
  255. package/src/adapters/node/index.js +0 -8
  256. package/src/adapters/node/index.ts +0 -9
  257. package/src/adapters/node/node-client-bridge.ts +0 -79
  258. package/src/adapters/node/node-hmr-manager.ts +0 -271
  259. package/src/adapters/node/server-adapter.ts +0 -561
  260. package/src/adapters/node/static-content-server.ts +0 -203
  261. package/src/adapters/shared/api-response.ts +0 -104
  262. package/src/adapters/shared/application-adapter.ts +0 -199
  263. package/src/adapters/shared/explicit-static-route-matcher.ts +0 -134
  264. package/src/adapters/shared/file-route-middleware-pipeline.ts +0 -123
  265. package/src/adapters/shared/fs-server-response-factory.ts +0 -118
  266. package/src/adapters/shared/fs-server-response-matcher.ts +0 -198
  267. package/src/adapters/shared/render-context.ts +0 -105
  268. package/src/adapters/shared/server-adapter.ts +0 -442
  269. package/src/adapters/shared/server-route-handler.ts +0 -166
  270. package/src/adapters/shared/server-static-builder.ts +0 -82
  271. package/src/build/build-adapter.ts +0 -132
  272. package/src/build/build-types.ts +0 -83
  273. package/src/build/esbuild-build-adapter.ts +0 -510
  274. package/src/config/config-builder.ts +0 -474
  275. package/src/constants.ts +0 -39
  276. package/src/create-app.ts +0 -87
  277. package/src/define-api-handler.js +0 -15
  278. package/src/define-api-handler.ts +0 -66
  279. package/src/dev/sc-server.ts +0 -143
  280. package/src/eco/component-render-context.d.ts +0 -105
  281. package/src/eco/component-render-context.js +0 -77
  282. package/src/eco/component-render-context.ts +0 -202
  283. package/src/eco/eco.ts +0 -221
  284. package/src/eco/eco.types.ts +0 -202
  285. package/src/eco/global-injector-map.ts +0 -112
  286. package/src/eco/lazy-injector-map.ts +0 -120
  287. package/src/eco/module-dependencies.ts +0 -75
  288. package/src/errors/http-error.ts +0 -72
  289. package/src/errors/index.ts +0 -2
  290. package/src/errors/locals-access-error.ts +0 -7
  291. package/src/global/app-logger.ts +0 -4
  292. package/src/hmr/client/__screenshots__/hmr-runtime.test.browser.ts/HMR-Runtime-HMR-Server-Integration-should-have-HMR-script-injected-in-page-1.png +0 -0
  293. package/src/hmr/client/__screenshots__/hmr-runtime.test.browser.ts/HMR-Runtime-HMR-Server-Integration-should-load-fixture-app-page-1.png +0 -0
  294. package/src/hmr/client/__screenshots__/hmr-runtime.test.browser.ts/HMR-Runtime-WebSocket-Connection-should-connect-to-correct-HMR-endpoint-1.png +0 -0
  295. package/src/hmr/client/hmr-runtime.ts +0 -121
  296. package/src/hmr/hmr-strategy.ts +0 -172
  297. package/src/hmr/hmr.test.e2e.ts +0 -75
  298. package/src/hmr/strategies/default-hmr-strategy.ts +0 -60
  299. package/src/hmr/strategies/js-hmr-strategy.ts +0 -308
  300. package/src/index.browser.ts +0 -3
  301. package/src/index.ts +0 -5
  302. package/src/integrations/ghtml/ghtml-renderer.ts +0 -93
  303. package/src/integrations/ghtml/ghtml.plugin.ts +0 -32
  304. package/src/internal-types.ts +0 -212
  305. package/src/plugins/alias-resolver-plugin.ts +0 -45
  306. package/src/plugins/eco-component-meta-plugin.ts +0 -474
  307. package/src/plugins/integration-plugin.ts +0 -184
  308. package/src/plugins/processor.ts +0 -220
  309. package/src/public-types.ts +0 -1255
  310. package/src/route-renderer/component-graph-executor.d.ts +0 -32
  311. package/src/route-renderer/component-graph-executor.js +0 -31
  312. package/src/route-renderer/component-graph-executor.ts +0 -84
  313. package/src/route-renderer/component-graph.d.ts +0 -42
  314. package/src/route-renderer/component-graph.js +0 -72
  315. package/src/route-renderer/component-graph.ts +0 -159
  316. package/src/route-renderer/component-marker.d.ts +0 -52
  317. package/src/route-renderer/component-marker.js +0 -46
  318. package/src/route-renderer/component-marker.ts +0 -117
  319. package/src/route-renderer/dependency-resolver.ts +0 -596
  320. package/src/route-renderer/html-post-processing.service.d.ts +0 -40
  321. package/src/route-renderer/html-post-processing.service.js +0 -86
  322. package/src/route-renderer/html-post-processing.service.ts +0 -103
  323. package/src/route-renderer/integration-renderer.d.ts +0 -339
  324. package/src/route-renderer/integration-renderer.js +0 -526
  325. package/src/route-renderer/integration-renderer.ts +0 -696
  326. package/src/route-renderer/marker-graph-resolver.d.ts +0 -76
  327. package/src/route-renderer/marker-graph-resolver.js +0 -93
  328. package/src/route-renderer/marker-graph-resolver.ts +0 -153
  329. package/src/route-renderer/page-module-loader.d.ts +0 -61
  330. package/src/route-renderer/page-module-loader.ts +0 -153
  331. package/src/route-renderer/render-execution.service.d.ts +0 -69
  332. package/src/route-renderer/render-execution.service.js +0 -91
  333. package/src/route-renderer/render-execution.service.ts +0 -158
  334. package/src/route-renderer/render-preparation.service.ts +0 -358
  335. package/src/route-renderer/route-renderer.ts +0 -80
  336. package/src/router/fs-router-scanner.ts +0 -217
  337. package/src/router/fs-router.ts +0 -122
  338. package/src/services/asset-processing-service/asset-processing.service.d.ts +0 -41
  339. package/src/services/asset-processing-service/asset-processing.service.ts +0 -306
  340. package/src/services/asset-processing-service/asset.factory.ts +0 -105
  341. package/src/services/asset-processing-service/assets.types.ts +0 -112
  342. package/src/services/asset-processing-service/index.d.ts +0 -3
  343. package/src/services/asset-processing-service/index.js +0 -3
  344. package/src/services/asset-processing-service/index.ts +0 -3
  345. package/src/services/asset-processing-service/processor.interface.ts +0 -27
  346. package/src/services/asset-processing-service/processor.registry.ts +0 -18
  347. package/src/services/asset-processing-service/processors/base/base-processor.ts +0 -76
  348. package/src/services/asset-processing-service/processors/base/base-script-processor.ts +0 -105
  349. package/src/services/asset-processing-service/processors/index.d.ts +0 -5
  350. package/src/services/asset-processing-service/processors/index.js +0 -5
  351. package/src/services/asset-processing-service/processors/index.ts +0 -5
  352. package/src/services/asset-processing-service/processors/script/content-script.processor.ts +0 -66
  353. package/src/services/asset-processing-service/processors/script/file-script.processor.ts +0 -88
  354. package/src/services/asset-processing-service/processors/script/node-module-script.processor.ts +0 -84
  355. package/src/services/asset-processing-service/processors/stylesheet/content-stylesheet.processor.ts +0 -27
  356. package/src/services/asset-processing-service/processors/stylesheet/file-stylesheet.processor.ts +0 -77
  357. package/src/services/cache/cache.types.ts +0 -126
  358. package/src/services/cache/index.ts +0 -18
  359. package/src/services/cache/memory-cache-store.ts +0 -130
  360. package/src/services/cache/page-cache-service.ts +0 -202
  361. package/src/services/html-transformer.service.d.ts +0 -50
  362. package/src/services/html-transformer.service.js +0 -163
  363. package/src/services/html-transformer.service.ts +0 -217
  364. package/src/services/page-module-import.service.d.ts +0 -37
  365. package/src/services/page-module-import.service.js +0 -88
  366. package/src/services/page-module-import.service.ts +0 -129
  367. package/src/services/page-request-cache-coordinator.service.ts +0 -128
  368. package/src/services/schema-validation-service.ts +0 -204
  369. package/src/services/validation/standard-schema.types.ts +0 -68
  370. package/src/static-site-generator/static-site-generator.ts +0 -359
  371. package/src/utils/css.d.ts +0 -1
  372. package/src/utils/css.js +0 -7
  373. package/src/utils/css.ts +0 -5
  374. package/src/utils/deep-merge.ts +0 -47
  375. package/src/utils/hash.ts +0 -5
  376. package/src/utils/html.ts +0 -1
  377. package/src/utils/invariant.ts +0 -15
  378. package/src/utils/locals-utils.ts +0 -37
  379. package/src/utils/parse-cli-args.ts +0 -83
  380. package/src/utils/path-utils.module.ts +0 -14
  381. package/src/utils/runtime.ts +0 -44
  382. package/src/utils/server-utils.module.ts +0 -67
  383. package/src/watchers/project-watcher.test-helpers.ts +0 -40
  384. package/src/watchers/project-watcher.ts +0 -306
  385. /package/src/adapters/{bun → shared}/define-api-handler.js +0 -0
  386. /package/src/{internal-types.js → plugins/runtime-capability.js} +0 -0
  387. /package/src/services/{asset-processing-service → assets/asset-processing-service}/assets.types.js +0 -0
  388. /package/src/services/{asset-processing-service → assets/asset-processing-service}/processor.interface.js +0 -0
  389. /package/src/services/{asset-processing-service → assets/asset-processing-service}/processor.registry.js +0 -0
  390. /package/src/{public-types.js → services/module-loading/module-loading-types.js} +0 -0
  391. /package/src/services/{schema-validation-service.js → validation/schema-validation-service.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  # Rendering Logic Graph
2
2
 
3
- This document maps the end-to-end rendering logic in core, including request-time rendering, explicit route rendering, static generation, and marker graph orchestration.
3
+ This document maps the end-to-end rendering logic in core, including request-time rendering, explicit route rendering, static generation, and deferred boundary orchestration.
4
4
 
5
5
  ## Design Principles
6
6
 
@@ -12,16 +12,14 @@ These diagrams are based on a few architectural assumptions that seem important
12
12
  Adapters and route matchers decide which renderer to use; once selected, the integration renderer owns the page render pipeline.
13
13
  - **Data resolution should happen before HTML transformation.**
14
14
  Static props, metadata, dependency processing, and route assets are all upstream of final HTML injection.
15
- - **Marker graph orchestration should be a post-render reconciliation step.**
16
- The initial integration render may emit deferred component markers; those are resolved after the first HTML pass, not during route matching.
17
- - **Marker emission is integration-defined boundary behavior.**
18
- Markers are emitted when the active render boundary policy decides a component boundary must be deferred. If no `eco-marker` tokens are emitted, the marker graph stage is skipped entirely.
19
- - **The marker pipeline remains generic after emission.**
20
- Once markers exist, core resolves them generically through marker graph extraction, integration renderer dispatch, asset collection, and HTML replacement. The current built-in React integration is one concrete consumer of that mechanism.
15
+ - **Deferred boundary orchestration should stay renderer-owned.**
16
+ The initial integration render is responsible for handing foreign boundaries back to their owning renderer before final route HTML is returned.
17
+ - **Foreign boundary ownership is renderer-defined behavior.**
18
+ If a renderer cannot resolve a foreign boundary inside its own runtime, route execution now treats any leftover unresolved boundary artifact HTML as an error instead of attempting any route-level fallback.
21
19
  - **Caching policy is authoritative at the page layer.**
22
20
  Middleware, locals, and response reuse all depend on the effective page cache strategy.
23
21
  - **Asset emission should converge into one injection stage.**
24
- Route-level assets, integration assets, page-root component assets, and marker-generated assets all end up in the HTML transformer.
22
+ Route-level assets, integration assets, page-root component assets, and renderer-owned boundary assets all end up in the HTML transformer.
25
23
 
26
24
  ## Entry Points
27
25
 
@@ -136,14 +134,14 @@ flowchart TD
136
134
  K -- Yes --> L[buildGlobalInjectorAssets]
137
135
  K -- No --> M[continue]
138
136
  L --> M
139
- M --> N[HtmlPostProcessingService dedupeProcessedAssets]
137
+ M --> N[HtmlTransformerService dedupeProcessedAssets]
140
138
  N --> O[htmlTransformer setProcessedDependencies]
141
139
  O --> P[return normalized render options]
142
140
  ```
143
141
 
144
142
  ### 4.2 Main execute flow via `RenderExecutionService`
145
143
 
146
- Important nuance: this phase does not always run marker graph resolution. It only does that when the first render pass actually produced `eco-marker` placeholders. In practice today, that usually means a non-React renderer crossed into React component rendering and deferred those nodes for the second pass.
144
+ Important nuance: this phase does not resolve mixed-integration boundaries itself anymore. Renderer-owned runtimes must finish that work before route finalization. If unresolved boundary artifact HTML survives to this phase, route execution fails fast.
147
145
 
148
146
  ```mermaid
149
147
  flowchart TD
@@ -151,19 +149,14 @@ flowchart TD
151
149
  B --> C[prepareRenderOptions]
152
150
  C --> D[runWithComponentRenderContext then render]
153
151
  D --> E[normalize response body to renderedHtml]
154
- E --> F[merge captured and explicit componentGraphContext]
155
- F --> G{contains eco marker token?}
156
- G -- Yes --> H[resolveMarkerGraphHtml]
157
- G -- No --> I[skip graph resolution]
158
- H --> J[HtmlPostProcessingService dedupeProcessedAssets]
159
- J --> K[merge marker assets into transformer deps]
160
- I --> L{root attributes attachable?}
161
- K --> L
162
- L -- Yes --> M[HtmlPostProcessingService applyAttributesToFirstBodyElement]
163
- L -- No --> N[leave html unchanged]
164
- M --> O[htmlTransformer transform]
165
- N --> O
166
- O --> P[return body stream and cache strategy]
152
+ E --> F{contains unresolved boundary artifact html?}
153
+ F -- Yes --> G[throw unresolved boundary error]
154
+ F -- No --> H{root attributes attachable?}
155
+ H -- Yes --> I[HtmlTransformerService applyAttributesToFirstBodyElement]
156
+ H -- No --> J[leave html unchanged]
157
+ I --> K[htmlTransformer transform]
158
+ J --> K
159
+ K --> L[return body stream and cache strategy]
167
160
  ```
168
161
 
169
162
  ### 4.3 Render preparation responsibilities
@@ -189,42 +182,40 @@ flowchart LR
189
182
  flowchart LR
190
183
  A[IntegrationRenderer] --> B[RenderPreparationService]
191
184
  A --> C[RenderExecutionService]
192
- A --> D[MarkerGraphResolver]
193
- A --> E[HtmlPostProcessingService]
185
+ A --> D[QueuedBoundaryRuntimeService]
194
186
  A --> F[PageModuleLoaderService]
195
187
  A --> G[DependencyResolverService]
196
188
  A --> H[HtmlTransformerService]
197
189
 
198
190
  B --> F
199
191
  B --> G
200
- B --> E
201
- C --> D
202
- C --> E
192
+ B --> H
203
193
  C --> H
194
+ D --> H
204
195
  ```
205
196
 
206
- ## 5) Marker Emission + Graph Resolution
197
+ ## 5) Boundary Tokens And Renderer-Owned Resolution
207
198
 
208
- This part is architecturally interesting because it introduces a second render stage. The first pass captures boundaries; the second pass resolves them in dependency order.
199
+ This part is architecturally interesting because boundaries can still emit temporary transport tokens, but renderer-owned runtimes are now responsible for resolving foreign descendants before final route HTML is returned.
209
200
 
210
201
  If this feels complex, the simplest mental model is:
211
202
 
212
203
  - first pass: render everything that can be rendered safely right now
213
- - when a boundary cannot be rendered safely in the current integration pass, emit a placeholder marker instead
214
- - second pass: revisit those placeholders and render them using the correct integration renderer
215
- - final pass: merge any emitted assets and perform the normal HTML transformation
204
+ - when a renderer supports mixed boundaries, hand foreign descendants back to the owning renderer inside that renderer's runtime
205
+ - if literal `<eco-marker>` boundary artifact HTML survives to route finalization, treat it as a failure instead of attempting any route-level fallback
206
+ - final pass: merge emitted assets and perform the normal HTML transformation
216
207
 
217
- In the current implementation, this marker path exists to defer React subtrees that cannot be rendered inline during the active non-React integration pass.
208
+ In the current implementation, renderer-owned runtimes use internal boundary tokens for queued nested handoff. Literal `<eco-marker>` markup remains only as a route-level failure signal when unresolved boundary artifacts escape renderer-owned resolution.
218
209
 
219
- Important clarification: not every integration automatically goes through this stage. The marker pipeline is conditional.
210
+ Important clarification: not every integration automatically goes through this stage. Boundary queueing is conditional.
220
211
 
221
- - If the first render pass returns plain HTML with no `eco-marker` tokens, rendering continues directly to post-processing and HTML transformation.
222
- - If the first render pass emits `eco-marker` tokens, the marker graph is built and resolved before the final HTML rewrite.
223
- - In the current implementation, marker emission is triggered when the active render pass boundary policy decides that entering React should be deferred. The policy is injected through component render context, and the React integration currently opts into that deferred behavior.
212
+ - If a render pass stays inside one integration, rendering continues directly to post-processing and HTML transformation.
213
+ - If a renderer can resolve foreign descendants inline, the boundary runtime returns resolved HTML immediately.
214
+ - If a renderer needs token-based nested handoff, it queues renderer-owned transport tokens and resolves them before returning final HTML.
224
215
 
225
216
  ### Why this exists
226
217
 
227
- The marker pipeline exists because some component boundaries cannot always be rendered eagerly inside the current integration pass.
218
+ Renderer-owned boundary queueing exists because some component boundaries cannot always be rendered eagerly inside the current integration pass.
228
219
 
229
220
  Typical reasons include:
230
221
 
@@ -233,62 +224,45 @@ Typical reasons include:
233
224
  - the parent render needs to preserve ordering and slots before the child subtree is resolved
234
225
  - the child render may emit its own assets or root attributes that must be merged back into the final document
235
226
 
236
- So the first pass captures a stable placeholder plus serialized render context, and the second pass resolves those placeholders using the correct integration renderer.
237
-
238
- Responsibility split:
239
-
240
- - core resolves the deferred marker mechanically: graph shape, refs, slot relationships, and target renderer lookup
241
- - the selected integration renderer resolves the actual component render once it receives `component`, `props`, and optional `children`
227
+ So the first pass either returns resolved renderer-owned output immediately or emits a renderer-local transport token that is resolved before the enclosing renderer returns its final HTML.
242
228
 
243
229
  Another way to say it:
244
230
 
245
- - a marker is a promise that says "this subtree will be rendered later by another renderer"
246
- - the marker stores just enough information to make that later render deterministic
247
- - the graph exists so nested deferred boundaries resolve from leaves to parents, preserving child insertion order and slot structure
231
+ - a boundary token says "this subtree belongs to another renderer, but the current renderer still owns the overall render pass"
232
+ - the token stores just enough information to make that later renderer-owned handoff deterministic
233
+ - the queue exists so nested foreign boundaries resolve from leaves to parents while preserving child insertion order and emitted assets
248
234
 
249
- ### 5.1 Marker emission in `eco.component` factory
235
+ ### 5.1 Boundary interception in `eco.component` factory
250
236
 
251
- The key rule here today is: markers are not a general-purpose placeholder for every component. During an active component render pass, `eco.component` asks the current render boundary context whether the next boundary should be deferred. When the answer is defer, it captures props/refs/slot links and returns an `eco-marker` token instead of rendering the component immediately.
237
+ The key rule here today is: boundaries are resolved by the owning renderer, not by a shared core fallback. During an active component render pass, `eco.component` asks the current render boundary context whether the next boundary should render inline or be resolved by a foreign renderer runtime.
252
238
 
253
- For the current built-in integrations, this is how non-React renders defer React subtrees until the marker resolution pass.
239
+ For the current built-in integrations, this is how non-owning renderers hand foreign subtrees back to the owning runtime without relying on a shared core fallback.
254
240
 
255
241
  ```mermaid
256
242
  flowchart TD
257
243
  A[eco component render] --> B[getComponentRenderContext]
258
- B --> C[boundaryContext decideBoundaryRender]
259
- C --> D{decision is defer?}
260
- D -- No --> E[render component content immediately]
261
- D -- Yes --> F[create nodeId + propsRef]
262
- F --> G[store props in propsByRef]
263
- G --> H{children include eco-marker tokens?}
264
- H -- Yes --> I[create slotRef and slotChildrenByRef links]
265
- H -- No --> J[no slot links]
266
- I --> K[createComponentMarker]
267
- J --> K
268
- K --> L[return eco marker token]
244
+ B --> C[boundaryRuntime interceptBoundarySync]
245
+ C --> D{resolved foreign boundary?}
246
+ D -- No --> E[render component content inline]
247
+ D -- Yes --> F[return renderer-owned resolved html]
269
248
  ```
270
249
 
271
- ### 5.2 Marker graph execution
250
+ ### 5.2 Queued boundary execution
272
251
 
273
- Once markers exist in the HTML, the second pass is integration-agnostic at execution time. Each marker carries its target integration name, so the resolver can ask the right renderer to render that specific node. Even though marker emission is currently React-focused, the resolution phase itself is generic and works off the marker payload plus renderer lookup.
252
+ When string-first renderers queue foreign boundaries, the base renderer helper resolves queued boundary tokens directly against the shared queue service. That pass is intentionally narrow: it only resolves queued boundary tokens that the owning renderer emitted as transport artifacts for that string runtime.
274
253
 
275
- This means the marker itself is not interpreted by the integration renderer. Core interprets the marker and reconstructs render input; the integration renderer only performs the final component render.
254
+ This means boundary tokens are no longer a general component-boundary contract. Core only resolves queued boundary payloads that already belong to a renderer-owned string boundary workflow.
276
255
 
277
256
  ```mermaid
278
257
  flowchart TD
279
- A[resolveMarkerGraphHtml] --> B[buildComponentRefRegistry]
280
- B --> C[extractComponentGraph from html and slot registry]
281
- C --> D[resolveComponentGraph in reverse levels]
282
- D --> E[for each marker node]
283
- E --> F[resolve component by componentRef]
284
- F --> G[resolve props by propsRef]
285
- G --> H[stitch child html from slotRef node ids]
286
- H --> I[getIntegrationRendererForName]
287
- I --> J[renderer.renderComponent]
288
- J --> K[collect component assets]
289
- K --> L[apply root attributes to first element]
290
- L --> M[replace marker token in HTML]
291
- M --> N[resolved html and assets]
258
+ A[string boundary runtime html] --> B[find queued boundary tokens]
259
+ B --> C[resolve nested child tokens first]
260
+ C --> D[dispatch boundary to owning renderer]
261
+ D --> E[renderer.renderComponentBoundary]
262
+ E --> F[collect emitted assets]
263
+ F --> G[apply root attributes to first element]
264
+ G --> H[replace queued token in html]
265
+ H --> I[resolved html and merged assets]
292
266
  ```
293
267
 
294
268
  ## 6) Explicit Rendering Paths (outside FS page matching)
@@ -347,16 +321,12 @@ For someone new to the rendering system, this is probably the most useful order
347
321
  6. `integration-renderer.ts`
348
322
  7. `render-preparation.service.ts`
349
323
  8. `render-execution.service.ts`
350
- 9. `marker-graph-resolver.ts`
351
- 10. `html-post-processing.service.ts`
324
+ 9. `queued-boundary-runtime.service.ts`
325
+ 10. `html-transformer.service.ts`
352
326
  11. `page-module-loader.ts`
353
327
  12. `dependency-resolver.ts`
354
- 13. `component-marker.ts`
355
- 14. `component-graph.ts`
356
- 15. `component-graph-executor.ts`
357
- 16. `eco.ts`
358
- 17. `component-render-context.ts`
359
- 18. `html-transformer.service.ts`
328
+ 13. `eco.ts`
329
+ 14. `component-render-context.ts`
360
330
 
361
331
  ## 9) Key Files
362
332
 
@@ -368,18 +338,14 @@ For someone new to the rendering system, this is probably the most useful order
368
338
  - `packages/core/src/adapters/shared/explicit-static-route-matcher.ts`
369
339
  - `packages/core/src/adapters/shared/render-context.ts`
370
340
  - `packages/core/src/route-renderer/route-renderer.ts`
371
- - `packages/core/src/route-renderer/integration-renderer.ts`
372
- - `packages/core/src/route-renderer/render-preparation.service.ts`
373
- - `packages/core/src/route-renderer/render-execution.service.ts`
374
- - `packages/core/src/route-renderer/html-post-processing.service.ts`
375
- - `packages/core/src/route-renderer/marker-graph-resolver.ts`
376
- - `packages/core/src/route-renderer/component-marker.ts`
377
- - `packages/core/src/route-renderer/component-graph.ts`
378
- - `packages/core/src/route-renderer/component-graph-executor.ts`
379
- - `packages/core/src/route-renderer/page-module-loader.ts`
380
- - `packages/core/src/route-renderer/dependency-resolver.ts`
381
- - `packages/core/src/services/page-module-import.service.ts`
382
- - `packages/core/src/services/page-request-cache-coordinator.service.ts`
341
+ - `packages/core/src/route-renderer/orchestration/integration-renderer.ts`
342
+ - `packages/core/src/route-renderer/orchestration/render-preparation.service.ts`
343
+ - `packages/core/src/route-renderer/orchestration/render-execution.service.ts`
344
+ - `packages/core/src/route-renderer/orchestration/queued-boundary-runtime.service.ts`
345
+ - `packages/core/src/route-renderer/page-loading/page-module-loader.ts`
346
+ - `packages/core/src/route-renderer/page-loading/dependency-resolver.ts`
347
+ - `packages/core/src/services/module-loading/page-module-import.service.ts`
348
+ - `packages/core/src/services/cache/page-request-cache-coordinator.service.ts`
383
349
  - `packages/core/src/eco/component-render-context.ts`
384
350
  - `packages/core/src/eco/eco.ts`
385
351
  - `packages/core/src/services/html-transformer.service.ts`
@@ -19,42 +19,27 @@ The route renderer layer is responsible for:
19
19
  - `RouteRendererFactory` chooses integration renderers based on route file extension.
20
20
  - `RouteRenderer` delegates route execution to the selected integration renderer.
21
21
 
22
- ### `integration-renderer.ts`
22
+ ### `orchestration/`
23
23
 
24
- Abstract base class that coordinates end-to-end route rendering:
24
+ Framework-owned orchestration services and renderer base class:
25
25
 
26
- 1. Resolve page module and page data.
27
- 2. Resolve and process component dependencies.
28
- 3. Add route-level assets and orchestration assets.
29
- 4. Render HTML via integration-specific `render()`.
30
- 5. Inject processed assets into final HTML through `HtmlTransformerService`.
26
+ - `integration-renderer.ts`: abstract base class that coordinates end-to-end route rendering.
27
+ - `render-preparation.service.ts`: page module/data/dependency preparation before render.
28
+ - `render-execution.service.ts`: render capture, unresolved boundary artifact enforcement, and finalization.
29
+ - `route-shell-composer.service.ts`: shared page/view/layout/html-template shell composition used by multiple integrations.
30
+ - `queued-boundary-runtime.service.ts`: shared queued foreign-boundary runtime used directly by renderer-owned helpers, including string-first renderers.
31
31
 
32
32
  It also provides:
33
33
 
34
34
  - `renderToResponse()` contract for explicit-route rendering.
35
35
  - `renderComponent()` contract for component-level orchestration and artifact reporting.
36
- - marker graph resolution for nested cross-integration component boundaries.
36
+ - deferred boundary resolution for nested cross-integration component boundaries.
37
37
 
38
- ### `component-marker.ts`
38
+ ### Boundary Tokens
39
39
 
40
- Defines marker token contract for component-level orchestration:
40
+ Renderer-owned runtimes may emit internal boundary tokens while they resolve foreign descendants before returning final HTML. If literal `<eco-marker ...></eco-marker>` markup survives to route finalization, it is treated as an unresolved boundary artifact rather than a normal transport mechanism.
41
41
 
42
- - `createComponentMarker()` for canonical `<eco-marker ...></eco-marker>` generation.
43
- - `parseComponentMarkers()` for marker extraction from rendered HTML.
44
-
45
- ### `component-graph.ts`
46
-
47
- Builds a deterministic DAG from marker nodes:
48
-
49
- - node collection by marker id.
50
- - parent/child edges from slot reference registry.
51
- - topological levels for bottom-up execution.
52
-
53
- ### `component-graph-executor.ts`
54
-
55
- Resolves graph levels in reverse order (leaf to root) and replaces markers with rendered HTML via integration `renderComponent()`.
56
-
57
- ### `page-module-loader.ts`
42
+ ### `page-loading/`
58
43
 
59
44
  Service for loading page modules and deriving page data:
60
45
 
@@ -62,8 +47,6 @@ Service for loading page modules and deriving page data:
62
47
  - `resolvePageModule()` normalizes exports and statics.
63
48
  - `resolvePageData()` resolves static props then metadata.
64
49
 
65
- ### `dependency-resolver.ts`
66
-
67
50
  Builds processed assets from component dependency declarations:
68
51
 
69
52
  - Scripts/styles/components/modules.
@@ -74,38 +57,73 @@ Builds processed assets from component dependency declarations:
74
57
 
75
58
  Default behavior:
76
59
 
77
- - marker-graph component orchestration + component render artifacts.
60
+ - renderer-owned component-boundary orchestration + component render artifacts.
78
61
  - global lazy trigger map + global injector bootstrap.
79
62
 
63
+ ## Mixed Renderer Mental Model
64
+
65
+ The current mixed-renderer contract has four phases:
66
+
67
+ 1. `render-preparation.service.ts` builds the route inputs and a conservative `boundaryPlan` from declared component dependencies.
68
+ 2. The selected integration renderer owns page, layout, document-shell, and explicit-view composition for that route.
69
+ 3. `route-shell-composer.service.ts` applies the shared page/view/layout/html-template composition flow while calling back into the owning renderer for each boundary render.
70
+ 4. Renderer-owned boundary runtimes resolve foreign nested components through the owning renderer and exchange a compatibility `renderBoundary()` payload with explicit attachment-policy semantics.
71
+ 5. `render-execution.service.ts` finalizes the response and fails if unresolved boundary artifact HTML survives the renderer-owned resolution pass.
72
+
73
+ Important:
74
+
75
+ - Renderer-owned deferral is intentional. Ecopages does not run a route-level fallback resolver after render completion.
76
+ - Boundary ownership is planned from declared component dependency metadata, not inferred purely from rendered HTML.
77
+ - Same-integration children do not have to pass through one universal string-only transport. Each renderer keeps its own child transport rules for same-integration trees.
78
+
79
+ ## Declared Foreign Child Contract
80
+
81
+ Mixed-integration component configs must declare every possible foreign child in `config.dependencies.components`. The planning pass uses those declarations to describe ownership transitions and surface invalid or unknown foreign owners before render execution.
82
+
83
+ Current behavior:
84
+
85
+ - Missing or unknown ownership is recorded on the route `boundaryPlan` as validation errors.
86
+ - Renderer-owned runtime discovery still resolves actual foreign descendants during render.
87
+ - If unresolved boundary artifact HTML reaches route finalization, Ecopages throws instead of attempting a route-level recovery pass.
88
+
80
89
  Global injector lifecycle notes:
81
90
 
82
91
  - The bootstrap remains active across client-side navigations.
83
92
  - On `eco:after-swap`, it prunes stale `ecopages/global-injector-map` scripts and calls `refresh()` so newly swapped `data-eco-trigger` elements can bind their lazy rules.
84
93
  - It must not call injector `cleanup()` on every swap, because that permanently disables future refresh work for the current runtime instance.
85
94
 
86
- ## Current Component Artifact Contract
95
+ ## Boundary Payload Contract
87
96
 
88
- Integration `renderComponent()` returns `ComponentRenderResult` with:
97
+ The compatibility boundary API is `renderBoundary()`. Today it wraps the existing `renderComponentBoundary()` behavior and returns a narrower payload:
89
98
 
90
99
  - `html`
91
- - `canAttachAttributes`
100
+ - `assets`
92
101
  - `rootTag`
93
102
  - `integrationName`
94
103
  - optional `rootAttributes`
95
- - optional `assets`
104
+ - `attachmentPolicy`
105
+
106
+ `renderComponent()` still returns `ComponentRenderResult` internally, including `canAttachAttributes`, because renderer-local implementations have not been collapsed into one universal boundary primitive.
107
+
108
+ Base orchestration uses the compatibility payload to:
109
+
110
+ - keep queued foreign-boundary resolution renderer-owned
111
+ - apply root attributes only when `attachmentPolicy.kind === 'first-element'`
112
+ - preserve asset bubbling through the normal dependency pipeline
96
113
 
97
- Current base orchestration behavior:
114
+ The lower-level `ComponentRenderResult` currently includes:
98
115
 
99
- - Calls `renderComponent()` for the page root component.
100
- - Merges returned `assets` into processed dependencies.
101
- - Applies returned `rootAttributes` to the first element under `<body>`.
116
+ - `html`
117
+ - `canAttachAttributes`
118
+ - `rootTag`
119
+ - `integrationName`
120
+ - optional `rootAttributes`
121
+ - optional `assets`
102
122
 
103
- When rendered output contains `eco-marker` nodes:
123
+ When rendered output still contains unresolved boundary artifact HTML:
104
124
 
105
- - builds marker graph using `componentGraphContext` (`propsByRef`, `slotChildrenByRef`) from integration-specific page module exports.
106
- - resolves markers bottom-up through integration-specific `renderComponent()` calls.
107
- - fails fast when marker component refs or props refs are missing.
108
- - merges marker-rendered assets back into the dependency pipeline with deduplication.
125
+ - route execution now fails fast instead of attempting any route-level unresolved-boundary fallback.
126
+ - renderer-owned boundary runtimes are responsible for resolving foreign nested components before final route HTML is returned.
109
127
 
110
128
  This enables island-style hydration assets (for example React/Lit/Kita integration outputs) to be emitted through the normal dependency injection pipeline.
111
129
 
@@ -128,8 +146,11 @@ This enables island-style hydration assets (for example React/Lit/Kita integrati
128
146
  6. HTML transformer injects head/body dependencies.
129
147
  7. Route result returns body + metadata + cache strategy.
130
148
 
131
- ## Notes for Future Work
149
+ ## Current Limits And Near-Term Work
150
+
151
+ If you are reading this file to understand today's contract, you can stop at the output pipeline above. The items below describe areas still evolving rather than required behavior.
132
152
 
133
- - Expand integration-side marker emission so more nested trees are resolved through graph mode by default.
134
- - Add broader fixtures/e2e for deep multi-level slot graphs.
135
- - Add optional batching by integration per graph level to reduce repeated renderer invocations.
153
+ - Deep multi-level mixed-integration trees now rely on renderer-owned boundary runtimes rather than a shared post-render graph resolver.
154
+ - Each renderer still decides how to hand off foreign boundaries, so specialized runtimes remain appropriate where child serialization or hydration contracts differ.
155
+ - `boundaryPlan` is currently preparation-time metadata and diagnostics. It does not yet drive a full route-composer execution model.
156
+ - A narrow `RouteShellComposer` now owns shared shell composition, but a broader route composer that absorbs boundary ownership or execution flow is still deferred.
@@ -0,0 +1,25 @@
1
+ import type { EcoPagesAppConfig } from '../../types/internal-types.js';
2
+ import type { BoundaryPlan, EcoComponent } from '../../types/public-types.js';
3
+ type BoundaryPlanBuildInput = {
4
+ routeFile: string;
5
+ currentIntegrationName: string;
6
+ HtmlTemplate: EcoComponent;
7
+ Layout?: EcoComponent;
8
+ Page: EcoComponent;
9
+ };
10
+ /**
11
+ * Builds a declared ownership plan from the component dependency graph.
12
+ *
13
+ * The plan is intentionally conservative: it reflects declared component
14
+ * dependencies available during render preparation and records diagnostics for
15
+ * foreign ownership edges that cannot be validated against registered
16
+ * integrations or stable component metadata.
17
+ */
18
+ export declare class BoundaryPlanningService {
19
+ private readonly appConfig;
20
+ private nextSyntheticId;
21
+ constructor(appConfig: EcoPagesAppConfig);
22
+ buildPlan(input: BoundaryPlanBuildInput): BoundaryPlan;
23
+ private isRegisteredIntegration;
24
+ }
25
+ export {};
@@ -0,0 +1,97 @@
1
+ class BoundaryPlanningService {
2
+ appConfig;
3
+ nextSyntheticId = 0;
4
+ constructor(appConfig) {
5
+ this.appConfig = appConfig;
6
+ }
7
+ buildPlan(input) {
8
+ this.nextSyntheticId = 0;
9
+ const validationErrors = [];
10
+ const rendererNames = /* @__PURE__ */ new Set([input.currentIntegrationName]);
11
+ let foreignEdgeCount = 0;
12
+ const buildNode = (component, source, parentIntegrationName, lineage) => {
13
+ const integrationName = component.config?.integration ?? component.config?.__eco?.integration ?? parentIntegrationName;
14
+ const componentMeta = component.config?.__eco;
15
+ const isForeignToParent = integrationName !== parentIntegrationName;
16
+ const componentId = componentMeta?.id ?? componentMeta?.file ?? `${source}:${this.nextSyntheticId += 1}`;
17
+ rendererNames.add(integrationName);
18
+ if (isForeignToParent) {
19
+ foreignEdgeCount += 1;
20
+ if (!componentMeta) {
21
+ validationErrors.push({
22
+ code: "MISSING_COMPONENT_METADATA",
23
+ message: `[ecopages] Foreign boundary "${componentId}" must provide stable __eco metadata so ownership diagnostics stay actionable. Declared dependencies must include all possible foreign children.`,
24
+ componentId,
25
+ integrationName
26
+ });
27
+ }
28
+ if (!this.isRegisteredIntegration(integrationName, input.currentIntegrationName)) {
29
+ validationErrors.push({
30
+ code: "UNKNOWN_INTEGRATION_OWNER",
31
+ message: `[ecopages] Foreign boundary "${componentId}" references unknown integration owner "${integrationName}". Declared dependencies must include all possible foreign children and those integrations must be registered.`,
32
+ componentId,
33
+ componentFile: componentMeta?.file,
34
+ integrationName
35
+ });
36
+ }
37
+ }
38
+ const nextLineage = new Set(lineage);
39
+ nextLineage.add(component);
40
+ const children = (component.config?.dependencies?.components ?? []).flatMap((child) => {
41
+ if (!child || nextLineage.has(child)) {
42
+ return [];
43
+ }
44
+ return [buildNode(child, "dependency", integrationName, nextLineage)];
45
+ });
46
+ return {
47
+ id: componentId,
48
+ source,
49
+ ownership: {
50
+ integrationName,
51
+ componentId,
52
+ componentFile: componentMeta?.file,
53
+ isPageEntry: source === "page",
54
+ isForeignToParent
55
+ },
56
+ children,
57
+ declaredDependenciesValid: true
58
+ };
59
+ };
60
+ const roots = [
61
+ { component: input.HtmlTemplate, source: "html-template" },
62
+ ...input.Layout ? [{ component: input.Layout, source: "layout" }] : [],
63
+ { component: input.Page, source: "page" }
64
+ ];
65
+ const root = {
66
+ id: `route:${input.routeFile}`,
67
+ source: "route",
68
+ ownership: {
69
+ integrationName: input.currentIntegrationName,
70
+ componentId: `route:${input.routeFile}`,
71
+ componentFile: input.routeFile,
72
+ isPageEntry: false,
73
+ isForeignToParent: false
74
+ },
75
+ children: roots.map(
76
+ ({ component, source }) => buildNode(component, source, input.currentIntegrationName, /* @__PURE__ */ new Set())
77
+ ),
78
+ declaredDependenciesValid: validationErrors.length === 0
79
+ };
80
+ return {
81
+ root,
82
+ rendererNames: Array.from(rendererNames),
83
+ foreignEdgeCount,
84
+ hasValidationErrors: validationErrors.length > 0,
85
+ validationErrors
86
+ };
87
+ }
88
+ isRegisteredIntegration(integrationName, currentIntegrationName) {
89
+ if (integrationName === currentIntegrationName) {
90
+ return true;
91
+ }
92
+ return this.appConfig.integrations.some((integration) => integration.name === integrationName);
93
+ }
94
+ }
95
+ export {
96
+ BoundaryPlanningService
97
+ };