@ecopages/core 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -143
- package/package.json +16 -3
- package/src/adapters/node/dev-session.js +2 -1
- package/src/adapters/node/node-client-bridge.d.ts +5 -7
- package/src/adapters/node/node-client-bridge.js +4 -14
- package/src/adapters/node/server-adapter.d.ts +4 -2
- package/src/adapters/node/server-adapter.js +13 -12
- package/src/adapters/shared/hmr/client-bridge.d.ts +25 -0
- package/src/adapters/shared/hmr/client-bridge.js +35 -0
- package/src/adapters/shared/hmr/dev-transform-entrypoint-registry.js +1 -1
- package/src/adapters/shared/hmr/hmr-manager.d.ts +9 -2
- package/src/adapters/shared/hmr/hmr-manager.js +36 -6
- package/src/adapters/shared/http/dist-file-handler.js +3 -7
- package/src/adapters/shared/http/response-headers.d.ts +29 -0
- package/src/adapters/shared/http/response-headers.js +89 -0
- package/src/adapters/shared/runtime/copy-runtime-public-dir.js +1 -1
- package/src/adapters/shared/runtime/runtime-server-lifecycle.d.ts +3 -2
- package/src/adapters/shared/runtime/runtime-server-lifecycle.js +4 -3
- package/src/adapters/shared/runtime/server-request-pipeline.js +4 -4
- package/src/adapters/shared/runtime/server-static-builder.d.ts +19 -8
- package/src/adapters/shared/runtime/server-static-builder.js +23 -4
- package/src/adapters/shared/ws/node-http-websocket-upgrades.d.ts +1 -1
- package/src/adapters/shared/ws/node-http-websocket-upgrades.js +23 -16
- package/src/assets/app-browser-client-build.d.ts +5 -12
- package/src/assets/app-browser-client-build.js +121 -336
- package/src/assets/asset-processing-service/app-browser-client-bundle.d.ts +4 -0
- package/src/assets/asset-processing-service/app-browser-client-bundle.js +6 -0
- package/src/assets/asset-processing-service/asset-dependency-keys.d.ts +28 -8
- package/src/assets/asset-processing-service/asset-dependency-keys.js +104 -29
- package/src/assets/asset-processing-service/asset-processing.service.d.ts +60 -2
- package/src/assets/asset-processing-service/asset-processing.service.js +189 -58
- package/src/assets/asset-processing-service/bundleable-script.d.ts +3 -0
- package/src/assets/asset-processing-service/bundleable-script.js +4 -0
- package/src/assets/asset-processing-service/grouped-content-bundles.d.ts +2 -2
- package/src/assets/asset-processing-service/grouped-content-bundles.js +5 -10
- package/src/assets/asset-processing-service/index.d.ts +0 -3
- package/src/assets/asset-processing-service/index.js +0 -3
- package/src/assets/asset-processing-service/last-good-output.d.ts +21 -0
- package/src/assets/asset-processing-service/last-good-output.js +32 -0
- package/src/assets/asset-processing-service/page-package.js +1 -4
- package/src/assets/asset-processing-service/processed-asset-ledger.d.ts +63 -0
- package/src/assets/asset-processing-service/processed-asset-ledger.js +101 -0
- package/src/assets/asset-processing-service/processors/base/base-processor.js +1 -1
- package/src/assets/asset-processing-service/processors/base/base-script-processor.js +1 -1
- package/src/assets/asset-processing-service/processors/script/content-script.processor.d.ts +24 -0
- package/src/assets/asset-processing-service/processors/script/content-script.processor.js +59 -4
- package/src/assets/asset-processing-service/processors/script/file-script.processor.d.ts +8 -4
- package/src/assets/asset-processing-service/processors/script/file-script.processor.js +18 -6
- package/src/assets/asset-processing-service/processors/script/node-module-script.processor.js +2 -3
- package/src/assets/asset-processing-service/processors/stylesheet/app-stylesheet-imports.d.ts +34 -0
- package/src/assets/asset-processing-service/processors/stylesheet/app-stylesheet-imports.js +115 -0
- package/src/assets/asset-processing-service/processors/stylesheet/content-stylesheet.processor.js +2 -2
- package/src/assets/asset-processing-service/processors/stylesheet/css-module-types.d.ts +39 -0
- package/src/assets/asset-processing-service/processors/stylesheet/css-module-types.js +150 -0
- package/src/assets/asset-processing-service/processors/stylesheet/css-scanner.d.ts +84 -0
- package/src/assets/asset-processing-service/processors/stylesheet/css-scanner.js +379 -0
- package/src/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.d.ts +16 -0
- package/src/assets/asset-processing-service/processors/stylesheet/file-stylesheet.processor.js +50 -24
- package/src/assets/asset-processing-service/processors/stylesheet/import-order.d.ts +33 -0
- package/src/assets/asset-processing-service/processors/stylesheet/import-order.js +67 -0
- package/src/assets/asset-processing-service/processors/stylesheet/package-stylesheet.d.ts +44 -0
- package/src/assets/asset-processing-service/processors/stylesheet/package-stylesheet.js +149 -0
- package/src/assets/asset-processing-service/processors/stylesheet/processed-stylesheet-cache.d.ts +31 -0
- package/src/assets/asset-processing-service/processors/stylesheet/processed-stylesheet-cache.js +59 -0
- package/src/assets/asset-processing-service/processors/stylesheet/source-relative-stylesheet.d.ts +20 -0
- package/src/assets/asset-processing-service/processors/stylesheet/source-relative-stylesheet.js +51 -0
- package/src/assets/asset-processing-service/processors/stylesheet/stylesheet-failure.d.ts +2 -0
- package/src/assets/asset-processing-service/processors/stylesheet/stylesheet-failure.js +5 -0
- package/src/assets/asset-processing-service/processors/stylesheet/stylesheet-module.d.ts +37 -0
- package/src/assets/asset-processing-service/processors/stylesheet/stylesheet-module.js +48 -0
- package/src/assets/asset-processing-service/processors/stylesheet/stylesheet-processor-pipeline.d.ts +25 -1
- package/src/assets/asset-processing-service/processors/stylesheet/stylesheet-processor-pipeline.js +56 -15
- package/src/assets/asset-processing-service/processors/stylesheet/stylesheet-warnings.d.ts +9 -0
- package/src/assets/asset-processing-service/processors/stylesheet/stylesheet-warnings.js +21 -0
- package/src/assets/browser-asset-output.js +1 -1
- package/src/assets/hashed-browser-asset.js +1 -1
- package/src/assets/{browser-runtime-asset-page-cache.d.ts → page-script-page-cache.d.ts} +3 -3
- package/src/assets/{browser-runtime-asset-page-cache.js → page-script-page-cache.js} +3 -3
- package/src/build/app-build-manifest-runtime.d.ts +23 -11
- package/src/build/app-build-manifest-runtime.js +52 -13
- package/src/build/browser/jsx-ownership-plugins.d.ts +4 -1
- package/src/build/browser/jsx-ownership-plugins.js +6 -0
- package/src/build/build-adapter.d.ts +1 -1
- package/src/build/build-adapter.js +1 -1
- package/src/build/build-graph.d.ts +4 -2
- package/src/build/build-graph.js +12 -46
- package/src/build/cache/build-input-dependency-index.d.ts +0 -19
- package/src/build/cache/build-input-dependency-index.js +1 -34
- package/src/build/cache/pages-unified-graph-build.js +7 -43
- package/src/build/cache/server-module-entries.d.ts +1 -1
- package/src/build/cache/server-module-entries.js +9 -9
- package/src/build/contracts/build-contracts.d.ts +59 -12
- package/src/build/contracts/build-manifest.d.ts +3 -6
- package/src/build/contracts/build-manifest.js +2 -12
- package/src/build/contracts/content-virtual-modules.js +1 -3
- package/src/build/copy-server-files.js +1 -1
- package/src/build/preserve-import-meta-transform.d.ts +3 -1
- package/src/build/preserve-import-meta-transform.js +7 -4
- package/src/build/production-asset-ledger.d.ts +36 -0
- package/src/build/production-asset-ledger.js +104 -0
- package/src/build/production-dist-complete.js +12 -13
- package/src/build/production-route-list.js +1 -1
- package/src/build/rolldown/app-package-declarations.js +1 -1
- package/src/build/rolldown/entry-module-closures.d.ts +5 -1
- package/src/build/rolldown/entry-module-closures.js +21 -8
- package/src/build/rolldown/rolldown-adapter-helpers.d.ts +19 -8
- package/src/build/rolldown/rolldown-adapter-helpers.js +82 -45
- package/src/build/rolldown/rolldown-build-adapter.js +10 -13
- package/src/build/rolldown/rolldown-module-id.d.ts +18 -0
- package/src/build/rolldown/rolldown-module-id.js +29 -0
- package/src/build/rolldown/rolldown-plugin-bridge.d.ts +24 -60
- package/src/build/rolldown/rolldown-plugin-bridge.js +201 -373
- package/src/build/rolldown/stylesheet-module-plugin.d.ts +34 -0
- package/src/build/rolldown/stylesheet-module-plugin.js +160 -0
- package/src/build/rolldown/worker-entries-plugin.d.ts +13 -0
- package/src/build/rolldown/worker-entries-plugin.js +57 -0
- package/src/build/runtime/build-environment-options.js +13 -3
- package/src/build/runtime/build-request-identity.js +1 -1
- package/src/build/runtime/build-request-policy.d.ts +7 -12
- package/src/build/runtime/build-request-policy.js +63 -17
- package/src/build/server/imported-view-plugin.d.ts +1 -0
- package/src/build/server/imported-view-plugin.js +6 -4
- package/src/build/server/page-module-import.service.d.ts +1 -2
- package/src/build/server/page-module-import.service.js +4 -6
- package/src/build/server/resolve-static-view.js +3 -2
- package/src/build/server/route-module-build-cache-registry.js +1 -1
- package/src/build/server/route-module-build-cache.store.js +1 -1
- package/src/build/server/route-module-build-manifest.js +1 -1
- package/src/build/server/route-module-dependency-hasher.d.ts +1 -1
- package/src/build/server/route-module-dependency-hasher.js +2 -2
- package/src/build/server/server-modules-manifest.d.ts +3 -5
- package/src/build/server/server-modules-manifest.js +6 -21
- package/src/build/server/view-module.d.ts +12 -0
- package/src/build/server/view-module.js +23 -0
- package/src/build/server/view-reference.d.ts +16 -5
- package/src/build/server/view-reference.js +25 -14
- package/src/build/server-bundle-deploy-manifest.d.ts +1 -1
- package/src/build/server-bundle-deploy-manifest.js +2 -2
- package/src/build/server-bundle-publication.d.ts +7 -1
- package/src/build/server-bundle-publication.js +11 -4
- package/src/build/server-module.js +1 -1
- package/src/build/worker-urls.d.ts +60 -0
- package/src/build/worker-urls.js +197 -0
- package/src/build.d.ts +7 -5
- package/src/build.js +7 -5
- package/src/cache/module-parse-cache.js +2 -2
- package/src/client/navigation-attributes.d.ts +8 -0
- package/src/client/navigation-attributes.js +8 -0
- package/src/client/navigation-scripts/global-scripts.d.ts +14 -0
- package/src/client/navigation-scripts/global-scripts.js +65 -0
- package/src/client/navigation-scripts/index.d.ts +1 -0
- package/src/client/navigation-scripts/index.js +1 -0
- package/src/client.d.ts +2 -2
- package/src/client.js +2 -2
- package/src/config/assembly/app-runtime.d.ts +45 -5
- package/src/config/assembly/app-runtime.js +11 -2
- package/src/config/assembly/finalize-config.js +13 -5
- package/src/config/config-module-files.js +10 -6
- package/src/config/index.d.ts +2 -1
- package/src/config/internal-types.d.ts +3 -0
- package/src/config/load-eco-config.js +8 -5
- package/src/config/resolve-eco-config-path.js +3 -3
- package/src/config/server-config-bundle.js +1 -1
- package/src/config/user-config-types.d.ts +54 -1
- package/src/config/write-types.js +4 -1
- package/src/css-imports.d.ts +12 -0
- package/src/declarations.d.ts +2 -0
- package/src/dev/development-restart-watch-paths.js +1 -1
- package/src/dev/development-restart.js +1 -1
- package/src/dev/invalidation/development-invalidation.service.d.ts +6 -1
- package/src/dev/invalidation/development-invalidation.service.js +18 -2
- package/src/dev/stylesheets/development-stylesheet.service.d.ts +149 -0
- package/src/dev/stylesheets/development-stylesheet.service.js +350 -0
- package/src/dev/transform-server/dev-transform-bundler.d.ts +12 -3
- package/src/dev/transform-server/dev-transform-bundler.js +32 -21
- package/src/dev/transform-server/dev-transform-externalize-plugin.d.ts +3 -5
- package/src/dev/transform-server/dev-transform-externalize-plugin.js +8 -9
- package/src/dev/transform-server/dev-transform-import-rewriter.d.ts +15 -2
- package/src/dev/transform-server/dev-transform-import-rewriter.js +204 -35
- package/src/dev/transform-server/dev-transform-install-stamp.d.ts +17 -0
- package/src/dev/transform-server/dev-transform-install-stamp.js +79 -0
- package/src/dev/transform-server/dev-transform-server.d.ts +38 -2
- package/src/dev/transform-server/dev-transform-server.js +96 -33
- package/src/dev/transform-server/dev-transform-url.d.ts +4 -2
- package/src/dev/transform-server/dev-transform-url.js +13 -12
- package/src/dev/transform-server/dev-transform-vendor-registry.d.ts +178 -21
- package/src/dev/transform-server/dev-transform-vendor-registry.js +675 -99
- package/src/dev/transform-server/index.d.ts +1 -1
- package/src/dev-toolbar/dev-toolbar-package.js +4 -4
- package/src/eco/component-render-output.d.ts +6 -1
- package/src/eco/component-render-output.js +32 -7
- package/src/eco/discovered-dependencies.d.ts +30 -11
- package/src/eco/discovered-dependencies.js +25 -13
- package/src/eco/discovered-dependency-paths.d.ts +36 -0
- package/src/eco/discovered-dependency-paths.js +58 -0
- package/src/eco/eco.browser.js +8 -12
- package/src/eco/eco.js +0 -30
- package/src/eco/mdx-page-metadata.d.ts +14 -0
- package/src/eco/mdx-page-metadata.js +15 -0
- package/src/eco/page-layout-normalization.d.ts +6 -2
- package/src/eco/page-layout-normalization.js +9 -6
- package/src/env.js +17 -0
- package/src/hmr/client/hmr-runtime.js +14 -13
- package/src/hmr/dev-client-runtime.d.ts +5 -2
- package/src/hmr/dev-client-runtime.js +14 -4
- package/src/hmr/hmr-entrypoint-output.js +1 -1
- package/src/hmr/hmr-strategy.d.ts +2 -2
- package/src/hmr/hmr-strategy.js +2 -2
- package/src/hmr/strategies/js-hmr-strategy.d.ts +4 -1
- package/src/hmr/strategies/js-hmr-strategy.js +7 -6
- package/src/hmr/strategies/template-source-hmr-strategy.d.ts +25 -0
- package/src/hmr/strategies/template-source-hmr-strategy.js +36 -0
- package/src/html-pages/html-page-module-scripts.d.ts +2 -1
- package/src/html-pages/html-page-module-scripts.js +37 -14
- package/src/html-pages/html-page-module.js +1 -1
- package/src/html-pages/html-page-renderer.js +7 -6
- package/src/html-pages/html-page-template.d.ts +0 -5
- package/src/html-pages/html-page-template.js +3 -15
- package/src/html-pages/html-pages.plugin.js +2 -2
- package/src/integration.d.ts +8 -6
- package/src/integration.js +5 -3
- package/src/page-cache/html-page-cache-dependency-index.js +1 -1
- package/src/page-cache/page-cache-service.js +1 -1
- package/src/plugins/alias-resolver-plugin.d.ts +7 -0
- package/src/plugins/alias-resolver-plugin.js +16 -6
- package/src/plugins/component-import-discovery.d.ts +178 -7
- package/src/plugins/component-import-discovery.js +696 -112
- package/src/plugins/eco-component-meta-plugin.d.ts +47 -6
- package/src/plugins/eco-component-meta-plugin.js +227 -59
- package/src/plugins/foreign-jsx-override-plugin.d.ts +14 -1
- package/src/plugins/foreign-jsx-override-plugin.js +18 -8
- package/src/plugins/integration-plugin.d.ts +47 -11
- package/src/plugins/integration-plugin.js +57 -8
- package/src/plugins/processor.d.ts +72 -7
- package/src/plugins/processor.js +44 -9
- package/src/plugins/stylesheet-kinds.d.ts +57 -0
- package/src/plugins/stylesheet-kinds.js +114 -0
- package/src/plugins/tsconfig-import-resolver.d.ts +49 -3
- package/src/plugins/tsconfig-import-resolver.js +120 -6
- package/src/processor-contract.d.ts +66 -0
- package/src/processor-contract.js +389 -0
- package/src/processor.d.ts +6 -1
- package/src/processor.js +6 -1
- package/src/route-renderer/error-pages/default-error-pages.d.ts +1 -0
- package/src/route-renderer/error-pages/default-error-pages.js +27 -7
- package/src/route-renderer/orchestration/custom-element-scripts/custom-element-script-preload-invalidation.d.ts +8 -0
- package/src/route-renderer/orchestration/custom-element-scripts/custom-element-script-preload-invalidation.js +12 -0
- package/src/route-renderer/orchestration/custom-element-scripts/custom-element-script-preloader.d.ts +77 -24
- package/src/route-renderer/orchestration/custom-element-scripts/custom-element-script-preloader.js +97 -32
- package/src/route-renderer/orchestration/custom-element-scripts/custom-element-server-module-importer.js +1 -1
- package/src/route-renderer/orchestration/document-shell/document-shell-render.service.d.ts +9 -0
- package/src/route-renderer/orchestration/document-shell/document-shell-render.service.js +16 -2
- package/src/route-renderer/orchestration/document-shell/layout-children-not-rendered-error.d.ts +35 -0
- package/src/route-renderer/orchestration/document-shell/layout-children-not-rendered-error.js +53 -0
- package/src/route-renderer/orchestration/foreign-child/render-session.d.ts +4 -8
- package/src/route-renderer/orchestration/foreign-child/render-session.js +2 -5
- package/src/route-renderer/orchestration/integration-renderer.d.ts +171 -64
- package/src/route-renderer/orchestration/integration-renderer.js +293 -332
- package/src/route-renderer/orchestration/ownership-graph/component-graph-collectors.d.ts +8 -5
- package/src/route-renderer/orchestration/ownership-graph/component-graph-collectors.js +27 -25
- package/src/route-renderer/orchestration/ownership-graph/component-graph.d.ts +0 -6
- package/src/route-renderer/orchestration/page-browser-graph/global-injector-assets.service.js +3 -3
- package/src/route-renderer/orchestration/page-browser-graph/grouped-graph-build-plan.d.ts +12 -25
- package/src/route-renderer/orchestration/page-browser-graph/grouped-graph-build-plan.js +1 -14
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.d.ts +0 -16
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.js +1 -87
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph.service.d.ts +8 -16
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph.service.js +25 -271
- package/src/route-renderer/orchestration/page-browser-graph/route-instance-key.d.ts +0 -24
- package/src/route-renderer/orchestration/page-browser-graph/route-instance-key.js +0 -67
- package/src/route-renderer/orchestration/route-pipeline/route-render-orchestrator.d.ts +28 -15
- package/src/route-renderer/orchestration/route-pipeline/route-render-orchestrator.js +63 -41
- package/src/route-renderer/page-loading/component-dependency-collection.d.ts +4 -1
- package/src/route-renderer/page-loading/component-dependency-collection.js +51 -15
- package/src/route-renderer/page-loading/dependency-resolver.d.ts +10 -0
- package/src/route-renderer/page-loading/dependency-resolver.js +27 -6
- package/src/route-renderer/page-loading/file-scoped-dependency-components.d.ts +4 -2
- package/src/route-renderer/page-loading/file-scoped-dependency-components.js +22 -17
- package/src/route-renderer/page-loading/lazy-entry-collection.d.ts +5 -0
- package/src/route-renderer/page-loading/lazy-entry-collection.js +6 -4
- package/src/route-renderer/page-loading/page-dependency-bundling.d.ts +5 -2
- package/src/route-renderer/page-loading/page-dependency-bundling.js +15 -31
- package/src/route-renderer/page-loading/page-module-loader.d.ts +13 -2
- package/src/route-renderer/page-loading/page-module-loader.js +23 -5
- package/src/route-renderer/route-renderer.d.ts +1 -1
- package/src/router/client/navigation-commit.d.ts +2 -0
- package/src/router/client/navigation-commit.js +4 -1
- package/src/router/client/navigation-coordinator.d.ts +18 -0
- package/src/router/client/navigation-coordinator.js +14 -0
- package/src/router/client/navigation-lifecycle.d.ts +8 -1
- package/src/router/client/navigation-lifecycle.js +6 -3
- package/src/router/client/navigation-pipeline.d.ts +1 -0
- package/src/router/client/navigation-pipeline.js +1 -0
- package/src/router/server/route-registry.d.ts +3 -2
- package/src/router/server/route-registry.js +6 -5
- package/src/static-site-generator/production-page-browser-graph-prebuild.d.ts +30 -18
- package/src/static-site-generator/production-page-browser-graph-prebuild.js +82 -143
- package/src/static-site-generator/static-site-generator.d.ts +37 -4
- package/src/static-site-generator/static-site-generator.js +99 -51
- package/src/types/asset-types.d.ts +19 -1
- package/src/types/build-types.d.ts +53 -35
- package/src/types/component-identity.d.ts +8 -0
- package/src/types/contracts.d.ts +69 -21
- package/src/types/dev-transform-types.d.ts +33 -6
- package/src/types/eco-api-types.d.ts +13 -18
- package/src/types/integration-types.d.ts +1 -1
- package/src/types/public-types.d.ts +1 -1
- package/src/utils/additional-watch-paths.js +3 -5
- package/src/utils/entry-command-flags.d.ts +23 -0
- package/src/utils/entry-command-flags.js +24 -0
- package/src/utils/package-path.d.ts +42 -0
- package/src/utils/package-path.js +114 -0
- package/src/utils/parse-cli-args.d.ts +18 -1
- package/src/utils/parse-cli-args.js +54 -37
- package/src/utils/path-containment.js +3 -10
- package/src/utils/resolve-work-dir.js +2 -2
- package/src/utils/root-relative-path.js +2 -2
- package/src/utils/server-bundle-context.d.ts +5 -0
- package/src/utils/server-bundle-context.js +7 -1
- package/src/utils/server-utils.module.js +1 -1
- package/src/watchers/project-watcher-ignore.js +3 -3
- package/src/watchers/project-watcher.d.ts +14 -2
- package/src/watchers/project-watcher.js +37 -6
- package/src/watchers/workspace-package-watch-roots.js +2 -2
- package/src/assets/app-browser-client-manifest.d.ts +0 -66
- package/src/assets/app-browser-client-manifest.js +0 -260
- package/src/assets/asset-processing-service/asset-package-role.d.ts +0 -2
- package/src/assets/asset-processing-service/asset-package-role.js +0 -3
- package/src/assets/asset-processing-service/browser-runtime-asset.factory.d.ts +0 -58
- package/src/assets/asset-processing-service/browser-runtime-asset.factory.js +0 -61
- package/src/assets/asset-processing-service/browser-runtime-entry-resolution.d.ts +0 -79
- package/src/assets/asset-processing-service/browser-runtime-entry-resolution.js +0 -200
- package/src/assets/asset-processing-service/browser-runtime-entry.factory.d.ts +0 -24
- package/src/assets/asset-processing-service/browser-runtime-entry.factory.js +0 -67
- package/src/build/browser/browser-runtime-manifest.d.ts +0 -35
- package/src/build/browser/browser-runtime-manifest.js +0 -65
- package/src/build/browser/browser-runtime-plugin-helpers.d.ts +0 -14
- package/src/build/browser/browser-runtime-plugin-helpers.js +0 -21
- package/src/build/browser/browser-runtime-plugin.d.ts +0 -54
- package/src/build/browser/browser-runtime-plugin.js +0 -76
- package/src/build/rolldown/server-side-css-shim-plugin.d.ts +0 -28
- package/src/build/rolldown/server-side-css-shim-plugin.js +0 -59
- package/src/dev/transform-server/dev-transform-module-kind.d.ts +0 -13
- package/src/dev/transform-server/dev-transform-module-kind.js +0 -17
- package/src/dev/transform-server/dev-transform-runtime-specifiers.d.ts +0 -5
- package/src/dev/transform-server/dev-transform-runtime-specifiers.js +0 -16
- package/src/route-renderer/orchestration/custom-element-scripts/custom-element-ssr-preload-entrypoint.d.ts +0 -15
- package/src/route-renderer/orchestration/custom-element-scripts/custom-element-ssr-preload-entrypoint.js +0 -65
- package/src/route-renderer/orchestration/page-browser-graph/missing-production-browser-graph.d.ts +0 -21
- package/src/route-renderer/orchestration/page-browser-graph/missing-production-browser-graph.js +0 -31
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
import type { EcoPagesAppConfig, IHmrManager, InternalComponentRenderInput } from '../../config/internal-types.js';
|
|
7
|
-
import type { ComponentRenderInput, ComponentRenderResult, EcoComponent, EcoPageFile, EcoPagesElement, HtmlTemplateProps, IntegrationRendererRenderOptions, InternalIntegrationRendererRenderOptions, PageBrowserGraphContribution, PageBrowserGraphContributionContext,
|
|
7
|
+
import type { ComponentRenderInput, ComponentRenderResult, EcoComponent, EcoPageFile, EcoPagesElement, HtmlTemplateProps, IntegrationRendererRenderOptions, InternalIntegrationRendererRenderOptions, PageBrowserGraphContribution, PageBrowserGraphContributionContext, PageBrowserGraphDeclaration, PageMetadataProps, RouteRendererBody, RouteRendererOptions, RouteRenderResult } from '../../types/contracts.js';
|
|
8
8
|
import { type AssetProcessingService, type ProcessedAsset } from '../../assets/asset-processing-service/index.js';
|
|
9
9
|
import type { AssetProcessingIntegration } from '../../assets/asset-processing-service/asset-processing-integration.js';
|
|
10
10
|
import { HtmlTransformerService } from '../../html/html-transformer.service.js';
|
|
@@ -12,14 +12,16 @@ import type { HtmlDocumentContribution } from '../../html/html-transformer.servi
|
|
|
12
12
|
import { HttpError } from '../../errors/http-error.js';
|
|
13
13
|
import { DependencyResolverService } from '../page-loading/dependency-resolver.js';
|
|
14
14
|
import { PageModuleLoaderService } from '../page-loading/page-module-loader.js';
|
|
15
|
-
import { type PreparedComponentGraphNode
|
|
15
|
+
import { type PreparedComponentGraphNode } from './ownership-graph/component-graph.js';
|
|
16
16
|
import { type PageClientBrowserAssets, type PageClientBuildEntry, type PageClientPlan } from './ownership-graph/page-client-plan.js';
|
|
17
|
-
import { RouteRenderOrchestrator, type RouteHtmlFinalization, type RouteRenderOrchestratorResolvedInputs } from './route-pipeline/route-render-orchestrator.js';
|
|
17
|
+
import { RouteRenderOrchestrator, type PlannedRoutePreparation, type RouteHtmlFinalization, type RouteRenderOrchestratorResolvedInputs } from './route-pipeline/route-render-orchestrator.js';
|
|
18
18
|
import { type ResolvedPageDependencies } from '../page-loading/resolved-page-dependencies.js';
|
|
19
|
-
import {
|
|
19
|
+
import type { GroupedGraphBuildPlan } from './page-browser-graph/grouped-graph-build-plan.js';
|
|
20
20
|
import type { ForeignChildInterceptionInput, ForeignChildRuntime } from '../../eco/component-render-context.js';
|
|
21
|
+
import { CustomElementScriptPreloader, type SsrScriptAssignment, type SsrScriptPreloaderInit } from './custom-element-scripts/custom-element-script-preloader.js';
|
|
21
22
|
import { type ForeignSubtreeExecutionOwningRenderer, type QueuedForeignSubtreeResolutionContext, type RenderQueuedForeignSubtreeChildren } from './foreign-child/foreign-subtree-execution.service.js';
|
|
22
23
|
import { type DocumentShellComposeChildrenHook, type DocumentShellLayoutInput } from './document-shell/document-shell-render.service.js';
|
|
24
|
+
import { type LayoutChildrenNotRenderedHandler } from './document-shell/layout-children-not-rendered-error.js';
|
|
23
25
|
/**
|
|
24
26
|
* Controls how one route module is loaded outside the normal render path.
|
|
25
27
|
*/
|
|
@@ -42,7 +44,7 @@ export type HtmlDocumentContributionContext<C = EcoPagesElement> = {
|
|
|
42
44
|
renderOptions?: IntegrationRendererRenderOptions<C>;
|
|
43
45
|
partial?: boolean;
|
|
44
46
|
};
|
|
45
|
-
export type { PageBrowserGraphContribution, PageBrowserGraphContributionContext } from '../../types/contracts.js';
|
|
47
|
+
export type { PageBrowserGraphContribution, PageBrowserGraphContributionContext, PageBrowserGraphDeclaration, } from '../../types/contracts.js';
|
|
46
48
|
export { selectHydrationIslandEntries, type PageClientBrowserAssets, type PageClientBuildEntry, type PageClientPlan, } from './ownership-graph/page-client-plan.js';
|
|
47
49
|
export type { HtmlDocumentContribution } from '../../html/html-transformer.service.js';
|
|
48
50
|
export type IntegrationRendererHooks = {
|
|
@@ -58,7 +60,15 @@ export type IntegrationRendererHooks = {
|
|
|
58
60
|
foreignChildRoots?: ReadonlyArray<EcoComponent | Partial<EcoComponent>>;
|
|
59
61
|
}) => DocumentShellComposeChildrenHook | undefined;
|
|
60
62
|
normalizePageModule?: <TPageModule extends EcoPageFile>(file: string, module: TPageModule) => TPageModule;
|
|
61
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Names what one Page adds to its Page Browser Graph.
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* The production prebuild calls it while it plans routes, before the app-wide browser build exists, so it must
|
|
68
|
+
* process nothing: return components and scripts in `components` and `bundledScripts`, and core processes
|
|
69
|
+
* them when it resolves the graph and plans their scripts for the app-wide build.
|
|
70
|
+
*/
|
|
71
|
+
collectPageBrowserGraphContribution?: (context: PageBrowserGraphContributionContext) => Promise<PageBrowserGraphDeclaration | undefined>;
|
|
62
72
|
documentContributions?: <C>(context: HtmlDocumentContributionContext<C>) => HtmlDocumentContribution[] | undefined;
|
|
63
73
|
documentAttributes?: <C>(renderOptions: IntegrationRendererRenderOptions<C>) => Record<string, string> | undefined;
|
|
64
74
|
/** Supplies an Integration-specific browser page payload or top-level document props. */
|
|
@@ -73,6 +83,16 @@ export type IntegrationRendererHooks = {
|
|
|
73
83
|
beforeRender?: <C>(options: IntegrationRendererRenderOptions<C>) => Promise<void>;
|
|
74
84
|
beforeImportPageModule?: (file: string) => Promise<void>;
|
|
75
85
|
transformDocumentHtml?: (html: string) => string;
|
|
86
|
+
/**
|
|
87
|
+
* Server-renders the custom elements in a Page document that another Integration produced.
|
|
88
|
+
*
|
|
89
|
+
* @remarks
|
|
90
|
+
* Core calls it on the finished document of a Page that has `ssr: true` scripts assigned to this Integration's
|
|
91
|
+
* preloader, whichever Integration owns the Page, so an element it registered gets its server output wherever the
|
|
92
|
+
* markup came from. It must leave markup it already rendered unchanged. Only a string document is passed; any
|
|
93
|
+
* other body is returned as it is.
|
|
94
|
+
*/
|
|
95
|
+
renderCustomElements?: (html: string) => Promise<string> | string;
|
|
76
96
|
/**
|
|
77
97
|
* Optional wrapper around the route render, for scoping such as HMR ownership.
|
|
78
98
|
* @remarks Core already wraps whatever this throws with `createRenderError('Error rendering page')`,
|
|
@@ -92,6 +112,14 @@ export type IntegrationRendererOptions = {
|
|
|
92
112
|
hooks?: IntegrationRendererHooks | IntegrationRendererHookFactory;
|
|
93
113
|
};
|
|
94
114
|
/** Options available while creating one renderer's Integration hooks. */
|
|
115
|
+
/** The Components of a Page tree whose `ssr: true` scripts core assigns to an Integration's preloader. */
|
|
116
|
+
export type PageSsrScriptComponents = {
|
|
117
|
+
Page?: EcoComponent | Partial<EcoComponent>;
|
|
118
|
+
Layout?: EcoComponent | Partial<EcoComponent>;
|
|
119
|
+
HtmlTemplate?: EcoComponent | Partial<EcoComponent>;
|
|
120
|
+
Layouts?: ReadonlyArray<EcoComponent | Partial<EcoComponent>>;
|
|
121
|
+
pageDependencyComponents?: ReadonlyArray<EcoComponent | Partial<EcoComponent>>;
|
|
122
|
+
};
|
|
95
123
|
export type IntegrationRendererHookFactoryOptions = Omit<IntegrationRendererOptions, 'hooks'> & {
|
|
96
124
|
hooks?: IntegrationRendererHooks;
|
|
97
125
|
/** Resolves component assets with this renderer's dependency rules and active render session. */
|
|
@@ -102,12 +130,46 @@ export type IntegrationRendererHookFactoryOptions = Omit<IntegrationRendererOpti
|
|
|
102
130
|
resolveDependencyPath: (componentDir: string, pathUrl: string) => string;
|
|
103
131
|
/** Resolves lazy client triggers from processed assets using the current render session. */
|
|
104
132
|
applyPendingLazyTriggers: (assets: ProcessedAsset[], configs: PageClientPlan['lazyConfigs']) => PageClientBrowserAssets['lazyTriggers'];
|
|
133
|
+
/**
|
|
134
|
+
* Builds the custom-element preloader that evaluates the `ssr: true` scripts core assigns to this Integration.
|
|
135
|
+
*
|
|
136
|
+
* @remarks
|
|
137
|
+
* The preloader follows the Integration's `ssrScriptPreload` declaration, which is the only statement of whether
|
|
138
|
+
* and what it preloads. Core runs it once per render, over the scripts it assigned from the whole Page tree.
|
|
139
|
+
* @throws When the Integration declares no `ssrScriptPreload`, since core would assign it no script.
|
|
140
|
+
*/
|
|
141
|
+
createSsrScriptPreloader: (init: SsrScriptPreloaderInit) => CustomElementScriptPreloader;
|
|
105
142
|
};
|
|
106
143
|
/** Creates the optional hooks for one app-owned renderer instance. */
|
|
107
144
|
export type IntegrationRendererHookFactory = (options: IntegrationRendererHookFactoryOptions) => IntegrationRendererHooks;
|
|
108
145
|
type IntegrationRendererConstructionOptions = Omit<IntegrationRendererOptions, 'hooks'> & {
|
|
109
146
|
hooks?: IntegrationRendererHooks | IntegrationRendererHookFactory;
|
|
110
147
|
};
|
|
148
|
+
/** One route instance the production build plans: a Page with its Params, a route template or a view. */
|
|
149
|
+
export type PlannedRouteInstance = {
|
|
150
|
+
routeFile: string;
|
|
151
|
+
params?: RouteRendererOptions['params'];
|
|
152
|
+
query?: RouteRendererOptions['query'];
|
|
153
|
+
skipStaticProps?: RouteRendererOptions['skipStaticProps'];
|
|
154
|
+
isRouteTemplate?: boolean;
|
|
155
|
+
};
|
|
156
|
+
/** One renderer's production routes: what they need from the app-wide browser build, and how to prepare them. */
|
|
157
|
+
export type ProductionRoutesPlan = {
|
|
158
|
+
plan: GroupedGraphBuildPlan;
|
|
159
|
+
/**
|
|
160
|
+
* Processes every planned route's dependencies once the app-wide browser build recorded its outputs.
|
|
161
|
+
*
|
|
162
|
+
* @remarks
|
|
163
|
+
* It reuses the inputs planning resolved, so no data hook runs again, and renders nothing. Every dependency
|
|
164
|
+
* it processes is recorded in the asset ledger, which is what `ecopages start` serves the route from.
|
|
165
|
+
*/
|
|
166
|
+
prepare: () => Promise<void>;
|
|
167
|
+
/** Each planned instance with its preparation, which the build's static export renders the instance with. */
|
|
168
|
+
preparations: ReadonlyArray<{
|
|
169
|
+
instance: PlannedRouteInstance;
|
|
170
|
+
preparation: PlannedRoutePreparation;
|
|
171
|
+
}>;
|
|
172
|
+
};
|
|
111
173
|
/**
|
|
112
174
|
* The IntegrationRenderer class is an abstract class that provides a base for rendering integration-specific components in the EcoPages framework.
|
|
113
175
|
* It handles the import of page files, collection of dependencies, and preparation of render options.
|
|
@@ -119,6 +181,8 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
119
181
|
protected assetProcessingService: AssetProcessingService;
|
|
120
182
|
protected assetProcessingIntegration?: AssetProcessingIntegration;
|
|
121
183
|
protected htmlTransformer: HtmlTransformerService;
|
|
184
|
+
/** Reports a layout that rendered without its children by the current render mode. */
|
|
185
|
+
protected readonly onLayoutChildrenNotRendered: LayoutChildrenNotRenderedHandler;
|
|
122
186
|
protected hmrManager?: IHmrManager;
|
|
123
187
|
protected resolvedIntegrationDependencies: ProcessedAsset[];
|
|
124
188
|
protected options: Required<InternalIntegrationRendererRenderOptions>;
|
|
@@ -126,9 +190,7 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
126
190
|
protected pageModuleLoaderService: PageModuleLoaderService;
|
|
127
191
|
protected routeRenderOrchestrator: RouteRenderOrchestrator;
|
|
128
192
|
protected integrationHooks: IntegrationRendererHooks;
|
|
129
|
-
private
|
|
130
|
-
private readonly prebuiltGroupedBuildPlans;
|
|
131
|
-
private readonly prebuiltPageClientBrowserAssets;
|
|
193
|
+
private ssrScriptPreloader?;
|
|
132
194
|
protected DOC_TYPE: string;
|
|
133
195
|
protected getActiveHmrManager(): IHmrManager | undefined;
|
|
134
196
|
protected getAssetProcessingIntegration(name?: string): AssetProcessingIntegration | undefined;
|
|
@@ -137,54 +199,33 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
137
199
|
*/
|
|
138
200
|
protected ensureIntegrationRuntimeActivated(): Promise<void>;
|
|
139
201
|
/**
|
|
140
|
-
*
|
|
141
|
-
*/
|
|
142
|
-
prebuildProductionPageBrowserGraph(routeFile: string, options?: Pick<RouteRendererOptions, 'params' | 'query'> & {
|
|
143
|
-
skipStaticProps?: RouteRendererOptions['skipStaticProps'];
|
|
144
|
-
isRouteTemplate?: boolean;
|
|
145
|
-
groupedBuildPlan?: GroupedGraphBuildPlan;
|
|
146
|
-
}): Promise<void>;
|
|
147
|
-
/** Returns the production app browser plan candidate for one route instance. */
|
|
148
|
-
getGroupedBuildPlanForRoute(routeOptions: Pick<RouteRendererOptions, 'file' | 'params' | 'query'>): GroupedGraphBuildPlan | undefined;
|
|
149
|
-
/**
|
|
150
|
-
* Builds one production grouped graph plan for the supplied static route instances.
|
|
202
|
+
* Plans the supplied production route instances without processing any of their assets.
|
|
151
203
|
*
|
|
152
204
|
* @remarks
|
|
153
|
-
* When `onRouteFailure` is provided, failed route instances are reported and
|
|
154
|
-
* route failure rejects the operation.
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
isRouteTemplate?: boolean;
|
|
162
|
-
}>, options?: {
|
|
163
|
-
onRouteFailure?: (routeInstance: {
|
|
164
|
-
routeFile: string;
|
|
165
|
-
params?: RouteRendererOptions['params'];
|
|
166
|
-
query?: RouteRendererOptions['query'];
|
|
167
|
-
skipStaticProps?: RouteRendererOptions['skipStaticProps'];
|
|
168
|
-
isRouteTemplate?: boolean;
|
|
169
|
-
}, error: unknown) => void;
|
|
170
|
-
}): Promise<GroupedGraphBuildPlan>;
|
|
171
|
-
private getPrebuiltRoutePreparation;
|
|
172
|
-
getPrebuiltRouteComponentGraphs(routeOptions: RouteRendererOptions): PreparedRouteComponentGraphs | undefined;
|
|
173
|
-
/**
|
|
174
|
-
* Drops every production prebuild result for a route, including its grouped plan and page-client assets.
|
|
205
|
+
* When `onRouteFailure` is provided, failed route instances are reported and left out of the plan. Without it, a
|
|
206
|
+
* route failure rejects the operation. Returns nothing when no instance could be planned.
|
|
207
|
+
*/
|
|
208
|
+
planProductionRoutes(instances: ReadonlyArray<PlannedRouteInstance>, options?: {
|
|
209
|
+
onRouteFailure?: (routeInstance: PlannedRouteInstance, error: unknown) => void;
|
|
210
|
+
}): Promise<ProductionRoutesPlan | undefined>;
|
|
211
|
+
/**
|
|
212
|
+
* Plans one route instance without processing any of its assets.
|
|
175
213
|
*
|
|
176
214
|
* @remarks
|
|
177
|
-
*
|
|
178
|
-
*
|
|
215
|
+
* The scripts the route's render would bundle, from the shell, the page Dependencies, the Page Browser Graph
|
|
216
|
+
* dependencies and the components and scripts its contribution names, go to `bundledScripts`, prepared as asset
|
|
217
|
+
* processing prepares them.
|
|
179
218
|
*/
|
|
180
|
-
|
|
219
|
+
private planRouteInstance;
|
|
220
|
+
private runInRenderSession;
|
|
181
221
|
/**
|
|
182
222
|
* Loads one route module through the owning renderer's import path.
|
|
183
223
|
*
|
|
184
224
|
* Request-time infrastructure may need page metadata such as cache strategy or
|
|
185
225
|
* middleware before full rendering starts. Exposing this narrow entrypoint lets
|
|
186
226
|
* those callers reuse integration-specific import setup instead of bypassing it
|
|
187
|
-
* with raw transpiler access.
|
|
227
|
+
* with raw transpiler access. A module that still exports `getStaticProps`,
|
|
228
|
+
* `getStaticPaths` or `getMetadata` fails here with an error that points to the codemod.
|
|
188
229
|
*/
|
|
189
230
|
loadPageModule(file: string, options?: RouteModuleLoadOptions): Promise<EcoPageFile>;
|
|
190
231
|
setHmrManager(hmrManager: IHmrManager): void;
|
|
@@ -212,8 +253,6 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
212
253
|
* status so the request matcher can serve a 404 instead of a 500.
|
|
213
254
|
*/
|
|
214
255
|
protected createRenderError(message: string, cause?: unknown): HttpError;
|
|
215
|
-
protected resolvePageBrowserGraphForFile(filePath: string): Promise<PageBrowserGraphResult | undefined>;
|
|
216
|
-
protected resolvePageBrowserGraphForRoute(filePath: string, routeOptions?: Pick<RouteRendererOptions, 'params' | 'query' | 'skipStaticProps'>, groupedBuildPlan?: GroupedGraphBuildPlan): Promise<PageBrowserGraphResult | undefined>;
|
|
217
256
|
/**
|
|
218
257
|
* Renders a route page through optional layout and document shells.
|
|
219
258
|
*
|
|
@@ -254,6 +293,56 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
254
293
|
protected renderStringComponentWithQueuedForeignSubtrees(input: ComponentRenderInput, component: (props: Record<string, unknown>) => Promise<EcoPagesElement> | EcoPagesElement): Promise<ComponentRenderResult>;
|
|
255
294
|
private resolveQueuedForeignChildren;
|
|
256
295
|
constructor({ appConfig, assetProcessingService, assetProcessingIntegration, resolvedIntegrationDependencies, hooks, }: IntegrationRendererConstructionOptions);
|
|
296
|
+
private createSsrScriptPreloader;
|
|
297
|
+
/**
|
|
298
|
+
* Decides what a script that fails to preload costs: the overlay in development, the build in static generation.
|
|
299
|
+
*
|
|
300
|
+
* @remarks
|
|
301
|
+
* Development keeps rendering the element without server rendering (see {@link keepsLastGoodOutput}). Static
|
|
302
|
+
* generation throws, so a build cannot exit 0 with elements that lack their server output. `ecopages start` only
|
|
303
|
+
* warns: it renders at request time, where throwing would turn one broken script into a failing page.
|
|
304
|
+
*
|
|
305
|
+
* @throws In static generation, naming the script and the cause.
|
|
306
|
+
*/
|
|
307
|
+
private handleSsrPreloadFailure;
|
|
308
|
+
/**
|
|
309
|
+
* Evaluates the `ssr: true` scripts of the whole Page tree, each by the one preloader core assigns it to.
|
|
310
|
+
*
|
|
311
|
+
* @remarks
|
|
312
|
+
* The assignment is made once, over the Page, its Layouts, the Html template and the Page's dependency
|
|
313
|
+
* Components, so no Integration decides from the part of the tree its own hook sees. Every assigned Integration
|
|
314
|
+
* preloads its share, including one that owns no Component the Page renders itself: a Page another Integration
|
|
315
|
+
* owns can reach it through a Component whose Integration does not preload. An assigned Integration other than
|
|
316
|
+
* this one is activated first.
|
|
317
|
+
*/
|
|
318
|
+
private assignPageSsrScripts;
|
|
319
|
+
/**
|
|
320
|
+
* Names the Integrations whose preloader evaluates an `ssr: true` script of this Page.
|
|
321
|
+
*
|
|
322
|
+
* @remarks
|
|
323
|
+
* Such an Integration takes part in the Page even when it owns none of its Components, as Lit does for an element
|
|
324
|
+
* declared on a Kita Component, so its global scripts, such as Lit's hydration support, reach the document.
|
|
325
|
+
*/
|
|
326
|
+
getPageSsrScriptIntegrationNames(options: PageSsrScriptComponents): string[];
|
|
327
|
+
/**
|
|
328
|
+
* Evaluates the `ssr: true` scripts of the whole Page tree, each by the one preloader core assigns it to.
|
|
329
|
+
*
|
|
330
|
+
* @remarks
|
|
331
|
+
* The assignment is made once, over the Page, its Layouts, the Html template and the Page's dependency
|
|
332
|
+
* Components, so no Integration decides from the part of the tree its own hook sees. Every assigned Integration
|
|
333
|
+
* preloads its share, including one that owns no Component the Page renders itself: a Page another Integration
|
|
334
|
+
* owns can reach it through a Component whose Integration does not preload. An assigned Integration other than
|
|
335
|
+
* this one is activated first.
|
|
336
|
+
*
|
|
337
|
+
* @returns The renderers of the assigned Integrations, which also render custom elements in the finished document.
|
|
338
|
+
*/
|
|
339
|
+
private preloadPageSsrScripts;
|
|
340
|
+
/** Server-renders the custom elements this renderer's Integration registered in a finished document. */
|
|
341
|
+
renderCustomElements(html: string): Promise<string>;
|
|
342
|
+
/** Whether the hooks built a custom-element preloader for this renderer. */
|
|
343
|
+
get buildsSsrScriptPreloader(): boolean;
|
|
344
|
+
/** Evaluates the scripts of a render-wide assignment that belong to this renderer's preloader, if it has one. */
|
|
345
|
+
preloadAssignedSsrScripts(assignment: SsrScriptAssignment | undefined): Promise<void>;
|
|
257
346
|
/**
|
|
258
347
|
* Returns the HTML template component.
|
|
259
348
|
* It imports the HTML template from the specified path in the app configuration.
|
|
@@ -279,18 +368,19 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
279
368
|
*/
|
|
280
369
|
protected resolveDependencyPath(componentDir: string, pathUrl: string): string;
|
|
281
370
|
/**
|
|
282
|
-
* Collects the dependencies
|
|
283
|
-
*
|
|
371
|
+
* Collects the dependencies of the provided components.
|
|
372
|
+
*
|
|
373
|
+
* @remarks
|
|
374
|
+
* The result holds component assets only. Core places every Integration's global scripts on the Page, this
|
|
375
|
+
* Integration's included (see {@link resolveRouteDependencies}).
|
|
284
376
|
*
|
|
285
377
|
* @param components - The components to collect dependencies from.
|
|
286
378
|
*/
|
|
287
379
|
protected resolveDependencies(components: (EcoComponent | Partial<EcoComponent>)[], options?: {
|
|
288
380
|
preparedGraph?: true;
|
|
289
381
|
}): Promise<ProcessedAsset[]>;
|
|
290
|
-
private prependResolvedIntegrationDependencies;
|
|
291
382
|
/**
|
|
292
|
-
* Processes component-specific dependencies
|
|
293
|
-
* Use this method when you need only the component's own assets.
|
|
383
|
+
* Processes component-specific dependencies.
|
|
294
384
|
*
|
|
295
385
|
* @param components - The components to collect dependencies from.
|
|
296
386
|
*/
|
|
@@ -303,15 +393,12 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
303
393
|
resolveRouteRenderInputs(routeOptions: RouteRendererOptions, options?: {
|
|
304
394
|
skipMetadata?: boolean;
|
|
305
395
|
}): Promise<RouteRenderOrchestratorResolvedInputs>;
|
|
306
|
-
buildPageBrowserGraphContributionContext(routeFile: string, routeOptions?: Pick<RouteRendererOptions, 'params' | 'query' | 'pageModule'>): Promise<PageBrowserGraphContributionContext>;
|
|
307
|
-
protected resolvePageDependencies(context: PageBrowserGraphContributionContext): Promise<ResolvedPageDependencies | undefined>;
|
|
308
396
|
resolvePageDependencyContribution(input: {
|
|
309
397
|
nodes: ReadonlyArray<PreparedComponentGraphNode>;
|
|
310
398
|
ownerFile: string;
|
|
311
399
|
}): Promise<PageBrowserGraphContribution | undefined>;
|
|
312
|
-
resolvePageDependenciesForRoute(context: PageBrowserGraphContributionContext
|
|
313
|
-
|
|
314
|
-
protected resolvePageBrowserGraphContributionFromComponents(components: ReadonlyArray<EcoComponent | Partial<EcoComponent>>, ownerFile: string, preparedNodes?: ReadonlyArray<PreparedComponentGraphNode>): Promise<PageBrowserGraphContribution | undefined>;
|
|
400
|
+
resolvePageDependenciesForRoute(context: PageBrowserGraphContributionContext): Promise<ResolvedPageDependencies | undefined>;
|
|
401
|
+
/** Resolves a route's component assets. */
|
|
315
402
|
resolveRouteDependencies(input: {
|
|
316
403
|
components: (EcoComponent | Partial<EcoComponent>)[];
|
|
317
404
|
}): Promise<{
|
|
@@ -323,9 +410,10 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
323
410
|
* It imports the page file, collects dependencies, and prepares the render options.
|
|
324
411
|
*
|
|
325
412
|
* @param options - The route renderer options.
|
|
413
|
+
* @param planned - The preparation the production build planned for this route, which skips its data hooks.
|
|
326
414
|
* @returns The prepared render options.
|
|
327
415
|
*/
|
|
328
|
-
protected prepareRenderOptions(options: RouteRendererOptions): Promise<InternalIntegrationRendererRenderOptions<C>>;
|
|
416
|
+
protected prepareRenderOptions(options: RouteRendererOptions, planned?: PlannedRoutePreparation): Promise<InternalIntegrationRendererRenderOptions<C>>;
|
|
329
417
|
/**
|
|
330
418
|
* Executes the integration renderer with the provided options.
|
|
331
419
|
*
|
|
@@ -341,9 +429,11 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
341
429
|
* response-body errors.
|
|
342
430
|
*
|
|
343
431
|
* @param options Route renderer options.
|
|
432
|
+
* @param planned The preparation `planProductionRoutes` returned for this route, which static export passes so
|
|
433
|
+
* the route's data hooks run once per build. A remote render ignores it.
|
|
344
434
|
* @returns Rendered route body plus effective cache strategy.
|
|
345
435
|
*/
|
|
346
|
-
execute(options: RouteRendererOptions): Promise<RouteRenderResult>;
|
|
436
|
+
execute(options: RouteRendererOptions, planned?: PlannedRoutePreparation): Promise<RouteRenderResult>;
|
|
347
437
|
protected renderRemote(_options: RouteRendererOptions): Promise<RouteRenderResult | undefined>;
|
|
348
438
|
/**
|
|
349
439
|
* Renders one explicit view through the route pipeline.
|
|
@@ -387,6 +477,14 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
387
477
|
* Integrations can add preparation and final HTML hooks around core composition.
|
|
388
478
|
*/
|
|
389
479
|
render(options: IntegrationRendererRenderOptions<C>): Promise<RouteRendererBody>;
|
|
480
|
+
/**
|
|
481
|
+
* Passes a finished string document through the renderers that were assigned `ssr: true` scripts, so the custom
|
|
482
|
+
* elements they registered are server-rendered in markup another Integration produced.
|
|
483
|
+
*
|
|
484
|
+
* @remarks
|
|
485
|
+
* A Page with no assigned script has no renderer here and pays nothing. Any other body is returned as it is.
|
|
486
|
+
*/
|
|
487
|
+
private renderAssignedCustomElements;
|
|
390
488
|
/**
|
|
391
489
|
* Renders the route document through the shared document shell.
|
|
392
490
|
*
|
|
@@ -452,11 +550,19 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
452
550
|
* @remarks
|
|
453
551
|
* The planning and merging live in `ownership-graph/page-client-browser-assets.ts`; this method
|
|
454
552
|
* supplies what only the renderer has: the owning renderers of other Integrations and its asset service.
|
|
553
|
+
* A route render passes `resolveFromAppBuild` to link the entries the app-wide browser build recorded; a plan
|
|
554
|
+
* contributed by another Integration's page does not.
|
|
555
|
+
*/
|
|
556
|
+
buildPageClientBrowserAssets(plan: PageClientPlan, resolveFromAppBuild?: boolean): Promise<PageClientBrowserAssets>;
|
|
557
|
+
/**
|
|
558
|
+
* Resolves the page's island and lazy entries to the outputs the app-wide browser build recorded.
|
|
559
|
+
*
|
|
560
|
+
* @remarks
|
|
561
|
+
* Returns nothing outside a production build or start, or when a bundleable entry is not recorded, so the
|
|
562
|
+
* Integration builds the entries itself through asset processing, which fails once `ecopages start` sealed
|
|
563
|
+
* the ledger. Entries the app-wide build does not bundle are processed on their own.
|
|
455
564
|
*/
|
|
456
|
-
buildPageClientBrowserAssets(plan: PageClientPlan, route?: Pick<RouteRendererOptions, 'file' | 'params' | 'query'>): Promise<PageClientBrowserAssets>;
|
|
457
565
|
private buildPrebuiltPageClientBrowserAssets;
|
|
458
|
-
private rejectUnplannedProductionPageClientGraph;
|
|
459
|
-
private resolvePrebuiltPageClientInstance;
|
|
460
566
|
private collectAppBrowserClientBuildEntries;
|
|
461
567
|
private prepareGraphLazyClientDependencies;
|
|
462
568
|
/**
|
|
@@ -477,7 +583,8 @@ export declare abstract class IntegrationRenderer<C = EcoPagesElement> {
|
|
|
477
583
|
* the supported page-browser extension point for integrations.
|
|
478
584
|
*
|
|
479
585
|
* @param context - The route file path and already imported page module.
|
|
480
|
-
* @returns
|
|
586
|
+
* @returns The declared dependencies and watch paths, with the declaration's components and bundled scripts
|
|
587
|
+
* processed into `assets`.
|
|
481
588
|
*/
|
|
482
589
|
collectPageBrowserGraphContribution(context: PageBrowserGraphContributionContext): Promise<PageBrowserGraphContribution | undefined>;
|
|
483
590
|
/**
|