veryfront 0.0.86 → 0.0.88
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/deno.d.ts +0 -1
- package/esm/deno.js +8 -9
- package/esm/deps/esm.sh/react-dom@19.1.1/client.d.ts +2 -0
- package/esm/deps/esm.sh/react-dom@19.1.1/client.d.ts.map +1 -0
- package/esm/deps/esm.sh/react-dom@19.1.1/client.js +5 -0
- package/esm/deps/esm.sh/react-dom@19.1.1/server.d.ts +2 -0
- package/esm/deps/esm.sh/react-dom@19.1.1/server.d.ts.map +1 -0
- package/esm/deps/esm.sh/react-dom@19.1.1/server.js +5 -0
- package/esm/deps/esm.sh/react@19.1.1/jsx-runtime.d.ts +2 -0
- package/esm/deps/esm.sh/react@19.1.1/jsx-runtime.d.ts.map +1 -0
- package/esm/deps/esm.sh/react@19.1.1/jsx-runtime.js +3 -0
- package/esm/deps/esm.sh/react@19.1.1.d.ts +2 -0
- package/esm/deps/esm.sh/react@19.1.1.d.ts.map +1 -0
- package/esm/deps/esm.sh/react@19.1.1.js +3 -0
- package/esm/deps/esm.sh/scheduler@^0.26.0.d.ts +2 -0
- package/esm/deps/esm.sh/scheduler@^0.26.0.d.ts.map +1 -0
- package/esm/deps/esm.sh/scheduler@^0.26.0.js +3 -0
- package/esm/proxy/main.d.ts +2 -0
- package/esm/proxy/main.d.ts.map +1 -0
- package/esm/proxy/main.js +400 -0
- package/esm/src/agent/react/use-agent.js +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +1 -1
- package/esm/src/agent/react/use-completion.js +1 -1
- package/esm/src/agent/react/use-streaming.js +1 -1
- package/esm/src/agent/react/use-voice-input.js +1 -1
- package/esm/src/cli/commands/init/config-generator.js +1 -1
- package/esm/src/cli/index/arg-parser.d.ts.map +1 -1
- package/esm/src/cli/index/arg-parser.js +1 -0
- package/esm/src/cli/index/command-router.d.ts.map +1 -1
- package/esm/src/cli/index/command-router.js +54 -39
- package/esm/src/cli/index/types.d.ts +4 -0
- package/esm/src/cli/index/types.d.ts.map +1 -1
- package/esm/src/cli/mcp/advanced-tools.d.ts +2 -2
- package/esm/src/config/loader.d.ts.map +1 -1
- package/esm/src/config/loader.js +5 -4
- package/esm/src/html/utils.js +2 -2
- package/esm/src/modules/component-registry/registry.d.ts +1 -1
- package/esm/src/modules/component-registry/registry.d.ts.map +1 -1
- package/esm/src/modules/import-map/default-import-map.d.ts +1 -11
- package/esm/src/modules/import-map/default-import-map.d.ts.map +1 -1
- package/esm/src/modules/import-map/default-import-map.js +3 -20
- package/esm/src/modules/import-map/loader.d.ts.map +1 -1
- package/esm/src/modules/import-map/loader.js +7 -22
- package/esm/src/modules/import-map/resolver.d.ts.map +1 -1
- package/esm/src/modules/import-map/resolver.js +12 -8
- package/esm/src/modules/react-loader/component-loader.d.ts +1 -1
- 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/extract-component.d.ts +1 -1
- package/esm/src/modules/react-loader/extract-component.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts +2 -7
- 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 +40 -32
- 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/types.d.ts +3 -1
- package/esm/src/modules/react-loader/types.d.ts.map +1 -1
- package/esm/src/modules/react-loader/unified-loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/unified-loader.js +7 -4
- package/esm/src/modules/server/module-batch-handler.d.ts +2 -0
- package/esm/src/modules/server/module-batch-handler.d.ts.map +1 -1
- package/esm/src/modules/server/module-batch-handler.js +3 -1
- package/esm/src/modules/server/module-server.d.ts +2 -0
- package/esm/src/modules/server/module-server.d.ts.map +1 -1
- package/esm/src/modules/server/module-server.js +4 -2
- package/esm/src/modules/server/ssr-import-rewriter.d.ts.map +1 -1
- package/esm/src/modules/server/ssr-import-rewriter.js +9 -17
- package/esm/src/react/compat/hooks-adapter.d.ts +1 -1
- package/esm/src/react/compat/hooks-adapter.d.ts.map +1 -1
- package/esm/src/react/compat/hooks-adapter.js +1 -1
- package/esm/src/react/compat/ssr-adapter/response-builder.d.ts +1 -1
- package/esm/src/react/compat/ssr-adapter/response-builder.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/server-loader.d.ts +5 -5
- package/esm/src/react/compat/ssr-adapter/server-loader.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/server-loader.js +2 -2
- package/esm/src/react/compat/ssr-adapter/stream-renderer.d.ts +1 -1
- package/esm/src/react/compat/ssr-adapter/stream-renderer.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/string-renderer.d.ts +1 -1
- package/esm/src/react/compat/ssr-adapter/string-renderer.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/string-renderer.js +1 -1
- package/esm/src/react/compat/version-detector/feature-detector.js +1 -1
- package/esm/src/react/components/AppWrapper.d.ts +1 -1
- package/esm/src/react/components/AppWrapper.d.ts.map +1 -1
- package/esm/src/react/components/AppWrapper.js +1 -1
- package/esm/src/react/components/Head.d.ts +1 -1
- package/esm/src/react/components/Head.d.ts.map +1 -1
- package/esm/src/react/components/Head.js +7 -3
- package/esm/src/react/components/LayoutComponent.d.ts +1 -1
- package/esm/src/react/components/LayoutComponent.d.ts.map +1 -1
- package/esm/src/react/components/LayoutComponent.js +1 -1
- package/esm/src/react/components/Link.d.ts +1 -1
- package/esm/src/react/components/Link.d.ts.map +1 -1
- package/esm/src/react/components/Link.js +1 -1
- package/esm/src/react/components/MDXProvider.d.ts +1 -1
- package/esm/src/react/components/MDXProvider.d.ts.map +1 -1
- package/esm/src/react/components/MDXProvider.js +2 -2
- package/esm/src/react/components/ProviderComponent.d.ts +1 -1
- package/esm/src/react/components/ProviderComponent.d.ts.map +1 -1
- package/esm/src/react/components/ProviderComponent.js +1 -1
- package/esm/src/react/components/ai/agent-card.d.ts +2 -2
- package/esm/src/react/components/ai/agent-card.d.ts.map +1 -1
- package/esm/src/react/components/ai/agent-card.js +1 -1
- package/esm/src/react/components/ai/chat/components/animations.d.ts +1 -1
- package/esm/src/react/components/ai/chat/components/animations.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/animations.js +1 -1
- package/esm/src/react/components/ai/chat/components/empty-state.d.ts +1 -1
- package/esm/src/react/components/ai/chat/components/empty-state.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/empty-state.js +1 -1
- package/esm/src/react/components/ai/chat/components/message-actions.d.ts +1 -1
- package/esm/src/react/components/ai/chat/components/message-actions.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/message-actions.js +1 -1
- package/esm/src/react/components/ai/chat/components/reasoning.d.ts +1 -1
- package/esm/src/react/components/ai/chat/components/reasoning.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/reasoning.js +1 -1
- package/esm/src/react/components/ai/chat/components/tool-ui.d.ts +1 -1
- package/esm/src/react/components/ai/chat/components/tool-ui.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/tool-ui.js +1 -1
- package/esm/src/react/components/ai/chat/composition/api.d.ts +5 -4
- package/esm/src/react/components/ai/chat/composition/api.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/composition/api.js +1 -1
- package/esm/src/react/components/ai/chat/index.d.ts +8 -3
- package/esm/src/react/components/ai/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/index.js +1 -1
- package/esm/src/react/components/ai/error-boundary.d.ts +1 -1
- package/esm/src/react/components/ai/error-boundary.d.ts.map +1 -1
- package/esm/src/react/components/ai/error-boundary.js +1 -1
- package/esm/src/react/components/ai/icons/index.d.ts +1 -1
- package/esm/src/react/components/ai/icons/index.d.ts.map +1 -1
- package/esm/src/react/components/ai/icons/index.js +1 -1
- package/esm/src/react/components/ai/markdown.d.ts +1 -1
- package/esm/src/react/components/ai/markdown.d.ts.map +1 -1
- package/esm/src/react/components/ai/markdown.js +1 -1
- package/esm/src/react/components/ai/message.d.ts +3 -3
- package/esm/src/react/components/ai/message.d.ts.map +1 -1
- package/esm/src/react/components/ai/message.js +1 -1
- package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.d.ts +1 -1
- package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.js +1 -1
- package/esm/src/react/components/optimized-image/OptimizedImage.d.ts +1 -1
- package/esm/src/react/components/optimized-image/OptimizedImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/OptimizedImage.js +1 -1
- package/esm/src/react/components/optimized-image/SimpleOptimizedImage.d.ts +1 -1
- package/esm/src/react/components/optimized-image/SimpleOptimizedImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/utils.d.ts +1 -1
- package/esm/src/react/components/optimized-image/utils.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/utils.js +1 -1
- package/esm/src/react/context/index.d.ts +1 -1
- package/esm/src/react/context/index.d.ts.map +1 -1
- package/esm/src/react/context/index.js +1 -1
- package/esm/src/react/fonts/index.d.ts +1 -1
- package/esm/src/react/fonts/index.d.ts.map +1 -1
- package/esm/src/react/fonts/index.js +1 -1
- package/esm/src/react/primitives/agent-primitives.d.ts +4 -4
- package/esm/src/react/primitives/agent-primitives.d.ts.map +1 -1
- package/esm/src/react/primitives/agent-primitives.js +1 -1
- package/esm/src/react/primitives/chat-container.d.ts +2 -2
- package/esm/src/react/primitives/chat-container.d.ts.map +1 -1
- package/esm/src/react/primitives/chat-container.js +1 -1
- package/esm/src/react/primitives/input-box.d.ts +4 -4
- package/esm/src/react/primitives/input-box.d.ts.map +1 -1
- package/esm/src/react/primitives/input-box.js +7 -3
- package/esm/src/react/primitives/message-list.d.ts +5 -5
- package/esm/src/react/primitives/message-list.d.ts.map +1 -1
- package/esm/src/react/primitives/message-list.js +1 -1
- package/esm/src/react/primitives/tool-primitives.d.ts +4 -4
- package/esm/src/react/primitives/tool-primitives.d.ts.map +1 -1
- package/esm/src/react/primitives/tool-primitives.js +1 -1
- package/esm/src/react/router/index.d.ts +1 -1
- package/esm/src/react/router/index.d.ts.map +1 -1
- package/esm/src/react/router/index.js +1 -1
- package/esm/src/rendering/app-reserved.d.ts +1 -1
- package/esm/src/rendering/app-reserved.d.ts.map +1 -1
- package/esm/src/rendering/app-reserved.js +1 -1
- package/esm/src/rendering/client/router.js +1 -1
- package/esm/src/rendering/client/state-bridge.d.ts +1 -1
- package/esm/src/rendering/client/state-bridge.d.ts.map +1 -1
- package/esm/src/rendering/client/state-bridge.js +1 -1
- package/esm/src/rendering/component-handling.d.ts +3 -1
- package/esm/src/rendering/component-handling.d.ts.map +1 -1
- package/esm/src/rendering/component-handling.js +4 -2
- package/esm/src/rendering/element-validator/element-normalizer.d.ts +1 -1
- package/esm/src/rendering/element-validator/element-normalizer.d.ts.map +1 -1
- package/esm/src/rendering/element-validator/element-normalizer.js +1 -1
- package/esm/src/rendering/element-validator/primitive-checks.d.ts +1 -1
- package/esm/src/rendering/element-validator/primitive-checks.d.ts.map +1 -1
- package/esm/src/rendering/element-validator/primitive-checks.js +1 -1
- package/esm/src/rendering/element-validator/validator-core.d.ts +1 -1
- package/esm/src/rendering/element-validator/validator-core.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-applicator.d.ts +1 -1
- package/esm/src/rendering/layouts/layout-applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-applicator.js +2 -0
- 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/component-loader.d.ts +1 -1
- package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/ensure-valid-child.d.ts +1 -1
- package/esm/src/rendering/layouts/utils/ensure-valid-child.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/layout.d.ts +1 -1
- package/esm/src/rendering/orchestrator/layout.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts +3 -0
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.js +74 -19
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +2 -0
- package/esm/src/rendering/orchestrator/ssr-orchestrator.d.ts +1 -1
- package/esm/src/rendering/orchestrator/ssr-orchestrator.d.ts.map +1 -1
- package/esm/src/rendering/page-renderer.d.ts +1 -1
- package/esm/src/rendering/page-renderer.d.ts.map +1 -1
- package/esm/src/rendering/page-rendering.d.ts +1 -1
- package/esm/src/rendering/page-rendering.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/component-detector.d.ts +1 -1
- package/esm/src/rendering/rsc/server-renderer/component-detector.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/rsc-renderer.d.ts +1 -1
- package/esm/src/rendering/rsc/server-renderer/rsc-renderer.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/tree-processor.d.ts +1 -1
- package/esm/src/rendering/rsc/server-renderer/tree-processor.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/tree-processor.js +4 -2
- package/esm/src/rendering/snippet-renderer.js +2 -2
- 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 +1 -1
- package/esm/src/rendering/ssr-renderer.d.ts +1 -1
- package/esm/src/rendering/ssr-renderer.d.ts.map +1 -1
- package/esm/src/rendering/utils/react-helpers.d.ts +1 -1
- package/esm/src/rendering/utils/react-helpers.d.ts.map +1 -1
- package/esm/src/rendering/utils/react-helpers.js +1 -1
- package/esm/src/server/handlers/request/ssr/error-page-fallback.js +1 -1
- package/esm/src/server/handlers/request/ssr/not-found-fallback.js +1 -1
- package/esm/src/transforms/esm/http-bundler.d.ts +15 -4
- package/esm/src/transforms/esm/http-bundler.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-bundler.js +105 -12
- package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache.js +26 -27
- package/esm/src/transforms/esm/import-rewriter.d.ts.map +1 -1
- package/esm/src/transforms/esm/import-rewriter.js +3 -3
- package/esm/src/transforms/esm/package-registry.d.ts +15 -13
- package/esm/src/transforms/esm/package-registry.d.ts.map +1 -1
- package/esm/src/transforms/esm/package-registry.js +45 -32
- package/esm/src/transforms/esm/react-imports.d.ts.map +1 -1
- package/esm/src/transforms/esm/react-imports.js +3 -7
- 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/mdx/esm-module-loader/cache/index.d.ts +14 -0
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.js +67 -0
- package/esm/src/transforms/mdx/esm-module-loader/loader.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/loader.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 +1 -0
- 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 -1
- package/esm/src/transforms/mdx/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/index.js +1 -1
- package/esm/src/transforms/mdx/mdx-cache-adapter.js +1 -1
- package/esm/src/transforms/mdx/module-loader/types.d.ts +1 -1
- package/esm/src/transforms/mdx/module-loader/types.d.ts.map +1 -1
- package/esm/src/transforms/mdx/types.d.ts +2 -2
- package/esm/src/transforms/mdx/types.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/context.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/context.js +7 -15
- package/esm/src/transforms/pipeline/stages/finalize.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/finalize.js +1 -1
- package/esm/src/types/app.d.ts +1 -1
- package/esm/src/types/app.d.ts.map +1 -1
- package/esm/src/types/global-guards.d.ts +1 -1
- package/esm/src/types/global-guards.d.ts.map +1 -1
- package/esm/src/types/index.d.ts +1 -1
- package/esm/src/types/index.d.ts.map +1 -1
- package/esm/src/utils/constants/cdn.d.ts.map +1 -1
- package/esm/src/utils/constants/cdn.js +22 -11
- package/esm/src/utils/hash-utils.d.ts +2 -0
- package/esm/src/utils/hash-utils.d.ts.map +1 -1
- package/esm/src/utils/hash-utils.js +4 -0
- package/esm/src/workflow/react/use-approval.js +1 -1
- package/esm/src/workflow/react/use-workflow-list.js +1 -1
- package/esm/src/workflow/react/use-workflow-start.js +1 -1
- package/esm/src/workflow/react/use-workflow.js +1 -1
- package/package.json +2 -1
- package/src/deno.js +8 -9
- package/src/deps/esm.sh/@types/react-dom@19.1.11/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/client.d.ts +105 -0
- package/src/deps/esm.sh/@types/react-dom@19.1.11/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/server.d.ts +162 -0
- package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjM/global.d.ts +165 -0
- package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjM/index.d.ts +4267 -0
- package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/global.d.ts +165 -0
- package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/index.d.ts +4267 -0
- package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/jsx-runtime.d.ts +36 -0
- package/src/deps/esm.sh/@types/scheduler@0.26.0/index.d.ts +30 -0
- package/src/deps/esm.sh/csstype@3.2.3/index.d.ts +22569 -0
- package/src/deps/esm.sh/react-dom@19.1.1/client.d.ts +105 -0
- package/src/deps/esm.sh/react-dom@19.1.1/client.js +5 -0
- package/src/deps/esm.sh/react-dom@19.1.1/server.d.ts +162 -0
- package/src/deps/esm.sh/react-dom@19.1.1/server.js +5 -0
- package/src/deps/esm.sh/react@19.1.1/jsx-runtime.d.ts +36 -0
- package/src/deps/esm.sh/react@19.1.1/jsx-runtime.js +3 -0
- package/src/deps/esm.sh/react@19.1.1.d.ts +4267 -0
- package/src/deps/esm.sh/react@19.1.1.js +3 -0
- package/src/deps/esm.sh/scheduler@^0.26.0.d.ts +30 -0
- package/src/deps/esm.sh/scheduler@^0.26.0.js +3 -0
- package/src/proxy/main.ts +471 -0
- package/src/src/agent/react/use-agent.ts +1 -1
- package/src/src/agent/react/use-chat/use-chat.ts +1 -1
- package/src/src/agent/react/use-completion.ts +1 -1
- package/src/src/agent/react/use-streaming.ts +1 -1
- package/src/src/agent/react/use-voice-input.ts +1 -1
- package/src/src/cli/commands/init/config-generator.ts +1 -1
- package/src/src/cli/index/arg-parser.ts +1 -0
- package/src/src/cli/index/command-router.ts +57 -40
- package/src/src/cli/index/types.ts +5 -0
- package/src/src/config/loader.ts +5 -4
- package/src/src/html/utils.ts +2 -2
- package/src/src/modules/component-registry/registry.ts +1 -1
- package/src/src/modules/import-map/default-import-map.ts +3 -25
- package/src/src/modules/import-map/loader.ts +7 -23
- package/src/src/modules/import-map/resolver.ts +13 -8
- package/src/src/modules/react-loader/component-loader.ts +3 -1
- package/src/src/modules/react-loader/extract-component.ts +1 -1
- package/src/src/modules/react-loader/ssr-module-loader/loader.ts +52 -38
- package/src/src/modules/react-loader/ssr-module-loader/types.ts +2 -0
- package/src/src/modules/react-loader/types.ts +3 -1
- package/src/src/modules/react-loader/unified-loader.ts +7 -4
- package/src/src/modules/server/module-batch-handler.ts +7 -0
- package/src/src/modules/server/module-server.ts +6 -1
- package/src/src/modules/server/ssr-import-rewriter.ts +9 -17
- package/src/src/react/compat/hooks-adapter.ts +1 -1
- package/src/src/react/compat/ssr-adapter/response-builder.ts +1 -1
- package/src/src/react/compat/ssr-adapter/server-loader.ts +10 -10
- package/src/src/react/compat/ssr-adapter/stream-renderer.ts +2 -2
- package/src/src/react/compat/ssr-adapter/string-renderer.ts +3 -3
- package/src/src/react/compat/version-detector/feature-detector.ts +1 -1
- package/src/src/react/components/AppWrapper.tsx +1 -1
- package/src/src/react/components/Head.tsx +7 -3
- package/src/src/react/components/LayoutComponent.tsx +2 -2
- package/src/src/react/components/Link.tsx +1 -1
- package/src/src/react/components/MDXProvider.tsx +2 -2
- package/src/src/react/components/ProviderComponent.tsx +2 -2
- package/src/src/react/components/ai/agent-card.tsx +1 -1
- package/src/src/react/components/ai/chat/components/animations.tsx +1 -1
- package/src/src/react/components/ai/chat/components/empty-state.tsx +1 -1
- package/src/src/react/components/ai/chat/components/message-actions.tsx +1 -1
- package/src/src/react/components/ai/chat/components/reasoning.tsx +1 -1
- package/src/src/react/components/ai/chat/components/tool-ui.tsx +1 -1
- package/src/src/react/components/ai/chat/composition/api.tsx +1 -1
- package/src/src/react/components/ai/chat/index.tsx +1 -1
- package/src/src/react/components/ai/error-boundary.tsx +1 -1
- package/src/src/react/components/ai/icons/index.ts +1 -1
- package/src/src/react/components/ai/markdown.tsx +1 -1
- package/src/src/react/components/ai/message.tsx +1 -1
- package/src/src/react/components/optimized-image/OptimizedBackgroundImage.tsx +1 -1
- package/src/src/react/components/optimized-image/OptimizedImage.tsx +1 -1
- package/src/src/react/components/optimized-image/SimpleOptimizedImage.tsx +1 -1
- package/src/src/react/components/optimized-image/utils.tsx +1 -1
- package/src/src/react/context/index.ts +1 -1
- package/src/src/react/fonts/index.ts +1 -1
- package/src/src/react/primitives/agent-primitives.tsx +1 -1
- package/src/src/react/primitives/chat-container.tsx +1 -1
- package/src/src/react/primitives/input-box.tsx +5 -3
- package/src/src/react/primitives/message-list.tsx +1 -1
- package/src/src/react/primitives/tool-primitives.tsx +1 -1
- package/src/src/react/router/index.ts +1 -1
- package/src/src/rendering/app-reserved.ts +1 -1
- package/src/src/rendering/client/router.ts +2 -2
- package/src/src/rendering/client/state-bridge.ts +2 -2
- package/src/src/rendering/component-handling.ts +7 -1
- package/src/src/rendering/element-validator/element-inspector.ts +1 -1
- package/src/src/rendering/element-validator/element-normalizer.ts +1 -1
- package/src/src/rendering/element-validator/primitive-checks.ts +1 -1
- package/src/src/rendering/element-validator/validator-core.ts +1 -1
- package/src/src/rendering/layouts/layout-applicator.ts +5 -6
- package/src/src/rendering/layouts/utils/applicator.ts +1 -1
- package/src/src/rendering/layouts/utils/component-loader.ts +1 -1
- package/src/src/rendering/layouts/utils/ensure-valid-child.ts +1 -1
- package/src/src/rendering/orchestrator/layout.ts +1 -1
- package/src/src/rendering/orchestrator/module-loader/index.ts +91 -20
- package/src/src/rendering/orchestrator/pipeline.ts +2 -0
- package/src/src/rendering/orchestrator/ssr-orchestrator.ts +2 -2
- package/src/src/rendering/page-renderer.ts +1 -1
- package/src/src/rendering/page-rendering.ts +1 -1
- package/src/src/rendering/rsc/server-renderer/component-detector.ts +1 -1
- package/src/src/rendering/rsc/server-renderer/rsc-renderer.ts +1 -1
- package/src/src/rendering/rsc/server-renderer/tree-processor.ts +14 -4
- package/src/src/rendering/snippet-renderer.ts +2 -2
- package/src/src/rendering/ssr/component-registry.ts +1 -1
- package/src/src/rendering/ssr-renderer.ts +1 -1
- package/src/src/rendering/utils/react-helpers.ts +1 -1
- package/src/src/server/build-app-route-renderer.ts +2 -2
- package/src/src/server/handlers/request/rsc/handlers/render-handler.ts +1 -1
- package/src/src/server/handlers/request/ssr/error-page-fallback.ts +2 -2
- package/src/src/server/handlers/request/ssr/not-found-fallback.ts +1 -1
- package/src/src/transforms/esm/http-bundler.ts +101 -11
- package/src/src/transforms/esm/http-cache.ts +27 -28
- package/src/src/transforms/esm/import-rewriter.ts +5 -3
- package/src/src/transforms/esm/package-registry.ts +46 -32
- package/src/src/transforms/esm/react-imports.ts +3 -7
- package/src/src/transforms/esm/types.ts +2 -0
- package/src/src/transforms/mdx/esm-module-loader/cache/index.ts +84 -0
- package/src/src/transforms/mdx/esm-module-loader/loader.ts +2 -1
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/index.ts +2 -1
- package/src/src/transforms/mdx/esm-module-loader/types.ts +4 -0
- package/src/src/transforms/mdx/index.ts +1 -1
- package/src/src/transforms/mdx/mdx-cache-adapter.ts +1 -1
- package/src/src/transforms/mdx/module-loader/types.ts +1 -1
- package/src/src/transforms/mdx/types.ts +2 -2
- package/src/src/transforms/pipeline/context.ts +7 -18
- package/src/src/transforms/pipeline/stages/finalize.ts +6 -1
- package/src/src/transforms/plugins/babel-node-positions.ts +2 -2
- package/src/src/types/app.ts +1 -1
- package/src/src/types/global-guards.ts +1 -1
- package/src/src/types/index.ts +1 -1
- package/src/src/utils/constants/cdn.ts +21 -12
- package/src/src/utils/hash-utils.ts +5 -0
- package/src/src/workflow/react/use-approval.ts +1 -1
- package/src/src/workflow/react/use-workflow-list.ts +1 -1
- package/src/src/workflow/react/use-workflow-start.ts +1 -1
- package/src/src/workflow/react/use-workflow.ts +1 -1
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
import { parallelMap, rendererLogger as logger } from "../../../utils/index.js";
|
|
10
10
|
import type { RuntimeAdapter } from "../../../platform/adapters/base.js";
|
|
11
11
|
import { getLocalAdapter } from "../../../platform/adapters/registry.js";
|
|
12
|
-
import {
|
|
13
|
-
import { findLocalLibFile, findSourceFile } from "../file-resolver/index.js";
|
|
12
|
+
import { findSourceFile } from "../file-resolver/index.js";
|
|
14
13
|
import { transformToESM } from "../../../transforms/esm-transform.js";
|
|
15
14
|
import { getProjectTmpDir } from "../../../modules/react-loader/index.js";
|
|
16
15
|
import {
|
|
@@ -19,10 +18,17 @@ import {
|
|
|
19
18
|
initializeTransformCache,
|
|
20
19
|
setCachedTransformAsync,
|
|
21
20
|
} from "../../../transforms/esm/transform-cache.js";
|
|
22
|
-
import { hashString } from "../../../cache/hash.js";
|
|
23
21
|
import { TRANSFORM_DISTRIBUTED_TTL_SEC } from "../../../utils/constants/cache.js";
|
|
24
22
|
import { ensureHttpBundlesExist } from "../../../transforms/esm/http-cache.js";
|
|
25
|
-
import { getHttpBundleCacheDir } from "../../../utils/cache-dir.js";
|
|
23
|
+
import { getHttpBundleCacheDir, getMdxEsmCacheDir } from "../../../utils/cache-dir.js";
|
|
24
|
+
import { join } from "../../../platform/compat/path/index.js";
|
|
25
|
+
import { hashCodeHex } from "../../../utils/hash-utils.js";
|
|
26
|
+
import { TRANSFORM_CACHE_VERSION } from "../../../transforms/esm/package-registry.js";
|
|
27
|
+
import {
|
|
28
|
+
getModulePathCache,
|
|
29
|
+
lookupMdxEsmCache,
|
|
30
|
+
saveModulePathCache,
|
|
31
|
+
} from "../../../transforms/mdx/esm-module-loader/cache/index.js";
|
|
26
32
|
|
|
27
33
|
// Re-export utilities
|
|
28
34
|
export { createEsmCache, createModuleCache, generateHash } from "./cache.js";
|
|
@@ -57,10 +63,13 @@ const TRANSFORM_CACHE_TTL_SECONDS = TRANSFORM_DISTRIBUTED_TTL_SEC;
|
|
|
57
63
|
export interface ModuleLoaderConfig {
|
|
58
64
|
projectDir: string;
|
|
59
65
|
projectId?: string;
|
|
66
|
+
contentSourceId?: string;
|
|
60
67
|
adapter: RuntimeAdapter;
|
|
61
68
|
mode: "development" | "production";
|
|
62
69
|
moduleCache: Map<string, string>;
|
|
63
70
|
esmCache: Map<string, string>;
|
|
71
|
+
/** React version for transforms (from project config) */
|
|
72
|
+
reactVersion?: string;
|
|
64
73
|
}
|
|
65
74
|
|
|
66
75
|
function getModuleCacheKey(filePath: string, projectId?: string, projectDir?: string): string {
|
|
@@ -97,19 +106,14 @@ async function resolveAliasImport(
|
|
|
97
106
|
imp: AliasImport,
|
|
98
107
|
projectDir: string,
|
|
99
108
|
adapter: RuntimeAdapter,
|
|
100
|
-
|
|
109
|
+
_localAdapter: RuntimeAdapter,
|
|
101
110
|
): Promise<ResolvedDep> {
|
|
102
111
|
const relativePath = imp.path.substring(2); // Remove @/ prefix
|
|
103
112
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
let depFilePath = await findSourceFile(relativePath, projectDir, adapter);
|
|
110
|
-
if (!depFilePath) {
|
|
111
|
-
depFilePath = await findSourceFile(`components/${relativePath}`, projectDir, adapter);
|
|
112
|
-
}
|
|
113
|
+
// @/ alias always resolves to project directory
|
|
114
|
+
// Try exact path first, then components/ subdirectory
|
|
115
|
+
const depFilePath = await findSourceFile(relativePath, projectDir, adapter) ??
|
|
116
|
+
await findSourceFile(`components/${relativePath}`, projectDir, adapter);
|
|
113
117
|
|
|
114
118
|
return { ...imp, relativePath, depFilePath, isLocalLib: false };
|
|
115
119
|
}
|
|
@@ -131,12 +135,26 @@ export async function transformModuleWithDeps(
|
|
|
131
135
|
config: ModuleLoaderConfig,
|
|
132
136
|
useLocalAdapter = false,
|
|
133
137
|
): Promise<string> {
|
|
134
|
-
const { moduleCache, projectDir, projectId, adapter, mode } = config;
|
|
138
|
+
const { moduleCache, projectDir, projectId, contentSourceId, adapter, mode } = config;
|
|
135
139
|
const cacheKey = getModuleCacheKey(filePath, projectId, projectDir);
|
|
136
140
|
|
|
137
141
|
const cachedPath = moduleCache.get(cacheKey);
|
|
138
142
|
if (cachedPath) return cachedPath;
|
|
139
143
|
|
|
144
|
+
// Check MDX-ESM cache to share modules with SSR loader (prevents duplicate React contexts)
|
|
145
|
+
if (projectId && contentSourceId) {
|
|
146
|
+
const baseCacheDir = getMdxEsmCacheDir();
|
|
147
|
+
const projectKey = encodeURIComponent(projectId);
|
|
148
|
+
const sourceKey = encodeURIComponent(contentSourceId);
|
|
149
|
+
const mdxCacheDir = join(baseCacheDir, projectKey, sourceKey);
|
|
150
|
+
|
|
151
|
+
const mdxCachedPath = await lookupMdxEsmCache(filePath, mdxCacheDir, projectDir);
|
|
152
|
+
if (mdxCachedPath) {
|
|
153
|
+
moduleCache.set(cacheKey, mdxCachedPath);
|
|
154
|
+
return mdxCachedPath;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
140
158
|
const readAdapter = useLocalAdapter ? localAdapter : adapter;
|
|
141
159
|
let fileContent = decodeFileContent(await readAdapter.fs.readFile(filePath));
|
|
142
160
|
|
|
@@ -193,7 +211,7 @@ export async function transformModuleWithDeps(
|
|
|
193
211
|
});
|
|
194
212
|
}
|
|
195
213
|
|
|
196
|
-
const contentHash =
|
|
214
|
+
const contentHash = hashCodeHex(fileContent);
|
|
197
215
|
const effectiveProjectId = projectId ?? projectDir;
|
|
198
216
|
const scopedPath = `${effectiveProjectId}:${filePath}`;
|
|
199
217
|
const transformCacheKey = generateTransformCacheKey(scopedPath, contentHash, true); // ssr=true
|
|
@@ -210,6 +228,7 @@ export async function transformModuleWithDeps(
|
|
|
210
228
|
projectId: effectiveProjectId,
|
|
211
229
|
dev: mode === "development",
|
|
212
230
|
ssr: true,
|
|
231
|
+
reactVersion: config.reactVersion,
|
|
213
232
|
});
|
|
214
233
|
},
|
|
215
234
|
TRANSFORM_CACHE_TTL_SECONDS,
|
|
@@ -231,6 +250,7 @@ export async function transformModuleWithDeps(
|
|
|
231
250
|
projectId: effectiveProjectId,
|
|
232
251
|
dev: mode === "development",
|
|
233
252
|
ssr: true,
|
|
253
|
+
reactVersion: config.reactVersion,
|
|
234
254
|
});
|
|
235
255
|
setCachedTransformAsync(
|
|
236
256
|
transformCacheKey,
|
|
@@ -246,10 +266,19 @@ export async function transformModuleWithDeps(
|
|
|
246
266
|
}
|
|
247
267
|
}
|
|
248
268
|
|
|
249
|
-
|
|
250
|
-
const
|
|
269
|
+
// Use TRANSFORMED hash for filename (matches SSR loader behavior)
|
|
270
|
+
const transformedHash = hashCodeHex(transformedCode).slice(0, 8);
|
|
271
|
+
|
|
272
|
+
const relativePath = filePath.startsWith(projectDir)
|
|
273
|
+
? filePath.slice(projectDir.length).replace(/^\/+/, "")
|
|
274
|
+
: filePath.replace(/^\/+/, "");
|
|
251
275
|
|
|
252
|
-
|
|
276
|
+
const jsPath = relativePath.replace(/\.(tsx?|jsx|mdx)$/, `.${transformedHash}.js`);
|
|
277
|
+
const tempFilePath = join(tmpDir, jsPath);
|
|
278
|
+
|
|
279
|
+
// Ensure directory exists (might be nested like lib/ or components/)
|
|
280
|
+
const tempDir = tempFilePath.substring(0, tempFilePath.lastIndexOf("/"));
|
|
281
|
+
await ensureDir(localAdapter, tempDir);
|
|
253
282
|
|
|
254
283
|
try {
|
|
255
284
|
await localAdapter.fs.writeFile(tempFilePath, transformedCode);
|
|
@@ -262,10 +291,52 @@ export async function transformModuleWithDeps(
|
|
|
262
291
|
throw error;
|
|
263
292
|
}
|
|
264
293
|
|
|
294
|
+
// Register in MDX-ESM cache index so other loaders can find this module
|
|
295
|
+
if (contentSourceId) {
|
|
296
|
+
const normalizedPath = `_vf_modules/${relativePath.replace(/\.(tsx?|jsx|mdx)$/, ".js")}`;
|
|
297
|
+
const mdxCacheKey = `v${TRANSFORM_CACHE_VERSION}:${normalizedPath}`;
|
|
298
|
+
const cache = await getModulePathCache(tmpDir);
|
|
299
|
+
cache.set(mdxCacheKey, tempFilePath);
|
|
300
|
+
// Persist to disk so MDX loader can find it
|
|
301
|
+
saveModulePathCache(tmpDir).catch((err) => {
|
|
302
|
+
logger.debug("[ModuleLoader] Failed to save module cache", { error: String(err) });
|
|
303
|
+
});
|
|
304
|
+
logger.debug("[ModuleLoader] Registered module in MDX-ESM cache", {
|
|
305
|
+
file: filePath.slice(-40),
|
|
306
|
+
mdxCacheKey,
|
|
307
|
+
tempFilePath: tempFilePath.slice(-60),
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
|
|
265
311
|
moduleCache.set(cacheKey, tempFilePath);
|
|
266
312
|
return tempFilePath;
|
|
267
313
|
}
|
|
268
314
|
|
|
315
|
+
/**
|
|
316
|
+
* Get the cache directory for module transforms.
|
|
317
|
+
* Uses MDX-ESM cache when contentSourceId is available, otherwise falls back to project tmp dir.
|
|
318
|
+
* This ensures modules are shared between orchestrator and MDX loader to prevent duplicate contexts.
|
|
319
|
+
*/
|
|
320
|
+
async function getModuleCacheDir(config: ModuleLoaderConfig): Promise<string> {
|
|
321
|
+
const { projectId, contentSourceId, projectDir } = config;
|
|
322
|
+
|
|
323
|
+
if (projectId && contentSourceId) {
|
|
324
|
+
const baseCacheDir = getMdxEsmCacheDir();
|
|
325
|
+
const projectKey = encodeURIComponent(projectId);
|
|
326
|
+
const sourceKey = encodeURIComponent(contentSourceId);
|
|
327
|
+
const cacheDir = join(baseCacheDir, projectKey, sourceKey);
|
|
328
|
+
|
|
329
|
+
// Ensure directory exists
|
|
330
|
+
const { createFileSystem } = await import("../../../platform/compat/fs.js");
|
|
331
|
+
await createFileSystem().mkdir(cacheDir, { recursive: true });
|
|
332
|
+
|
|
333
|
+
return cacheDir;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// Fallback for cases without contentSourceId
|
|
337
|
+
return getProjectTmpDir(projectId ?? projectDir);
|
|
338
|
+
}
|
|
339
|
+
|
|
269
340
|
/**
|
|
270
341
|
* Load a module by path, transforming it and its dependencies.
|
|
271
342
|
*
|
|
@@ -274,7 +345,7 @@ export async function transformModuleWithDeps(
|
|
|
274
345
|
* @returns The loaded module
|
|
275
346
|
*/
|
|
276
347
|
export async function loadModule(filePath: string, config: ModuleLoaderConfig): Promise<any> {
|
|
277
|
-
const tmpDir = await
|
|
348
|
+
const tmpDir = await getModuleCacheDir(config);
|
|
278
349
|
const localAdapter = await getLocalAdapter();
|
|
279
350
|
|
|
280
351
|
const tempFilePath = await transformModuleWithDeps(filePath, tmpDir, localAdapter, config);
|
|
@@ -253,6 +253,7 @@ export class RenderPipeline {
|
|
|
253
253
|
setupSSRGlobals();
|
|
254
254
|
|
|
255
255
|
this.moduleLoaderConfig.projectId = projectId;
|
|
256
|
+
this.moduleLoaderConfig.contentSourceId = options?.contentSourceId;
|
|
256
257
|
|
|
257
258
|
if (this.config.mode === "development") {
|
|
258
259
|
clearSSRModuleCacheForProject(projectId);
|
|
@@ -523,6 +524,7 @@ export class RenderPipeline {
|
|
|
523
524
|
|
|
524
525
|
const projectId = options?.projectId ?? this.config.projectDir;
|
|
525
526
|
this.moduleLoaderConfig.projectId = projectId;
|
|
527
|
+
this.moduleLoaderConfig.contentSourceId = options?.contentSourceId;
|
|
526
528
|
|
|
527
529
|
if (this.config.mode === "development") {
|
|
528
530
|
clearSSRModuleCacheForProject(projectId);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
2
|
import { rendererLogger as logger } from "../../utils/index.js";
|
|
3
|
-
import type * as React from "react";
|
|
3
|
+
import type * as React from "../../../deps/esm.sh/react@19.1.1.js";
|
|
4
4
|
import { createError, toError } from "../../errors/veryfront-error.js";
|
|
5
5
|
import { withSpan } from "../../observability/tracing/otlp-setup.js";
|
|
6
6
|
import { SpanNames } from "../../observability/tracing/span-names.js";
|
|
@@ -47,7 +47,7 @@ export class SSROrchestrator {
|
|
|
47
47
|
): Promise<SSRRenderingResult> {
|
|
48
48
|
logger.debug("[SSROrchestrator] performSSRRendering called", {
|
|
49
49
|
elementType: getElementTypeName(pageElement),
|
|
50
|
-
hasChildren: !!pageElement?.props?.children,
|
|
50
|
+
hasChildren: !!(pageElement?.props as Record<string, unknown>)?.children,
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
const validatedElement = this.config.elementValidator.ensureValidReactElement(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from "react";
|
|
1
|
+
import * as React from "../../deps/esm.sh/react@19.1.1.js";
|
|
2
2
|
import { rendererLogger as logger } from "../utils/index.js";
|
|
3
3
|
import { ErrorCode, VeryfrontError } from "../errors/index.js";
|
|
4
4
|
import { createDefaultMDXComponents } from "./utils/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { rendererLogger as logger } from "../utils/index.js";
|
|
2
2
|
import { ErrorCode, VeryfrontError } from "../errors/index.js";
|
|
3
|
-
import type * as BundledReact from "react";
|
|
3
|
+
import type * as BundledReact from "../../deps/esm.sh/react@19.1.1.js";
|
|
4
4
|
import type { RuntimeAdapter } from "../platform/adapters/base.js";
|
|
5
5
|
import type { EntityInfo, MdxBundle, MDXComponents, MDXModule, PageBundle } from "../types/index.js";
|
|
6
6
|
import { mdxRenderer } from "../transforms/mdx/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as React from "react";
|
|
1
|
+
import type * as React from "../../../../deps/esm.sh/react@19.1.1.js";
|
|
2
2
|
import { serverLogger as logger } from "../../../utils/index.js";
|
|
3
3
|
import { withSpan } from "../../../observability/tracing/otlp-setup.js";
|
|
4
4
|
import type { ClientComponentMeta, RSCPayload, RSCRendererOptions } from "../types.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from "react";
|
|
1
|
+
import * as React from "../../../../deps/esm.sh/react@19.1.1.js";
|
|
2
2
|
import { serverLogger as logger } from "../../../utils/index.js";
|
|
3
3
|
import { renderToStringAdapter } from "../../../react/index.js";
|
|
4
4
|
import type { ClientComponentMeta, RSCNode } from "../types.js";
|
|
@@ -64,15 +64,25 @@ export async function processElement(
|
|
|
64
64
|
clientManifest: Map<string, ClientComponentMeta>,
|
|
65
65
|
clientRefs: Map<string, string>,
|
|
66
66
|
): Promise<RSCNode> {
|
|
67
|
-
const { type
|
|
67
|
+
const { type } = element;
|
|
68
|
+
// Cast props for React 19 compatibility (props is unknown in R19 types)
|
|
69
|
+
const props = element.props as Record<string, unknown>;
|
|
68
70
|
|
|
69
71
|
if (type === React.Fragment) {
|
|
70
|
-
const children = await renderChildren(
|
|
72
|
+
const children = await renderChildren(
|
|
73
|
+
props.children as React.ReactNode,
|
|
74
|
+
clientManifest,
|
|
75
|
+
clientRefs,
|
|
76
|
+
);
|
|
71
77
|
return { type: "fragment", children };
|
|
72
78
|
}
|
|
73
79
|
|
|
74
80
|
if (typeof type === "string") {
|
|
75
|
-
const processedChildren = await renderChildren(
|
|
81
|
+
const processedChildren = await renderChildren(
|
|
82
|
+
props.children as React.ReactNode,
|
|
83
|
+
clientManifest,
|
|
84
|
+
clientRefs,
|
|
85
|
+
);
|
|
76
86
|
|
|
77
87
|
if (processedChildren.every((child) => child.type === "html")) {
|
|
78
88
|
const html = await renderToStringAdapter(element);
|
|
@@ -247,8 +247,8 @@ export function renderSnippet(
|
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
const [{ renderToString }, React] = await Promise.all([
|
|
250
|
-
import("react-dom/server"),
|
|
251
|
-
import("react"),
|
|
250
|
+
import("../../deps/esm.sh/react-dom@19.1.1/server.js"),
|
|
251
|
+
import("../../deps/esm.sh/react@19.1.1.js"),
|
|
252
252
|
]);
|
|
253
253
|
|
|
254
254
|
const element = React.createElement(MDXContent, {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { dirname, join } from "../../platform/compat/path-helper.js";
|
|
7
7
|
import { DEFAULT_DASHBOARD_PORT, rendererLogger as logger } from "../../utils/index.js";
|
|
8
|
-
import * as React from "react";
|
|
8
|
+
import * as React from "../../../deps/esm.sh/react@19.1.1.js";
|
|
9
9
|
import type { RuntimeAdapter } from "../../platform/adapters/base.js";
|
|
10
10
|
import { VirtualModuleSystem } from "../virtual-module-system.js";
|
|
11
11
|
import { loadComponentFromSource } from "../../modules/react-loader/component-loader.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import { isCompiledBinary, rendererLogger as logger } from "../utils/index.js";
|
|
16
16
|
import { withSpan } from "../observability/tracing/otlp-setup.js";
|
|
17
17
|
import { SpanNames } from "../observability/tracing/span-names.js";
|
|
18
|
-
import type * as React from "react";
|
|
18
|
+
import type * as React from "../../deps/esm.sh/react@19.1.1.js";
|
|
19
19
|
import { streamToString } from "./utils/index.js";
|
|
20
20
|
import { setupSSRGlobals } from "./ssr-globals.js";
|
|
21
21
|
|
|
@@ -9,7 +9,7 @@ import { getProjectReact, renderToStringAdapter } from "../react/index.js";
|
|
|
9
9
|
import { loadComponentFromSource } from "../modules/react-loader/index.js";
|
|
10
10
|
import { CompilationError } from "../errors/index.js";
|
|
11
11
|
|
|
12
|
-
type ReactComponentLike = import("react").ComponentType<{ children?: import("react").ReactNode }>;
|
|
12
|
+
type ReactComponentLike = import("../../deps/esm.sh/react@19.1.1.js").ComponentType<{ children?: import("react").ReactNode }>;
|
|
13
13
|
|
|
14
14
|
async function fileExists(adapter: RuntimeAdapter, filePath: string): Promise<boolean> {
|
|
15
15
|
try {
|
|
@@ -70,7 +70,7 @@ export async function renderAppRouteToHTML(args: {
|
|
|
70
70
|
throw new CompilationError("Invalid page component", { pageFile, type: typeof Page });
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
let element: import("react").ReactNode = React.createElement(Page as ReactComponentLike);
|
|
73
|
+
let element: import("../../deps/esm.sh/react@19.1.1.js").ReactNode = React.createElement(Page as ReactComponentLike);
|
|
74
74
|
|
|
75
75
|
for (let i = layouts.length - 1; i >= 0; i--) {
|
|
76
76
|
const layoutPath = layouts[i];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as dntShim from "../../../../../../_dnt.shims.js";
|
|
2
|
-
import type * as React from "react";
|
|
2
|
+
import type * as React from "../../../../../../deps/esm.sh/react@19.1.1.js";
|
|
3
3
|
import { serverLogger as logger } from "../../../../../utils/index.js";
|
|
4
4
|
import { RSCProductionOptimizer } from "../../../../../rendering/rsc/production-optimizer.js";
|
|
5
5
|
import type { RSCRenderer } from "../../../../../rendering/rsc/server-renderer/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as dntShim from "../../../../../_dnt.shims.js";
|
|
2
|
-
import type * as React from "react";
|
|
2
|
+
import type * as React from "../../../../../deps/esm.sh/react@19.1.1.js";
|
|
3
3
|
import type { HandlerContext } from "../../types.js";
|
|
4
4
|
import type { ResponseBuilder } from "../../../../security/index.js";
|
|
5
5
|
import { join as joinPath } from "../../../../platform/compat/path/index.js";
|
|
@@ -181,7 +181,7 @@ async function renderErrorPage(
|
|
|
181
181
|
error?: Error,
|
|
182
182
|
pathname?: string,
|
|
183
183
|
): Promise<dntShim.Response> {
|
|
184
|
-
const React = await import("react");
|
|
184
|
+
const React = await import("../../../../../deps/esm.sh/react@19.1.1.js");
|
|
185
185
|
const { renderToStringAdapter } = await import(
|
|
186
186
|
"../../../../react/compat/ssr-adapter/index.js"
|
|
187
187
|
);
|
|
@@ -46,7 +46,7 @@ export async function tryNotFoundFallback(
|
|
|
46
46
|
|
|
47
47
|
if (!NotFoundComp) return null;
|
|
48
48
|
|
|
49
|
-
const React = await import("react");
|
|
49
|
+
const React = await import("../../../../../deps/esm.sh/react@19.1.1.js");
|
|
50
50
|
const { renderToStringAdapter } = await import(
|
|
51
51
|
"../../../../react/compat/ssr-adapter/index.js"
|
|
52
52
|
);
|
|
@@ -156,47 +156,137 @@ export function createHTTPPlugin(): Plugin {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
/**
|
|
159
|
-
* Ensure esm.sh URLs have
|
|
160
|
-
* This makes them import React as
|
|
159
|
+
* Ensure esm.sh URLs have external=react,react-dom for SSR.
|
|
160
|
+
* This makes them import React as bare specifiers, which the import map resolves.
|
|
161
161
|
*
|
|
162
162
|
* Uses two esm.sh features:
|
|
163
|
-
* - `external=react` - Don't bundle React, let import map resolve
|
|
163
|
+
* - `external=react,react-dom` - Don't bundle React/ReactDOM, let import map resolve them
|
|
164
164
|
* - `deps=react@X,react-dom@X` - Pin dependency versions to prevent mismatches
|
|
165
|
+
*
|
|
166
|
+
* Logic for external handling:
|
|
167
|
+
* 1. If no `external=` param → add `external=react,react-dom`
|
|
168
|
+
* 2. If `external=X` exists but no `react` → append `,react,react-dom`
|
|
169
|
+
* 3. If has `react` but no `react-dom` → append `,react-dom`
|
|
170
|
+
* 4. If has both `react` AND `react-dom` → leave alone
|
|
171
|
+
*
|
|
172
|
+
* @param code - Source code to process
|
|
173
|
+
* @param _cacheDir - Unused (kept for API compatibility)
|
|
174
|
+
* @param hash - Hash for logging
|
|
175
|
+
* @param reactVersion - React version for deps param (defaults to REACT_VERSION)
|
|
165
176
|
*/
|
|
166
177
|
export function bundleHttpImports(
|
|
167
178
|
code: string,
|
|
168
179
|
_cacheDir: string,
|
|
169
180
|
hash: string,
|
|
181
|
+
reactVersion?: string,
|
|
170
182
|
): string | Promise<string> {
|
|
171
183
|
const has = hasHttpImports(code);
|
|
172
184
|
logger.debug(`${LOG_PREFIX} Check: hasHttp=${has}, hash=${hash.slice(0, 8)}`);
|
|
173
185
|
if (!has) return code;
|
|
174
186
|
|
|
187
|
+
const version = reactVersion ?? REACT_VERSION;
|
|
188
|
+
|
|
175
189
|
return replaceSpecifiers(code, (specifier) => {
|
|
190
|
+
// Handle relative esm.sh paths like "/react-dom?target=es2022" or "/hoist-non-react-statics@..."
|
|
191
|
+
// These are returned by esm.sh stub modules and need to be converted to full URLs
|
|
192
|
+
if (specifier.startsWith("/") && !specifier.startsWith("//")) {
|
|
193
|
+
const fullUrl = `https://esm.sh${specifier}`;
|
|
194
|
+
// Recursively process as full URL (will add external params if needed)
|
|
195
|
+
const isReactPackage = /^\/react(-dom)?(@|\/|\?|$)/.test(specifier);
|
|
196
|
+
if (isReactPackage) {
|
|
197
|
+
// React packages - just ensure target and return full URL
|
|
198
|
+
if (!specifier.includes("target=")) {
|
|
199
|
+
const joiner = specifier.includes("?") ? "&" : "?";
|
|
200
|
+
return `${fullUrl}${joiner}target=es2022`;
|
|
201
|
+
}
|
|
202
|
+
return fullUrl;
|
|
203
|
+
}
|
|
204
|
+
// Non-React packages - add external params
|
|
205
|
+
const params: string[] = [];
|
|
206
|
+
if (!specifier.includes("target=")) params.push("target=es2022");
|
|
207
|
+
if (!specifier.includes("external=")) params.push("external=react,react-dom");
|
|
208
|
+
if (!specifier.includes("deps=")) params.push(`deps=react@${version},react-dom@${version}`);
|
|
209
|
+
if (params.length === 0) return fullUrl;
|
|
210
|
+
const joiner = specifier.includes("?") ? "&" : "?";
|
|
211
|
+
return `${fullUrl}${joiner}${params.join("&")}`;
|
|
212
|
+
}
|
|
213
|
+
|
|
176
214
|
const isEsmSh = specifier.startsWith("https://esm.sh/") ||
|
|
177
215
|
specifier.startsWith("http://esm.sh/");
|
|
178
216
|
const isVfEsm = specifier.startsWith("https://esm.veryfront.com/");
|
|
179
217
|
if (!isEsmSh && !isVfEsm) return null;
|
|
180
218
|
|
|
219
|
+
// Don't modify React/ReactDOM package URLs themselves
|
|
181
220
|
const isReactPackage = /\/react(-dom)?(@|\/|$)/.test(specifier);
|
|
221
|
+
if (isReactPackage) {
|
|
222
|
+
// Just ensure target is set for React packages
|
|
223
|
+
if (!specifier.includes("target=")) {
|
|
224
|
+
const joiner = specifier.includes("?") ? "&" : "?";
|
|
225
|
+
return `${specifier}${joiner}target=es2022`;
|
|
226
|
+
}
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
182
229
|
|
|
230
|
+
// For non-React packages: ensure external=react,react-dom and deps
|
|
183
231
|
const params: string[] = [];
|
|
184
232
|
|
|
185
233
|
if (!specifier.includes("target=")) {
|
|
186
234
|
params.push("target=es2022");
|
|
187
235
|
}
|
|
188
236
|
|
|
189
|
-
//
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
237
|
+
// Handle external param - ensure both react AND react-dom are externalized
|
|
238
|
+
const hasExternal = specifier.includes("external=");
|
|
239
|
+
const hasReactExternal = specifier.includes("external=react") ||
|
|
240
|
+
/external=[^&]*\breact\b/.test(specifier);
|
|
241
|
+
const hasReactDomExternal = /external=[^&]*react-dom/.test(specifier);
|
|
242
|
+
|
|
243
|
+
if (!hasExternal) {
|
|
244
|
+
// No external param - add both
|
|
245
|
+
params.push("external=react,react-dom");
|
|
246
|
+
} else if (!hasReactExternal) {
|
|
247
|
+
// Has external but no react - append react,react-dom
|
|
248
|
+
// This requires modifying existing param, so we'll use URL parsing
|
|
249
|
+
try {
|
|
250
|
+
const url = new URL(specifier);
|
|
251
|
+
const existing = url.searchParams.get("external") || "";
|
|
252
|
+
url.searchParams.set("external", `${existing},react,react-dom`);
|
|
253
|
+
// Return full modified URL and skip other param additions
|
|
254
|
+
if (!specifier.includes("target=")) {
|
|
255
|
+
url.searchParams.set("target", "es2022");
|
|
256
|
+
}
|
|
257
|
+
if (!specifier.includes("deps=")) {
|
|
258
|
+
url.searchParams.set("deps", `react@${version},react-dom@${version}`);
|
|
259
|
+
}
|
|
260
|
+
logger.debug(`${LOG_PREFIX} ${specifier} -> ${url.toString()}`);
|
|
261
|
+
return url.toString();
|
|
262
|
+
} catch {
|
|
263
|
+
// Fallback: just add as new param (may create duplicate)
|
|
264
|
+
params.push("external=react,react-dom");
|
|
195
265
|
}
|
|
196
|
-
|
|
197
|
-
|
|
266
|
+
} else if (!hasReactDomExternal) {
|
|
267
|
+
// Has react but not react-dom - append react-dom
|
|
268
|
+
try {
|
|
269
|
+
const url = new URL(specifier);
|
|
270
|
+
const existing = url.searchParams.get("external") || "";
|
|
271
|
+
url.searchParams.set("external", `${existing},react-dom`);
|
|
272
|
+
if (!specifier.includes("target=")) {
|
|
273
|
+
url.searchParams.set("target", "es2022");
|
|
274
|
+
}
|
|
275
|
+
if (!specifier.includes("deps=")) {
|
|
276
|
+
url.searchParams.set("deps", `react@${version},react-dom@${version}`);
|
|
277
|
+
}
|
|
278
|
+
logger.debug(`${LOG_PREFIX} ${specifier} -> ${url.toString()}`);
|
|
279
|
+
return url.toString();
|
|
280
|
+
} catch {
|
|
281
|
+
// Fallback
|
|
282
|
+
params.push("external=react-dom");
|
|
198
283
|
}
|
|
199
284
|
}
|
|
285
|
+
// else: has both react and react-dom - no external changes needed
|
|
286
|
+
|
|
287
|
+
if (!specifier.includes("deps=")) {
|
|
288
|
+
params.push(`deps=react@${version},react-dom@${version}`);
|
|
289
|
+
}
|
|
200
290
|
|
|
201
291
|
if (params.length === 0) return null;
|
|
202
292
|
|
|
@@ -12,6 +12,7 @@ import * as dntShim from "../../../_dnt.shims.js";
|
|
|
12
12
|
import { createFileSystem, exists } from "../../platform/compat/fs.js";
|
|
13
13
|
import { isAbsolute, join } from "../../platform/compat/path/index.js";
|
|
14
14
|
import { cwd } from "../../platform/compat/process.js";
|
|
15
|
+
import { isDeno } from "../../platform/compat/runtime.js";
|
|
15
16
|
import { rendererLogger as logger } from "../../utils/index.js";
|
|
16
17
|
import { simpleHash } from "../../utils/hash-utils.js";
|
|
17
18
|
import { LRUCache } from "../../utils/lru-wrapper.js";
|
|
@@ -19,8 +20,7 @@ import { withSpan } from "../../observability/tracing/otlp-setup.js";
|
|
|
19
20
|
import { SpanNames } from "../../observability/tracing/span-names.js";
|
|
20
21
|
import { resolveImport } from "../../modules/import-map/resolver.js";
|
|
21
22
|
import type { ImportMapConfig } from "../../modules/import-map/types.js";
|
|
22
|
-
import {
|
|
23
|
-
import { getDenoNpmReactMap, getReactImportMap, REACT_VERSION } from "./package-registry.js";
|
|
23
|
+
import { getReactImportMap, REACT_VERSION } from "./package-registry.js";
|
|
24
24
|
import { parseImports, replaceSpecifiers } from "./lexer.js";
|
|
25
25
|
import { CacheBackends, createDistributedCacheAccessor } from "../../cache/backend.js";
|
|
26
26
|
import {
|
|
@@ -61,13 +61,23 @@ function isHttpUrl(specifier: string): boolean {
|
|
|
61
61
|
/**
|
|
62
62
|
* Check if a URL is for React core packages.
|
|
63
63
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* React instance.
|
|
64
|
+
* React core modules (react, react-dom) must NOT be cached/bundled.
|
|
65
|
+
* Instead, all packages use external=react and import from the same esm.sh URL.
|
|
66
|
+
* This prevents multiple React instances which causes "useContext is null" errors.
|
|
68
67
|
*/
|
|
69
|
-
function isReactCoreUrl(
|
|
70
|
-
|
|
68
|
+
function isReactCoreUrl(url: string): boolean {
|
|
69
|
+
try {
|
|
70
|
+
const parsed = new URL(url);
|
|
71
|
+
if (!parsed.hostname.includes("esm.sh")) return false;
|
|
72
|
+
|
|
73
|
+
// Extract package name from esm.sh pathname
|
|
74
|
+
// Formats: /react@version, /v150/react@version, /stable/react@version
|
|
75
|
+
const pathname = parsed.pathname.replace(/^\/(v\d+|stable)\//, "/");
|
|
76
|
+
const match = pathname.match(/^\/(react|react-dom)(@[\d.]+)?(?:\/|$|\?)/);
|
|
77
|
+
return match !== null;
|
|
78
|
+
} catch {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
71
81
|
}
|
|
72
82
|
|
|
73
83
|
function isExternalScheme(specifier: string): boolean {
|
|
@@ -135,26 +145,8 @@ function resolveBareSpecifier(
|
|
|
135
145
|
importMap: ImportMapConfig,
|
|
136
146
|
reactVersion: string = REACT_VERSION,
|
|
137
147
|
): string {
|
|
138
|
-
//
|
|
139
|
-
//
|
|
140
|
-
// See: https://deno.com/blog/not-using-npm-specifiers-doing-it-wrong
|
|
141
|
-
if (isDeno) {
|
|
142
|
-
const denoReactMap = getDenoNpmReactMap(reactVersion);
|
|
143
|
-
const denoMatch = denoReactMap[specifier];
|
|
144
|
-
if (denoMatch) return denoMatch;
|
|
145
|
-
|
|
146
|
-
// For unknown react/* or react-dom/* subpaths, construct npm: specifiers
|
|
147
|
-
if (specifier.startsWith("react/") && !specifier.startsWith("react-dom")) {
|
|
148
|
-
const subpath = specifier.slice("react/".length);
|
|
149
|
-
return `npm:react@${reactVersion}/${subpath}`;
|
|
150
|
-
}
|
|
151
|
-
if (specifier.startsWith("react-dom/")) {
|
|
152
|
-
const subpath = specifier.slice("react-dom/".length);
|
|
153
|
-
return `npm:react-dom@${reactVersion}/${subpath}`;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// For non-Deno runtimes: Use esm.sh URLs with consistent versioning.
|
|
148
|
+
// Use esm.sh URLs for React - NO npm: specifiers per plan requirements.
|
|
149
|
+
// All packages use external=react to share the same React instance.
|
|
158
150
|
const reactMap = getReactImportMap(reactVersion);
|
|
159
151
|
const reactMapped = reactMap[specifier];
|
|
160
152
|
if (reactMapped) return reactMapped;
|
|
@@ -336,6 +328,13 @@ async function resolveSpecifier(
|
|
|
336
328
|
if (!baseUrl || !isHttpUrl(baseUrl)) return null;
|
|
337
329
|
|
|
338
330
|
const resolved = new URL(specifier, baseUrl).toString();
|
|
331
|
+
|
|
332
|
+
// For React core URLs: return the full esm.sh URL (not cached, to prevent multiple instances)
|
|
333
|
+
// This transforms relative paths like "/react-dom?..." to "https://esm.sh/react-dom?..."
|
|
334
|
+
if (isReactCoreUrl(resolved)) {
|
|
335
|
+
return normalizeHttpUrl(resolved);
|
|
336
|
+
}
|
|
337
|
+
|
|
339
338
|
const cached = await cacheHttpModule(resolved, options);
|
|
340
339
|
return cached ? `file://${cached}` : null;
|
|
341
340
|
}
|