veryfront 0.1.1239 → 0.1.1241
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/esm/cli/commands/build/command-help.d.ts.map +1 -1
- package/esm/cli/commands/build/command-help.js +4 -0
- package/esm/cli/commands/build/command.d.ts +3 -1
- package/esm/cli/commands/build/command.d.ts.map +1 -1
- package/esm/cli/commands/build/command.js +13 -5
- package/esm/cli/commands/build/handler.d.ts +17 -0
- package/esm/cli/commands/build/handler.d.ts.map +1 -1
- package/esm/cli/commands/build/handler.js +188 -9
- package/esm/cli/commands/generate/command.d.ts.map +1 -1
- package/esm/cli/commands/generate/command.js +40 -0
- package/esm/cli/commands/push/command.d.ts.map +1 -1
- package/esm/cli/commands/push/command.js +24 -16
- package/esm/cli/shared/ensure-content-processor.d.ts +16 -1
- package/esm/cli/shared/ensure-content-processor.d.ts.map +1 -1
- package/esm/cli/shared/ensure-content-processor.js +39 -5
- package/esm/cli/shared/project-creation.d.ts.map +1 -1
- package/esm/cli/shared/project-creation.js +29 -1
- package/esm/deno.d.ts +14 -5
- package/esm/deno.js +23 -7
- package/esm/extensions/ext-llm-openai/src/openai-chat-stream.d.ts.map +1 -1
- package/esm/extensions/ext-llm-openai/src/openai-chat-stream.js +16 -6
- package/esm/extensions/ext-llm-openai/src/openai-provider.d.ts.map +1 -1
- package/esm/extensions/ext-llm-openai/src/openai-provider.js +11 -2
- package/esm/extensions/ext-llm-openai/src/openai-reasoning-models.d.ts +2 -14
- package/esm/extensions/ext-llm-openai/src/openai-reasoning-models.d.ts.map +1 -1
- package/esm/extensions/ext-llm-openai/src/openai-reasoning-models.js +1 -72
- package/esm/extensions/ext-schema-zod/src/adapter.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/browser-aliases.d.ts +164 -0
- package/esm/src/agent/ag-ui/browser-aliases.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/browser-aliases.js +68 -0
- package/esm/src/agent/ag-ui/chat-ui-chunk-encoder.d.ts +35 -0
- package/esm/src/agent/ag-ui/chat-ui-chunk-encoder.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{chat-ui-chunk-browser-encoder.js → chat-ui-chunk-encoder.js} +11 -11
- package/esm/src/agent/ag-ui/chunk-encoder-bridge.d.ts +8 -6
- package/esm/src/agent/ag-ui/chunk-encoder-bridge.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/chunk-encoder-bridge.js +5 -4
- package/esm/src/agent/ag-ui/chunk-encoder.d.ts +26 -0
- package/esm/src/agent/ag-ui/chunk-encoder.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{browser-chunk-encoder.js → chunk-encoder.js} +3 -2
- package/esm/src/agent/ag-ui/{browser-encoder.d.ts → encoder.d.ts} +33 -19
- package/esm/src/agent/ag-ui/encoder.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{browser-encoder.js → encoder.js} +81 -27
- package/esm/src/agent/ag-ui/finalize-tracker.d.ts +15 -0
- package/esm/src/agent/ag-ui/finalize-tracker.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{browser-finalize-tracker.js → finalize-tracker.js} +4 -4
- package/esm/src/agent/ag-ui/response-stream.d.ts +36 -0
- package/esm/src/agent/ag-ui/response-stream.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{browser-response-stream.js → response-stream.js} +6 -3
- package/esm/src/agent/ag-ui/runtime-chat-stream-encoder.d.ts +1 -1
- package/esm/src/agent/ag-ui/runtime-chat-stream-encoder.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/runtime-event-encoder.d.ts +7 -7
- package/esm/src/agent/ag-ui/runtime-event-encoder.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/runtime-event-encoder.js +4 -4
- package/esm/src/agent/ag-ui/runtime-response.d.ts +20 -0
- package/esm/src/agent/ag-ui/runtime-response.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/runtime-response.js +16 -0
- package/esm/src/agent/ag-ui/sse-parser.d.ts +1 -1
- package/esm/src/agent/ag-ui/sse-parser.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/sse-parser.js +3 -3
- package/esm/src/agent/ag-ui/tracked-response.d.ts +11 -0
- package/esm/src/agent/ag-ui/tracked-response.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{tracked-browser-response.js → tracked-response.js} +6 -4
- package/esm/src/agent/conversation/hosted-lifecycle.d.ts.map +1 -1
- package/esm/src/agent/conversation/hosted-lifecycle.js +2 -1
- package/esm/src/agent/conversation/lifecycle-run-event-adapter.d.ts.map +1 -1
- package/esm/src/agent/conversation/lifecycle-run-event-adapter.js +2 -0
- package/esm/src/agent/conversation/private-run-event.d.ts.map +1 -1
- package/esm/src/agent/conversation/private-run-event.js +174 -3
- package/esm/src/agent/conversation/run-chunk-mirror.d.ts +2 -0
- package/esm/src/agent/conversation/run-chunk-mirror.d.ts.map +1 -1
- package/esm/src/agent/conversation/run-chunk-mirror.js +13 -6
- package/esm/src/agent/conversation/run-events.d.ts +8 -0
- package/esm/src/agent/conversation/run-events.d.ts.map +1 -1
- package/esm/src/agent/conversation/run-events.js +54 -4
- package/esm/src/agent/conversation/run-stream-mirror.d.ts.map +1 -1
- package/esm/src/agent/conversation/run-stream-mirror.js +5 -2
- package/esm/src/agent/hosted/durable-run-event-sink.d.ts +2 -1
- package/esm/src/agent/hosted/durable-run-event-sink.d.ts.map +1 -1
- package/esm/src/agent/hosted/durable-run-event-sink.js +9 -7
- package/esm/src/agent/hosted/prepared-chat-execution.js +2 -2
- package/esm/src/agent/index.d.ts +9 -8
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/index.js +9 -8
- package/esm/src/agent/memory/memory.d.ts.map +1 -1
- package/esm/src/agent/memory/memory.js +7 -6
- package/esm/src/agent/react/use-chat/types.d.ts +2 -0
- package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +3 -2
- package/esm/src/agent/runtime/ag-ui-contract.d.ts +2 -2
- package/esm/src/agent/runtime/ag-ui-contract.d.ts.map +1 -1
- package/esm/src/agent/runtime/ag-ui-contract.js +2 -2
- package/esm/src/agent/runtime/chat-stream-handler.d.ts.map +1 -1
- package/esm/src/agent/runtime/chat-stream-handler.js +34 -4
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +15 -6
- package/esm/src/agent/streaming/data-stream.d.ts +1 -1
- package/esm/src/agent/streaming/data-stream.d.ts.map +1 -1
- package/esm/src/agent/streaming/fork-runtime-part-mapper.d.ts +1 -1
- package/esm/src/agent/streaming/fork-runtime-part-mapper.d.ts.map +1 -1
- package/esm/src/agent/streaming/lifecycle/live-adapter.d.ts.map +1 -1
- package/esm/src/agent/streaming/lifecycle/live-adapter.js +2 -0
- package/esm/src/agent/streaming/lifecycle/reducer.d.ts.map +1 -1
- package/esm/src/agent/streaming/lifecycle/reducer.js +7 -0
- package/esm/src/agent/streaming/lifecycle/runtime-provider-adapter.js +4 -0
- package/esm/src/build/production-build/templates.d.ts.map +1 -1
- package/esm/src/build/production-build/templates.js +1 -1
- package/esm/src/cache/request-cache-batcher.d.ts +1 -0
- package/esm/src/cache/request-cache-batcher.d.ts.map +1 -1
- package/esm/src/cache/request-cache-batcher.js +21 -7
- package/esm/src/chat/ag-ui.d.ts +1 -1
- package/esm/src/chat/index.d.ts +2 -2
- package/esm/src/chat/index.d.ts.map +1 -1
- package/esm/src/chat/index.js +1 -1
- package/esm/src/config/config-shim.d.ts +1 -1
- package/esm/src/config/config-shim.d.ts.map +1 -1
- package/esm/src/config/config-shim.js +1 -1
- package/esm/src/config/declarative-evaluator-worker-protocol.d.ts.map +1 -1
- package/esm/src/config/env.js +1 -1
- package/esm/src/config/environment-config.js +1 -1
- package/esm/src/config/loader.d.ts.map +1 -1
- package/esm/src/config/loader.js +4 -4
- package/esm/src/config/schemas/config.schema.d.ts +20 -0
- package/esm/src/config/schemas/config.schema.d.ts.map +1 -1
- package/esm/src/config/schemas/config.schema.js +27 -0
- package/esm/src/config/server-external-packages.d.ts +11 -0
- package/esm/src/config/server-external-packages.d.ts.map +1 -0
- package/esm/src/config/server-external-packages.js +53 -0
- package/esm/src/data/data-fetcher.d.ts.map +1 -1
- package/esm/src/data/data-fetcher.js +9 -4
- package/esm/src/data/data-result-validation.d.ts +5 -0
- package/esm/src/data/data-result-validation.d.ts.map +1 -0
- package/esm/src/data/data-result-validation.js +56 -0
- package/esm/src/data/helpers.d.ts +5 -5
- package/esm/src/data/helpers.d.ts.map +1 -1
- package/esm/src/data/helpers.js +22 -68
- package/esm/src/data/index.d.ts +1 -1
- package/esm/src/data/index.d.ts.map +1 -1
- package/esm/src/data/response-metadata.d.ts +23 -0
- package/esm/src/data/response-metadata.d.ts.map +1 -0
- package/esm/src/data/response-metadata.js +311 -0
- package/esm/src/data/schemas/data.schema.d.ts +95 -6
- package/esm/src/data/schemas/data.schema.d.ts.map +1 -1
- package/esm/src/data/schemas/data.schema.js +57 -3
- package/esm/src/data/schemas/index.d.ts +1 -1
- package/esm/src/data/schemas/index.d.ts.map +1 -1
- package/esm/src/data/schemas/index.js +1 -1
- package/esm/src/data/server-data-fetcher.d.ts.map +1 -1
- package/esm/src/data/server-data-fetcher.js +5 -5
- package/esm/src/data/static-data-fetcher.d.ts +2 -2
- package/esm/src/data/static-data-fetcher.d.ts.map +1 -1
- package/esm/src/data/static-data-fetcher.js +6 -3
- package/esm/src/data/types.d.ts +1 -1
- package/esm/src/data/types.d.ts.map +1 -1
- package/esm/src/discovery/discovery-engine.d.ts.map +1 -1
- package/esm/src/discovery/discovery-engine.js +81 -26
- package/esm/src/discovery/handlers/task-handler.d.ts +1 -1
- package/esm/src/discovery/handlers/task-handler.d.ts.map +1 -1
- package/esm/src/discovery/handlers/task-handler.js +6 -3
- package/esm/src/discovery/types.d.ts +6 -4
- package/esm/src/discovery/types.d.ts.map +1 -1
- package/esm/src/errors/error-registry/runtime.d.ts +2 -0
- package/esm/src/errors/error-registry/runtime.d.ts.map +1 -1
- package/esm/src/errors/error-registry/runtime.js +8 -0
- package/esm/src/errors/error-registry.d.ts +1 -0
- package/esm/src/errors/error-registry.d.ts.map +1 -1
- package/esm/src/errors/index.d.ts +1 -1
- package/esm/src/errors/index.d.ts.map +1 -1
- package/esm/src/errors/index.js +1 -1
- package/esm/src/errors/user-friendly/error-wrapper.js +1 -1
- package/esm/src/errors/veryfront-error.d.ts.map +1 -1
- package/esm/src/extensions/index.d.ts +2 -0
- package/esm/src/extensions/index.d.ts.map +1 -1
- package/esm/src/extensions/index.js +1 -0
- package/esm/src/extensions/parser/code-parser.d.ts +9 -0
- package/esm/src/extensions/parser/code-parser.d.ts.map +1 -1
- package/esm/src/extensions/parser/defaults.d.ts +5 -0
- package/esm/src/extensions/parser/defaults.d.ts.map +1 -1
- package/esm/src/extensions/parser/defaults.js +23 -11
- package/esm/src/fs/index.d.ts +50 -1
- package/esm/src/fs/index.d.ts.map +1 -1
- package/esm/src/fs/index.js +50 -1
- package/esm/src/html/html-injection.d.ts +2 -0
- package/esm/src/html/html-injection.d.ts.map +1 -1
- package/esm/src/html/html-injection.js +4 -1
- package/esm/src/html/html-shell-generator.d.ts.map +1 -1
- package/esm/src/html/html-shell-generator.js +11 -3
- package/esm/src/html/hydration-script-builder/hydration-runtime.generated.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/hydration-runtime.generated.js +1 -1
- package/esm/src/html/hydration-script-builder/prod-runtime-selection.d.ts +23 -0
- package/esm/src/html/hydration-script-builder/prod-runtime-selection.d.ts.map +1 -0
- package/esm/src/html/hydration-script-builder/prod-runtime-selection.js +55 -0
- package/esm/src/html/hydration-script-builder/prod-scripts.d.ts +2 -0
- package/esm/src/html/hydration-script-builder/prod-scripts.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/prod-scripts.js +12 -3
- package/esm/src/html/schemas/html.schema.d.ts +2 -0
- package/esm/src/html/schemas/html.schema.d.ts.map +1 -1
- package/esm/src/html/schemas/html.schema.js +2 -0
- package/esm/src/html/styles-builder/css-hash-cache.d.ts +1 -1
- package/esm/src/html/styles-builder/css-hash-cache.d.ts.map +1 -1
- package/esm/src/html/styles-builder/css-hash-cache.js +1 -1
- package/esm/src/index.client.d.ts +2 -2
- package/esm/src/index.client.d.ts.map +1 -1
- package/esm/src/index.client.js +3 -1
- package/esm/src/index.d.ts +1 -1
- package/esm/src/index.d.ts.map +1 -1
- package/esm/src/internal-agents/ag-ui-sse.d.ts +7 -7
- package/esm/src/internal-agents/ag-ui-sse.d.ts.map +1 -1
- package/esm/src/internal-agents/ag-ui-sse.js +17 -9
- package/esm/src/internal-agents/control-plane-auth.js +1 -1
- package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
- package/esm/src/internal-agents/run-stream.js +15 -9
- package/esm/src/modules/import-map/loader.d.ts.map +1 -1
- package/esm/src/modules/import-map/loader.js +2 -2
- package/esm/src/modules/import-map/merger.js +2 -2
- package/esm/src/modules/import-map/preloader.js +2 -2
- package/esm/src/modules/react-loader/component-loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/component-loader.js +2 -0
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.js +3 -2
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.js +7 -1
- package/esm/src/modules/react-loader/ssr-module-loader/types.d.ts +2 -0
- package/esm/src/modules/react-loader/ssr-module-loader/types.d.ts.map +1 -1
- package/esm/src/modules/react-loader/transformed-module-coordinator.d.ts.map +1 -1
- package/esm/src/modules/react-loader/transformed-module-coordinator.js +2 -1
- package/esm/src/modules/react-loader/types.d.ts +2 -0
- package/esm/src/modules/react-loader/types.d.ts.map +1 -1
- package/esm/src/modules/server/module-response-cache.d.ts +1 -0
- package/esm/src/modules/server/module-response-cache.d.ts.map +1 -1
- package/esm/src/modules/server/module-response-cache.js +5 -0
- package/esm/src/modules/server/module-server.d.ts.map +1 -1
- package/esm/src/modules/server/module-server.js +4 -0
- package/esm/src/modules/server/module-transform.d.ts.map +1 -1
- package/esm/src/modules/server/module-transform.js +2 -0
- package/esm/src/observability/metrics/config.js +1 -1
- package/esm/src/observability/request-profiler.js +1 -1
- package/esm/src/observability/telemetry-error.js +2 -2
- package/esm/src/observability/tracing/telemetry-env.js +1 -1
- package/esm/src/platform/adapters/fs/cache/file-cache.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/cache/file-cache.js +5 -0
- package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts +39 -0
- package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/adapter.js +209 -40
- package/esm/src/platform/adapters/fs/veryfront/file-list-index.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/file-list-index.js +0 -14
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts +0 -1
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.js +0 -3
- package/esm/src/platform/adapters/fs/veryfront/read-operations.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/read-operations.js +1 -4
- package/esm/src/platform/adapters/fs/veryfront/request-context.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/request-context.js +4 -0
- package/esm/src/platform/adapters/fs/veryfront/stat-operations.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/stat-operations.js +9 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager-helpers.js +1 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts +2 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.js +97 -66
- package/esm/src/platform/compat/dns.d.ts +10 -0
- package/esm/src/platform/compat/dns.d.ts.map +1 -1
- package/esm/src/platform/compat/dns.js +50 -0
- package/esm/src/platform/compat/http/pinned-fetch.d.ts +1 -1
- package/esm/src/platform/compat/process/lifecycle.d.ts +10 -0
- package/esm/src/platform/compat/process/lifecycle.d.ts.map +1 -1
- package/esm/src/platform/compat/process/lifecycle.js +23 -0
- package/esm/src/platform/compat/process.d.ts +1 -1
- package/esm/src/platform/compat/process.d.ts.map +1 -1
- package/esm/src/platform/compat/process.js +1 -1
- package/esm/src/platform/compat/proxy-topology.js +1 -1
- package/esm/src/platform/request-context-access.d.ts +24 -0
- package/esm/src/platform/request-context-access.d.ts.map +1 -0
- package/esm/src/platform/request-context-access.js +26 -0
- package/esm/src/provider/shared/openai-reasoning.d.ts +16 -0
- package/esm/src/provider/shared/openai-reasoning.d.ts.map +1 -0
- package/esm/src/provider/shared/openai-reasoning.js +73 -0
- package/esm/src/provider/types.d.ts +2 -0
- package/esm/src/provider/types.d.ts.map +1 -1
- package/esm/src/provider/veryfront-cloud/provider.d.ts.map +1 -1
- package/esm/src/provider/veryfront-cloud/provider.js +45 -18
- package/esm/src/proxy/handler.d.ts +1 -0
- package/esm/src/proxy/handler.d.ts.map +1 -1
- package/esm/src/proxy/handler.js +17 -4
- package/esm/src/proxy/proxy-error-context.d.ts +1 -0
- package/esm/src/proxy/proxy-error-context.d.ts.map +1 -1
- package/esm/src/proxy/proxy-error-context.js +1 -0
- package/esm/src/proxy/request-host.d.ts +3 -0
- package/esm/src/proxy/request-host.d.ts.map +1 -1
- package/esm/src/proxy/request-host.js +28 -8
- package/esm/src/proxy/routing-invalidation-redis.d.ts.map +1 -1
- package/esm/src/proxy/routing-invalidation-redis.js +38 -4
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts +27 -3
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/attachments-panel.js +29 -7
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts +15 -6
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/sidebar.js +37 -4
- package/esm/src/react/components/chat/chat/components/sidebar.types.d.ts +12 -1
- package/esm/src/react/components/chat/chat/components/sidebar.types.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts +3 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.js +17 -6
- package/esm/src/react/components/chat/chat/composition/chat-composer.types.d.ts +12 -5
- package/esm/src/react/components/chat/chat/composition/chat-composer.types.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts +18 -5
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-root.js +65 -1
- package/esm/src/react/components/chat/chat/composition/use-composer-value.d.ts +6 -3
- package/esm/src/react/components/chat/chat/composition/use-composer-value.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/use-composer-value.js +56 -5
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts +7 -1
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts +14 -4
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/conversations-context.js +10 -1
- package/esm/src/react/components/chat/chat/index.d.ts +1 -1
- package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/persistence/conversation-codec.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat.d.ts +1 -1
- package/esm/src/react/components/chat/chat.d.ts.map +1 -1
- package/esm/src/react/server-render-context.d.ts.map +1 -1
- package/esm/src/release-assets/dependency-artifact-builder.d.ts.map +1 -1
- package/esm/src/rendering/app-reserved.d.ts +2 -2
- package/esm/src/rendering/app-reserved.d.ts.map +1 -1
- package/esm/src/rendering/app-reserved.js +4 -3
- package/esm/src/rendering/cache/cache-coordinator.d.ts.map +1 -1
- package/esm/src/rendering/cache/cache-coordinator.js +1 -0
- package/esm/src/rendering/cache/cache-payload.d.ts.map +1 -1
- package/esm/src/rendering/cache/cache-payload.js +44 -0
- package/esm/src/rendering/component-handling.d.ts +4 -1
- package/esm/src/rendering/component-handling.d.ts.map +1 -1
- package/esm/src/rendering/component-handling.js +13 -6
- package/esm/src/rendering/layouts/layout-applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-applicator.js +3 -1
- package/esm/src/rendering/layouts/layout-collector.d.ts +1 -0
- package/esm/src/rendering/layouts/layout-collector.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-collector.js +201 -4
- package/esm/src/rendering/layouts/utils/applicator.d.ts +1 -1
- package/esm/src/rendering/layouts/utils/applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/applicator.js +3 -3
- package/esm/src/rendering/layouts/utils/component-loader.d.ts +2 -2
- package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/component-loader.js +12 -4
- package/esm/src/rendering/orchestrator/file-resolver/index.d.ts +3 -1
- package/esm/src/rendering/orchestrator/file-resolver/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/file-resolver/index.js +13 -5
- package/esm/src/rendering/orchestrator/html.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/html.js +26 -10
- package/esm/src/rendering/orchestrator/layout.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/layout.js +2 -2
- package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.js +20 -2
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts +2 -0
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.js +6 -3
- package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.d.ts +3 -2
- package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.js +6 -6
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts +1 -0
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.js +2 -2
- package/esm/src/rendering/orchestrator/module-loader/module-transform-cache.d.ts +2 -0
- package/esm/src/rendering/orchestrator/module-loader/module-transform-cache.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/module-transform-cache.js +7 -1
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +58 -10
- package/esm/src/rendering/orchestrator/render-result-assembly.d.ts +3 -0
- package/esm/src/rendering/orchestrator/render-result-assembly.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/render-result-assembly.js +3 -1
- package/esm/src/rendering/page-renderer.d.ts +2 -0
- package/esm/src/rendering/page-renderer.d.ts.map +1 -1
- package/esm/src/rendering/page-renderer.js +4 -1
- package/esm/src/rendering/page-rendering.d.ts +2 -0
- package/esm/src/rendering/page-rendering.d.ts.map +1 -1
- package/esm/src/rendering/page-rendering.js +1 -0
- package/esm/src/rendering/renderer.d.ts.map +1 -1
- package/esm/src/rendering/renderer.js +31 -1
- package/esm/src/rendering/script-page-handling.d.ts +2 -0
- package/esm/src/rendering/script-page-handling.d.ts.map +1 -1
- package/esm/src/rendering/script-page-handling.js +17 -1
- package/esm/src/rendering/shared/context-aware-cache.d.ts.map +1 -1
- package/esm/src/rendering/shared/context-aware-cache.js +3 -0
- package/esm/src/rendering/snippet-renderer.d.ts +10 -0
- package/esm/src/rendering/snippet-renderer.d.ts.map +1 -1
- package/esm/src/rendering/snippet-renderer.js +40 -18
- package/esm/src/rendering/ssr/component-registry.d.ts +1 -1
- package/esm/src/rendering/ssr/component-registry.d.ts.map +1 -1
- package/esm/src/rendering/ssr/component-registry.js +13 -6
- package/esm/src/rendering/ssr-outcome.d.ts +4 -3
- package/esm/src/rendering/ssr-outcome.d.ts.map +1 -1
- package/esm/src/rendering/ssr-outcome.js +25 -8
- package/esm/src/routing/api/handler.d.ts +1 -1
- package/esm/src/routing/api/handler.d.ts.map +1 -1
- package/esm/src/routing/api/handler.js +6 -1
- package/esm/src/runtime/model-call-context.d.ts +37 -2
- package/esm/src/runtime/model-call-context.d.ts.map +1 -1
- package/esm/src/runtime/model-call-context.js +42 -1
- package/esm/src/runtime/runtime-bridge.d.ts.map +1 -1
- package/esm/src/runtime/runtime-bridge.js +108 -8
- package/esm/src/sandbox/shell-tools.d.ts.map +1 -1
- package/esm/src/sandbox/shell-tools.js +16 -6
- package/esm/src/schedule/validation.d.ts +9 -1
- package/esm/src/schedule/validation.d.ts.map +1 -1
- package/esm/src/schedule/validation.js +167 -80
- package/esm/src/schemas/json-value.d.ts.map +1 -1
- package/esm/src/schemas/json-value.js +81 -37
- package/esm/src/security/http/base-handler.js +1 -1
- package/esm/src/security/sandbox/project-worker.d.ts +1 -0
- package/esm/src/security/sandbox/project-worker.d.ts.map +1 -1
- package/esm/src/security/sandbox/project-worker.js +6 -0
- package/esm/src/security/sandbox/worker-read-scope.d.ts +20 -0
- package/esm/src/security/sandbox/worker-read-scope.d.ts.map +1 -0
- package/esm/src/security/sandbox/worker-read-scope.js +127 -0
- package/esm/src/security/sandbox/worker-types.d.ts +12 -0
- package/esm/src/security/sandbox/worker-types.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/dashboard/api.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/dashboard/api.js +70 -3
- package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts +5 -0
- package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/files/esbuild-plugins.js +61 -3
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +227 -29
- package/esm/src/server/handlers/request/api/pages-api-handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/api/pages-api-handler.js +20 -2
- package/esm/src/server/handlers/request/module/page-data-endpoint-handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/module/page-data-endpoint-handler.js +32 -15
- package/esm/src/server/handlers/request/prod-hydration-module.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/prod-hydration-module.handler.js +10 -3
- package/esm/src/server/handlers/request/project-run-execute.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/project-run-execute.handler.js +1 -0
- package/esm/src/server/handlers/request/snippet.handler.d.ts +6 -0
- package/esm/src/server/handlers/request/snippet.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/snippet.handler.js +8 -1
- package/esm/src/server/handlers/request/ssr/error-page-fallback.js +1 -0
- package/esm/src/server/handlers/request/ssr/ssr-response-builder.d.ts.map +1 -1
- package/esm/src/server/handlers/request/ssr/ssr-response-builder.js +10 -6
- package/esm/src/server/handlers/request/ssr/ssr.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/ssr/ssr.handler.js +22 -10
- package/esm/src/server/handlers/request/static.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/static.handler.js +1 -0
- package/esm/src/server/runtime-handler/handler-context-builder.d.ts +2 -0
- package/esm/src/server/runtime-handler/handler-context-builder.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/handler-context-builder.js +1 -0
- package/esm/src/server/runtime-handler/project-runtime-context.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/project-runtime-context.js +6 -2
- package/esm/src/server/runtime-handler/request-tracker.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/request-tracker.js +10 -3
- package/esm/src/server/services/rendering/ssr.service.d.ts +5 -0
- package/esm/src/server/services/rendering/ssr.service.d.ts.map +1 -1
- package/esm/src/server/services/rendering/ssr.service.js +71 -16
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
- package/esm/src/server/services/rsc/orchestrators/handler.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/handler.js +1 -0
- package/esm/src/server/services/rsc/orchestrators/render-handler.d.ts +1 -0
- package/esm/src/server/services/rsc/orchestrators/render-handler.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/render-handler.js +2 -0
- package/esm/src/server/services/static/static-file.service.d.ts +4 -1
- package/esm/src/server/services/static/static-file.service.d.ts.map +1 -1
- package/esm/src/server/services/static/static-file.service.js +48 -22
- package/esm/src/server/shared/browser-module-bundler.d.ts.map +1 -1
- package/esm/src/server/shared/browser-module-bundler.js +10 -0
- package/esm/src/server/utils/request-host.d.ts +6 -0
- package/esm/src/server/utils/request-host.d.ts.map +1 -1
- package/esm/src/server/utils/request-host.js +42 -1
- package/esm/src/skill/tools.d.ts.map +1 -1
- package/esm/src/task/definition-snapshot.d.ts +8 -0
- package/esm/src/task/definition-snapshot.d.ts.map +1 -0
- package/esm/src/task/definition-snapshot.js +154 -0
- package/esm/src/task/discovery.d.ts.map +1 -1
- package/esm/src/task/discovery.js +47 -21
- package/esm/src/task/types.d.ts +3 -0
- package/esm/src/task/types.d.ts.map +1 -1
- package/esm/src/task/types.js +7 -16
- package/esm/src/tool/remote-mcp.d.ts.map +1 -1
- package/esm/src/tool/remote-mcp.js +86 -5
- package/esm/src/transforms/esm/bundle-recovery.d.ts.map +1 -1
- package/esm/src/transforms/esm/bundle-recovery.js +1 -0
- package/esm/src/transforms/esm/http-cache-helpers.d.ts +3 -1
- package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-helpers.js +18 -2
- package/esm/src/transforms/esm/http-cache-wrapper.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-wrapper.js +23 -0
- package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
- package/esm/src/transforms/esm/specifier-resolver.js +2 -1
- package/esm/src/transforms/esm/types.d.ts +2 -0
- package/esm/src/transforms/esm/types.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/commonjs-policy.d.ts +22 -0
- package/esm/src/transforms/import-rewriter/commonjs-policy.d.ts.map +1 -0
- package/esm/src/transforms/import-rewriter/commonjs-policy.js +75 -0
- package/esm/src/transforms/import-rewriter/core.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/core.js +29 -1
- package/esm/src/transforms/import-rewriter/ssr-adapter.d.ts +2 -0
- package/esm/src/transforms/import-rewriter/ssr-adapter.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/ssr-adapter.js +79 -10
- package/esm/src/transforms/import-rewriter/strategies/bare-strategy.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/strategies/bare-strategy.js +14 -4
- package/esm/src/transforms/import-rewriter/types.d.ts +2 -0
- package/esm/src/transforms/import-rewriter/types.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/url-builder.d.ts +2 -19
- package/esm/src/transforms/import-rewriter/url-builder.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/url-builder.js +2 -67
- package/esm/src/transforms/mdx/esm-module-loader/import-transformer.d.ts +3 -2
- package/esm/src/transforms/mdx/esm-module-loader/import-transformer.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/import-transformer.js +39 -8
- package/esm/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.js +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.js +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.d.ts +3 -3
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.js +14 -6
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.d.ts +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.js +2 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.js +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.js +6 -3
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.d.ts +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.js +2 -2
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.js +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/source-transform.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/source-transform.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/source-transform.js +2 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-writer.d.ts +2 -2
- package/esm/src/transforms/mdx/esm-module-loader/module-writer.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-writer.js +15 -7
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts +4 -0
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts.map +1 -1
- package/esm/src/transforms/mdx/index.d.ts +1 -0
- package/esm/src/transforms/mdx/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/index.js +2 -1
- package/esm/src/transforms/pipeline/cache-identity.d.ts +1 -0
- package/esm/src/transforms/pipeline/cache-identity.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/cache-identity.js +15 -0
- package/esm/src/transforms/pipeline/context.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/context.js +2 -0
- package/esm/src/transforms/pipeline/index.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/index.js +1 -0
- package/esm/src/transforms/pipeline/stages/resolve-imports.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/resolve-imports.js +1 -0
- package/esm/src/transforms/pipeline/stages/ssr-http-cache.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-http-cache.js +1 -0
- package/esm/src/transforms/pipeline/types.d.ts +4 -0
- package/esm/src/transforms/pipeline/types.d.ts.map +1 -1
- package/esm/src/transforms/shared/esm-sh-specifier.d.ts +18 -0
- package/esm/src/transforms/shared/esm-sh-specifier.d.ts.map +1 -0
- package/esm/src/transforms/shared/esm-sh-specifier.js +253 -0
- package/esm/src/transforms/shared/package-specifier.d.ts.map +1 -1
- package/esm/src/transforms/shared/package-specifier.js +9 -2
- package/esm/src/transforms/shared/server-only-packages.d.ts +25 -1
- package/esm/src/transforms/shared/server-only-packages.d.ts.map +1 -1
- package/esm/src/transforms/shared/server-only-packages.js +176 -4
- package/esm/src/types/entities/getEntityInfo.d.ts.map +1 -1
- package/esm/src/types/index.d.ts +5 -0
- package/esm/src/types/index.d.ts.map +1 -1
- package/esm/src/types/server.d.ts +6 -0
- package/esm/src/types/server.d.ts.map +1 -1
- package/esm/src/utils/env-loader.d.ts.map +1 -1
- package/esm/src/utils/env-loader.js +2 -1
- package/esm/src/utils/feature-flags.js +1 -1
- package/esm/src/utils/lru-wrapper.js +2 -2
- package/esm/src/utils/memory/profiler.d.ts +20 -0
- package/esm/src/utils/memory/profiler.d.ts.map +1 -1
- package/esm/src/utils/memory/profiler.js +43 -5
- package/esm/src/utils/perf-timer.js +1 -1
- package/esm/src/utils/redirect-policy.d.ts +18 -0
- package/esm/src/utils/redirect-policy.d.ts.map +1 -0
- package/esm/src/utils/redirect-policy.js +92 -0
- package/esm/src/utils/redis-client.d.ts.map +1 -1
- package/esm/src/utils/redis-client.js +6 -3
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/workflow/claude-code/tool.d.ts +27 -27
- package/esm/src/workflow/claude-code/tool.d.ts.map +1 -1
- package/esm/src/workflow/claude-code/wire-protocol.d.ts.map +1 -1
- package/esm/src/workflow/dsl/workflow.d.ts +3 -0
- package/esm/src/workflow/dsl/workflow.d.ts.map +1 -1
- package/esm/src/workflow/dsl/workflow.js +2 -1
- package/esm/src/workflow/executor/workflow-definition-snapshot.d.ts.map +1 -1
- package/esm/src/workflow/executor/workflow-definition-snapshot.js +88 -39
- package/esm/src/workflow/registry.d.ts +4 -1
- package/esm/src/workflow/registry.d.ts.map +1 -1
- package/esm/src/workflow/registry.js +10 -8
- package/esm/src/workflow/types.d.ts +3 -0
- package/esm/src/workflow/types.d.ts.map +1 -1
- package/esm/templates/index.d.ts.map +1 -1
- package/esm/templates/index.js +7 -0
- package/esm/templates/manifest.generated.d.ts.map +1 -1
- package/esm/templates/manifest.generated.js +1 -1
- package/package.json +16 -9
- package/esm/src/agent/ag-ui/browser-chunk-encoder.d.ts +0 -24
- package/esm/src/agent/ag-ui/browser-chunk-encoder.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/browser-encoder.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/browser-finalize-tracker.d.ts +0 -15
- package/esm/src/agent/ag-ui/browser-finalize-tracker.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/browser-response-stream.d.ts +0 -33
- package/esm/src/agent/ag-ui/browser-response-stream.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/chat-ui-chunk-browser-encoder.d.ts +0 -35
- package/esm/src/agent/ag-ui/chat-ui-chunk-browser-encoder.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/runtime-browser-response.d.ts +0 -20
- package/esm/src/agent/ag-ui/runtime-browser-response.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/runtime-browser-response.js +0 -16
- package/esm/src/agent/ag-ui/tracked-browser-response.d.ts +0 -11
- package/esm/src/agent/ag-ui/tracked-browser-response.d.ts.map +0 -1
|
@@ -9,14 +9,15 @@ import { computeSourceHash } from "../../studio/hash-utils.js";
|
|
|
9
9
|
import { extractRelativePath } from "../../utils/route-path-utils.js";
|
|
10
10
|
import { hasUseClientDirective } from "../rsc/page-island.js";
|
|
11
11
|
import { getReadyManifestForRenderAsync } from "../../release-assets/manifest-cache.js";
|
|
12
|
-
import { resolveAppComponentPath } from "../layouts/utils/app-resolver.js";
|
|
13
12
|
import { resolveProjectReactVersion } from "../../transforms/esm/package-registry.js";
|
|
14
|
-
import { StreamTimeoutError, streamToString } from "../utils/stream-utils.js";
|
|
15
13
|
import { profilePhase, profileSyncPhase } from "../../observability/index.js";
|
|
14
|
+
import { NOT_SUPPORTED } from "../../errors/index.js";
|
|
15
|
+
import { hasImmutableReleaseHydrationRuntime, resolveProdHydrationModulePath, } from "../../html/hydration-script-builder/prod-runtime-selection.js";
|
|
16
|
+
import { resolveAppComponentPath } from "../layouts/utils/app-resolver.js";
|
|
17
|
+
import { StreamTimeoutError, streamToString } from "../utils/stream-utils.js";
|
|
16
18
|
import { extractProjectClassesForRoute, startPreparedCSSWarmup, startProjectCSSPreparation, } from "./html-project-css.js";
|
|
17
19
|
import { buildCollectedHeadDescriptors, buildHeadElements as buildCollectedHeadElements, mergeCollectedHeadWithShell, mergeFrontmatter as mergeCollectedFrontmatter, resolveCommittedHeadFromHTML, } from "./html-head.js";
|
|
18
20
|
import { mergeImportedCSS as mergeImportedProjectCss } from "./html-imported-css.js";
|
|
19
|
-
import { NOT_SUPPORTED } from "../../errors/index.js";
|
|
20
21
|
const logger = rendererLogger.component("html-generator");
|
|
21
22
|
function hasCollectedHeadEntries(head) {
|
|
22
23
|
return head !== undefined && (head.title !== undefined ||
|
|
@@ -31,7 +32,8 @@ function toShellFrontmatter(frontmatter) {
|
|
|
31
32
|
// frontmatter index, while the HTML pipeline supports structured meta/link/
|
|
32
33
|
// script/style fields. This boundary narrows only the type view; the shell
|
|
33
34
|
// immediately validates and snapshots every structured value before use.
|
|
34
|
-
|
|
35
|
+
const record = frontmatter;
|
|
36
|
+
return record;
|
|
35
37
|
}
|
|
36
38
|
function injectHeadScriptsAfterImportMap(html, scripts) {
|
|
37
39
|
const headOpen = html.indexOf("<head>");
|
|
@@ -212,7 +214,7 @@ export class HTMLGenerator {
|
|
|
212
214
|
});
|
|
213
215
|
}
|
|
214
216
|
const mergedFrontmatter = mergeCollectedFrontmatter(fullContext);
|
|
215
|
-
const htmlOptions = await profilePhase("html.build_options", () => this.buildHTMLOptions(fullContext, mergedFrontmatter));
|
|
217
|
+
const htmlOptions = await profilePhase("html.build_options", () => this.buildHTMLOptions(fullContext, mergedFrontmatter, true));
|
|
216
218
|
const projectCSSPromise = startProjectCSSPreparation(fullContext, htmlOptions);
|
|
217
219
|
startPreparedCSSWarmup(this.config, fullContext, htmlOptions);
|
|
218
220
|
const { start, end } = await profilePhase("html.generate_shell_parts", () => this.generateShellParts(fullContext, mergedFrontmatter, htmlOptions, reactContent, projectCSSPromise));
|
|
@@ -232,7 +234,8 @@ export class HTMLGenerator {
|
|
|
232
234
|
});
|
|
233
235
|
}
|
|
234
236
|
const mergedFrontmatter = mergeCollectedFrontmatter(context);
|
|
235
|
-
const
|
|
237
|
+
const hasReleaseIdentity = hasImmutableReleaseHydrationRuntime(resolveReleaseId(context.options));
|
|
238
|
+
const htmlOptions = await profilePhase("html.build_options", () => this.buildHTMLOptions(context, mergedFrontmatter, hasReleaseIdentity));
|
|
236
239
|
const projectCSSPromise = startProjectCSSPreparation(context, htmlOptions);
|
|
237
240
|
const metadata = extractHTMLMetadata(mergedFrontmatter, (context.layoutBundle?.frontmatter || {}));
|
|
238
241
|
// Full-document placeholders use the same bounded structured-head contract
|
|
@@ -269,6 +272,7 @@ export class HTMLGenerator {
|
|
|
269
272
|
projectStylesheetHref,
|
|
270
273
|
dependencyPinningCacheKey: context.options?.dependencyPinningCacheKey,
|
|
271
274
|
releaseAssetManifest,
|
|
275
|
+
prodHydrationModulePath: htmlOptions.prodHydrationModulePath,
|
|
272
276
|
directories: this.config.config.directories,
|
|
273
277
|
});
|
|
274
278
|
if (injectedHtml.trimStart().toLowerCase().startsWith("<!doctype"))
|
|
@@ -305,7 +309,7 @@ export class HTMLGenerator {
|
|
|
305
309
|
}
|
|
306
310
|
async wrapHTMLFragment(context) {
|
|
307
311
|
const mergedFrontmatter = mergeCollectedFrontmatter(context);
|
|
308
|
-
const htmlOptions = await profilePhase("html.build_options", () => this.buildHTMLOptions(context, mergedFrontmatter));
|
|
312
|
+
const htmlOptions = await profilePhase("html.build_options", () => this.buildHTMLOptions(context, mergedFrontmatter, true));
|
|
309
313
|
const projectCSSPromise = startProjectCSSPreparation(context, htmlOptions);
|
|
310
314
|
startPreparedCSSWarmup(this.config, context, htmlOptions);
|
|
311
315
|
const reactContent = context.html.trim();
|
|
@@ -436,7 +440,7 @@ export class HTMLGenerator {
|
|
|
436
440
|
});
|
|
437
441
|
const { computeContentSourceId } = await import("../../cache/keys.js");
|
|
438
442
|
const contentSourceId = computeContentSourceId(this.config.isLocalProject === true, context.options?.environment ?? "preview", null, context.options?.releaseId);
|
|
439
|
-
const loaded = await loadReservedWithPath(dirs, "error", this.config.projectDir, this.config.mode, this.config.adapter, context.options?.projectId, contentSourceId, reactVersion, context.options?.dependencyPinningCacheKey, context.options?.dependencyPinningDependencies, context.options?.dependencyPinningSource, context.options?.url?.origin);
|
|
443
|
+
const loaded = await loadReservedWithPath(dirs, "error", this.config.projectDir, this.config.mode, this.config.adapter, context.options?.projectId, contentSourceId, reactVersion, context.options?.dependencyPinningCacheKey, context.options?.dependencyPinningDependencies, context.options?.dependencyPinningSource, context.options?.url?.origin, this.config.config?.build?.serverExternalPackages);
|
|
440
444
|
if (!loaded)
|
|
441
445
|
return null;
|
|
442
446
|
return { component: loaded.component, path: loaded.filePath };
|
|
@@ -461,7 +465,7 @@ export class HTMLGenerator {
|
|
|
461
465
|
return undefined;
|
|
462
466
|
}
|
|
463
467
|
}
|
|
464
|
-
async buildHTMLOptions(context, mergedFrontmatter) {
|
|
468
|
+
async buildHTMLOptions(context, mergedFrontmatter, includeProdHydrationRuntime) {
|
|
465
469
|
const stylesheetPath = this.config.config?.tailwind?.stylesheet || "globals.css";
|
|
466
470
|
const [appComponentPathOrNull, globalCSS] = await Promise.all([
|
|
467
471
|
profilePhase("html.resolve_app_path", () => this.resolveAppPath()),
|
|
@@ -492,6 +496,17 @@ export class HTMLGenerator {
|
|
|
492
496
|
const sourceHash = context.options?.studioEmbed && context.pageInfo.entity.content
|
|
493
497
|
? computeSourceHash(context.pageInfo.entity.content)
|
|
494
498
|
: undefined;
|
|
499
|
+
const releaseId = resolveReleaseId(context.options);
|
|
500
|
+
const usesProductionScripts = context.options?.forceProductionScripts === true ||
|
|
501
|
+
!(this.config.isLocalProject === true || context.options?.environment === "preview");
|
|
502
|
+
const prodHydrationModulePath = includeProdHydrationRuntime && usesProductionScripts
|
|
503
|
+
? await profilePhase("html.release_hydration_runtime", () => resolveProdHydrationModulePath({
|
|
504
|
+
fs: this.config.adapter.fs,
|
|
505
|
+
projectDir: this.config.projectDir,
|
|
506
|
+
buildOutDir: this.config.config?.build?.outDir,
|
|
507
|
+
releaseId,
|
|
508
|
+
}))
|
|
509
|
+
: undefined;
|
|
495
510
|
return profileSyncPhase("html.build_options.finalize", () => ({
|
|
496
511
|
mode: this.config.mode,
|
|
497
512
|
config: this.config.config,
|
|
@@ -516,7 +531,8 @@ export class HTMLGenerator {
|
|
|
516
531
|
studioEmbed: context.options?.studioEmbed,
|
|
517
532
|
projectId: context.options?.projectId,
|
|
518
533
|
projectSlug: context.options?.projectSlug,
|
|
519
|
-
releaseId
|
|
534
|
+
releaseId,
|
|
535
|
+
prodHydrationModulePath,
|
|
520
536
|
pageId: context.options?.pageId,
|
|
521
537
|
sourceHash,
|
|
522
538
|
colorScheme: context.options?.colorScheme,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAGzE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAMjF,OAAO,EACL,KAAK,4BAA4B,EAElC,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAItE,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,EAAE,aAAa,GAAG,YAAY,CAAC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,eAAe,CAAC;IACjC,cAAc,EAAE,cAAc,CAAC;IAC/B,WAAW,E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UAAU,EACpB,YAAY,EAAE,SAAS,GAAG,SAAS,EACnC,aAAa,EAAE,UAAU,EAAE,EAC3B,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACpD,UAAU,CAAC,EAAE,GAAG,EAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EAC1C,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,EAC7D,WAAW,CAAC,EAAE,MAAM,EACpB,gBAAgB,CAAC,EAAE;QAAE,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,EAC3D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,yBAAyB,CAAC,EAAE,MAAM,EAClC,6BAA6B,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAChE,uBAAuB,CAAC,EAAE,4BAA4B,GACrD,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC;CA2E/B"}
|
|
@@ -106,7 +106,7 @@ export class LayoutOrchestrator {
|
|
|
106
106
|
const componentPath = layout.componentPath;
|
|
107
107
|
preloadPromises.push((async () => {
|
|
108
108
|
try {
|
|
109
|
-
await loadTSXComponent(componentPath, this.config.projectDir, this.config.layoutCache, this.config.adapter, this.config.projectId, this.config.projectSlug, this.config.contentSourceId, reactVersion, undefined, dependencyPinningCacheKey, dependencyPinningDependencies, dependencyPinningSource, moduleServerOrigin);
|
|
109
|
+
await loadTSXComponent(componentPath, this.config.projectDir, this.config.layoutCache, this.config.adapter, this.config.projectId, this.config.projectSlug, this.config.contentSourceId, reactVersion, undefined, dependencyPinningCacheKey, dependencyPinningDependencies, dependencyPinningSource, moduleServerOrigin, this.config.config.build?.serverExternalPackages);
|
|
110
110
|
return { type: "tsx", path: componentPath, success: true };
|
|
111
111
|
}
|
|
112
112
|
catch (error) {
|
|
@@ -180,7 +180,7 @@ export class LayoutOrchestrator {
|
|
|
180
180
|
return withSpan("layout.applyLayoutsAndWrappers", async () => {
|
|
181
181
|
const reactVersion = await this.getReactVersion(dependencyPinningCacheKey, dependencyPinningDependencies);
|
|
182
182
|
const registryComponents = isSnapshotAwareComponentRegistry(this.config.componentRegistry)
|
|
183
|
-
? this.config.componentRegistry.getAllAsComponents(await this.config.componentRegistry.prepareDependencySnapshot(dependencyPinningCacheKey, dependencyPinningDependencies, dependencyPinningSource, requestUrl?.origin))
|
|
183
|
+
? this.config.componentRegistry.getAllAsComponents(await this.config.componentRegistry.prepareDependencySnapshot(dependencyPinningCacheKey, dependencyPinningDependencies, dependencyPinningSource, requestUrl?.origin, this.config.config.build?.serverExternalPackages))
|
|
184
184
|
: this.config.componentRegistry;
|
|
185
185
|
const mergedComponents = {
|
|
186
186
|
...createDefaultMDXComponents(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/dependency-resolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAsDzE,sEAAsE;AACtE,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,6EAA6E;IAC7E,SAAS,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,uFAAuF;AACvF,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,GAAG;IACnE,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,sEAAsE;AACtE,MAAM,WAAW,8BAA8B;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc,CAAC;CACzB;
|
|
1
|
+
{"version":3,"file":"dependency-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/dependency-resolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAsDzE,sEAAsE;AACtE,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,6EAA6E;IAC7E,SAAS,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,uFAAuF;AACvF,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,GAAG;IACnE,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,sEAAsE;AACtE,MAAM,WAAW,8BAA8B;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc,CAAC;CACzB;AAgKD,yEAAyE;AACzE,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAuBrC;AAED,2EAA2E;AAC3E,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,2BAA2B,EAAE,GAC7C,MAAM,CAiBR"}
|
|
@@ -49,8 +49,26 @@ function collectRelativeImports(fileContent, fileDir) {
|
|
|
49
49
|
}
|
|
50
50
|
async function resolveAliasImport(imp, projectDir, adapter) {
|
|
51
51
|
const relativePath = imp.path.substring(2); // Remove @/ prefix.
|
|
52
|
-
const
|
|
53
|
-
(
|
|
52
|
+
const warnLegacyFallback = (suggestedSpecifier) => {
|
|
53
|
+
logger.warn("The @/ alias resolved through the deprecated components/ fallback. Update the import to match the project-relative file path.", { specifier: imp.path, suggestedSpecifier });
|
|
54
|
+
};
|
|
55
|
+
const directPath = await findSourceFile(relativePath, projectDir, adapter, {
|
|
56
|
+
onLegacyComponentsFallback: () => {
|
|
57
|
+
warnLegacyFallback(`@/${relativePath.replace(/^components\//, "")}`);
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
let depFilePath = directPath;
|
|
61
|
+
if (!depFilePath) {
|
|
62
|
+
let resolvedThroughStripFallback = false;
|
|
63
|
+
depFilePath = await findSourceFile(`components/${relativePath}`, projectDir, adapter, {
|
|
64
|
+
onLegacyComponentsFallback: () => {
|
|
65
|
+
resolvedThroughStripFallback = true;
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
if (depFilePath && !resolvedThroughStripFallback) {
|
|
69
|
+
warnLegacyFallback(`@/components/${relativePath}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
54
72
|
return { ...imp, relativePath, depFilePath, isLocalLib: false };
|
|
55
73
|
}
|
|
56
74
|
async function resolveRelativeImport(imp, adapter) {
|
|
@@ -35,6 +35,8 @@ export interface ModuleLoaderConfig {
|
|
|
35
35
|
reactVersion?: string;
|
|
36
36
|
/** Absolute request origin used to identify same-origin module URLs. */
|
|
37
37
|
moduleServerOrigin?: string;
|
|
38
|
+
/** Bare npm package roots that the runtime resolves without bundling. */
|
|
39
|
+
serverExternalPackages?: readonly string[];
|
|
38
40
|
/** Stable VERYFRONT_DEPENDENCY_PINNING + package dependency-map state. */
|
|
39
41
|
dependencyPinningCacheKey?: string;
|
|
40
42
|
/** Immutable package map paired with dependencyPinningCacheKey. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAsBzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAKhG,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA6CpD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOpE;;;;;;;;;GASG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,cAAc,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,eAAe,UAAQ,EACvB,OAAO,GAAE,WAAW,CAAC,MAAM,CAAa,EAKxC,YAAY,GAAE,GAAG,CAAC,MAAM,CAAa,EAarC,oBAAoB,GAAE,GAAG,CAAC,MAAM,CAAa,GAC5C,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAsBzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,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MAAM,CAAC,CAAC,CAAC;IACjE,yEAAyE;IACzE,uBAAuB,CAAC,EAAE,4BAA4B,CAAC;IACvD,0DAA0D;IAC1D,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,yEAAyE;IACzE,UAAU,CAAC,EAAE,yBAAyB,CAAC;CACxC;AAyBD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAI5D;AAkED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,EACd,oBAAoB,EAAE,WAAW,CAAC,MAAM,CAAC,EACzC,mBAAmB,CAAC,EAAE,MAAM,GAC3B,OAAO,CAwBT;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA4JlC"}
|
|
@@ -94,7 +94,7 @@ cycleTargets = new Set(),
|
|
|
94
94
|
unresolvedSpecifiers = new Set()) {
|
|
95
95
|
throwIfModuleLoadAborted(config);
|
|
96
96
|
const { moduleCache, projectDir, projectId, contentSourceId, adapter, mode } = config;
|
|
97
|
-
const cacheKey = getModuleCacheKey(filePath, projectId, projectDir, contentSourceId, config.reactVersion, mode, config.dependencyPinningCacheKey, config.moduleServerOrigin);
|
|
97
|
+
const cacheKey = getModuleCacheKey(filePath, projectId, projectDir, contentSourceId, config.reactVersion, mode, config.dependencyPinningCacheKey, config.moduleServerOrigin, config.serverExternalPackages);
|
|
98
98
|
const cachedPath = await resolveCachedModulePath({
|
|
99
99
|
cacheKey,
|
|
100
100
|
filePath,
|
|
@@ -105,6 +105,7 @@ unresolvedSpecifiers = new Set()) {
|
|
|
105
105
|
reactVersion: config.reactVersion,
|
|
106
106
|
dependencyPinningCacheKey: config.dependencyPinningCacheKey,
|
|
107
107
|
moduleServerOrigin: config.moduleServerOrigin,
|
|
108
|
+
serverExternalPackages: config.serverExternalPackages,
|
|
108
109
|
});
|
|
109
110
|
if (cachedPath) {
|
|
110
111
|
// Replay the evidence this module produced when it was last resolved. A
|
|
@@ -219,6 +220,7 @@ unresolvedSpecifiers = new Set()) {
|
|
|
219
220
|
adapter,
|
|
220
221
|
reactVersion: config.reactVersion,
|
|
221
222
|
moduleServerOrigin: config.moduleServerOrigin,
|
|
223
|
+
serverExternalPackages: config.serverExternalPackages,
|
|
222
224
|
dependencyPinningCacheKey: config.dependencyPinningCacheKey,
|
|
223
225
|
dependencyPinningDependencies: config.dependencyPinningDependencies,
|
|
224
226
|
dependencyPinningSource: config.dependencyPinningSource,
|
|
@@ -238,6 +240,7 @@ unresolvedSpecifiers = new Set()) {
|
|
|
238
240
|
reactVersion: config.reactVersion,
|
|
239
241
|
moduleServerOrigin: config.moduleServerOrigin,
|
|
240
242
|
dependencyPinningCacheKey: config.dependencyPinningCacheKey,
|
|
243
|
+
serverExternalPackages: config.serverExternalPackages,
|
|
241
244
|
isCycleTarget: cycleTargets.has(filePath),
|
|
242
245
|
unresolvedSpecifiers: [...moduleUnresolvedSpecifiers],
|
|
243
246
|
});
|
|
@@ -431,11 +434,11 @@ export async function loadModule(filePath, config) {
|
|
|
431
434
|
filePath,
|
|
432
435
|
tempFilePath,
|
|
433
436
|
});
|
|
434
|
-
config.moduleCache.delete(getModuleCacheKey(filePath, config.projectId, config.projectDir, config.contentSourceId, config.reactVersion, config.mode, config.dependencyPinningCacheKey, config.moduleServerOrigin));
|
|
437
|
+
config.moduleCache.delete(getModuleCacheKey(filePath, config.projectId, config.projectDir, config.contentSourceId, config.reactVersion, config.mode, config.dependencyPinningCacheKey, config.moduleServerOrigin, config.serverExternalPackages));
|
|
435
438
|
// tmpDir is the exact cache dir this module was registered under, so the
|
|
436
439
|
// invalidation stays scoped to this tenant (the path-cache key is not
|
|
437
440
|
// project-scoped — see invalidateMdxEsmModule).
|
|
438
|
-
invalidateMdxEsmModule(tmpDir, filePath, config.projectDir, config.reactVersion, buildModuleTransformCacheVariant(config.dependencyPinningCacheKey, config.moduleServerOrigin));
|
|
441
|
+
invalidateMdxEsmModule(tmpDir, filePath, config.projectDir, config.reactVersion, buildModuleTransformCacheVariant(config.dependencyPinningCacheKey, config.moduleServerOrigin, config.serverExternalPackages));
|
|
439
442
|
// Classification at the retry seam must describe the rebuilt graph, not
|
|
440
443
|
// the artifact that just failed. A dependency may appear between the two
|
|
441
444
|
// transforms, so retaining its earlier dropped-specifier evidence can
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { createFileSystem } from "../../../platform/compat/fs.js";
|
|
7
7
|
import { lookupMdxEsmCache } from "../../../transforms/mdx/esm-module-loader/cache/index.js";
|
|
8
|
-
export declare function buildModuleTransformCacheVariant(dependencyPinningCacheKey?: string, moduleServerOrigin?: string): string | undefined;
|
|
9
|
-
export declare function getModuleCacheKey(filePath: string, projectId?: string, projectDir?: string, contentSourceId?: string, reactVersion?: string, mode?: "development" | "production", dependencyPinningCacheKey?: string, moduleServerOrigin?: string): string;
|
|
8
|
+
export declare function buildModuleTransformCacheVariant(dependencyPinningCacheKey?: string, moduleServerOrigin?: string, serverExternalPackages?: readonly string[]): string | undefined;
|
|
9
|
+
export declare function getModuleCacheKey(filePath: string, projectId?: string, projectDir?: string, contentSourceId?: string, reactVersion?: string, mode?: "development" | "production", dependencyPinningCacheKey?: string, moduleServerOrigin?: string, serverExternalPackages?: readonly string[]): string;
|
|
10
10
|
type LookupMdxCache = typeof lookupMdxEsmCache;
|
|
11
11
|
type FileSystemReader = Pick<ReturnType<typeof createFileSystem>, "readTextFile">;
|
|
12
12
|
export interface ResolveCachedModulePathInput {
|
|
@@ -18,6 +18,7 @@ export interface ResolveCachedModulePathInput {
|
|
|
18
18
|
reactVersion?: string;
|
|
19
19
|
dependencyPinningCacheKey?: string;
|
|
20
20
|
moduleServerOrigin?: string;
|
|
21
|
+
serverExternalPackages?: readonly string[];
|
|
21
22
|
moduleCache: Map<string, string>;
|
|
22
23
|
readTextFile?: (path: string) => Promise<string>;
|
|
23
24
|
fileSystem?: FileSystemReader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-cache-lookup.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/module-cache-lookup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAEL,iBAAiB,EAClB,MAAM,0DAA0D,CAAC;AASlE,wBAAgB,gCAAgC,CAC9C,yBAAyB,CAAC,EAAE,MAAM,EAClC,kBAAkB,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"module-cache-lookup.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/module-cache-lookup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAEL,iBAAiB,EAClB,MAAM,0DAA0D,CAAC;AASlE,wBAAgB,gCAAgC,CAC9C,yBAAyB,CAAC,EAAE,MAAM,EAClC,kBAAkB,CAAC,EAAE,MAAM,EAC3B,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,GACzC,MAAM,GAAG,SAAS,CAMpB;AAED,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,MAAM,EACnB,eAAe,CAAC,EAAE,MAAM,EACxB,YAAY,CAAC,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE,aAAa,GAAG,YAAY,EACnC,yBAAyB,CAAC,EAAE,MAAM,EAClC,kBAAkB,CAAC,EAAE,MAAM,EAC3B,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,GACzC,MAAM,CAeR;AAED,KAAK,cAAc,GAAG,OAAO,iBAAiB,CAAC;AAC/C,KAAK,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,EAAE,cAAc,CAAC,CAAC;AAElF,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACjD,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AA4ED,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,4BAA4B,GAClC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAK7B"}
|
|
@@ -10,12 +10,12 @@ import { getMdxEsmCacheDir } from "../../../utils/cache-dir.js";
|
|
|
10
10
|
import { rendererLogger } from "../../../utils/index.js";
|
|
11
11
|
import { REACT_DEFAULT_VERSION } from "../../../utils/constants/cdn.js";
|
|
12
12
|
import { UNRESOLVED_VF_MODULES_RE } from "./module-transform-cache.js";
|
|
13
|
-
import {
|
|
13
|
+
import { getMdxModuleCacheVariant } from "../../../transforms/mdx/esm-module-loader/module-fetcher/cache-keys.js";
|
|
14
14
|
const logger = rendererLogger.component("module-loader");
|
|
15
|
-
export function buildModuleTransformCacheVariant(dependencyPinningCacheKey, moduleServerOrigin) {
|
|
16
|
-
return
|
|
15
|
+
export function buildModuleTransformCacheVariant(dependencyPinningCacheKey, moduleServerOrigin, serverExternalPackages) {
|
|
16
|
+
return getMdxModuleCacheVariant(dependencyPinningCacheKey, moduleServerOrigin, serverExternalPackages);
|
|
17
17
|
}
|
|
18
|
-
export function getModuleCacheKey(filePath, projectId, projectDir, contentSourceId, reactVersion, mode, dependencyPinningCacheKey, moduleServerOrigin) {
|
|
18
|
+
export function getModuleCacheKey(filePath, projectId, projectDir, contentSourceId, reactVersion, mode, dependencyPinningCacheKey, moduleServerOrigin, serverExternalPackages) {
|
|
19
19
|
const base = projectId ?? projectDir ?? "default";
|
|
20
20
|
const source = contentSourceId ?? "default";
|
|
21
21
|
const fields = [
|
|
@@ -24,7 +24,7 @@ export function getModuleCacheKey(filePath, projectId, projectDir, contentSource
|
|
|
24
24
|
reactVersion ?? REACT_DEFAULT_VERSION,
|
|
25
25
|
mode ?? "default",
|
|
26
26
|
];
|
|
27
|
-
const cacheVariant = buildModuleTransformCacheVariant(dependencyPinningCacheKey, moduleServerOrigin);
|
|
27
|
+
const cacheVariant = buildModuleTransformCacheVariant(dependencyPinningCacheKey, moduleServerOrigin, serverExternalPackages);
|
|
28
28
|
return JSON.stringify(cacheVariant ? [...fields, cacheVariant, filePath] : [...fields, filePath]);
|
|
29
29
|
}
|
|
30
30
|
async function resolveInMemoryCachedPath(input) {
|
|
@@ -60,7 +60,7 @@ async function resolveMdxEsmCachedPath(input) {
|
|
|
60
60
|
const mdxCacheResult = await lookup(input.filePath, mdxCacheDir, input.projectDir, undefined, {
|
|
61
61
|
projectId: input.projectId,
|
|
62
62
|
contentSourceId: input.contentSourceId,
|
|
63
|
-
}, input.reactVersion, buildModuleTransformCacheVariant(input.dependencyPinningCacheKey, input.moduleServerOrigin));
|
|
63
|
+
}, input.reactVersion, buildModuleTransformCacheVariant(input.dependencyPinningCacheKey, input.moduleServerOrigin, input.serverExternalPackages));
|
|
64
64
|
if (mdxCacheResult.status === "hit") {
|
|
65
65
|
input.moduleCache.set(input.cacheKey, mdxCacheResult.path);
|
|
66
66
|
return mdxCacheResult.path;
|
|
@@ -16,6 +16,7 @@ export interface PersistTransformedModuleInput {
|
|
|
16
16
|
reactVersion?: string;
|
|
17
17
|
dependencyPinningCacheKey?: string;
|
|
18
18
|
moduleServerOrigin?: string;
|
|
19
|
+
serverExternalPackages?: readonly string[];
|
|
19
20
|
/** Tenant-authored imports left unresolved in this module subtree. */
|
|
20
21
|
unresolvedSpecifiers?: readonly string[];
|
|
21
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-persistence.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/module-persistence.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AA6DzE,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,cAAc,CAAC;IAC7B,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sEAAsE;IACtE,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,4EAA4E;AAC5E,wBAAsB,iCAAiC,CACrD,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,cAAc,GAC3B,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAmB5B;AA4ZD,uEAAuE;AACvE,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,6BAA6B,GACnC,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"module-persistence.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/module-persistence.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AA6DzE,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,cAAc,CAAC;IAC7B,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,sEAAsE;IACtE,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,4EAA4E;AAC5E,wBAAsB,iCAAiC,CACrD,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,cAAc,GAC3B,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAmB5B;AA4ZD,uEAAuE;AACvE,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,6BAA6B,GACnC,OAAO,CAAC,MAAM,CAAC,CAkHjB"}
|
|
@@ -445,7 +445,7 @@ export async function persistTransformedModule(input) {
|
|
|
445
445
|
const relativePath = input.filePath.startsWith(input.projectDir)
|
|
446
446
|
? input.filePath.slice(input.projectDir.length).replace(/^\/+/, "")
|
|
447
447
|
: input.filePath.replace(/^\/+/, "");
|
|
448
|
-
const cacheVariant = buildModuleTransformCacheVariant(input.dependencyPinningCacheKey, input.moduleServerOrigin);
|
|
448
|
+
const cacheVariant = buildModuleTransformCacheVariant(input.dependencyPinningCacheKey, input.moduleServerOrigin, input.serverExternalPackages);
|
|
449
449
|
const outputRelativePath = cacheVariant
|
|
450
450
|
? join("_pins", encodeURIComponent(cacheVariant), relativePath)
|
|
451
451
|
: relativePath;
|
|
@@ -502,7 +502,7 @@ export async function persistTransformedModule(input) {
|
|
|
502
502
|
}
|
|
503
503
|
if (shouldPublishReusableCache && input.contentSourceId) {
|
|
504
504
|
const normalizedPath = `_vf_modules/${relativePath.replace(/\.(tsx?|jsx|mdx)$/, ".js")}`;
|
|
505
|
-
const mdxCacheKey = buildMdxEsmPathCacheKey(normalizedPath, input.reactVersion, buildModuleTransformCacheVariant(input.dependencyPinningCacheKey, input.moduleServerOrigin));
|
|
505
|
+
const mdxCacheKey = buildMdxEsmPathCacheKey(normalizedPath, input.reactVersion, buildModuleTransformCacheVariant(input.dependencyPinningCacheKey, input.moduleServerOrigin, input.serverExternalPackages));
|
|
506
506
|
const cache = await getModulePathCache(input.tmpDir);
|
|
507
507
|
cache.set(mdxCacheKey, tempFilePath);
|
|
508
508
|
saveModulePathCache(input.tmpDir).catch((err) => {
|
|
@@ -34,6 +34,7 @@ interface TransformOptions {
|
|
|
34
34
|
ssr: boolean;
|
|
35
35
|
reactVersion?: string;
|
|
36
36
|
moduleServerOrigin?: string;
|
|
37
|
+
serverExternalPackages?: readonly string[];
|
|
37
38
|
dependencyPinningCacheKey?: string;
|
|
38
39
|
dependencyPinningDependencies?: Readonly<Record<string, string>>;
|
|
39
40
|
dependencyPinningSource?: DependencyPinningSourceInput;
|
|
@@ -63,6 +64,7 @@ export interface TransformModuleCodeWithCacheInput {
|
|
|
63
64
|
adapter: RuntimeAdapter;
|
|
64
65
|
reactVersion?: string;
|
|
65
66
|
moduleServerOrigin?: string;
|
|
67
|
+
serverExternalPackages?: readonly string[];
|
|
66
68
|
dependencyPinningCacheKey?: string;
|
|
67
69
|
dependencyPinningDependencies?: Readonly<Record<string, string>>;
|
|
68
70
|
dependencyPinningSource?: DependencyPinningSourceInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-transform-cache.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/module-transform-cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAIzE,OAAO,EAGL,wBAAwB,EACxB,uBAAuB,EACvB,KAAK,6BAA6B,EACnC,MAAM,4CAA4C,CAAC;AAIpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGpE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAChG,OAAO,EACL,KAAK,+BAA+B,EAErC,MAAM,8DAA8D,CAAC;
|
|
1
|
+
{"version":3,"file":"module-transform-cache.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/module-transform-cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAIzE,OAAO,EAGL,wBAAwB,EACxB,uBAAuB,EACvB,KAAK,6BAA6B,EACnC,MAAM,4CAA4C,CAAC;AAIpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGpE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAChG,OAAO,EACL,KAAK,+BAA+B,EAErC,MAAM,8DAA8D,CAAC;AAOtE,oFAAoF;AACpF,eAAO,MAAM,wBAAwB,QAA6D,CAAC;AAEnG,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,QAA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,CAAC,EAAE,MAAM,CAAC;IACnC,6BAA6B,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjE,uBAAuB,CAAC,EAAE,4BAA4B,CAAC;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,IAAI,CAAC,EAAE,wBAAwB,CAAC;CACjC;AAgDD,qFAAqF;AACrF,wBAAsB,4BAA4B,CAChD,KAAK,EAAE,iCAAiC,GACvC,OAAO,CAAC,0BAA0B,CAAC,CA6JrC"}
|
|
@@ -16,6 +16,7 @@ import { REACT_DEFAULT_VERSION } from "../../../utils/constants/cdn.js";
|
|
|
16
16
|
import { validateDependencyResolutionObservations, } from "../../../transforms/import-rewriter/dependency-resolution.js";
|
|
17
17
|
import { replaySSRDependencyResolutionObservations } from "../../../transforms/import-rewriter/ssr-adapter.js";
|
|
18
18
|
import { buildDependencyPinningCacheVariant } from "../../../cache/keys/dependency-pinning.js";
|
|
19
|
+
import { buildServerExternalPackagesIdentity } from "../../../config/server-external-packages.js";
|
|
19
20
|
const logger = rendererLogger.component("module-loader");
|
|
20
21
|
/** Pattern to detect unresolved /_vf_modules/ imports that will fail at runtime. */
|
|
21
22
|
export const UNRESOLVED_VF_MODULES_RE = /from\s*["']((?:file:\/\/)?\/?\/?_vf_modules\/[^"']+)["']/;
|
|
@@ -81,7 +82,11 @@ export async function transformModuleCodeWithCache(input) {
|
|
|
81
82
|
input.mode,
|
|
82
83
|
reactVersion,
|
|
83
84
|
];
|
|
84
|
-
const
|
|
85
|
+
const serverExternalPackagesIdentity = buildServerExternalPackagesIdentity(input.serverExternalPackages);
|
|
86
|
+
const extendedConfig = serverExternalPackagesIdentity
|
|
87
|
+
? [...legacyConfig, `server-externals:${serverExternalPackagesIdentity}`]
|
|
88
|
+
: legacyConfig;
|
|
89
|
+
const configHash = hashCodeHex(JSON.stringify(cacheVariant ? [...extendedConfig, cacheVariant] : extendedConfig));
|
|
85
90
|
const cacheKey = generateTransformCacheKey(scopedPath, contentHash, true, false, { configHash });
|
|
86
91
|
const dependencyResolutionObservations = new Map();
|
|
87
92
|
const transformOptions = {
|
|
@@ -90,6 +95,7 @@ export async function transformModuleCodeWithCache(input) {
|
|
|
90
95
|
ssr: true,
|
|
91
96
|
reactVersion,
|
|
92
97
|
moduleServerOrigin,
|
|
98
|
+
serverExternalPackages: input.serverExternalPackages,
|
|
93
99
|
dependencyPinningCacheKey: input.dependencyPinningCacheKey,
|
|
94
100
|
dependencyPinningDependencies: input.dependencyPinningDependencies,
|
|
95
101
|
dependencyPinningSource: input.dependencyPinningSource,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,iCAAiC,CAAC;AASzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"pipe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A2Y9E,+EAA+E;IACzE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC;YA+JzE,kBAAkB;YA2ClB,cAAc;IAW5B,OAAO,CAAC,uBAAuB;YAYjB,kBAAkB;IA+FhC,OAAO,CAAC,kBAAkB;YAQZ,uBAAuB;IAmBrC;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;CA8BtB"}
|
|
@@ -27,6 +27,7 @@ import { extractRenderedCssHash, hasRenderedReleaseAssetCss, serializeLayoutProp
|
|
|
27
27
|
import { join } from "../../platform/compat/path/index.js";
|
|
28
28
|
import { isExtendedFSAdapter } from "../../platform/adapters/fs/wrapper.js";
|
|
29
29
|
import { DataFetcher } from "../../data/index.js";
|
|
30
|
+
import { attachDataResponseMetadata, mergeDataResponseMetadata, unwrapDataResponseMetadataError, wrapDataResponseMetadataError, } from "../../data/response-metadata.js";
|
|
30
31
|
import { clearSSRModuleCacheForProject } from "../../modules/react-loader/index.js";
|
|
31
32
|
import { setupSSRGlobals } from "../ssr-globals.js";
|
|
32
33
|
import { LAYOUT_EXTENSIONS } from "../layouts/types.js";
|
|
@@ -139,6 +140,7 @@ export class RenderPipeline {
|
|
|
139
140
|
moduleServerOrigin: dependencySnapshot.cacheKey.startsWith("on:")
|
|
140
141
|
? options?.url?.origin
|
|
141
142
|
: undefined,
|
|
143
|
+
serverExternalPackages: this.config.config?.build?.serverExternalPackages,
|
|
142
144
|
dependencyPinningCacheKey: dependencySnapshot.cacheKey,
|
|
143
145
|
dependencyPinningDependencies: dependencySnapshot.dependencies,
|
|
144
146
|
dependencyPinningSource,
|
|
@@ -318,8 +320,8 @@ export class RenderPipeline {
|
|
|
318
320
|
return { ...job, result: null, error: error };
|
|
319
321
|
}
|
|
320
322
|
})), DATA_FETCH_TIMEOUT_MS, `Data fetch for ${slug}`), { "render.data_job_count": dataJobs.length }));
|
|
321
|
-
this.applyFetchedDataResults(slug, dataResults, pageProps, layoutProps);
|
|
322
|
-
return { params, pageProps, layoutProps };
|
|
323
|
+
const responseMetadata = this.applyFetchedDataResults(slug, dataResults, pageProps, layoutProps);
|
|
324
|
+
return { params, pageProps, layoutProps, ...responseMetadata };
|
|
323
325
|
}
|
|
324
326
|
/**
|
|
325
327
|
* Build a host-owned worker generation for raw local data modules.
|
|
@@ -358,22 +360,34 @@ export class RenderPipeline {
|
|
|
358
360
|
};
|
|
359
361
|
}
|
|
360
362
|
applyFetchedDataResults(slug, dataResults, pageProps, layoutProps) {
|
|
363
|
+
// Layouts are collected outermost to innermost. Apply them in that order,
|
|
364
|
+
// then the page, so the closest owner wins a duplicate custom header.
|
|
365
|
+
// Cookies remain distinct and preserve the same outer-to-inner-to-page order.
|
|
366
|
+
const responseMetadata = mergeDataResponseMetadata([
|
|
367
|
+
...dataResults.filter(({ type }) => type === "layout"),
|
|
368
|
+
...dataResults.filter(({ type }) => type === "page"),
|
|
369
|
+
]
|
|
370
|
+
.flatMap(({ result }) => result ? [result] : []));
|
|
361
371
|
for (const { type, id, result, error } of dataResults) {
|
|
362
|
-
if (error)
|
|
372
|
+
if (error) {
|
|
373
|
+
if (responseMetadata.headers || responseMetadata.cookies) {
|
|
374
|
+
throw wrapDataResponseMetadataError(error, responseMetadata);
|
|
375
|
+
}
|
|
363
376
|
throw error;
|
|
377
|
+
}
|
|
364
378
|
if (!result)
|
|
365
379
|
continue;
|
|
366
380
|
if (result.notFound) {
|
|
367
|
-
throw FILE_NOT_FOUND.create({
|
|
381
|
+
throw attachDataResponseMetadata(FILE_NOT_FOUND.create({
|
|
368
382
|
detail: "Page/Layout returned notFound",
|
|
369
383
|
context: { slug, component: id },
|
|
370
|
-
});
|
|
384
|
+
}), responseMetadata);
|
|
371
385
|
}
|
|
372
386
|
if (result.redirect) {
|
|
373
|
-
throw RENDER_ERROR.create({
|
|
387
|
+
throw attachDataResponseMetadata(RENDER_ERROR.create({
|
|
374
388
|
detail: `Redirect to ${result.redirect.destination}`,
|
|
375
389
|
context: { slug, redirect: result.redirect },
|
|
376
|
-
});
|
|
390
|
+
}), responseMetadata);
|
|
377
391
|
}
|
|
378
392
|
if (!result.props)
|
|
379
393
|
continue;
|
|
@@ -384,6 +398,7 @@ export class RenderPipeline {
|
|
|
384
398
|
layoutProps.set(id, result.props);
|
|
385
399
|
}
|
|
386
400
|
}
|
|
401
|
+
return responseMetadata;
|
|
387
402
|
}
|
|
388
403
|
async renderPage(slug, options) {
|
|
389
404
|
const pipelineStartTime = performance.now();
|
|
@@ -424,6 +439,8 @@ export class RenderPipeline {
|
|
|
424
439
|
}), { "render.slug": slug }));
|
|
425
440
|
timing.pageResolve = Math.round(performance.now() - pageResolveStart);
|
|
426
441
|
const sourceFile = extractRelativePathShared(pageInfo.entity.path, this.config.projectDir);
|
|
442
|
+
let responseHeaders;
|
|
443
|
+
let responseCookies;
|
|
427
444
|
try {
|
|
428
445
|
const skipLayouts = isDotPath({
|
|
429
446
|
slug,
|
|
@@ -452,6 +469,8 @@ export class RenderPipeline {
|
|
|
452
469
|
? internalPreResolvedData.pageProps
|
|
453
470
|
: undefined;
|
|
454
471
|
layoutDataMap = internalPreResolvedData.layoutProps;
|
|
472
|
+
responseHeaders = internalPreResolvedData.headers;
|
|
473
|
+
responseCookies = internalPreResolvedData.cookies;
|
|
455
474
|
}
|
|
456
475
|
else if (options?.url && (options.request || options.staticDataOnly)) {
|
|
457
476
|
await profilePhase("render.data_fetching", () => withSpan("render.data_fetching", async () => {
|
|
@@ -462,6 +481,8 @@ export class RenderPipeline {
|
|
|
462
481
|
? dataResolution.pageProps
|
|
463
482
|
: undefined;
|
|
464
483
|
layoutDataMap = dataResolution.layoutProps;
|
|
484
|
+
responseHeaders = dataResolution.headers;
|
|
485
|
+
responseCookies = dataResolution.cookies;
|
|
465
486
|
}
|
|
466
487
|
catch (error) {
|
|
467
488
|
if (error instanceof VeryfrontError)
|
|
@@ -488,8 +509,23 @@ export class RenderPipeline {
|
|
|
488
509
|
const bundlePrepStart = performance.now();
|
|
489
510
|
const pageBundleResult = await profilePhase("render.prepare_bundles", () => withSpan("render.prepare_bundles", () => this.config.pageRenderer.preparePageBundles(pageInfo, slug, cacheResult?.cachedModule, mergedOptions), { "render.slug": slug }));
|
|
490
511
|
timing.bundlePrep = Math.round(performance.now() - bundlePrepStart);
|
|
491
|
-
if (pageBundleResult.scriptResult)
|
|
492
|
-
|
|
512
|
+
if (pageBundleResult.scriptResult) {
|
|
513
|
+
const scriptResponseMetadata = mergeDataResponseMetadata([
|
|
514
|
+
{
|
|
515
|
+
...(pageBundleResult.scriptResult.headers
|
|
516
|
+
? { headers: pageBundleResult.scriptResult.headers }
|
|
517
|
+
: {}),
|
|
518
|
+
...(pageBundleResult.scriptResult.cookies
|
|
519
|
+
? { cookies: pageBundleResult.scriptResult.cookies }
|
|
520
|
+
: {}),
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
...(responseHeaders ? { headers: responseHeaders } : {}),
|
|
524
|
+
...(responseCookies ? { cookies: responseCookies } : {}),
|
|
525
|
+
},
|
|
526
|
+
]);
|
|
527
|
+
return { ...pageBundleResult.scriptResult, ...scriptResponseMetadata };
|
|
528
|
+
}
|
|
493
529
|
if (!pageBundleResult.pageElement || !pageBundleResult.pageBundle) {
|
|
494
530
|
throw RENDER_ERROR.create({
|
|
495
531
|
detail: "Failed to prepare page bundle",
|
|
@@ -557,6 +593,8 @@ export class RenderPipeline {
|
|
|
557
593
|
cacheCoordinator: this.config.cacheCoordinator,
|
|
558
594
|
logger: renderPipelineLog,
|
|
559
595
|
nonce: renderOptions.nonce,
|
|
596
|
+
headers: responseHeaders,
|
|
597
|
+
cookies: responseCookies,
|
|
560
598
|
});
|
|
561
599
|
timing.total = Math.round(performance.now() - pipelineStartTime);
|
|
562
600
|
renderPipelineLog.debug("Complete", { slug, timing });
|
|
@@ -564,7 +602,17 @@ export class RenderPipeline {
|
|
|
564
602
|
}
|
|
565
603
|
catch (error) {
|
|
566
604
|
if (error instanceof Error) {
|
|
567
|
-
|
|
605
|
+
const classifiedError = unwrapDataResponseMetadataError(error);
|
|
606
|
+
const sourceError = classifiedError instanceof Error ? classifiedError : error;
|
|
607
|
+
sourceError.sourceFile = sourceFile;
|
|
608
|
+
}
|
|
609
|
+
if (responseHeaders || responseCookies) {
|
|
610
|
+
throw wrapDataResponseMetadataError(error, mergeDataResponseMetadata([
|
|
611
|
+
{
|
|
612
|
+
...(responseHeaders ? { headers: responseHeaders } : {}),
|
|
613
|
+
...(responseCookies ? { cookies: responseCookies } : {}),
|
|
614
|
+
},
|
|
615
|
+
]));
|
|
568
616
|
}
|
|
569
617
|
throw error;
|
|
570
618
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PageBundle, RenderResult } from "../../types/index.js";
|
|
2
|
+
import type { ResponseCookie } from "../../data/types.js";
|
|
2
3
|
interface RenderResultAssemblyCache {
|
|
3
4
|
persistResult(result: RenderResult, slug: string, cacheKey?: string, nonce?: string): Promise<void>;
|
|
4
5
|
}
|
|
@@ -22,6 +23,8 @@ export interface AssembleRenderResultOptions {
|
|
|
22
23
|
cacheCoordinator?: RenderResultAssemblyCache;
|
|
23
24
|
logger?: RenderResultAssemblyLogger;
|
|
24
25
|
nonce?: string;
|
|
26
|
+
headers?: Record<string, string>;
|
|
27
|
+
cookies?: ResponseCookie[];
|
|
25
28
|
}
|
|
26
29
|
export declare function assembleRenderResult(options: AssembleRenderResultOptions): RenderResult;
|
|
27
30
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-result-assembly.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/render-result-assembly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"render-result-assembly.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/render-result-assembly.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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