vite-plugin-react-server 1.2.0-alpha.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +211 -59
- package/dist/client.d.ts +4 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -4
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -10
- package/dist/package.json +102 -27
- package/dist/plugin/bundle/bundles.d.ts +11 -0
- package/dist/plugin/bundle/bundles.d.ts.map +1 -0
- package/dist/plugin/bundle/bundles.js +11 -0
- package/dist/plugin/bundle/deferredStaticGeneration.d.ts +31 -0
- package/dist/plugin/bundle/deferredStaticGeneration.d.ts.map +1 -0
- package/dist/plugin/bundle/deferredStaticGeneration.js +44 -0
- package/dist/plugin/bundle/manifests.d.ts +20 -0
- package/dist/plugin/bundle/manifests.d.ts.map +1 -0
- package/dist/plugin/bundle/manifests.js +54 -0
- package/dist/plugin/components/css.d.ts +2 -5
- package/dist/plugin/components/css.d.ts.map +1 -1
- package/dist/plugin/components/css.js +7 -9
- package/dist/plugin/components/html.d.ts +2 -3
- package/dist/plugin/components/html.d.ts.map +1 -1
- package/dist/plugin/components/html.js +3 -3
- package/dist/plugin/components/index.d.ts +1 -1
- package/dist/plugin/components/index.d.ts.map +1 -1
- package/dist/plugin/components/root.d.ts.map +1 -1
- package/dist/plugin/components/root.js +4 -4
- package/dist/plugin/config/autoDiscover/createGlobAutoDiscover.d.ts.map +1 -1
- package/dist/plugin/config/autoDiscover/createGlobAutoDiscover.js +6 -6
- package/dist/plugin/config/autoDiscover/pageAndPropFiles.d.ts.map +1 -1
- package/dist/plugin/config/autoDiscover/pageAndPropFiles.js +1 -1
- package/dist/plugin/config/autoDiscover/resolveAutoDiscover.d.ts +6 -5
- package/dist/plugin/config/autoDiscover/resolveAutoDiscover.d.ts.map +1 -1
- package/dist/plugin/config/autoDiscover/resolveAutoDiscover.js +34 -51
- package/dist/plugin/config/autoDiscover/resolveBuildPages.d.ts +5 -1
- package/dist/plugin/config/autoDiscover/resolveBuildPages.d.ts.map +1 -1
- package/dist/plugin/config/autoDiscover/resolveBuildPages.js +124 -52
- package/dist/plugin/config/createHandlerOptions.client.d.ts +4 -0
- package/dist/plugin/config/createHandlerOptions.client.d.ts.map +1 -0
- package/dist/plugin/config/createHandlerOptions.client.js +293 -0
- package/dist/plugin/config/createHandlerOptions.d.ts +4 -0
- package/dist/plugin/config/createHandlerOptions.d.ts.map +1 -0
- package/dist/plugin/config/createHandlerOptions.js +13 -0
- package/dist/plugin/config/createHandlerOptions.server.d.ts +4 -0
- package/dist/plugin/config/createHandlerOptions.server.d.ts.map +1 -0
- package/dist/plugin/config/createHandlerOptions.server.js +344 -0
- package/dist/plugin/config/createHandlerOptions.types.d.ts +114 -0
- package/dist/plugin/config/createHandlerOptions.types.d.ts.map +1 -0
- package/dist/plugin/config/createModuleID.d.ts +1 -1
- package/dist/plugin/config/createModuleID.d.ts.map +1 -1
- package/dist/plugin/config/createModuleID.js +121 -8
- package/dist/plugin/config/defaults.d.ts +152 -17
- package/dist/plugin/config/defaults.d.ts.map +1 -1
- package/dist/plugin/config/defaults.js +69 -25
- package/dist/plugin/config/envPrefixFromConfig.d.ts +3 -0
- package/dist/plugin/config/envPrefixFromConfig.d.ts.map +1 -0
- package/dist/plugin/config/envPrefixFromConfig.js +8 -0
- package/dist/plugin/config/getCondition.d.ts +54 -3
- package/dist/plugin/config/getCondition.d.ts.map +1 -1
- package/dist/plugin/config/getCondition.js +158 -6
- package/dist/plugin/{getNodeEnv.d.ts → config/getNodeEnv.d.ts} +1 -1
- package/dist/plugin/config/getNodeEnv.d.ts.map +1 -0
- package/dist/plugin/config/getNodeEnv.js +17 -0
- package/dist/plugin/config/index.d.ts +43 -1
- package/dist/plugin/config/index.d.ts.map +1 -1
- package/dist/plugin/config/index.js +9 -4
- package/dist/plugin/config/resolveDirectiveMatcher.d.ts +6 -6
- package/dist/plugin/config/resolveDirectiveMatcher.d.ts.map +1 -1
- package/dist/plugin/config/resolveDirectiveMatcher.js +7 -23
- package/dist/plugin/config/resolveEnv.d.ts +1 -1
- package/dist/plugin/config/resolveEnv.d.ts.map +1 -1
- package/dist/plugin/config/resolveEnv.js +32 -28
- package/dist/plugin/config/resolveOptions.d.ts +3 -2
- package/dist/plugin/config/resolveOptions.d.ts.map +1 -1
- package/dist/plugin/config/resolveOptions.js +195 -61
- package/dist/plugin/config/resolvePages.d.ts +1 -1
- package/dist/plugin/config/resolvePages.d.ts.map +1 -1
- package/dist/plugin/config/resolvePages.js +1 -1
- package/dist/plugin/config/resolvePatternWithValues.d.ts.map +1 -1
- package/dist/plugin/config/resolvePatternWithValues.js +7 -26
- package/dist/plugin/config/resolveUrlOption.d.ts +1 -1
- package/dist/plugin/config/resolveUrlOption.d.ts.map +1 -1
- package/dist/plugin/config/resolveUrlOption.js +2 -2
- package/dist/plugin/config/resolveUserConfig.d.ts +5 -3
- package/dist/plugin/config/resolveUserConfig.d.ts.map +1 -1
- package/dist/plugin/config/resolveUserConfig.js +221 -70
- package/dist/plugin/config/stashedOptionsState.d.ts +66 -0
- package/dist/plugin/config/stashedOptionsState.d.ts.map +1 -0
- package/dist/plugin/config/stashedOptionsState.js +25 -0
- package/dist/plugin/dev-server/cleanupServerAction.client.d.ts +6 -0
- package/dist/plugin/dev-server/cleanupServerAction.client.d.ts.map +1 -0
- package/dist/plugin/dev-server/cleanupServerAction.client.js +28 -0
- package/dist/plugin/dev-server/cleanupServerAction.d.ts +2 -0
- package/dist/plugin/dev-server/cleanupServerAction.d.ts.map +1 -0
- package/dist/plugin/dev-server/cleanupServerAction.js +4 -0
- package/dist/plugin/dev-server/cleanupServerAction.server.d.ts +8 -0
- package/dist/plugin/dev-server/cleanupServerAction.server.d.ts.map +1 -0
- package/dist/plugin/dev-server/cleanupServerAction.server.js +15 -0
- package/dist/plugin/dev-server/configureReactServer.client.d.ts +7 -0
- package/dist/plugin/dev-server/configureReactServer.client.d.ts.map +1 -0
- package/dist/plugin/dev-server/configureReactServer.client.js +85 -0
- package/dist/plugin/dev-server/configureReactServer.d.ts +2 -0
- package/dist/plugin/dev-server/configureReactServer.d.ts.map +1 -0
- package/dist/plugin/dev-server/configureReactServer.js +13 -0
- package/dist/plugin/dev-server/configureReactServer.server.d.ts +3 -0
- package/dist/plugin/dev-server/configureReactServer.server.d.ts.map +1 -0
- package/dist/plugin/dev-server/configureReactServer.server.js +444 -0
- package/dist/plugin/dev-server/configureRequestHandler.client.d.ts +13 -0
- package/dist/plugin/dev-server/configureRequestHandler.client.d.ts.map +1 -0
- package/dist/plugin/dev-server/configureRequestHandler.client.js +307 -0
- package/dist/plugin/dev-server/configureRequestHandler.d.ts +2 -0
- package/dist/plugin/dev-server/configureRequestHandler.d.ts.map +1 -0
- package/dist/plugin/dev-server/configureRequestHandler.js +4 -0
- package/dist/plugin/dev-server/configureRequestHandler.server.d.ts +6 -0
- package/dist/plugin/dev-server/configureRequestHandler.server.d.ts.map +1 -0
- package/dist/plugin/dev-server/configureRequestHandler.server.js +44 -0
- package/dist/plugin/dev-server/handleServerAction.client.d.ts +11 -0
- package/dist/plugin/dev-server/handleServerAction.client.d.ts.map +1 -0
- package/dist/plugin/dev-server/handleServerAction.client.js +97 -0
- package/dist/plugin/dev-server/handleServerAction.d.ts +2 -0
- package/dist/plugin/dev-server/handleServerAction.d.ts.map +1 -0
- package/dist/plugin/dev-server/handleServerAction.js +13 -0
- package/dist/plugin/dev-server/handleServerAction.server.d.ts +3 -0
- package/dist/plugin/dev-server/handleServerAction.server.d.ts.map +1 -0
- package/dist/plugin/dev-server/handleServerAction.server.js +15 -0
- package/dist/plugin/dev-server/index.client.d.ts +7 -0
- package/dist/plugin/dev-server/index.client.d.ts.map +1 -0
- package/dist/plugin/dev-server/index.client.js +11 -0
- package/dist/plugin/dev-server/index.d.ts +4 -0
- package/dist/plugin/dev-server/index.d.ts.map +1 -0
- package/dist/plugin/dev-server/index.js +19 -0
- package/dist/plugin/dev-server/index.server.d.ts +7 -0
- package/dist/plugin/dev-server/index.server.d.ts.map +1 -0
- package/dist/plugin/dev-server/index.server.js +11 -0
- package/dist/plugin/dev-server/plugin.client.d.ts +7 -0
- package/dist/plugin/dev-server/plugin.client.d.ts.map +1 -0
- package/dist/plugin/dev-server/plugin.client.js +122 -0
- package/dist/plugin/dev-server/plugin.server.d.ts +8 -0
- package/dist/plugin/dev-server/plugin.server.d.ts.map +1 -0
- package/dist/plugin/dev-server/plugin.server.js +108 -0
- package/dist/plugin/dev-server/restartWorker.client.d.ts +3 -0
- package/dist/plugin/dev-server/restartWorker.client.d.ts.map +1 -0
- package/dist/plugin/dev-server/restartWorker.client.js +131 -0
- package/dist/plugin/dev-server/restartWorker.d.ts +2 -0
- package/dist/plugin/dev-server/restartWorker.d.ts.map +1 -0
- package/dist/plugin/dev-server/restartWorker.js +4 -0
- package/dist/plugin/dev-server/restartWorker.server.d.ts +3 -0
- package/dist/plugin/dev-server/restartWorker.server.d.ts.map +1 -0
- package/dist/plugin/dev-server/restartWorker.server.js +88 -0
- package/dist/plugin/dev-server/types.d.ts +38 -0
- package/dist/plugin/dev-server/types.d.ts.map +1 -0
- package/dist/plugin/dev-server/virtualRscHmrPlugin.d.ts +7 -0
- package/dist/plugin/dev-server/virtualRscHmrPlugin.d.ts.map +1 -0
- package/dist/plugin/dev-server/virtualRscHmrPlugin.js +80 -0
- package/dist/plugin/env/createConfigEnv.d.ts +13 -0
- package/dist/plugin/env/createConfigEnv.d.ts.map +1 -0
- package/dist/plugin/env/createConfigEnv.js +43 -0
- package/dist/plugin/env/createEnvPlugin.d.ts +3 -0
- package/dist/plugin/env/createEnvPlugin.d.ts.map +1 -0
- package/dist/plugin/env/createEnvPlugin.js +59 -0
- package/dist/plugin/env/getArgValue.d.ts +8 -0
- package/dist/plugin/env/getArgValue.d.ts.map +1 -0
- package/dist/plugin/env/getArgValue.js +52 -0
- package/dist/plugin/env/getEnvKey.d.ts +46 -0
- package/dist/plugin/env/getEnvKey.d.ts.map +1 -0
- package/dist/plugin/env/getEnvKey.js +32 -0
- package/dist/plugin/env/index.d.ts +5 -0
- package/dist/plugin/env/index.d.ts.map +1 -1
- package/dist/plugin/env/index.js +7 -0
- package/dist/plugin/env/plugin.client.d.ts +2 -0
- package/dist/plugin/env/plugin.client.d.ts.map +1 -0
- package/dist/plugin/env/plugin.client.js +2 -0
- package/dist/plugin/env/plugin.d.ts +4 -34
- package/dist/plugin/env/plugin.d.ts.map +1 -1
- package/dist/plugin/env/plugin.js +27 -102
- package/dist/plugin/env/plugin.server.d.ts +2 -0
- package/dist/plugin/env/plugin.server.d.ts.map +1 -0
- package/dist/plugin/env/plugin.server.js +2 -0
- package/dist/plugin/env/userConfigEnv.d.ts +2 -0
- package/dist/plugin/env/userConfigEnv.d.ts.map +1 -0
- package/dist/plugin/env/userConfigEnv.js +12 -0
- package/dist/plugin/environments/createBuildEventPlugin.d.ts +4 -0
- package/dist/plugin/environments/createBuildEventPlugin.d.ts.map +1 -0
- package/dist/plugin/environments/createBuildEventPlugin.js +100 -0
- package/dist/plugin/environments/createEnvironmentPlugin.d.ts +19 -0
- package/dist/plugin/environments/createEnvironmentPlugin.d.ts.map +1 -0
- package/dist/plugin/environments/createEnvironmentPlugin.js +257 -0
- package/dist/plugin/environments/hashCoordination.d.ts +14 -0
- package/dist/plugin/environments/hashCoordination.d.ts.map +1 -0
- package/dist/plugin/environments/hashCoordination.js +35 -0
- package/dist/plugin/environments/resolveEnvironmentConfig.d.ts +41 -0
- package/dist/plugin/environments/resolveEnvironmentConfig.d.ts.map +1 -0
- package/dist/plugin/environments/resolveEnvironmentConfig.js +232 -0
- package/dist/plugin/error/assertPanic.d.ts +2 -0
- package/dist/plugin/error/assertPanic.d.ts.map +1 -0
- package/dist/plugin/error/assertPanic.js +15 -0
- package/dist/plugin/error/handleError.d.ts +9 -0
- package/dist/plugin/error/handleError.d.ts.map +1 -0
- package/dist/plugin/error/handleError.js +51 -0
- package/dist/plugin/error/index.d.ts +3 -0
- package/dist/plugin/error/index.d.ts.map +1 -1
- package/dist/plugin/error/index.js +4 -1
- package/dist/plugin/error/logError.d.ts +6 -2
- package/dist/plugin/error/logError.d.ts.map +1 -1
- package/dist/plugin/error/logError.js +35 -34
- package/dist/plugin/error/panicThresholdHandler.d.ts +27 -0
- package/dist/plugin/error/panicThresholdHandler.d.ts.map +1 -0
- package/dist/plugin/error/panicThresholdHandler.js +13 -0
- package/dist/plugin/error/serializeError.d.ts +6 -2
- package/dist/plugin/error/serializeError.d.ts.map +1 -1
- package/dist/plugin/error/serializeError.js +30 -10
- package/dist/plugin/error/serializeErrorInfo.d.ts +5 -0
- package/dist/plugin/error/serializeErrorInfo.d.ts.map +1 -0
- package/dist/plugin/error/serializeErrorInfo.js +19 -0
- package/dist/plugin/error/setupGlobalErrorHandler.d.ts +4 -0
- package/dist/plugin/error/setupGlobalErrorHandler.d.ts.map +1 -0
- package/dist/plugin/error/setupGlobalErrorHandler.js +52 -0
- package/dist/plugin/error/shouldPanic.d.ts +6 -0
- package/dist/plugin/error/shouldPanic.d.ts.map +1 -0
- package/dist/plugin/error/shouldPanic.js +15 -0
- package/dist/plugin/error/toError.d.ts +5 -1
- package/dist/plugin/error/toError.d.ts.map +1 -1
- package/dist/plugin/error/toError.js +43 -19
- package/dist/plugin/error/types.d.ts +28 -0
- package/dist/plugin/error/types.d.ts.map +1 -0
- package/dist/plugin/helpers/collectManifestCss.d.ts.map +1 -1
- package/dist/plugin/helpers/collectManifestCss.js +19 -5
- package/dist/plugin/helpers/collectViteModuleGraphCss.d.ts +3 -3
- package/dist/plugin/helpers/collectViteModuleGraphCss.d.ts.map +1 -1
- package/dist/plugin/helpers/collectViteModuleGraphCss.js +64 -3
- package/dist/plugin/helpers/createBufferedRscStream.d.ts +52 -0
- package/dist/plugin/helpers/createBufferedRscStream.d.ts.map +1 -0
- package/dist/plugin/helpers/createBufferedRscStream.js +147 -0
- package/dist/plugin/helpers/createCssProps.d.ts.map +1 -1
- package/dist/plugin/helpers/createCssProps.js +15 -25
- package/dist/plugin/helpers/createElementWithReact.d.ts +9 -0
- package/dist/plugin/helpers/createElementWithReact.d.ts.map +1 -0
- package/dist/plugin/helpers/createElementWithReact.js +87 -0
- package/dist/plugin/helpers/createPatternMatcher.d.ts +24 -0
- package/dist/plugin/helpers/createPatternMatcher.d.ts.map +1 -0
- package/dist/plugin/helpers/createPatternMatcher.js +50 -0
- package/dist/plugin/helpers/createRscRenderHelpers.d.ts +16 -0
- package/dist/plugin/helpers/createRscRenderHelpers.d.ts.map +1 -0
- package/dist/plugin/helpers/createRscRenderHelpers.js +60 -0
- package/dist/plugin/helpers/createSafePageComponent.d.ts +36 -0
- package/dist/plugin/helpers/createSafePageComponent.d.ts.map +1 -0
- package/dist/plugin/helpers/createSafePageComponent.js +50 -0
- package/dist/plugin/helpers/createSerializableHandlerOptions.d.ts +60 -0
- package/dist/plugin/helpers/createSerializableHandlerOptions.d.ts.map +1 -0
- package/dist/plugin/helpers/createSerializableHandlerOptions.js +94 -0
- package/dist/plugin/helpers/createSharedLoader.d.ts +44 -0
- package/dist/plugin/helpers/createSharedLoader.d.ts.map +1 -0
- package/dist/plugin/helpers/createSharedLoader.js +137 -0
- package/dist/plugin/helpers/createUnifiedCssProcessor.d.ts +70 -0
- package/dist/plugin/helpers/createUnifiedCssProcessor.d.ts.map +1 -0
- package/dist/plugin/helpers/createUnifiedCssProcessor.js +89 -0
- package/dist/plugin/helpers/getBundleManifest.d.ts.map +1 -1
- package/dist/plugin/helpers/getBundleManifest.js +2 -3
- package/dist/plugin/helpers/getRouteFiles.d.ts +2 -2
- package/dist/plugin/helpers/getRouteFiles.d.ts.map +1 -1
- package/dist/plugin/helpers/getRouteFiles.js +67 -36
- package/dist/plugin/helpers/handleServerAction.client.d.ts +29 -0
- package/dist/plugin/helpers/handleServerAction.client.d.ts.map +1 -0
- package/dist/plugin/helpers/handleServerAction.client.js +93 -0
- package/dist/plugin/helpers/handleServerAction.d.ts +2 -34
- package/dist/plugin/helpers/handleServerAction.d.ts.map +1 -1
- package/dist/plugin/helpers/handleServerAction.js +15 -44
- package/dist/plugin/helpers/handleServerAction.server.d.ts +25 -0
- package/dist/plugin/helpers/handleServerAction.server.d.ts.map +1 -0
- package/dist/plugin/helpers/handleServerAction.server.js +80 -0
- package/dist/plugin/helpers/handleServerActionHelper.d.ts +61 -0
- package/dist/plugin/helpers/handleServerActionHelper.d.ts.map +1 -0
- package/dist/plugin/helpers/handleServerActionHelper.js +183 -0
- package/dist/plugin/helpers/headlessStreamReuseHandler.d.ts +12 -0
- package/dist/plugin/helpers/headlessStreamReuseHandler.d.ts.map +1 -0
- package/dist/plugin/helpers/headlessStreamReuseHandler.js +29 -0
- package/dist/plugin/helpers/headlessStreamState.d.ts +71 -0
- package/dist/plugin/helpers/headlessStreamState.d.ts.map +1 -0
- package/dist/plugin/helpers/headlessStreamState.js +81 -0
- package/dist/plugin/helpers/hydrateUserOptions.d.ts +1 -1
- package/dist/plugin/helpers/hydrateUserOptions.d.ts.map +1 -1
- package/dist/plugin/helpers/hydrateUserOptions.js +2 -2
- package/dist/plugin/helpers/index.d.ts +12 -5
- package/dist/plugin/helpers/index.d.ts.map +1 -1
- package/dist/plugin/helpers/index.js +18 -4
- package/dist/plugin/helpers/logRenderStart.d.ts +17 -0
- package/dist/plugin/helpers/logRenderStart.d.ts.map +1 -0
- package/dist/plugin/helpers/logRenderStart.js +13 -0
- package/dist/plugin/helpers/mergeMessageWithDefaults.d.ts +90 -0
- package/dist/plugin/helpers/mergeMessageWithDefaults.d.ts.map +1 -0
- package/dist/plugin/helpers/mergeMessageWithDefaults.js +67 -0
- package/dist/plugin/helpers/pipeToResponse.d.ts +19 -0
- package/dist/plugin/helpers/pipeToResponse.d.ts.map +1 -0
- package/dist/plugin/helpers/pipeToResponse.js +55 -0
- package/dist/plugin/helpers/requestInfo.d.ts +6 -4
- package/dist/plugin/helpers/requestInfo.d.ts.map +1 -1
- package/dist/plugin/helpers/requestInfo.js +48 -30
- package/dist/plugin/helpers/resolveComponents.client.d.ts +34 -0
- package/dist/plugin/helpers/resolveComponents.client.d.ts.map +1 -0
- package/dist/plugin/helpers/resolveComponents.client.js +126 -0
- package/dist/plugin/helpers/resolveModuleFromManifest.d.ts +36 -0
- package/dist/plugin/helpers/resolveModuleFromManifest.d.ts.map +1 -0
- package/dist/plugin/helpers/resolveModuleFromManifest.js +60 -0
- package/dist/plugin/helpers/resolvePageAndProps.d.ts +23 -2
- package/dist/plugin/helpers/resolvePageAndProps.d.ts.map +1 -1
- package/dist/plugin/helpers/resolvePageAndProps.js +150 -9
- package/dist/plugin/helpers/resolveRenderUrl.d.ts +11 -0
- package/dist/plugin/helpers/resolveRenderUrl.d.ts.map +1 -0
- package/dist/plugin/helpers/resolveRenderUrl.js +19 -0
- package/dist/plugin/helpers/resolveStreamElements.client.d.ts +14 -0
- package/dist/plugin/helpers/resolveStreamElements.client.d.ts.map +1 -0
- package/dist/plugin/helpers/resolveStreamElements.client.js +36 -0
- package/dist/plugin/helpers/resolveStreamElements.d.ts +3 -0
- package/dist/plugin/helpers/resolveStreamElements.d.ts.map +1 -0
- package/dist/plugin/helpers/resolveStreamElements.js +13 -0
- package/dist/plugin/helpers/resolveStreamElements.server.d.ts +15 -0
- package/dist/plugin/helpers/resolveStreamElements.server.d.ts.map +1 -0
- package/dist/plugin/helpers/resolveStreamElements.server.js +35 -0
- package/dist/plugin/helpers/resolveStreamElements.types.d.ts +22 -0
- package/dist/plugin/helpers/resolveStreamElements.types.d.ts.map +1 -0
- package/dist/plugin/helpers/resolveStreamElements.types.js +1 -0
- package/dist/plugin/helpers/resolveVirtualAndNodeModules.d.ts +15 -0
- package/dist/plugin/helpers/resolveVirtualAndNodeModules.d.ts.map +1 -0
- package/dist/plugin/helpers/resolveVirtualAndNodeModules.js +45 -0
- package/dist/plugin/helpers/resolveWithDefaultRootAndHtml.d.ts +18 -0
- package/dist/plugin/helpers/resolveWithDefaultRootAndHtml.d.ts.map +1 -0
- package/dist/plugin/helpers/resolveWithDefaultRootAndHtml.js +17 -0
- package/dist/plugin/helpers/serializeUserOptions.d.ts +2 -2
- package/dist/plugin/helpers/serializeUserOptions.d.ts.map +1 -1
- package/dist/plugin/helpers/serializeUserOptions.js +28 -13
- package/dist/plugin/helpers/tryManifest.d.ts +2 -2
- package/dist/plugin/helpers/tryManifest.d.ts.map +1 -1
- package/dist/plugin/helpers/tryManifest.js +12 -6
- package/dist/plugin/helpers/validateRscRenderMessage.d.ts +9 -0
- package/dist/plugin/helpers/validateRscRenderMessage.d.ts.map +1 -0
- package/dist/plugin/helpers/validateRscRenderMessage.js +13 -0
- package/dist/plugin/helpers/workerCleanup.d.ts +29 -0
- package/dist/plugin/helpers/workerCleanup.d.ts.map +1 -0
- package/dist/plugin/helpers/workerCleanup.js +28 -0
- package/dist/plugin/helpers/workerManager.d.ts +5 -0
- package/dist/plugin/helpers/workerManager.d.ts.map +1 -0
- package/dist/plugin/helpers/workerManager.js +18 -0
- package/dist/plugin/index.d.ts +4 -1
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +5 -2
- package/dist/plugin/loader/createDefaultLoader.d.ts +1 -1
- package/dist/plugin/loader/createDefaultLoader.d.ts.map +1 -1
- package/dist/plugin/loader/createDefaultLoader.js +2 -22
- package/dist/plugin/loader/createTransformer.d.ts.map +1 -1
- package/dist/plugin/loader/createTransformer.js +157 -32
- package/dist/plugin/loader/directives/analyzeDirectives.d.ts +3 -2
- package/dist/plugin/loader/directives/analyzeDirectives.d.ts.map +1 -1
- package/dist/plugin/loader/directives/analyzeDirectives.js +53 -26
- package/dist/plugin/loader/directives/analyzeModule.d.ts +2 -6
- package/dist/plugin/loader/directives/analyzeModule.d.ts.map +1 -1
- package/dist/plugin/loader/directives/analyzeModule.js +32 -11
- package/dist/plugin/loader/env-loader.d.ts +3 -2
- package/dist/plugin/loader/env-loader.d.ts.map +1 -1
- package/dist/plugin/loader/env-loader.js +32 -9
- package/dist/plugin/loader/parse.d.ts +3 -2
- package/dist/plugin/loader/parse.d.ts.map +1 -1
- package/dist/plugin/loader/parse.js +2 -2
- package/dist/plugin/loader/react-loader.d.ts +4 -4
- package/dist/plugin/loader/react-loader.d.ts.map +1 -1
- package/dist/plugin/loader/react-loader.js +101 -73
- package/dist/plugin/loader/transformClientModule.d.ts +4 -5
- package/dist/plugin/loader/transformClientModule.d.ts.map +1 -1
- package/dist/plugin/loader/transformClientModule.js +63 -18
- package/dist/plugin/loader/transformModule.d.ts.map +1 -1
- package/dist/plugin/loader/transformModule.js +82 -14
- package/dist/plugin/loader/transformModuleIfNeeded.d.ts +6 -1
- package/dist/plugin/loader/transformModuleIfNeeded.d.ts.map +1 -1
- package/dist/plugin/loader/transformModuleIfNeeded.js +10 -18
- package/dist/plugin/loader/transformNonServerEnvironment.d.ts +10 -0
- package/dist/plugin/loader/transformNonServerEnvironment.d.ts.map +1 -0
- package/dist/plugin/loader/transformNonServerEnvironment.js +74 -0
- package/dist/plugin/loader/transformServerModule.d.ts +2 -3
- package/dist/plugin/loader/transformServerModule.d.ts.map +1 -1
- package/dist/plugin/loader/transformServerModule.js +80 -22
- package/dist/plugin/loader/transformWithAcornLoose.js +1 -3
- package/dist/plugin/loader/types.d.ts +37 -32
- package/dist/plugin/loader/types.d.ts.map +1 -1
- package/dist/plugin/metrics/collectStreamMetrics.d.ts +1 -2
- package/dist/plugin/metrics/collectStreamMetrics.d.ts.map +1 -1
- package/dist/plugin/metrics/collectStreamMetrics.js +1 -1
- package/dist/plugin/metrics/convertStreamMetrics.d.ts +3 -0
- package/dist/plugin/metrics/convertStreamMetrics.d.ts.map +1 -0
- package/dist/plugin/metrics/convertStreamMetrics.js +26 -0
- package/dist/plugin/metrics/createModuleResolutionMetrics.d.ts +12 -0
- package/dist/plugin/metrics/createModuleResolutionMetrics.d.ts.map +1 -0
- package/dist/plugin/metrics/createModuleResolutionMetrics.js +32 -0
- package/dist/plugin/metrics/createRenderMetrics.d.ts +2 -2
- package/dist/plugin/metrics/createRenderMetrics.d.ts.map +1 -1
- package/dist/plugin/metrics/createRenderMetrics.js +45 -13
- package/dist/plugin/metrics/createStreamMetrics.d.ts +2 -2
- package/dist/plugin/metrics/createStreamMetrics.d.ts.map +1 -1
- package/dist/plugin/metrics/createStreamMetrics.js +15 -4
- package/dist/plugin/metrics/createWorkerStartupMetrics.d.ts +12 -0
- package/dist/plugin/metrics/createWorkerStartupMetrics.d.ts.map +1 -0
- package/dist/plugin/metrics/createWorkerStartupMetrics.js +14 -0
- package/dist/plugin/metrics/formatMetrics.d.ts +0 -6
- package/dist/plugin/metrics/formatMetrics.d.ts.map +1 -1
- package/dist/plugin/metrics/formatMetrics.js +7 -29
- package/dist/plugin/metrics/index.d.ts +6 -3
- package/dist/plugin/metrics/index.d.ts.map +1 -1
- package/dist/plugin/metrics/index.js +6 -3
- package/dist/plugin/metrics/metricWatcher.d.ts +9 -0
- package/dist/plugin/metrics/metricWatcher.d.ts.map +1 -0
- package/dist/plugin/metrics/metricWatcher.js +141 -0
- package/dist/plugin/metrics/types.d.ts +72 -6
- package/dist/plugin/metrics/types.d.ts.map +1 -1
- package/dist/plugin/orchestrator/createPluginOrchestrator.client.d.ts +3 -0
- package/dist/plugin/orchestrator/createPluginOrchestrator.client.d.ts.map +1 -0
- package/dist/plugin/orchestrator/createPluginOrchestrator.client.js +36 -0
- package/dist/plugin/orchestrator/createPluginOrchestrator.d.ts +19 -0
- package/dist/plugin/orchestrator/createPluginOrchestrator.d.ts.map +1 -0
- package/dist/plugin/orchestrator/createPluginOrchestrator.js +13 -0
- package/dist/plugin/orchestrator/createPluginOrchestrator.server.d.ts +3 -0
- package/dist/plugin/orchestrator/createPluginOrchestrator.server.d.ts.map +1 -0
- package/dist/plugin/orchestrator/createPluginOrchestrator.server.js +44 -0
- package/dist/plugin/orchestrator/index.d.ts +2 -0
- package/dist/plugin/orchestrator/index.d.ts.map +1 -0
- package/dist/plugin/orchestrator/index.js +1 -0
- package/dist/plugin/orchestrator/plugin.js +7 -0
- package/dist/plugin/orchestrator/resolveStrategy.d.ts +19 -0
- package/dist/plugin/orchestrator/resolveStrategy.d.ts.map +1 -0
- package/dist/plugin/orchestrator/resolveStrategy.js +35 -0
- package/dist/plugin/orchestrator/types.d.ts +21 -0
- package/dist/plugin/orchestrator/types.d.ts.map +1 -0
- package/dist/plugin/orchestrator/types.js +1 -0
- package/dist/plugin/plugin.client.d.ts +11 -19
- package/dist/plugin/plugin.client.d.ts.map +1 -1
- package/dist/plugin/plugin.client.js +28 -29
- package/dist/plugin/plugin.d.ts +2 -1
- package/dist/plugin/plugin.d.ts.map +1 -1
- package/dist/plugin/plugin.js +4 -2
- package/dist/plugin/plugin.server.d.ts +13 -11
- package/dist/plugin/plugin.server.d.ts.map +1 -1
- package/dist/plugin/plugin.server.js +19 -22
- package/dist/plugin/process-env.d.ts +19 -6
- package/dist/plugin/process-env.d.ts.map +1 -1
- package/dist/plugin/process-env.js +17 -0
- package/dist/plugin/react-client/createMessageHandlers.d.ts +2 -10
- package/dist/plugin/react-client/createMessageHandlers.d.ts.map +1 -1
- package/dist/plugin/react-client/createMessageHandlers.js +42 -69
- package/dist/plugin/react-client/index.client.d.ts +2 -0
- package/dist/plugin/react-client/index.client.d.ts.map +1 -0
- package/dist/plugin/react-client/index.client.js +1 -0
- package/dist/plugin/react-client/index.d.ts +3 -4
- package/dist/plugin/react-client/index.d.ts.map +1 -1
- package/dist/plugin/react-client/index.js +10 -5
- package/dist/plugin/react-client/index.server.d.ts +2 -0
- package/dist/plugin/react-client/index.server.d.ts.map +1 -0
- package/dist/plugin/react-client/index.server.js +1 -0
- package/dist/plugin/react-client/plugin.client.d.ts +15 -0
- package/dist/plugin/react-client/plugin.client.d.ts.map +1 -0
- package/dist/plugin/react-client/plugin.client.js +98 -0
- package/dist/plugin/react-client/plugin.d.ts +2 -5
- package/dist/plugin/react-client/plugin.d.ts.map +1 -1
- package/dist/plugin/react-client/plugin.js +6 -121
- package/dist/plugin/react-client/plugin.server.d.ts +15 -0
- package/dist/plugin/react-client/plugin.server.d.ts.map +1 -0
- package/dist/plugin/react-client/plugin.server.js +93 -0
- package/dist/plugin/react-client/types.d.ts +60 -0
- package/dist/plugin/react-client/types.d.ts.map +1 -0
- package/dist/plugin/react-client/types.js +1 -0
- package/dist/plugin/react-server/index.client.d.ts +2 -0
- package/dist/plugin/react-server/index.client.d.ts.map +1 -0
- package/dist/plugin/react-server/index.client.js +1 -0
- package/dist/plugin/react-server/index.d.ts +3 -1
- package/dist/plugin/react-server/index.d.ts.map +1 -1
- package/dist/plugin/react-server/index.js +13 -1
- package/dist/plugin/react-server/index.server.d.ts +2 -0
- package/dist/plugin/react-server/index.server.d.ts.map +1 -0
- package/dist/plugin/react-server/index.server.js +1 -0
- package/dist/plugin/react-server/plugin.client.d.ts +3 -0
- package/dist/plugin/react-server/plugin.client.d.ts.map +1 -0
- package/dist/plugin/react-server/plugin.client.js +40 -0
- package/dist/plugin/react-server/plugin.d.ts +2 -5
- package/dist/plugin/react-server/plugin.d.ts.map +1 -1
- package/dist/plugin/react-server/plugin.js +5 -141
- package/dist/plugin/react-server/plugin.server.d.ts +3 -0
- package/dist/plugin/react-server/plugin.server.d.ts.map +1 -0
- package/dist/plugin/react-server/plugin.server.js +18 -0
- package/dist/plugin/react-server/types.d.ts +11 -0
- package/dist/plugin/react-server/types.d.ts.map +1 -0
- package/dist/plugin/react-server/types.js +1 -0
- package/dist/plugin/react-static/collectHtmlContent.d.ts +15 -0
- package/dist/plugin/react-static/collectHtmlContent.d.ts.map +1 -0
- package/dist/plugin/react-static/collectHtmlContent.js +104 -0
- package/dist/plugin/react-static/collectRscContent.d.ts +10 -15
- package/dist/plugin/react-static/collectRscContent.d.ts.map +1 -1
- package/dist/plugin/react-static/collectRscContent.js +71 -20
- package/dist/plugin/react-static/configurePreviewServer.d.ts +1 -7
- package/dist/plugin/react-static/configurePreviewServer.d.ts.map +1 -1
- package/dist/plugin/react-static/configurePreviewServer.js +15 -29
- package/dist/plugin/react-static/createBuildLoader.client.d.ts +2 -0
- package/dist/plugin/react-static/createBuildLoader.client.d.ts.map +1 -0
- package/dist/plugin/react-static/createBuildLoader.client.js +7 -0
- package/dist/plugin/react-static/createBuildLoader.d.ts +3 -19
- package/dist/plugin/react-static/createBuildLoader.d.ts.map +1 -1
- package/dist/plugin/react-static/createBuildLoader.js +4 -226
- package/dist/plugin/react-static/createBuildLoader.server.d.ts +9 -0
- package/dist/plugin/react-static/createBuildLoader.server.d.ts.map +1 -0
- package/dist/plugin/react-static/createBuildLoader.server.js +253 -0
- package/dist/plugin/react-static/fileWriter.d.ts +3 -14
- package/dist/plugin/react-static/fileWriter.d.ts.map +1 -1
- package/dist/plugin/react-static/fileWriter.js +233 -42
- package/dist/plugin/react-static/index.client.d.ts +7 -0
- package/dist/plugin/react-static/index.client.d.ts.map +1 -0
- package/dist/plugin/react-static/index.client.js +6 -0
- package/dist/plugin/react-static/index.d.ts +7 -1
- package/dist/plugin/react-static/index.d.ts.map +1 -1
- package/dist/plugin/react-static/index.js +19 -1
- package/dist/plugin/react-static/index.server.d.ts +7 -0
- package/dist/plugin/react-static/index.server.d.ts.map +1 -0
- package/dist/plugin/react-static/index.server.js +6 -0
- package/dist/plugin/react-static/plugin.client.d.ts +32 -0
- package/dist/plugin/react-static/plugin.client.d.ts.map +1 -0
- package/dist/plugin/react-static/plugin.client.js +801 -0
- package/dist/plugin/react-static/plugin.d.ts +3 -20
- package/dist/plugin/react-static/plugin.d.ts.map +1 -1
- package/dist/plugin/react-static/plugin.js +4 -365
- package/dist/plugin/react-static/plugin.server.d.ts +18 -0
- package/dist/plugin/react-static/plugin.server.d.ts.map +1 -0
- package/dist/plugin/react-static/plugin.server.js +615 -0
- package/dist/plugin/react-static/processCssFilesForPages.d.ts +16 -0
- package/dist/plugin/react-static/processCssFilesForPages.d.ts.map +1 -0
- package/dist/plugin/react-static/processCssFilesForPages.js +94 -0
- package/dist/plugin/react-static/renderPage.client.d.ts +49 -0
- package/dist/plugin/react-static/renderPage.client.d.ts.map +1 -0
- package/dist/plugin/react-static/renderPage.client.js +555 -0
- package/dist/plugin/react-static/renderPage.d.ts +3 -4
- package/dist/plugin/react-static/renderPage.d.ts.map +1 -1
- package/dist/plugin/react-static/renderPage.js +6 -131
- package/dist/plugin/react-static/renderPage.server.d.ts +24 -0
- package/dist/plugin/react-static/renderPage.server.d.ts.map +1 -0
- package/dist/plugin/react-static/renderPage.server.js +533 -0
- package/dist/plugin/react-static/renderPages.d.ts +11 -3
- package/dist/plugin/react-static/renderPages.d.ts.map +1 -1
- package/dist/plugin/react-static/renderPages.js +533 -92
- package/dist/plugin/react-static/renderPagesBatched.d.ts +6 -0
- package/dist/plugin/react-static/renderPagesBatched.d.ts.map +1 -0
- package/dist/plugin/react-static/renderPagesBatched.js +195 -0
- package/dist/plugin/react-static/renderStreams.d.ts +2 -5
- package/dist/plugin/react-static/renderStreams.d.ts.map +1 -1
- package/dist/plugin/react-static/renderStreams.js +36 -24
- package/dist/plugin/react-static/rscToHtmlStream.client.d.ts +12 -0
- package/dist/plugin/react-static/rscToHtmlStream.client.d.ts.map +1 -0
- package/dist/plugin/react-static/rscToHtmlStream.client.js +32 -0
- package/dist/plugin/react-static/rscToHtmlStream.d.ts +3 -21
- package/dist/plugin/react-static/rscToHtmlStream.d.ts.map +1 -1
- package/dist/plugin/react-static/rscToHtmlStream.js +4 -53
- package/dist/plugin/react-static/rscToHtmlStream.server.d.ts +3 -0
- package/dist/plugin/react-static/rscToHtmlStream.server.d.ts.map +1 -0
- package/dist/plugin/react-static/rscToHtmlStream.server.js +39 -0
- package/dist/plugin/react-static/temporaryReferences.client.d.ts +2 -0
- package/dist/plugin/react-static/temporaryReferences.client.d.ts.map +1 -0
- package/dist/plugin/react-static/temporaryReferences.client.js +1 -0
- package/dist/plugin/react-static/temporaryReferences.d.ts +2 -1
- package/dist/plugin/react-static/temporaryReferences.d.ts.map +1 -1
- package/dist/plugin/react-static/temporaryReferences.js +6 -10
- package/dist/plugin/react-static/temporaryReferences.server.d.ts +2 -0
- package/dist/plugin/react-static/temporaryReferences.server.d.ts.map +1 -0
- package/dist/plugin/react-static/temporaryReferences.server.js +3 -0
- package/dist/plugin/react-static/types.d.ts +83 -9
- package/dist/plugin/react-static/types.d.ts.map +1 -1
- package/dist/plugin/root.d.ts.map +1 -1
- package/dist/plugin/root.js +2 -5
- package/dist/plugin/stream/MessagePortReadable.d.ts +22 -0
- package/dist/plugin/stream/MessagePortReadable.d.ts.map +1 -0
- package/dist/plugin/stream/MessagePortReadable.js +101 -0
- package/dist/plugin/stream/MessagePortWritable.d.ts +22 -0
- package/dist/plugin/stream/MessagePortWritable.d.ts.map +1 -0
- package/dist/plugin/stream/MessagePortWritable.js +85 -0
- package/dist/plugin/stream/client.js +12 -0
- package/dist/plugin/stream/createFromNodeStream.client.d.ts +9 -0
- package/dist/plugin/stream/createFromNodeStream.client.d.ts.map +1 -0
- package/dist/plugin/stream/createFromNodeStream.client.js +76 -0
- package/dist/plugin/stream/createFromNodeStream.d.ts +3 -0
- package/dist/plugin/stream/createFromNodeStream.d.ts.map +1 -0
- package/dist/plugin/stream/createFromNodeStream.js +6 -0
- package/dist/plugin/stream/createFromNodeStream.server.d.ts +9 -0
- package/dist/plugin/stream/createFromNodeStream.server.d.ts.map +1 -0
- package/dist/plugin/stream/createFromNodeStream.server.js +27 -0
- package/dist/plugin/stream/createFromNodeStream.types.d.ts +37 -0
- package/dist/plugin/stream/createFromNodeStream.types.d.ts.map +1 -0
- package/dist/plugin/stream/createFromNodeStream.types.js +1 -0
- package/dist/plugin/stream/createHtmlStream.client.d.ts +3 -0
- package/dist/plugin/stream/createHtmlStream.client.d.ts.map +1 -0
- package/dist/plugin/stream/createHtmlStream.client.js +42 -0
- package/dist/plugin/stream/createHtmlStream.d.ts +3 -0
- package/dist/plugin/stream/createHtmlStream.d.ts.map +1 -0
- package/dist/plugin/stream/createHtmlStream.js +6 -0
- package/dist/plugin/stream/createHtmlStream.server.d.ts +6 -0
- package/dist/plugin/stream/createHtmlStream.server.d.ts.map +1 -0
- package/dist/plugin/stream/createHtmlStream.server.js +224 -0
- package/dist/plugin/stream/createHtmlStream.types.d.ts +43 -0
- package/dist/plugin/stream/createHtmlStream.types.d.ts.map +1 -0
- package/dist/plugin/stream/createHtmlStream.types.js +1 -0
- package/dist/plugin/stream/createMainThreadHandlers.d.ts +11 -0
- package/dist/plugin/stream/createMainThreadHandlers.d.ts.map +1 -0
- package/dist/plugin/stream/createMainThreadHandlers.js +32 -0
- package/dist/plugin/stream/createMessageChannels.d.ts +29 -0
- package/dist/plugin/stream/createMessageChannels.d.ts.map +1 -0
- package/dist/plugin/stream/createMessageChannels.js +35 -0
- package/dist/plugin/stream/createRenderToPipeableStreamHandler.client.d.ts +10 -0
- package/dist/plugin/stream/createRenderToPipeableStreamHandler.client.d.ts.map +1 -0
- package/dist/plugin/stream/createRenderToPipeableStreamHandler.client.js +188 -0
- package/dist/plugin/stream/createRenderToPipeableStreamHandler.d.ts +3 -0
- package/dist/plugin/stream/createRenderToPipeableStreamHandler.d.ts.map +1 -0
- package/dist/plugin/stream/createRenderToPipeableStreamHandler.js +6 -0
- package/dist/plugin/stream/createRenderToPipeableStreamHandler.server.d.ts +45 -0
- package/dist/plugin/stream/createRenderToPipeableStreamHandler.server.d.ts.map +1 -0
- package/dist/plugin/stream/createRenderToPipeableStreamHandler.server.js +249 -0
- package/dist/plugin/stream/createRenderToPipeableStreamHandler.types.d.ts +17 -0
- package/dist/plugin/stream/createRenderToPipeableStreamHandler.types.d.ts.map +1 -0
- package/dist/plugin/stream/createRenderToPipeableStreamHandler.types.js +1 -0
- package/dist/plugin/stream/createRscStream.client.d.ts +18 -0
- package/dist/plugin/stream/createRscStream.client.d.ts.map +1 -0
- package/dist/plugin/stream/createRscStream.client.js +79 -0
- package/dist/plugin/stream/createRscStream.d.ts +2 -0
- package/dist/plugin/stream/createRscStream.d.ts.map +1 -0
- package/dist/plugin/stream/createRscStream.js +13 -0
- package/dist/plugin/stream/createRscStream.server.d.ts +46 -0
- package/dist/plugin/stream/createRscStream.server.d.ts.map +1 -0
- package/dist/plugin/stream/createRscStream.server.js +113 -0
- package/dist/plugin/stream/createRscStream.types.d.ts +134 -0
- package/dist/plugin/stream/createRscStream.types.d.ts.map +1 -0
- package/dist/plugin/stream/createRscStream.types.js +1 -0
- package/dist/plugin/stream/createRscStream.utils.d.ts +54 -0
- package/dist/plugin/stream/createRscStream.utils.d.ts.map +1 -0
- package/dist/plugin/stream/createRscStream.utils.js +91 -0
- package/dist/plugin/stream/createRscWorkerStream.d.ts +41 -0
- package/dist/plugin/stream/createRscWorkerStream.d.ts.map +1 -0
- package/dist/plugin/stream/createRscWorkerStream.js +120 -0
- package/dist/plugin/stream/handleRscStream.client.d.ts +17 -0
- package/dist/plugin/stream/handleRscStream.client.d.ts.map +1 -0
- package/dist/plugin/stream/handleRscStream.client.js +163 -0
- package/dist/plugin/stream/handleRscStream.d.ts +3 -0
- package/dist/plugin/stream/handleRscStream.d.ts.map +1 -0
- package/dist/plugin/stream/handleRscStream.js +13 -0
- package/dist/plugin/stream/handleRscStream.server.d.ts +6 -0
- package/dist/plugin/stream/handleRscStream.server.d.ts.map +1 -0
- package/dist/plugin/stream/handleRscStream.server.js +70 -0
- package/dist/plugin/stream/handleRscStream.types.d.ts +28 -0
- package/dist/plugin/stream/handleRscStream.types.d.ts.map +1 -0
- package/dist/plugin/stream/handleRscStream.types.js +1 -0
- package/dist/plugin/stream/index.client.d.ts +7 -0
- package/dist/plugin/stream/index.client.d.ts.map +1 -0
- package/dist/plugin/stream/index.client.js +11 -0
- package/dist/plugin/stream/index.d.ts +95 -0
- package/dist/plugin/stream/index.d.ts.map +1 -0
- package/dist/plugin/stream/index.js +21 -0
- package/dist/plugin/stream/index.server.d.ts +7 -0
- package/dist/plugin/stream/index.server.d.ts.map +1 -0
- package/dist/plugin/stream/index.server.js +11 -0
- package/dist/plugin/stream/renderRscStream.server.d.ts +21 -0
- package/dist/plugin/stream/renderRscStream.server.d.ts.map +1 -0
- package/dist/plugin/stream/renderRscStream.server.js +153 -0
- package/dist/plugin/stream/renderRscStream.types.d.ts +36 -0
- package/dist/plugin/stream/renderRscStream.types.d.ts.map +1 -0
- package/dist/plugin/stream/renderRscStream.types.js +1 -0
- package/dist/plugin/stream/renderRscStreamHelpers.server.d.ts +9 -0
- package/dist/plugin/stream/renderRscStreamHelpers.server.d.ts.map +1 -0
- package/dist/plugin/stream/renderRscStreamHelpers.server.js +63 -0
- package/dist/plugin/stream/server.js +12 -0
- package/dist/plugin/stream/setMaxListeners.d.ts +16 -0
- package/dist/plugin/stream/setMaxListeners.d.ts.map +1 -0
- package/dist/plugin/stream/setMaxListeners.js +16 -0
- package/dist/plugin/transformer/createTransformerPlugin.d.ts +18 -0
- package/dist/plugin/transformer/createTransformerPlugin.d.ts.map +1 -0
- package/dist/plugin/transformer/createTransformerPlugin.js +269 -0
- package/dist/plugin/transformer/plugin.client.d.ts +3 -0
- package/dist/plugin/transformer/plugin.client.d.ts.map +1 -0
- package/dist/plugin/transformer/plugin.client.js +5 -0
- package/dist/plugin/transformer/plugin.server.d.ts +2 -29
- package/dist/plugin/transformer/plugin.server.d.ts.map +1 -1
- package/dist/plugin/transformer/plugin.server.js +5 -104
- package/dist/plugin/transformer/transformerEnv.d.ts +15 -0
- package/dist/plugin/transformer/transformerEnv.d.ts.map +1 -0
- package/dist/plugin/transformer/transformerEnv.js +26 -0
- package/dist/plugin/types.d.ts +368 -143
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/plugin/types.js +1 -2
- package/dist/plugin/utils/callServer.d.ts +1 -1
- package/dist/plugin/utils/callServer.d.ts.map +1 -1
- package/dist/plugin/utils/createCallServer.d.ts +1 -1
- package/dist/plugin/utils/createCallServer.d.ts.map +1 -1
- package/dist/plugin/utils/createCallServer.js +4 -9
- package/dist/plugin/utils/createReactFetcher.d.ts +43 -2
- package/dist/plugin/utils/createReactFetcher.d.ts.map +1 -1
- package/dist/plugin/utils/createReactFetcher.js +14 -3
- package/dist/plugin/utils/envUrls.node.d.ts.map +1 -1
- package/dist/plugin/utils/envUrls.node.js +11 -11
- package/dist/plugin/utils/index.client.d.ts +8 -0
- package/dist/plugin/utils/index.client.d.ts.map +1 -0
- package/dist/plugin/utils/index.client.js +8 -0
- package/dist/plugin/utils/index.d.ts +1 -0
- package/dist/plugin/utils/index.d.ts.map +1 -1
- package/dist/plugin/utils/index.js +3 -2
- package/dist/plugin/utils/index.server.d.ts +6 -0
- package/dist/plugin/utils/index.server.d.ts.map +1 -0
- package/dist/plugin/utils/index.server.js +8 -0
- package/dist/plugin/utils/routeToURL.d.ts.map +1 -1
- package/dist/plugin/utils/routeToURL.js +4 -4
- package/dist/plugin/utils/urls.d.ts +1 -1
- package/dist/plugin/utils/urls.d.ts.map +1 -1
- package/dist/plugin/utils/urls.js +29 -8
- package/dist/plugin/utils/useRscHmr.d.ts +39 -0
- package/dist/plugin/utils/useRscHmr.d.ts.map +1 -0
- package/dist/plugin/utils/useRscHmr.js +27 -0
- package/dist/plugin/vendor/vendor.client.d.ts +3 -3
- package/dist/plugin/vendor/vendor.client.d.ts.map +1 -1
- package/dist/plugin/vendor/vendor.client.js +7 -6
- package/dist/plugin/vendor/vendor.d.ts +1 -1
- package/dist/plugin/vendor/vendor.d.ts.map +1 -1
- package/dist/plugin/vendor/vendor.js +4 -6
- package/dist/plugin/vendor/vendor.server.d.ts +4 -2
- package/dist/plugin/vendor/vendor.server.d.ts.map +1 -1
- package/dist/plugin/vendor/vendor.server.js +2 -3
- package/dist/plugin/vendor/vendor.static.d.ts +4 -0
- package/dist/plugin/vendor/vendor.static.d.ts.map +1 -0
- package/dist/plugin/vendor/vendor.static.js +15 -0
- package/dist/plugin/worker/createWorker.d.ts +16 -5
- package/dist/plugin/worker/createWorker.d.ts.map +1 -1
- package/dist/plugin/worker/createWorker.js +207 -30
- package/dist/plugin/worker/html/handleHtmlRender.d.ts +14 -0
- package/dist/plugin/worker/html/handleHtmlRender.d.ts.map +1 -0
- package/dist/plugin/worker/html/handleHtmlRender.js +190 -0
- package/dist/plugin/worker/html/html-worker.development.js +9 -26
- package/dist/plugin/worker/html/html-worker.js +4 -4
- package/dist/plugin/worker/html/html-worker.production.js +7 -13
- package/dist/plugin/worker/html/index.d.ts +1 -1
- package/dist/plugin/worker/html/index.js +6 -2
- package/dist/plugin/worker/html/messageHandler.d.ts +1 -1
- package/dist/plugin/worker/html/messageHandler.d.ts.map +1 -1
- package/dist/plugin/worker/html/messageHandler.js +291 -104
- package/dist/plugin/worker/html/state.d.ts +10 -0
- package/dist/plugin/worker/html/state.d.ts.map +1 -0
- package/dist/plugin/worker/html/state.js +28 -0
- package/dist/plugin/worker/html/types.d.ts +52 -23
- package/dist/plugin/worker/html/types.d.ts.map +1 -1
- package/dist/plugin/worker/index.js +1 -1
- package/dist/plugin/worker/rsc/createBundleLoader.d.ts +22 -0
- package/dist/plugin/worker/rsc/createBundleLoader.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/createBundleLoader.js +55 -0
- package/dist/plugin/worker/rsc/createRscWorkerLoader.d.ts +23 -0
- package/dist/plugin/worker/rsc/createRscWorkerLoader.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/createRscWorkerLoader.js +79 -0
- package/dist/plugin/worker/rsc/handleRscRender.d.ts +32 -0
- package/dist/plugin/worker/rsc/handleRscRender.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/handleRscRender.js +349 -0
- package/dist/plugin/worker/rsc/handlers.d.ts +8 -2
- package/dist/plugin/worker/rsc/handlers.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/handlers.js +137 -200
- package/dist/plugin/worker/rsc/hydrateRscRenderMessage.d.ts +118 -0
- package/dist/plugin/worker/rsc/hydrateRscRenderMessage.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/hydrateRscRenderMessage.js +61 -0
- package/dist/plugin/worker/rsc/messageHandler.d.ts +1 -1
- package/dist/plugin/worker/rsc/messageHandler.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/messageHandler.js +927 -47
- package/dist/plugin/worker/rsc/rsc-worker.development.js +153 -148
- package/dist/plugin/worker/rsc/rsc-worker.js +2 -3
- package/dist/plugin/worker/rsc/rsc-worker.production.js +240 -15
- package/dist/plugin/worker/rsc/state.d.ts +6 -0
- package/dist/plugin/worker/rsc/state.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/state.js +37 -5
- package/dist/plugin/worker/rsc/types.d.ts +73 -12
- package/dist/plugin/worker/rsc/types.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/workerUserOptions.d.ts +10 -0
- package/dist/plugin/worker/rsc/workerUserOptions.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/workerUserOptions.js +39 -0
- package/dist/plugin/worker/sendMessage.d.ts +2 -3
- package/dist/plugin/worker/sendMessage.d.ts.map +1 -1
- package/dist/plugin/worker/sendMessage.js +24 -38
- package/dist/plugin/worker/types.d.ts +42 -56
- package/dist/plugin/worker/types.d.ts.map +1 -1
- package/dist/plugin/worker/worker-handlers.server.d.ts +2 -0
- package/dist/plugin/worker/worker-handlers.server.d.ts.map +1 -0
- package/dist/plugin/worker/worker-handlers.server.js +1 -0
- package/dist/server.d.ts +5 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +4 -6
- package/dist/static.js +11 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +102 -27
- package/plugin/bundle/bundles.ts +22 -0
- package/plugin/bundle/deferredStaticGeneration.ts +48 -0
- package/plugin/bundle/manifests.ts +73 -0
- package/plugin/components/css.tsx +3 -7
- package/plugin/components/html.tsx +4 -3
- package/plugin/components/index.ts +1 -1
- package/plugin/components/root.tsx +3 -3
- package/plugin/config/autoDiscover/createGlobAutoDiscover.ts +10 -5
- package/plugin/config/autoDiscover/pageAndPropFiles.ts +4 -2
- package/plugin/config/autoDiscover/resolveAutoDiscover.ts +64 -79
- package/plugin/config/autoDiscover/resolveBuildPages.ts +181 -69
- package/plugin/config/createHandlerOptions.client.ts +403 -0
- package/plugin/config/createHandlerOptions.server.ts +477 -0
- package/plugin/config/createHandlerOptions.ts +46 -0
- package/plugin/config/createHandlerOptions.types.ts +119 -0
- package/plugin/config/createModuleID.ts +201 -10
- package/plugin/config/defaults.tsx +108 -55
- package/plugin/config/envPrefixFromConfig.ts +10 -0
- package/plugin/config/getCondition.ts +267 -10
- package/plugin/{getNodeEnv.ts → config/getNodeEnv.ts} +4 -2
- package/plugin/config/index.ts +60 -1
- package/plugin/config/resolveDirectiveMatcher.ts +13 -34
- package/plugin/config/resolveEnv.ts +37 -33
- package/plugin/config/resolveOptions.ts +375 -154
- package/plugin/config/resolvePages.ts +1 -1
- package/plugin/config/resolvePatternWithValues.ts +6 -26
- package/plugin/config/resolveUrlOption.ts +2 -2
- package/plugin/config/resolveUserConfig.ts +359 -124
- package/plugin/config/stashedOptionsState.ts +144 -0
- package/plugin/dev-server/cleanupServerAction.client.ts +47 -0
- package/plugin/dev-server/cleanupServerAction.server.ts +24 -0
- package/plugin/dev-server/cleanupServerAction.ts +8 -0
- package/plugin/dev-server/configureReactServer.client.ts +107 -0
- package/plugin/dev-server/configureReactServer.server.ts +558 -0
- package/plugin/dev-server/configureReactServer.ts +8 -0
- package/plugin/dev-server/configureRequestHandler.client.ts +382 -0
- package/plugin/dev-server/configureRequestHandler.server.ts +46 -0
- package/plugin/dev-server/configureRequestHandler.ts +8 -0
- package/plugin/dev-server/handleServerAction.client.ts +126 -0
- package/plugin/dev-server/handleServerAction.server.ts +10 -0
- package/plugin/dev-server/handleServerAction.ts +8 -0
- package/plugin/dev-server/index.client.ts +6 -0
- package/plugin/dev-server/index.server.ts +6 -0
- package/plugin/dev-server/index.ts +20 -0
- package/plugin/dev-server/plugin.client.ts +160 -0
- package/plugin/dev-server/plugin.server.ts +133 -0
- package/plugin/dev-server/restartWorker.client.ts +155 -0
- package/plugin/dev-server/restartWorker.server.ts +108 -0
- package/plugin/dev-server/restartWorker.ts +8 -0
- package/plugin/dev-server/types.ts +78 -0
- package/plugin/dev-server/virtualRscHmrPlugin.ts +82 -0
- package/plugin/env/createConfigEnv.ts +59 -0
- package/plugin/env/createEnvPlugin.ts +76 -0
- package/plugin/env/getArgValue.ts +56 -0
- package/plugin/env/getEnvKey.ts +80 -0
- package/plugin/env/index.ts +14 -1
- package/plugin/env/plugin.client.ts +3 -0
- package/plugin/env/plugin.server.ts +4 -0
- package/plugin/env/plugin.ts +40 -164
- package/plugin/env/userConfigEnv.ts +22 -0
- package/plugin/environments/createBuildEventPlugin.ts +117 -0
- package/plugin/environments/createEnvironmentPlugin.ts +332 -0
- package/plugin/environments/hashCoordination.ts +39 -0
- package/plugin/environments/resolveEnvironmentConfig.ts +320 -0
- package/plugin/error/assertPanic.ts +9 -0
- package/plugin/error/handleError.ts +63 -0
- package/plugin/error/index.ts +4 -1
- package/plugin/error/logError.ts +64 -40
- package/plugin/error/panicThresholdHandler.ts +52 -0
- package/plugin/error/serializeError.ts +36 -11
- package/plugin/error/serializeErrorInfo.ts +17 -0
- package/plugin/error/setupGlobalErrorHandler.ts +71 -0
- package/plugin/error/shouldPanic.ts +14 -0
- package/plugin/error/toError.ts +59 -19
- package/plugin/error/types.ts +32 -0
- package/plugin/helpers/README.md +112 -0
- package/plugin/helpers/collectManifestCss.ts +24 -5
- package/plugin/helpers/collectViteModuleGraphCss.ts +83 -9
- package/plugin/helpers/createBufferedRscStream.ts +194 -0
- package/plugin/helpers/createCssProps.tsx +22 -41
- package/plugin/helpers/createElementWithReact.tsx +121 -0
- package/plugin/helpers/createPatternMatcher.ts +100 -0
- package/plugin/helpers/createRscRenderHelpers.ts +77 -0
- package/plugin/helpers/createSafePageComponent.ts +64 -0
- package/plugin/helpers/createSerializableHandlerOptions.ts +183 -0
- package/plugin/helpers/createSharedLoader.ts +207 -0
- package/plugin/helpers/createUnifiedCssProcessor.ts +175 -0
- package/plugin/helpers/getBundleManifest.ts +2 -3
- package/plugin/helpers/getRouteFiles.ts +94 -48
- package/plugin/helpers/handleServerAction.client.ts +145 -0
- package/plugin/helpers/handleServerAction.server.ts +151 -0
- package/plugin/helpers/handleServerAction.ts +19 -78
- package/plugin/helpers/handleServerActionHelper.ts +270 -0
- package/plugin/helpers/headlessStreamReuseHandler.ts +48 -0
- package/plugin/helpers/headlessStreamState.ts +122 -0
- package/plugin/helpers/hydrateUserOptions.ts +2 -2
- package/plugin/helpers/index.ts +32 -5
- package/plugin/helpers/logRenderStart.ts +26 -0
- package/plugin/helpers/mergeMessageWithDefaults.ts +80 -0
- package/plugin/helpers/pipeToResponse.ts +77 -0
- package/plugin/helpers/requestInfo.ts +59 -39
- package/plugin/helpers/resolveComponents.client.ts +183 -0
- package/plugin/helpers/resolveModuleFromManifest.ts +99 -0
- package/plugin/helpers/resolvePageAndProps.ts +237 -50
- package/plugin/helpers/resolveRenderUrl.ts +26 -0
- package/plugin/helpers/resolveStreamElements.client.ts +50 -0
- package/plugin/helpers/resolveStreamElements.server.ts +43 -0
- package/plugin/helpers/resolveStreamElements.ts +13 -0
- package/plugin/helpers/resolveStreamElements.types.ts +29 -0
- package/plugin/helpers/resolveVirtualAndNodeModules.ts +75 -0
- package/plugin/helpers/resolveWithDefaultRootAndHtml.ts +25 -0
- package/plugin/helpers/serializeUserOptions.ts +37 -15
- package/plugin/helpers/tryManifest.ts +15 -6
- package/plugin/helpers/validateRscRenderMessage.ts +13 -0
- package/plugin/helpers/workerCleanup.ts +85 -0
- package/plugin/helpers/workerManager.ts +16 -0
- package/plugin/index.ts +6 -2
- package/plugin/loader/createDefaultLoader.ts +0 -21
- package/plugin/loader/createTransformer.ts +232 -46
- package/plugin/loader/directives/analyzeDirectives.ts +163 -73
- package/plugin/loader/directives/analyzeModule.ts +46 -19
- package/plugin/loader/env-loader.ts +56 -14
- package/plugin/loader/parse.ts +2 -2
- package/plugin/loader/react-loader.ts +133 -85
- package/plugin/loader/transformClientModule.ts +84 -26
- package/plugin/loader/transformModule.ts +103 -18
- package/plugin/loader/transformModuleIfNeeded.ts +20 -23
- package/plugin/loader/transformNonServerEnvironment.ts +103 -0
- package/plugin/loader/transformServerModule.ts +132 -37
- package/plugin/loader/types.ts +31 -23
- package/plugin/metrics/collectStreamMetrics.ts +1 -2
- package/plugin/metrics/convertStreamMetrics.ts +28 -0
- package/plugin/metrics/createModuleResolutionMetrics.ts +38 -0
- package/plugin/metrics/createRenderMetrics.ts +46 -13
- package/plugin/metrics/createStreamMetrics.ts +16 -6
- package/plugin/metrics/createWorkerStartupMetrics.ts +38 -0
- package/plugin/metrics/formatMetrics.ts +5 -33
- package/plugin/metrics/index.ts +6 -3
- package/plugin/metrics/metricWatcher.ts +216 -0
- package/plugin/metrics/types.ts +87 -8
- package/plugin/orchestrator/createPluginOrchestrator.client.ts +47 -0
- package/plugin/orchestrator/createPluginOrchestrator.server.ts +55 -0
- package/plugin/orchestrator/createPluginOrchestrator.ts +29 -0
- package/plugin/orchestrator/index.ts +1 -0
- package/plugin/orchestrator/resolveStrategy.ts +53 -0
- package/plugin/orchestrator/types.ts +24 -0
- package/plugin/plugin.client.ts +30 -32
- package/plugin/plugin.server.ts +38 -45
- package/plugin/plugin.ts +8 -2
- package/plugin/process-env.ts +30 -6
- package/plugin/react-client/createMessageHandlers.ts +9 -34
- package/plugin/react-client/index.client.ts +1 -0
- package/plugin/react-client/index.server.ts +1 -0
- package/plugin/react-client/index.ts +13 -4
- package/plugin/react-client/plugin.client.ts +124 -0
- package/plugin/react-client/plugin.server.ts +108 -0
- package/plugin/react-client/plugin.ts +13 -152
- package/plugin/react-client/types.ts +95 -0
- package/plugin/react-server/index.client.ts +1 -0
- package/plugin/react-server/index.server.ts +1 -0
- package/plugin/react-server/index.ts +13 -1
- package/plugin/react-server/plugin.client.ts +54 -0
- package/plugin/react-server/plugin.server.ts +27 -0
- package/plugin/react-server/plugin.ts +8 -183
- package/plugin/react-server/types.ts +24 -0
- package/plugin/react-static/collectHtmlContent.ts +131 -0
- package/plugin/react-static/collectRscContent.ts +92 -49
- package/plugin/react-static/configurePreviewServer.ts +20 -41
- package/plugin/react-static/createBuildLoader.client.ts +7 -0
- package/plugin/react-static/createBuildLoader.server.ts +333 -0
- package/plugin/react-static/createBuildLoader.ts +8 -300
- package/plugin/react-static/fileWriter.ts +303 -64
- package/plugin/react-static/index.client.ts +6 -0
- package/plugin/react-static/index.server.ts +6 -0
- package/plugin/react-static/index.ts +25 -1
- package/plugin/react-static/plugin.client.ts +932 -0
- package/plugin/react-static/plugin.server.ts +713 -0
- package/plugin/react-static/plugin.ts +8 -446
- package/plugin/react-static/processCssFilesForPages.ts +148 -0
- package/plugin/react-static/renderPage.client.ts +640 -0
- package/plugin/react-static/renderPage.server.ts +655 -0
- package/plugin/react-static/renderPage.ts +10 -172
- package/plugin/react-static/renderPages.ts +736 -139
- package/plugin/react-static/renderPagesBatched.ts +264 -0
- package/plugin/react-static/renderStreams.ts +12 -16
- package/plugin/react-static/rscToHtmlStream.client.ts +61 -0
- package/plugin/react-static/rscToHtmlStream.server.ts +66 -0
- package/plugin/react-static/rscToHtmlStream.ts +8 -80
- package/plugin/react-static/temporaryReferences.client.ts +1 -0
- package/plugin/react-static/temporaryReferences.server.ts +5 -0
- package/plugin/react-static/temporaryReferences.ts +11 -2
- package/plugin/react-static/types.ts +202 -8
- package/plugin/root.ts +1 -3
- package/plugin/stream/MessagePortReadable.ts +131 -0
- package/plugin/stream/MessagePortWritable.ts +104 -0
- package/plugin/stream/createFromNodeStream.client.ts +90 -0
- package/plugin/stream/createFromNodeStream.server.ts +30 -0
- package/plugin/stream/createFromNodeStream.ts +13 -0
- package/plugin/stream/createFromNodeStream.types.ts +53 -0
- package/plugin/stream/createHtmlStream.client.ts +47 -0
- package/plugin/stream/createHtmlStream.server.ts +312 -0
- package/plugin/stream/createHtmlStream.ts +13 -0
- package/plugin/stream/createHtmlStream.types.ts +63 -0
- package/plugin/stream/createMainThreadHandlers.ts +44 -0
- package/plugin/stream/createMessageChannels.ts +52 -0
- package/plugin/stream/createRenderToPipeableStreamHandler.client.ts +224 -0
- package/plugin/stream/createRenderToPipeableStreamHandler.server.ts +358 -0
- package/plugin/stream/createRenderToPipeableStreamHandler.ts +13 -0
- package/plugin/stream/createRenderToPipeableStreamHandler.types.ts +69 -0
- package/plugin/stream/createRscStream.client.ts +122 -0
- package/plugin/stream/createRscStream.server.ts +188 -0
- package/plugin/stream/createRscStream.ts +8 -0
- package/plugin/stream/createRscStream.types.ts +168 -0
- package/plugin/stream/createRscStream.utils.ts +171 -0
- package/plugin/stream/createRscWorkerStream.ts +178 -0
- package/plugin/stream/handleRscStream.client.ts +214 -0
- package/plugin/stream/handleRscStream.server.ts +82 -0
- package/plugin/stream/handleRscStream.ts +11 -0
- package/plugin/stream/handleRscStream.types.ts +70 -0
- package/plugin/stream/index.client.ts +15 -0
- package/plugin/stream/index.server.ts +15 -0
- package/plugin/stream/index.ts +137 -0
- package/plugin/stream/renderRscStream.server.ts +182 -0
- package/plugin/stream/renderRscStream.types.ts +43 -0
- package/plugin/stream/renderRscStreamHelpers.server.ts +88 -0
- package/plugin/stream/setMaxListeners.ts +30 -0
- package/plugin/transformer/README.md +2 -381
- package/plugin/transformer/createTransformerPlugin.ts +388 -0
- package/plugin/transformer/plugin.client.ts +7 -0
- package/plugin/transformer/plugin.server.ts +6 -140
- package/plugin/transformer/transformerEnv.ts +49 -0
- package/plugin/types/react-server-dom-esm.d.ts +269 -110
- package/plugin/types/virtual-rsc-hmr.d.ts +21 -0
- package/plugin/types.ts +637 -225
- package/plugin/utils/createCallServer.ts +8 -18
- package/plugin/utils/createReactFetcher.ts +87 -5
- package/plugin/utils/env.ts +1 -1
- package/plugin/utils/envUrls.node.ts +15 -10
- package/plugin/utils/index.client.ts +8 -0
- package/plugin/utils/index.server.ts +8 -0
- package/plugin/utils/index.ts +5 -1
- package/plugin/utils/routeToURL.ts +3 -4
- package/plugin/utils/urls.ts +41 -9
- package/plugin/utils/useRscHmr.ts +72 -0
- package/plugin/vendor/vendor.client.ts +9 -7
- package/plugin/vendor/vendor.server.ts +5 -4
- package/plugin/vendor/vendor.static.ts +12 -0
- package/plugin/vendor/vendor.ts +10 -5
- package/plugin/worker/createWorker.ts +283 -41
- package/plugin/worker/html/README.md +2 -65
- package/plugin/worker/html/handleHtmlRender.ts +245 -0
- package/plugin/worker/html/html-worker.development.tsx +5 -17
- package/plugin/worker/html/html-worker.production.tsx +1 -1
- package/plugin/worker/html/html-worker.ts +5 -5
- package/plugin/worker/html/index.ts +6 -6
- package/plugin/worker/html/messageHandler.tsx +317 -98
- package/plugin/worker/html/state.ts +38 -0
- package/plugin/worker/html/types.ts +108 -35
- package/plugin/worker/rsc/README.md +2 -257
- package/plugin/worker/rsc/createBundleLoader.ts +92 -0
- package/plugin/worker/rsc/createRscWorkerLoader.ts +104 -0
- package/plugin/worker/rsc/handleRscRender.ts +510 -0
- package/plugin/worker/rsc/handlers.ts +159 -238
- package/plugin/worker/rsc/hydrateRscRenderMessage.ts +118 -0
- package/plugin/worker/rsc/messageHandler.tsx +1289 -56
- package/plugin/worker/rsc/rsc-worker.development.ts +198 -185
- package/plugin/worker/rsc/rsc-worker.production.ts +306 -21
- package/plugin/worker/rsc/rsc-worker.tsx +3 -5
- package/plugin/worker/rsc/state.ts +54 -2
- package/plugin/worker/rsc/types.ts +110 -32
- package/plugin/worker/rsc/workerUserOptions.ts +63 -0
- package/plugin/worker/sendMessage.ts +33 -53
- package/plugin/worker/types.ts +94 -91
- package/scripts/generate-toc.mjs +311 -0
- package/scripts/remove-toc.mjs +51 -0
- package/scripts/test-both.sh +82 -0
- package/dist/plugin/config/resolveDevServerConfig.d.ts +0 -2
- package/dist/plugin/config/resolveDevServerConfig.d.ts.map +0 -1
- package/dist/plugin/getNodeEnv.d.ts.map +0 -1
- package/dist/plugin/getNodeEnv.js +0 -17
- package/dist/plugin/helpers/collectBundleManifestCss.d.ts +0 -2
- package/dist/plugin/helpers/collectBundleManifestCss.d.ts.map +0 -1
- package/dist/plugin/helpers/collectBundleManifestCss.js +0 -2
- package/dist/plugin/helpers/createEventHandler.d.ts +0 -22
- package/dist/plugin/helpers/createEventHandler.d.ts.map +0 -1
- package/dist/plugin/helpers/createEventHandler.js +0 -36
- package/dist/plugin/helpers/createHandler.d.ts +0 -14
- package/dist/plugin/helpers/createHandler.d.ts.map +0 -1
- package/dist/plugin/helpers/createHandler.js +0 -75
- package/dist/plugin/helpers/createRscStream.d.ts +0 -26
- package/dist/plugin/helpers/createRscStream.d.ts.map +0 -1
- package/dist/plugin/helpers/createRscStream.js +0 -174
- package/dist/plugin/helpers/defaultFileWriter.d.ts +0 -2
- package/dist/plugin/helpers/defaultFileWriter.d.ts.map +0 -1
- package/dist/plugin/helpers/resolveComponents.d.ts +0 -27
- package/dist/plugin/helpers/resolveComponents.d.ts.map +0 -1
- package/dist/plugin/helpers/resolveComponents.js +0 -137
- package/dist/plugin/helpers/resolveUserComponents.d.ts +0 -33
- package/dist/plugin/helpers/resolveUserComponents.d.ts.map +0 -1
- package/dist/plugin/helpers/resolveUserComponents.js +0 -163
- package/dist/plugin/preserver/index.d.ts +0 -2
- package/dist/plugin/preserver/index.d.ts.map +0 -1
- package/dist/plugin/preserver/index.js +0 -1
- package/dist/plugin/preserver/plugin.d.ts +0 -3
- package/dist/plugin/preserver/plugin.d.ts.map +0 -1
- package/dist/plugin/preserver/plugin.js +0 -134
- package/dist/plugin/react-client/cleanupWorkerServerAction.d.ts +0 -11
- package/dist/plugin/react-client/cleanupWorkerServerAction.d.ts.map +0 -1
- package/dist/plugin/react-client/cleanupWorkerServerAction.js +0 -18
- package/dist/plugin/react-client/configureWorkerRequestHandler.d.ts +0 -17
- package/dist/plugin/react-client/configureWorkerRequestHandler.d.ts.map +0 -1
- package/dist/plugin/react-client/configureWorkerRequestHandler.js +0 -209
- package/dist/plugin/react-client/createWorkerStream.d.ts +0 -26
- package/dist/plugin/react-client/createWorkerStream.d.ts.map +0 -1
- package/dist/plugin/react-client/createWorkerStream.js +0 -163
- package/dist/plugin/react-client/handleWorkerRscStream.d.ts +0 -24
- package/dist/plugin/react-client/handleWorkerRscStream.d.ts.map +0 -1
- package/dist/plugin/react-client/handleWorkerRscStream.js +0 -99
- package/dist/plugin/react-client/handleWorkerServerAction.d.ts +0 -13
- package/dist/plugin/react-client/handleWorkerServerAction.d.ts.map +0 -1
- package/dist/plugin/react-client/handleWorkerServerAction.js +0 -62
- package/dist/plugin/react-client/restartWorker.d.ts +0 -12
- package/dist/plugin/react-client/restartWorker.d.ts.map +0 -1
- package/dist/plugin/react-client/restartWorker.js +0 -70
- package/dist/plugin/react-server/configureReactServer.d.ts +0 -10
- package/dist/plugin/react-server/configureReactServer.d.ts.map +0 -1
- package/dist/plugin/react-server/configureReactServer.js +0 -205
- package/dist/plugin/react-server/handleServerAction.d.ts +0 -6
- package/dist/plugin/react-server/handleServerAction.d.ts.map +0 -1
- package/dist/plugin/react-server/handleServerAction.js +0 -159
- package/dist/plugin/react-static/collectHtmlWorkerContent.d.ts +0 -25
- package/dist/plugin/react-static/collectHtmlWorkerContent.d.ts.map +0 -1
- package/dist/plugin/react-static/collectHtmlWorkerContent.js +0 -94
- package/dist/plugin/react-static/streamHandler.d.ts +0 -2
- package/dist/plugin/react-static/streamHandler.d.ts.map +0 -1
- package/dist/plugin/worker/html/createHtmlWorkerRenderState.d.ts +0 -12
- package/dist/plugin/worker/html/createHtmlWorkerRenderState.d.ts.map +0 -1
- package/dist/plugin/worker/html/createHtmlWorkerRenderState.js +0 -130
- package/dist/plugin/worker/html/sendHtmlWorkerMessage.d.ts +0 -3
- package/dist/plugin/worker/html/sendHtmlWorkerMessage.d.ts.map +0 -1
- package/dist/plugin/worker/html/sendHtmlWorkerMessage.js +0 -2
- package/dist/plugin/worker/rsc/handleRender.d.ts +0 -5
- package/dist/plugin/worker/rsc/handleRender.d.ts.map +0 -1
- package/dist/plugin/worker/rsc/handleRender.js +0 -140
- package/dist/plugin/worker/rsc/sendRscWorkerMessage.d.ts +0 -3
- package/dist/plugin/worker/rsc/sendRscWorkerMessage.d.ts.map +0 -1
- package/dist/plugin/worker/rsc/sendRscWorkerMessage.js +0 -11
- package/dist/plugin/worker/rsc/userOptions.d.ts +0 -2
- package/dist/plugin/worker/rsc/userOptions.d.ts.map +0 -1
- package/dist/plugin/worker/rsc/userOptions.js +0 -16
- package/plugin/helpers/collectBundleManifestCss.ts +0 -1
- package/plugin/helpers/createEventHandler.ts +0 -44
- package/plugin/helpers/createHandler.ts +0 -97
- package/plugin/helpers/createRscStream.tsx +0 -221
- package/plugin/helpers/defaultFileWriter.ts +0 -0
- package/plugin/helpers/resolveComponents.ts +0 -185
- package/plugin/helpers/resolveUserComponents.ts +0 -190
- package/plugin/preserver/index.ts +0 -1
- package/plugin/preserver/plugin.ts +0 -178
- package/plugin/react-client/cleanupWorkerServerAction.ts +0 -33
- package/plugin/react-client/configureWorkerRequestHandler.ts +0 -255
- package/plugin/react-client/createWorkerStream.ts +0 -210
- package/plugin/react-client/handleWorkerRscStream.ts +0 -156
- package/plugin/react-client/handleWorkerServerAction.ts +0 -96
- package/plugin/react-client/restartWorker.ts +0 -91
- package/plugin/react-server/configureReactServer.ts +0 -231
- package/plugin/react-server/handleServerAction.ts +0 -192
- package/plugin/react-static/collectHtmlWorkerContent.ts +0 -147
- package/plugin/react-static/streamHandler.ts +0 -0
- package/plugin/worker/html/createHtmlWorkerRenderState.tsx +0 -142
- package/plugin/worker/html/sendHtmlWorkerMessage.ts +0 -8
- package/plugin/worker/rsc/handleRender.ts +0 -175
- package/plugin/worker/rsc/sendRscWorkerMessage.ts +0 -7
- package/plugin/worker/rsc/userOptions.ts +0 -7
- /package/dist/plugin/config/{resolveDevServerConfig.js → createHandlerOptions.types.js} +0 -0
- /package/dist/plugin/{helpers/defaultFileWriter.js → dev-server/types.js} +0 -0
- /package/dist/plugin/{react-static/streamHandler.js → error/types.js} +0 -0
- /package/plugin/{config/resolveDevServerConfig.tsx → worker/worker-handlers.server.ts} +0 -0
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vite-plugin-react-server
|
|
3
|
+
* Copyright (c) Nico Brinkkemper
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
import 'node:worker_threads';
|
|
7
|
+
import { serializedOptions } from '../helpers/serializeUserOptions.js';
|
|
8
|
+
import { requestInfo } from '../helpers/requestInfo.js';
|
|
9
|
+
import { restartWorker } from './restartWorker.client.js';
|
|
10
|
+
import { handleRscStream } from '../stream/handleRscStream.client.js';
|
|
11
|
+
import { getRouteFiles } from '../helpers/getRouteFiles.js';
|
|
12
|
+
import { handleServerAction } from './handleServerAction.client.js';
|
|
13
|
+
import { handleError } from '../error/handleError.js';
|
|
14
|
+
import { getNodeEnv } from '../config/getNodeEnv.js';
|
|
15
|
+
import { setupGlobalErrorHandler, cleanupGlobalErrorHandler } from '../error/setupGlobalErrorHandler.js';
|
|
16
|
+
import { pipeToResponse } from '../helpers/pipeToResponse.js';
|
|
17
|
+
|
|
18
|
+
let hasInvalidatedModules = false;
|
|
19
|
+
function markModulesInvalidated() {
|
|
20
|
+
hasInvalidatedModules = true;
|
|
21
|
+
}
|
|
22
|
+
const configureRequestHandler = async function _configureWorkerRequestHandler({
|
|
23
|
+
server,
|
|
24
|
+
autoDiscoveredFiles,
|
|
25
|
+
userOptions: _userOptions,
|
|
26
|
+
configEnv,
|
|
27
|
+
hmrChannel,
|
|
28
|
+
onWorkerCreated
|
|
29
|
+
}) {
|
|
30
|
+
const logger = server.config.customLogger || server.config.logger;
|
|
31
|
+
const {
|
|
32
|
+
// remove these
|
|
33
|
+
moduleBaseURL: _moduleBaseURL,
|
|
34
|
+
...handlerUserOptions
|
|
35
|
+
} = _userOptions;
|
|
36
|
+
const handlerOptions = Object.assign({}, handlerUserOptions, {
|
|
37
|
+
moduleBaseURL: server.config.base,
|
|
38
|
+
projectRoot: _userOptions.projectRoot || server.config.root,
|
|
39
|
+
logger
|
|
40
|
+
});
|
|
41
|
+
setupGlobalErrorHandler({
|
|
42
|
+
panicThreshold: handlerOptions.panicThreshold,
|
|
43
|
+
logger,
|
|
44
|
+
verbose: handlerOptions.verbose
|
|
45
|
+
});
|
|
46
|
+
let currentWorker = null;
|
|
47
|
+
let restartWorkerForHMR = null;
|
|
48
|
+
server.ws.on("restart", async () => {
|
|
49
|
+
logger.info("[react-client] Server restarting, shutting down worker...");
|
|
50
|
+
if (currentWorker) {
|
|
51
|
+
currentWorker.postMessage({
|
|
52
|
+
type: "SHUTDOWN",
|
|
53
|
+
id: "*"
|
|
54
|
+
});
|
|
55
|
+
await new Promise((resolve, reject) => {
|
|
56
|
+
currentWorker?.on("message", (message) => {
|
|
57
|
+
if (message.type === "SHUTDOWN_COMPLETE") {
|
|
58
|
+
resolve(true);
|
|
59
|
+
} else {
|
|
60
|
+
reject("Did not receive SHUTDOWN_COMPLETE");
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
currentWorker.removeAllListeners();
|
|
65
|
+
currentWorker = null;
|
|
66
|
+
}
|
|
67
|
+
cleanupGlobalErrorHandler();
|
|
68
|
+
});
|
|
69
|
+
const handler = async (req, res, next) => {
|
|
70
|
+
if (!req.url) return next();
|
|
71
|
+
const info = requestInfo(req, handlerOptions, "");
|
|
72
|
+
const handlerOptionsWithUrl = {
|
|
73
|
+
...handlerOptions,
|
|
74
|
+
url: info.url
|
|
75
|
+
};
|
|
76
|
+
if (handlerOptions.verbose) {
|
|
77
|
+
server.config.logger.info(`[configureRequestHandler] handlerOptionsWithUrl.projectRoot: ${handlerOptionsWithUrl.projectRoot}`);
|
|
78
|
+
server.config.logger.info(`[configureRequestHandler] handlerOptions.projectRoot: ${handlerOptions.projectRoot}`);
|
|
79
|
+
}
|
|
80
|
+
const serializedUserOptions = serializedOptions(
|
|
81
|
+
handlerOptionsWithUrl,
|
|
82
|
+
autoDiscoveredFiles
|
|
83
|
+
);
|
|
84
|
+
if (!restartWorkerForHMR) {
|
|
85
|
+
restartWorkerForHMR = async () => {
|
|
86
|
+
if (currentWorker) {
|
|
87
|
+
currentWorker = await restartWorker({
|
|
88
|
+
server,
|
|
89
|
+
autoDiscoveredFiles,
|
|
90
|
+
userOptions: serializedUserOptions,
|
|
91
|
+
configEnv,
|
|
92
|
+
hmrChannel
|
|
93
|
+
});
|
|
94
|
+
if (currentWorker && restartWorkerForHMR) {
|
|
95
|
+
onWorkerCreated?.(currentWorker, restartWorkerForHMR);
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
currentWorker = await restartWorker({
|
|
99
|
+
server,
|
|
100
|
+
autoDiscoveredFiles,
|
|
101
|
+
userOptions: serializedUserOptions,
|
|
102
|
+
configEnv,
|
|
103
|
+
hmrChannel
|
|
104
|
+
});
|
|
105
|
+
if (currentWorker && restartWorkerForHMR) {
|
|
106
|
+
onWorkerCreated?.(currentWorker, restartWorkerForHMR);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (handlerOptions.verbose) {
|
|
112
|
+
server.config.logger.info(`[configureRequestHandler] serializedUserOptions.projectRoot: ${serializedUserOptions.projectRoot}`);
|
|
113
|
+
}
|
|
114
|
+
if (info.isServerActionRequest) {
|
|
115
|
+
if (!currentWorker) {
|
|
116
|
+
currentWorker = await restartWorker({
|
|
117
|
+
server,
|
|
118
|
+
autoDiscoveredFiles,
|
|
119
|
+
userOptions: serializedUserOptions,
|
|
120
|
+
configEnv,
|
|
121
|
+
hmrChannel
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
if (!currentWorker) {
|
|
125
|
+
throw new Error("Failed to start worker");
|
|
126
|
+
}
|
|
127
|
+
return handleServerAction(req, res, currentWorker, logger);
|
|
128
|
+
}
|
|
129
|
+
if (!info.isRscRequest) {
|
|
130
|
+
return next();
|
|
131
|
+
}
|
|
132
|
+
const routeFiles = await getRouteFiles(
|
|
133
|
+
info.route,
|
|
134
|
+
autoDiscoveredFiles,
|
|
135
|
+
handlerOptions,
|
|
136
|
+
logger
|
|
137
|
+
);
|
|
138
|
+
if (routeFiles.type === "error") {
|
|
139
|
+
const panicError = handleError({
|
|
140
|
+
error: routeFiles.error,
|
|
141
|
+
logger,
|
|
142
|
+
mode: getNodeEnv(server.config.mode),
|
|
143
|
+
panicThreshold: handlerOptions.panicThreshold,
|
|
144
|
+
critical: false});
|
|
145
|
+
if (panicError != null) {
|
|
146
|
+
throw panicError;
|
|
147
|
+
}
|
|
148
|
+
return next(routeFiles.error);
|
|
149
|
+
}
|
|
150
|
+
const pagePath = routeFiles.page;
|
|
151
|
+
const propsPath = routeFiles.props;
|
|
152
|
+
const rootPath = routeFiles.root;
|
|
153
|
+
let resolvedPageProps;
|
|
154
|
+
if (propsPath) {
|
|
155
|
+
try {
|
|
156
|
+
const fullPropsPath = `${handlerOptions.projectRoot}/${propsPath}`;
|
|
157
|
+
const serverEnv = server.environments?.["server"];
|
|
158
|
+
let propsModule;
|
|
159
|
+
if (handlerOptions.verbose) {
|
|
160
|
+
logger.info(`[configureRequestHandler] Pre-loading props from: ${fullPropsPath}`);
|
|
161
|
+
}
|
|
162
|
+
if (serverEnv && "runner" in serverEnv && serverEnv.runner) {
|
|
163
|
+
try {
|
|
164
|
+
propsModule = await serverEnv.runner.import(fullPropsPath);
|
|
165
|
+
} catch (runnerError) {
|
|
166
|
+
if (handlerOptions.verbose) {
|
|
167
|
+
logger.info(`[configureRequestHandler] Props will be loaded by worker (expected in dev:ssr mode)`);
|
|
168
|
+
}
|
|
169
|
+
propsModule = null;
|
|
170
|
+
}
|
|
171
|
+
} else {
|
|
172
|
+
propsModule = null;
|
|
173
|
+
}
|
|
174
|
+
const propsExportName = handlerOptions.propsExportName || "props";
|
|
175
|
+
if (propsModule) {
|
|
176
|
+
const propsExport = propsModule[propsExportName];
|
|
177
|
+
if (typeof propsExport === "function") {
|
|
178
|
+
let result = propsExport(info.url);
|
|
179
|
+
if (result instanceof Promise) {
|
|
180
|
+
result = await result;
|
|
181
|
+
}
|
|
182
|
+
resolvedPageProps = result;
|
|
183
|
+
if (handlerOptions.verbose) {
|
|
184
|
+
logger.info(`[configureRequestHandler] Pre-loaded props for ${info.route}: ${Object.keys(resolvedPageProps || {}).length} keys`);
|
|
185
|
+
}
|
|
186
|
+
} else if (propsExport && typeof propsExport === "object") {
|
|
187
|
+
resolvedPageProps = propsExport;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
} catch (error) {
|
|
191
|
+
if (handlerOptions.verbose) {
|
|
192
|
+
logger.warn(`[configureRequestHandler] Failed to pre-load props: ${error}`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
try {
|
|
197
|
+
res.setHeader("Content-Type", info.contentType);
|
|
198
|
+
res.setHeader("Transfer-Encoding", "chunked");
|
|
199
|
+
res.setHeader("Connection", "keep-alive");
|
|
200
|
+
res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
|
201
|
+
res.setHeader("Pragma", "no-cache");
|
|
202
|
+
res.setHeader("Expires", "0");
|
|
203
|
+
const userOnMetrics = handlerOptions.onMetrics;
|
|
204
|
+
if (!currentWorker) {
|
|
205
|
+
currentWorker = await restartWorker({
|
|
206
|
+
server,
|
|
207
|
+
autoDiscoveredFiles,
|
|
208
|
+
userOptions: serializedUserOptions,
|
|
209
|
+
configEnv,
|
|
210
|
+
hmrChannel
|
|
211
|
+
});
|
|
212
|
+
hasInvalidatedModules = false;
|
|
213
|
+
} else if (hasInvalidatedModules) {
|
|
214
|
+
logger.info(`[configureRequestHandler] Modules invalidated, restarting worker to clear Node.js module cache...`);
|
|
215
|
+
currentWorker = await restartWorker({
|
|
216
|
+
server,
|
|
217
|
+
autoDiscoveredFiles,
|
|
218
|
+
userOptions: serializedUserOptions,
|
|
219
|
+
configEnv,
|
|
220
|
+
hmrChannel
|
|
221
|
+
});
|
|
222
|
+
hasInvalidatedModules = false;
|
|
223
|
+
} else {
|
|
224
|
+
}
|
|
225
|
+
if (!currentWorker) {
|
|
226
|
+
throw new Error("Failed to start worker");
|
|
227
|
+
}
|
|
228
|
+
onWorkerCreated?.(currentWorker, restartWorkerForHMR);
|
|
229
|
+
const stream = handleRscStream({
|
|
230
|
+
options: {
|
|
231
|
+
...serializedUserOptions,
|
|
232
|
+
worker: currentWorker,
|
|
233
|
+
id: info.route,
|
|
234
|
+
type: "INIT",
|
|
235
|
+
logger,
|
|
236
|
+
// we make the worker stream aware of the route, pagePath, propsPath, rootPath, htmlPath
|
|
237
|
+
route: info.route,
|
|
238
|
+
url: info.url,
|
|
239
|
+
pagePath,
|
|
240
|
+
propsPath,
|
|
241
|
+
// Pass pre-resolved props (loaded via Vite's ssrLoadModule for proper transforms)
|
|
242
|
+
resolvedPageProps,
|
|
243
|
+
rootPath,
|
|
244
|
+
// CRITICAL: For RSC requests, use htmlPath: "" for headless mode (no Html wrapper)
|
|
245
|
+
// This prevents hydration errors where <html> would be rendered inside #root div
|
|
246
|
+
htmlPath: "",
|
|
247
|
+
// Empty string = headless RSC (no Html wrapper)
|
|
248
|
+
// Component overrides (undefined for file-based components in client dev)
|
|
249
|
+
HtmlComponent: void 0,
|
|
250
|
+
RootComponent: void 0,
|
|
251
|
+
// Use userOptions.projectRoot if available, otherwise fall back to server.config.root
|
|
252
|
+
projectRoot: serializedUserOptions.projectRoot || server.config.root,
|
|
253
|
+
build: {
|
|
254
|
+
...serializedUserOptions.build || {},
|
|
255
|
+
pages: Array.isArray(serializedUserOptions.build?.pages) ? serializedUserOptions.build.pages : []
|
|
256
|
+
},
|
|
257
|
+
manifest: {},
|
|
258
|
+
cssFiles: /* @__PURE__ */ new Map(),
|
|
259
|
+
globalCss: /* @__PURE__ */ new Map(),
|
|
260
|
+
serverPipeableStreamOptions: serializedUserOptions.serverPipeableStreamOptions,
|
|
261
|
+
clientPipeableStreamOptions: serializedUserOptions.clientPipeableStreamOptions
|
|
262
|
+
},
|
|
263
|
+
handlers: {
|
|
264
|
+
onMetrics: (id, metrics) => {
|
|
265
|
+
metrics.route = id;
|
|
266
|
+
userOnMetrics?.(metrics);
|
|
267
|
+
},
|
|
268
|
+
onHmrAccept: () => {
|
|
269
|
+
},
|
|
270
|
+
onHmrUpdate: () => {
|
|
271
|
+
},
|
|
272
|
+
onShellError: (_id, _error) => {
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
...handlerOptions
|
|
276
|
+
});
|
|
277
|
+
pipeToResponse({
|
|
278
|
+
stream,
|
|
279
|
+
response: res,
|
|
280
|
+
contentType: info.contentType,
|
|
281
|
+
logger,
|
|
282
|
+
verbose: handlerOptions.verbose,
|
|
283
|
+
panicThreshold: handlerOptions.panicThreshold,
|
|
284
|
+
context: "configureWorkerRequestHandler"
|
|
285
|
+
});
|
|
286
|
+
} catch (error) {
|
|
287
|
+
const panicError = handleError({
|
|
288
|
+
error,
|
|
289
|
+
logger,
|
|
290
|
+
mode: getNodeEnv(server.config.mode),
|
|
291
|
+
panicThreshold: handlerOptions.panicThreshold,
|
|
292
|
+
critical: false});
|
|
293
|
+
if (panicError != null) {
|
|
294
|
+
throw panicError;
|
|
295
|
+
}
|
|
296
|
+
if (!res.headersSent) {
|
|
297
|
+
res.statusCode = 500;
|
|
298
|
+
res.setHeader("Content-Type", "text/x-component; charset=utf-8");
|
|
299
|
+
}
|
|
300
|
+
res.end();
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
server.middlewares.use(handler);
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
export { configureRequestHandler, markModulesInvalidated };
|
|
307
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJlUmVxdWVzdEhhbmRsZXIuY2xpZW50LmpzIiwic291cmNlcyI6WyIuLi8uLi8uLi9wbHVnaW4vZGV2LXNlcnZlci9jb25maWd1cmVSZXF1ZXN0SGFuZGxlci5jbGllbnQudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBSZXF1ZXN0SGFuZGxlciB9IGZyb20gXCIuLi90eXBlcy5qc1wiO1xuaW1wb3J0IHsgdHlw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0gbnVsbDtcbiAgICBsZXQgcmVzdGFydFdvcmtlckZvckhNUjogKCgpID0+IFByb21pc2U8dm9pZD4pIHwgbnVsbCA9IG51bGw7XG5cbiAgICAvLyBIYW5kbGUgc2VydmVyIHJlc3RhcnRzXG4gICAgc2VydmVyLndzLm9uKFwicmVzdGFydFwiLCBhc3luYyAoKSA9PiB7XG4gICAgICBsb2dnZXIuaW5mbyhcIltyZWFjdC1jbGllbnRdIFNlcnZlciByZXN0YXJ0aW5nLCBzaHV0dGluZyBkb3duIHdvcmtlci4uLlwiKTtcbiAgICAgIGlmIChjdXJyZW50V29ya2VyKSB7XG4gICAgICAgIGN1cnJlbnRXb3JrZXIucG9zdE1lc3NhZ2Uoe1xuICAgICAgICAgIHR5cGU6IFwiU0hVVERPV05cIixcbiAgICAgICAgICBpZDogXCIqXCIsXG4gICAgICAgIH0gc2F0aXNmaWVzIFJzY1dvcmtlcklucHV0TWVzc2FnZSk7XG4gICAgICAgIGF3YWl0IG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgICAgICBjdXJyZW50V29ya2VyPy5vbihcIm1lc3NhZ2VcIiwgKG1lc3NhZ2UpID0+IHtcbiAgICAgICAgICAgIGlmIChtZXNzYWdlLnR5cGUgPT09IFwiU0hVVERPV05fQ09NUExFVEVcIikge1xuICAgICAgICAgICAgICByZXNvbHZlKHRydWUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmVqZWN0KFwiRGlkIG5vdCByZWNlaXZlIFNIVVRET1dOX0NPTVBMRVRFXCIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICAgICAgY3VycmVudFdvcmtlci5yZW1vdmVBbGxMaXN0ZW5lcnMoKTtcbiAgICAgICAgY3VycmVudFdvcmtlciA9IG51bGw7XG4gICAgICB9XG4gICAgICBcbiAgICAgIC8vIENsZWFuIHVwIGdsb2JhbCBlcnJvciBoYW5k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mVyZWRGaWxlc1xuICAgICAgKTtcbiAgICAgIFxuICAgICAgLy8gRGVmaW5lIHJlc3RhcnQgZnVuY3Rpb24gZm9yIEhNUiAobmVlZHMgc2VyaWFsaXplZFVzZXJPcHRpb25zKVxuICAgICAgaWYgKCFyZXN0YXJ0V29ya2VyRm9ySE1SKSB7XG4gICAgICAgIHJlc3RhcnRXb3JrZXJGb3JITVIgPSBhc3luYyAoKSA9PiB7XG4gICAgICAgICAgaWYgKGN1cnJlbnRXb3JrZXIpIHtcbiAgICAgICAgICAgIGN1cnJlbnRXb3JrZXIgPSBhd2FpdCByZXN0YXJ0V29ya2VyKHtcbiAgICAgICAgICAgICAgc2VydmVyLFxuICAgICAgICAgICAgICBhdXRvRGlzY292ZXJlZEZpbGVzLFxuICAgICAgICAgICAgICB1c2VyT3B0aW9uczogc2VyaWFsaXplZFVzZXJPcHRpb25zLFxuICAgICAgICAgICAgICBjb25maWdFbnY6IGNvbmZpZ0VudixcbiAgICAgICAgICAgICAgaG1yQ2hhbm5lbCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgaWYgKGN1cnJlbnRXb3JrZXIgJiYgcmVzdGFydFdvcmtlckZvckhNUikge1xuICAgICAgICAgICAgICBvbldvcmtlckNyZWF0ZWQ/LihjdXJyZW50V29ya2VyLCByZXN0YXJ0V29ya2VyRm9ySE1SKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gV29ya2VyIGRvZXNuJ3QgZXhpc3QgeWV0LCBjcmVhdGUgaXRcbiAgICAgICAgICAgIGN1cnJlbnRXb3JrZXIgPSBhd2FpdCByZXN0YXJ0V29ya2VyKHtcbiAgICAgICAgICAgICAgc2VydmVyLFxuICAgICAgICAgICAgICBhdXRvRGlzY292ZXJlZEZpbGVzLFxuICAgICAgICAgICAgICB1c2VyT3B0aW9uczogc2VyaWFsaXplZFVzZXJPcHRpb25zLFxuICAgICAgICAgICAgICBjb25maWdFbnY6IGNvbmZpZ0VudixcbiAgICAgICAgICAgICAgaG1yQ2hhbm5lbCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgaWYgKGN1cnJlbnRXb3JrZXIgJiYgcmVzdGFydFdvcmtlckZvckhNUikge1xuICAgICAgICAgICAgICBvbldvcmtlckNyZWF0ZWQ/LihjdXJyZW50V29ya2VyLCByZXN0YXJ0V29ya2VyRm9ySE1SKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICB9XG4gICAgICBcbiAgICAgIGlmIChoYW5kbGVyT3B0aW9ucy52ZXJib3NlKSB7XG4gICAgICAgIHNlcnZlci5jb25maWcubG9nZ2VyLmluZm8oYFtjb25maWd1cmVSZXF1ZXN0SGFuZGxlcl0gc2VyaWFsaXplZFVzZXJPcHRpb25zLnByb2plY3RSb290OiAke3NlcmlhbGl6ZWRVc2VyT3B0aW9ucy5wcm9qZWN0Um9vdH1gKTtcbiAgICAgIH1cblxuICAgICAgLy8gSGFuZGxlIHNlcnZlciBhY3Rpb24gcmVxdWVzdHNcbiAgICAgIGlmIChpbmZvLmlzU2VydmVyQWN0aW9uUmVxdWVzdCkge1xuICAgICAgICBpZiAoIWN1cnJlbnRXb3JrZXIpIHtcbiAgICAgICAgICBjdXJyZW50V29ya2VyID0gYXdhaXQgcmVzdGFydFdvcmtlcih7XG4gICAgICAgICAgICBzZXJ2ZXIsXG4gICAgICAgICAgICBhdXRvRGlzY292ZXJlZEZpbGVzLFxuICAgICAgICAgICAgdXNlck9wdGlvbnM6IHNlcmlhbGl6ZWRVc2VyT3B0aW9ucyxcbiAgICAgICAgICAgIGNvbmZpZ0VudjogY29uZmlnRW52LFxuICAgICAgICAgICAgaG1yQ2hhbm5lbCxcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWN1cnJlbnRXb3JrZXIpIHtcbiAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJGYWlsZWQgdG8g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QSxTQUFBLENBQVUsZ0JBQWdCLGlDQUFpQyxDQUFBO0FBQUE7QUFFakUsTUFBQSxHQUFBLENBQUksR0FBSSxFQUFBO0FBQUE7QUFDVixHQUNGO0FBRUEsRUFBTyxNQUFBLENBQUEsV0FBQSxDQUFZLElBQUksT0FBTyxDQUFBO0FBRWhDOzs7OyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configureRequestHandler.d.ts","sourceRoot":"","sources":["../../../plugin/dev-server/configureRequestHandler.ts"],"names":[],"mappings":"AAKA,eAAO,MAAQ,uBAAuB,KAErC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { getCondition } from "../config/getCondition.js";
|
|
2
|
+
const dir = new URL("./", import.meta.url).pathname.replace(/\/$/, "");
|
|
3
|
+
const condition = getCondition("");
|
|
4
|
+
export const { configureRequestHandler } = (await import(`${dir}/configureRequestHandler.${condition}.js`));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ConfigureWorkerRequestHandlerFn } from "../react-client/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Server version of configureRequestHandler - delegates to react-server's configureReactServer
|
|
4
|
+
*/
|
|
5
|
+
export declare const configureRequestHandler: ConfigureWorkerRequestHandlerFn;
|
|
6
|
+
//# sourceMappingURL=configureRequestHandler.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configureRequestHandler.server.d.ts","sourceRoot":"","sources":["../../../plugin/dev-server/configureRequestHandler.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAIhF;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,+BAsCrC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vite-plugin-react-server
|
|
3
|
+
* Copyright (c) Nico Brinkkemper
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
import { handleError } from '../error/handleError.js';
|
|
7
|
+
import { configureReactServer } from './configureReactServer.server.js';
|
|
8
|
+
|
|
9
|
+
const configureRequestHandler = async function _configureRequestHandler({
|
|
10
|
+
server,
|
|
11
|
+
autoDiscoveredFiles,
|
|
12
|
+
userOptions,
|
|
13
|
+
serverManifest,
|
|
14
|
+
resolvedConfig,
|
|
15
|
+
hmrChannel,
|
|
16
|
+
onWorkerCreated
|
|
17
|
+
}) {
|
|
18
|
+
try {
|
|
19
|
+
if (server.config.logger) {
|
|
20
|
+
server.config.logger.info("[configureRequestHandler:server] Delegating to react-server configureReactServer");
|
|
21
|
+
}
|
|
22
|
+
configureReactServer({
|
|
23
|
+
server,
|
|
24
|
+
autoDiscoveredFiles,
|
|
25
|
+
userOptions,
|
|
26
|
+
serverManifest,
|
|
27
|
+
resolvedConfig,
|
|
28
|
+
hmrChannel,
|
|
29
|
+
onWorkerCreated
|
|
30
|
+
});
|
|
31
|
+
} catch (error) {
|
|
32
|
+
const panicError = handleError({
|
|
33
|
+
error,
|
|
34
|
+
logger: server.config.logger,
|
|
35
|
+
panicThreshold: "none"});
|
|
36
|
+
if (panicError) {
|
|
37
|
+
throw panicError;
|
|
38
|
+
}
|
|
39
|
+
throw new Error("Failed to configure request handler");
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { configureRequestHandler };
|
|
44
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJlUmVxdWVzdEhhbmRsZXIuc2VydmVyLmpzIiwic291cmNlcyI6WyIuLi8uLi8uLi9wbHVnaW4vZGV2LXNlcnZlci9jb25maWd1cmVSZXF1ZXN0SGFuZGxlci5zZXJ2ZXIudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBDb25maWd1cmVXb3JrZXJSZXF1ZXN0SGFuZGxlckZuIH0gZnJvbSBcIi4uL3JlYWN0LW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BQSxNQUFBLENBQU8sTUFBTyxDQUFBLElBQUEsQ0FBSyxrRkFBa0YsQ0FBQTtBQUFBO0FBSzlHLElBQXFCLG9CQUFBLENBQUE7QUFBQSxNQUNuQixNQUFBO0FBQUEsTUFDQSxtQkFBQTtBQUFBLE1BQ0EsV0FBQTtBQUFBLE1BQ0EsY0FBQTtBQUFBLE1BQ0EsY0FBQTtBQUFBLE1BQ0EsVUFBQTtBQUFBLE1BQ0E7QUFBQSxLQUNELENBQUE7QUFBQSxXQUNNLEtBQU8sRUFBQTtBQUNkLElBQUEsTUFBTSxhQUFhLFdBQVksQ0FBQTtBQUFBLE1BQzdCLEtBQUE7QUFBQSxNQUNBLE1BQUEsRUFBUSxPQUFPLE1BQU8sQ0FBQSxNQUFBO0FBQUEsTUFDdEIsY0FBZ0IsRUFBQSxNQUVsQixDQUFDLENBQUE7QUFFRCxJQUFBLElBQUksVUFBWSxFQUFBO0FBQ2QsTUFBTSxNQUFBLFVBQUE7QUFBQTtBQUVSLElBQU0sTUFBQSxJQUFJLE1BQU0scUNBQXFDLENBQUE7QUFBQTtBQUV6RDs7OzsifQ==
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HandleWorkerServerActionFn } from "../react-client/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Handles server action requests in the worker scenario.
|
|
4
|
+
*
|
|
5
|
+
* @param req - The incoming request
|
|
6
|
+
* @param res - The response object
|
|
7
|
+
* @param worker - The worker thread
|
|
8
|
+
* @param logger - The Vite logger
|
|
9
|
+
*/
|
|
10
|
+
export declare const handleServerAction: HandleWorkerServerActionFn;
|
|
11
|
+
//# sourceMappingURL=handleServerAction.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleServerAction.client.d.ts","sourceRoot":"","sources":["../../../plugin/dev-server/handleServerAction.client.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAE3E;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,EAAE,0BAsG9B,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vite-plugin-react-server
|
|
3
|
+
* Copyright (c) Nico Brinkkemper
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
import { createServerActionStream, parseServerActionRequestBody, setupServerActionHeaders, handleServerActionError } from '../helpers/handleServerAction.js';
|
|
7
|
+
import { cleanupServerAction } from './cleanupServerAction.client.js';
|
|
8
|
+
|
|
9
|
+
const handleServerAction = async function _handleWorkerServerAction(req, res, worker, logger) {
|
|
10
|
+
let messageHandler = null;
|
|
11
|
+
const passThrough = createServerActionStream(res);
|
|
12
|
+
try {
|
|
13
|
+
const chunks = [];
|
|
14
|
+
for await (const chunk of req) {
|
|
15
|
+
chunks.push(chunk);
|
|
16
|
+
}
|
|
17
|
+
const body = Buffer.concat(chunks).toString();
|
|
18
|
+
const headerActionId = req.headers["x-rsc-action"];
|
|
19
|
+
const parsed = parseServerActionRequestBody(body, req.url);
|
|
20
|
+
const id = headerActionId || parsed.id;
|
|
21
|
+
const args = parsed.args;
|
|
22
|
+
setupServerActionHeaders(res);
|
|
23
|
+
worker.postMessage({
|
|
24
|
+
type: "SERVER_ACTION",
|
|
25
|
+
id,
|
|
26
|
+
args
|
|
27
|
+
});
|
|
28
|
+
messageHandler = (message) => {
|
|
29
|
+
try {
|
|
30
|
+
if (message.type === "RSC_CHUNK") {
|
|
31
|
+
passThrough.write(message.chunk);
|
|
32
|
+
} else if (message.type === "RSC_END") {
|
|
33
|
+
if (messageHandler) {
|
|
34
|
+
cleanupServerAction(passThrough, worker, messageHandler, res);
|
|
35
|
+
}
|
|
36
|
+
} else if (message.type === "SERVER_ACTION_RESPONSE") {
|
|
37
|
+
if (message.error?.message) {
|
|
38
|
+
logger.error(`[handleServerAction] Server action error: ${message.error?.message}`);
|
|
39
|
+
passThrough.write(`0:${JSON.stringify({ error: message.error.message })}
|
|
40
|
+
`);
|
|
41
|
+
} else if (typeof message.error === "string") {
|
|
42
|
+
logger.error(`[handleServerAction] Server action error: ${message.error}`);
|
|
43
|
+
passThrough.write(`0:${JSON.stringify({ error: message.error })}
|
|
44
|
+
`);
|
|
45
|
+
} else {
|
|
46
|
+
passThrough.write(`0:${JSON.stringify(message.result)}
|
|
47
|
+
`);
|
|
48
|
+
}
|
|
49
|
+
if (messageHandler) {
|
|
50
|
+
cleanupServerAction(passThrough, worker, messageHandler, res);
|
|
51
|
+
}
|
|
52
|
+
} else if (message.type === "ERROR") {
|
|
53
|
+
if (messageHandler) {
|
|
54
|
+
cleanupServerAction(
|
|
55
|
+
passThrough,
|
|
56
|
+
worker,
|
|
57
|
+
messageHandler,
|
|
58
|
+
res,
|
|
59
|
+
message.error,
|
|
60
|
+
logger
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
} catch (error) {
|
|
65
|
+
logger.error(`[handleServerAction] Message handler error: ${error}`);
|
|
66
|
+
if (messageHandler) {
|
|
67
|
+
cleanupServerAction(
|
|
68
|
+
passThrough,
|
|
69
|
+
worker,
|
|
70
|
+
messageHandler,
|
|
71
|
+
res,
|
|
72
|
+
error,
|
|
73
|
+
logger
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
worker.on("message", messageHandler);
|
|
79
|
+
passThrough.on("error", (error) => {
|
|
80
|
+
if (messageHandler) {
|
|
81
|
+
cleanupServerAction(
|
|
82
|
+
passThrough,
|
|
83
|
+
worker,
|
|
84
|
+
messageHandler,
|
|
85
|
+
res,
|
|
86
|
+
error,
|
|
87
|
+
logger
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
} catch (error) {
|
|
92
|
+
handleServerActionError(error, res, logger);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export { handleServerAction };
|
|
97
|
+
//# sourceMappingURL=data:application/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dpbGwgdW53cmFwIGl0XG4gICAgICAgICAgICAgIHBhc3NUaHJvdWdoLndyaXRlKGAwOiR7SlNPTi5zdHJpbmdpZnkobWVzc2FnZS5yZXN1bHQpfVxcbmApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1lc3NhZ2VIYW5kbGVyKSB7XG4gICAgICAgICAgICAgIGNsZWFudXBTZXJ2ZXJBY3Rpb24ocGFzc1Rocm91Z2gsIHdvcmtlciwgbWVzc2FnZUhhbmRsZXIsIHJlcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlLnR5cGUgPT09IFwiRVJST1JcIikge1xuICAgICAgICAgICAgaWYgKG1lc3NhZ2VIYW5kbGVyKSB7XG4gICAgICAgICAgICAgIGNsZWFudXBTZXJ2ZXJBY3Rpb24oXG4gICAgICAgICAgICAgICAgcGFzc1Rocm91Z2gsXG4gICAgICAgICAgICAgICAgd29ya2VyLFxuICAgICAgICAgICAgICAgIG1lc3NhZ2VIYW5kbGVyLFxuICAgICAgICAgICAgICAgIHJlcyxcbiAgICAgICAgICAgICAgICBtZXNzYWdlLmVycm9yLFxuICAgICAgICAgICAgICAgIGxvZ2dlclxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICBsb2dnZXIuZXJyb3IoYFtoYW5kbGVTZXJ2ZXJBY3Rpb25dIE1lc3NhZ2UgaGFuZGxlciBlcnJvcjogJHtlcnJvcn1gKTtcbiAgICAgICAgICBpZiAobWVzc2FnZUhhbmRsZXIpIHtcbiAgICAgICAgICAgIGNsZWFudXBTZXJ2ZXJBY3Rpb24oXG4gICAgICAgICAgICAgIHBhc3NUaHJvdWdoLFxuICAgICAgICAgICAgICB3b3JrZXIsXG4gICAgICAgICAgICAgIG1lc3NhZ2VIYW5kbGVyLFxuICAgICAgICAgICAgICByZXMsXG4gICAg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A,eAAO,MAAQ,kBAAkB,KAEhC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vite-plugin-react-server
|
|
3
|
+
* Copyright (c) Nico Brinkkemper
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
import { getCondition } from '../config/getCondition.js';
|
|
7
|
+
|
|
8
|
+
const dir = new URL("./", import.meta.url).pathname.replace(/\/$/, "");
|
|
9
|
+
const condition = getCondition("");
|
|
10
|
+
const { handleServerAction } = await import(`${dir}/handleServerAction.${condition}.js`);
|
|
11
|
+
|
|
12
|
+
export { handleServerAction };
|
|
13
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFuZGxlU2VydmVyQWN0aW9uLmpzIiwic291cmNlcyI6WyIuLi8uLi8uLi9wbHVnaW4vZGV2LXNlcnZlci9oYW5kbGVTZXJ2ZXJBY3Rpb24udHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgZ2V0Q29uZGl0aW9uIH0gZnJvbSBcIi4uL2NvbmZpZy9nZXRDb25kaXRpb24uanNcIjtcblxuY29uc3QgZGlyID0gbmV3IFVSTChcIi4vXCIsIGltcG9ydC5tZXRhLnVybCkucGF0aG5hbWUucmVwbGFjZSgvXFwvJC8sIFwiXCIpO1xuY29uc3QgY29uZGl0aW9uID0gZ2V0Q29uZGl0aW9uKFwiXCIpO1xuXG5leHBvcnQgY29uc3QgeyBoYW5kbGVTZXJ2ZXJBY3Rpb24gfSA9IChhd2FpdCBpbXBvcnQoYCR7ZGlyfS9oYW5kbGVTZXJ2ZXJBY3Rpb24uJHtjb25kaXRpb259LmpzYCkpIGFzIHtcbiAgaGFuZGxlU2VydmVyQWN0aW9uOiBhbnk7XG59OyAiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OztBQUVBLE1BQU0sR0FBQSxHQUFNLElBQUksR0FBQSxDQUFJLElBQU0sRUFBQSxNQUFBLENBQUEsSUFBQSxDQUFZLEdBQUcsQ0FBRSxDQUFBLFFBQUEsQ0FBUyxPQUFRLENBQUEsS0FBQSxFQUFPLEVBQUUsQ0FBQTtBQUNyRSxNQUFNLFNBQUEsR0FBWSxhQUFhLEVBQUUsQ0FBQTtBQUVwQixNQUFBLEVBQUUsb0JBQXdCLEdBQUEsTUFBTSxPQUFPLENBQUcsRUFBQSxHQUFHLHVCQUF1QixTQUFTLENBQUEsR0FBQSxDQUFBOzs7OyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleServerAction.server.d.ts","sourceRoot":"","sources":["../../../plugin/dev-server/handleServerAction.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAMvD,eAAO,MAAM,kBAAkB,EAAE,oBAG9B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vite-plugin-react-server
|
|
3
|
+
* Copyright (c) Nico Brinkkemper
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
import { assertReactServer } from '../config/getCondition.js';
|
|
7
|
+
import { handleServerActionWithViteServer } from '../helpers/handleServerAction.js';
|
|
8
|
+
|
|
9
|
+
assertReactServer();
|
|
10
|
+
const handleServerAction = async function _handleServerAction(req, res, server, handlerOptions) {
|
|
11
|
+
return handleServerActionWithViteServer(req, res, server, handlerOptions);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { handleServerAction };
|
|
15
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFuZGxlU2VydmVyQWN0aW9uLnNlcnZlci5qcyIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcGx1Z2luL2Rldi1zZXJ2ZXIvaGFuZGxlU2VydmVyQWN0aW9uLnNlcnZlci50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IEhhbmRsZVNlcnZlckFjdGlvbkZuIH0gZnJvbSBcIi4vdHlwZXMuanNcIjtcbmltcG9ydCB7IGFzc2VydFJlYWN0U2VydmVyIH0gZnJvbSBcIi4uL2NvbmZpZy9nZXRDb25kaXRpb24uanNcIjtcbmltcG9ydCB7IGhhbmRsZVNlcnZlckFjdGlvbldpdGhWaXRlU2VydmVyIH0gZnJvbSBcIi4uL2hlbHBlcnMvaGFuZGxlU2VydmVyQWN0aW9uLmpzXCI7XG5cbmFzc2VydFJlYWN0U2VydmVyKClcblxuZXhwb3J0IGNvbnN0IGhhbmRsZVNlcnZlckFjdGlvbjogSGFuZGxlU2VydmVyQWN0aW9uRm4gPVxuICBhc3luYyBmdW5jdGlvbiBfaGFuZGxlU2VydmVyQWN0aW9uKHJlcSwgcmVzLCBzZXJ2ZXIsIGhhbmRsZXJPcHRpb25zKSB7XG4gICAgcmV0dXJuIGhhbmRsZVNlcnZlckFjdGlvbldpdGhWaXRlU2VydmVyKHJlcSwgcmVzLCBzZXJ2ZXIsIGhhbmRsZXJPcHRpb25zKTtcbiAgfTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUlBLGlCQUFrQixFQUFBO0FBRVgsTUFBTSxxQkFDWCxlQUFlLG1CQUFBLENBQW9CLEdBQUssRUFBQSxHQUFBLEVBQUssUUFBUSxjQUFnQixFQUFBO0FBQ25FLEVBQUEsT0FBTyxnQ0FBaUMsQ0FBQSxHQUFBLEVBQUssR0FBSyxFQUFBLE1BQUEsRUFBUSxjQUFjLENBQUE7QUFDMUU7Ozs7In0=
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./handleServerAction.client.js";
|
|
2
|
+
export * from "./configureReactServer.client.js";
|
|
3
|
+
export * from "./cleanupServerAction.client.js";
|
|
4
|
+
export * from "./handleServerAction.client.js";
|
|
5
|
+
export * from "./configureRequestHandler.client.js";
|
|
6
|
+
export * from "./plugin.client.js";
|
|
7
|
+
//# sourceMappingURL=index.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../plugin/dev-server/index.client.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,oBAAoB,CAAC"}
|