vite-plugin-react-server 1.1.20 → 1.2.0-alpha.1
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 +95 -396
- package/dist/_virtual/dynamic-import-helper.js +1 -1
- package/dist/client.d.ts +2 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +6 -2
- package/dist/index.js +1 -1
- package/dist/package.json +58 -25
- package/dist/plugin/components/{css-collector-elements.d.ts → css.d.ts} +2 -2
- package/dist/plugin/components/css.d.ts.map +1 -0
- package/dist/plugin/components/css.js +33 -0
- package/dist/plugin/components/html.d.ts +1 -1
- package/dist/plugin/components/html.d.ts.map +1 -1
- package/dist/plugin/components/html.js +5 -5
- package/dist/plugin/components/index.d.ts +3 -3
- package/dist/plugin/components/index.d.ts.map +1 -1
- package/dist/plugin/components/index.js +9 -3
- package/dist/plugin/components/root.d.ts +7 -0
- package/dist/plugin/components/root.d.ts.map +1 -0
- package/dist/plugin/components/root.js +18 -0
- package/dist/plugin/config/autoDiscover/createGlobAutoDiscover.js +1 -1
- package/dist/plugin/config/autoDiscover/customWorkerFiles.js +1 -1
- package/dist/plugin/config/autoDiscover/pageAndPropFiles.js +1 -1
- package/dist/plugin/config/autoDiscover/resolveAutoDiscover.d.ts +5 -4
- package/dist/plugin/config/autoDiscover/resolveAutoDiscover.d.ts.map +1 -1
- package/dist/plugin/config/autoDiscover/resolveAutoDiscover.js +26 -7
- package/dist/plugin/config/autoDiscover/resolveBuildPages.d.ts +25 -2
- package/dist/plugin/config/autoDiscover/resolveBuildPages.d.ts.map +1 -1
- package/dist/plugin/config/autoDiscover/resolveBuildPages.js +84 -5
- package/dist/plugin/config/createModuleID.d.ts +3 -6
- package/dist/plugin/config/createModuleID.d.ts.map +1 -1
- package/dist/plugin/config/createModuleID.js +42 -32
- package/dist/plugin/config/defaults.d.ts +294 -121
- package/dist/plugin/config/defaults.d.ts.map +1 -1
- package/dist/plugin/config/defaults.js +156 -89
- package/dist/plugin/config/extMap.d.ts +6 -2
- package/dist/plugin/config/extMap.d.ts.map +1 -1
- package/dist/plugin/config/extMap.js +38 -48
- package/dist/plugin/config/flightBindings.d.ts +4 -0
- package/dist/plugin/config/flightBindings.d.ts.map +1 -0
- package/dist/plugin/config/flightBindings.js +215 -0
- package/dist/plugin/config/getCondition.d.ts +2 -0
- package/dist/plugin/config/getCondition.d.ts.map +1 -1
- package/dist/plugin/config/getCondition.js +4 -2
- package/dist/plugin/config/getPaths.js +1 -1
- package/dist/plugin/config/index.d.ts +17 -4
- package/dist/plugin/config/index.d.ts.map +1 -1
- package/dist/plugin/config/index.js +29 -7
- package/dist/plugin/config/interpolatePattern.d.ts +13 -0
- package/dist/plugin/config/interpolatePattern.d.ts.map +1 -0
- package/dist/plugin/config/interpolatePattern.js +13 -0
- package/dist/plugin/config/mimeTypes.js +1 -1
- package/dist/plugin/config/parsePattern.d.ts +25 -0
- package/dist/plugin/config/parsePattern.d.ts.map +1 -0
- package/dist/plugin/config/parsePattern.js +30 -0
- package/dist/plugin/config/resolveAllowedDirectives.d.ts +26 -0
- package/dist/plugin/config/resolveAllowedDirectives.d.ts.map +1 -0
- package/dist/plugin/config/resolveAllowedDirectives.js +35 -0
- package/dist/plugin/config/resolveDirectiveMatcher.d.ts +25 -0
- package/dist/plugin/config/resolveDirectiveMatcher.d.ts.map +1 -0
- package/dist/plugin/config/resolveDirectiveMatcher.js +33 -0
- 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 +45 -28
- package/dist/plugin/config/resolveOptions.d.ts +13 -3
- package/dist/plugin/config/resolveOptions.d.ts.map +1 -1
- package/dist/plugin/config/resolveOptions.js +230 -219
- package/dist/plugin/config/resolvePages.js +1 -1
- package/dist/plugin/config/resolvePatternWithValues.d.ts +39 -0
- package/dist/plugin/config/resolvePatternWithValues.d.ts.map +1 -0
- package/dist/plugin/config/resolvePatternWithValues.js +36 -0
- package/dist/plugin/config/resolveRegExp.d.ts +29 -0
- package/dist/plugin/config/resolveRegExp.d.ts.map +1 -0
- package/dist/plugin/config/resolveRegExp.js +39 -0
- package/dist/plugin/config/resolveUrlOption.d.ts +37 -6
- package/dist/plugin/config/resolveUrlOption.d.ts.map +1 -1
- package/dist/plugin/config/resolveUrlOption.js +42 -12
- package/dist/plugin/config/resolveUserConfig.d.ts +5 -4
- package/dist/plugin/config/resolveUserConfig.d.ts.map +1 -1
- package/dist/plugin/config/resolveUserConfig.js +98 -47
- package/dist/plugin/env/createConfigEnv.d.ts +7 -0
- package/dist/plugin/env/createConfigEnv.d.ts.map +1 -0
- package/dist/plugin/env/createConfigEnv.js +30 -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 +32 -0
- package/dist/plugin/env/getEnvKey.d.ts +40 -0
- package/dist/plugin/env/getEnvKey.d.ts.map +1 -0
- package/dist/plugin/env/getEnvKey.js +24 -0
- package/dist/plugin/env/index.d.ts +3 -0
- package/dist/plugin/env/index.d.ts.map +1 -1
- package/dist/plugin/env/index.js +3 -0
- package/dist/plugin/env/plugin.d.ts +6 -0
- package/dist/plugin/env/plugin.d.ts.map +1 -1
- package/dist/plugin/env/plugin.js +69 -93
- 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 +21 -0
- package/dist/plugin/error/directiveError.d.ts +13 -0
- package/dist/plugin/error/directiveError.d.ts.map +1 -0
- package/dist/plugin/error/directiveError.js +21 -0
- package/dist/plugin/error/enhanceError.d.ts +14 -0
- package/dist/plugin/error/enhanceError.d.ts.map +1 -0
- package/dist/plugin/error/enhanceError.js +24 -0
- package/dist/plugin/error/index.d.ts +4 -0
- package/dist/plugin/error/index.d.ts.map +1 -0
- package/dist/plugin/error/index.js +9 -0
- package/dist/plugin/error/logError.d.ts +3 -0
- package/dist/plugin/error/logError.d.ts.map +1 -0
- package/dist/plugin/error/logError.js +50 -0
- package/dist/plugin/error/serializeError.d.ts +7 -0
- package/dist/plugin/error/serializeError.d.ts.map +1 -0
- package/dist/plugin/error/serializeError.js +37 -0
- package/dist/plugin/error/toError.d.ts +1 -8
- package/dist/plugin/error/toError.d.ts.map +1 -1
- package/dist/plugin/error/toError.js +62 -34
- package/dist/plugin/file-preserver/plugin.js +93 -105
- package/dist/plugin/getNodeEnv.d.ts +11 -0
- package/dist/plugin/getNodeEnv.d.ts.map +1 -0
- package/dist/plugin/getNodeEnv.js +17 -0
- package/dist/plugin/helpers/cleanObject.d.ts.map +1 -1
- package/dist/plugin/helpers/cleanObject.js +2 -1
- package/dist/plugin/helpers/collectManifestCss.js +1 -1
- package/dist/plugin/helpers/collectViteModuleGraphCss.d.ts +6 -4
- package/dist/plugin/helpers/collectViteModuleGraphCss.d.ts.map +1 -1
- package/dist/plugin/helpers/collectViteModuleGraphCss.js +15 -9
- package/dist/plugin/helpers/createCssProps.d.ts +3 -4
- package/dist/plugin/helpers/createCssProps.d.ts.map +1 -1
- package/dist/plugin/helpers/createCssProps.js +16 -15
- package/dist/plugin/helpers/createEventHandler.d.ts +2 -2
- package/dist/plugin/helpers/createEventHandler.d.ts.map +1 -1
- package/dist/plugin/helpers/createEventHandler.js +1 -1
- package/dist/plugin/helpers/createHandler.d.ts +10 -8
- package/dist/plugin/helpers/createHandler.d.ts.map +1 -1
- package/dist/plugin/helpers/createHandler.js +11 -5
- package/dist/plugin/helpers/createRscStream.d.ts +18 -5
- package/dist/plugin/helpers/createRscStream.d.ts.map +1 -1
- package/dist/plugin/helpers/createRscStream.js +53 -15
- package/dist/plugin/helpers/formatMetrics.d.ts +1 -5
- package/dist/plugin/helpers/formatMetrics.d.ts.map +1 -1
- package/dist/plugin/helpers/formatMetrics.js +2 -39
- package/dist/plugin/helpers/getBundleManifest.d.ts.map +1 -1
- package/dist/plugin/helpers/getBundleManifest.js +9 -2
- package/dist/plugin/helpers/getRouteFiles.d.ts +30 -2
- package/dist/plugin/helpers/getRouteFiles.d.ts.map +1 -1
- package/dist/plugin/helpers/getRouteFiles.js +100 -8
- package/dist/plugin/helpers/handleServerAction.d.ts +8 -7
- package/dist/plugin/helpers/handleServerAction.d.ts.map +1 -1
- package/dist/plugin/helpers/handleServerAction.js +7 -3
- package/dist/plugin/helpers/hydrateUserOptions.d.ts +9 -0
- package/dist/plugin/helpers/hydrateUserOptions.d.ts.map +1 -0
- package/dist/plugin/helpers/hydrateUserOptions.js +22 -0
- package/dist/plugin/helpers/index.d.ts +2 -0
- package/dist/plugin/helpers/index.d.ts.map +1 -1
- package/dist/plugin/helpers/index.js +31 -31
- package/dist/plugin/helpers/inputNormalizer.d.ts +1 -1
- package/dist/plugin/helpers/inputNormalizer.d.ts.map +1 -1
- package/dist/plugin/helpers/inputNormalizer.js +33 -20
- package/dist/plugin/helpers/metrics.d.ts +4 -10
- package/dist/plugin/helpers/metrics.d.ts.map +1 -1
- package/dist/plugin/helpers/metrics.js +3 -59
- package/dist/plugin/helpers/moduleRefs.js +1 -1
- package/dist/plugin/helpers/moduleResolver.d.ts +24 -2
- package/dist/plugin/helpers/moduleResolver.d.ts.map +1 -1
- package/dist/plugin/helpers/moduleResolver.js +61 -22
- package/dist/plugin/helpers/requestInfo.d.ts +31 -4
- package/dist/plugin/helpers/requestInfo.d.ts.map +1 -1
- package/dist/plugin/helpers/requestInfo.js +62 -35
- package/dist/plugin/helpers/requestToRoute.d.ts +1 -1
- package/dist/plugin/helpers/requestToRoute.d.ts.map +1 -1
- package/dist/plugin/helpers/requestToRoute.js +17 -9
- package/dist/plugin/helpers/resolveComponent.d.ts +57 -0
- package/dist/plugin/helpers/resolveComponent.d.ts.map +1 -0
- package/dist/plugin/helpers/resolveComponent.js +71 -0
- package/dist/plugin/helpers/resolveComponents.d.ts +27 -0
- package/dist/plugin/helpers/resolveComponents.d.ts.map +1 -0
- package/dist/plugin/helpers/resolveComponents.js +146 -0
- package/dist/plugin/helpers/resolvePage.d.ts +15 -11
- package/dist/plugin/helpers/resolvePage.d.ts.map +1 -1
- package/dist/plugin/helpers/resolvePage.js +11 -7
- package/dist/plugin/helpers/resolvePageAndProps.d.ts +3 -10
- package/dist/plugin/helpers/resolvePageAndProps.d.ts.map +1 -1
- package/dist/plugin/helpers/resolvePageAndProps.js +28 -18
- package/dist/plugin/helpers/resolveProps.d.ts +13 -7
- package/dist/plugin/helpers/resolveProps.d.ts.map +1 -1
- package/dist/plugin/helpers/resolveProps.js +55 -25
- package/dist/plugin/helpers/resolveUserComponents.d.ts +33 -0
- package/dist/plugin/helpers/resolveUserComponents.d.ts.map +1 -0
- package/dist/plugin/helpers/resolveUserComponents.js +163 -0
- package/dist/plugin/helpers/serializeUserOptions.d.ts +7 -7
- package/dist/plugin/helpers/serializeUserOptions.d.ts.map +1 -1
- package/dist/plugin/helpers/serializeUserOptions.js +127 -42
- package/dist/plugin/helpers/stashReturnValue.d.ts +2 -1
- package/dist/plugin/helpers/stashReturnValue.d.ts.map +1 -1
- package/dist/plugin/helpers/stashReturnValue.js +6 -3
- package/dist/plugin/helpers/tryManifest.d.ts +1 -2
- package/dist/plugin/helpers/tryManifest.d.ts.map +1 -1
- package/dist/plugin/helpers/tryManifest.js +1 -1
- package/dist/plugin/loader/createDefaultLoader.d.ts +19 -8
- package/dist/plugin/loader/createDefaultLoader.d.ts.map +1 -1
- package/dist/plugin/loader/createDefaultLoader.js +69 -107
- package/dist/plugin/loader/createTransformer.d.ts +6 -0
- package/dist/plugin/loader/createTransformer.d.ts.map +1 -0
- package/dist/plugin/loader/createTransformer.js +92 -0
- package/dist/plugin/loader/{css-loader.development.d.ts → css-loader.d.ts} +6 -8
- package/dist/plugin/loader/css-loader.d.ts.map +1 -0
- package/dist/plugin/loader/css-loader.js +134 -0
- package/dist/plugin/loader/directives/addLocalExportedNames.d.ts +4 -0
- package/dist/plugin/loader/directives/addLocalExportedNames.d.ts.map +1 -0
- package/dist/plugin/loader/directives/addLocalExportedNames.js +57 -0
- package/dist/plugin/loader/directives/analyzeDirectives.d.ts +9 -0
- package/dist/plugin/loader/directives/analyzeDirectives.d.ts.map +1 -0
- package/dist/plugin/loader/directives/analyzeDirectives.js +221 -0
- package/dist/plugin/loader/directives/analyzeModule.d.ts +7 -0
- package/dist/plugin/loader/directives/analyzeModule.d.ts.map +1 -0
- package/dist/plugin/loader/directives/analyzeModule.js +48 -0
- package/dist/plugin/loader/directives/collectExports.d.ts +13 -0
- package/dist/plugin/loader/directives/collectExports.d.ts.map +1 -0
- package/dist/plugin/loader/directives/collectExports.js +116 -0
- package/dist/plugin/loader/directives/collectExportsFromModule.d.ts +6 -0
- package/dist/plugin/loader/directives/collectExportsFromModule.d.ts.map +1 -0
- package/dist/plugin/loader/directives/collectExportsFromModule.js +24 -0
- package/dist/plugin/loader/directives/findDirectiveMatches.d.ts +3 -0
- package/dist/plugin/loader/directives/findDirectiveMatches.d.ts.map +1 -0
- package/dist/plugin/loader/directives/findDirectiveMatches.js +46 -0
- package/dist/plugin/loader/directives/getExportedName.d.ts +3 -0
- package/dist/plugin/loader/directives/getExportedName.d.ts.map +1 -0
- package/dist/plugin/loader/directives/getExportedName.js +59 -0
- package/dist/plugin/loader/directives/getExports.d.ts +7 -0
- package/dist/plugin/loader/directives/getExports.d.ts.map +1 -0
- package/dist/plugin/loader/directives/getExports.js +28 -0
- package/dist/plugin/loader/directives/getFunctionBody.d.ts +3 -0
- package/dist/plugin/loader/directives/getFunctionBody.d.ts.map +1 -0
- package/dist/plugin/loader/directives/getFunctionBody.js +31 -0
- package/dist/plugin/loader/directives/getFunctionName.d.ts +10 -0
- package/dist/plugin/loader/directives/getFunctionName.d.ts.map +1 -0
- package/dist/plugin/loader/directives/getFunctionName.js +42 -0
- package/dist/plugin/loader/directives/getQualifiedName.d.ts +3 -0
- package/dist/plugin/loader/directives/getQualifiedName.d.ts.map +1 -0
- package/dist/plugin/loader/directives/getQualifiedName.js +65 -0
- package/dist/plugin/loader/directives/index.d.ts +14 -0
- package/dist/plugin/loader/directives/index.d.ts.map +1 -0
- package/dist/plugin/loader/directives/index.js +18 -0
- package/dist/plugin/loader/directives/processFunctionNode.d.ts +4 -0
- package/dist/plugin/loader/directives/processFunctionNode.d.ts.map +1 -0
- package/dist/plugin/loader/directives/processFunctionNode.js +86 -0
- package/dist/plugin/loader/directives/typeGuards.d.ts +37 -0
- package/dist/plugin/loader/directives/typeGuards.d.ts.map +1 -0
- package/dist/plugin/loader/directives/typeGuards.js +100 -0
- package/dist/plugin/loader/directives/types.d.ts +154 -0
- package/dist/plugin/loader/directives/types.d.ts.map +1 -0
- package/dist/plugin/loader/directives/utils.d.ts +14 -0
- package/dist/plugin/loader/directives/utils.d.ts.map +1 -0
- package/dist/plugin/loader/directives/utils.js +21 -0
- package/dist/plugin/loader/env-loader.d.ts +12 -0
- package/dist/plugin/loader/env-loader.d.ts.map +1 -0
- package/dist/plugin/loader/env-loader.js +88 -0
- package/dist/plugin/loader/index.d.ts +8 -1
- package/dist/plugin/loader/index.d.ts.map +1 -1
- package/dist/plugin/loader/index.js +13 -4
- package/dist/plugin/loader/parse.d.ts +12 -2
- package/dist/plugin/loader/parse.d.ts.map +1 -1
- package/dist/plugin/loader/parse.js +28 -5
- package/dist/plugin/loader/react-loader.d.ts +22 -1
- package/dist/plugin/loader/react-loader.d.ts.map +1 -1
- package/dist/plugin/loader/react-loader.js +169 -6
- package/dist/plugin/loader/removeDirectives.d.ts +5 -0
- package/dist/plugin/loader/removeDirectives.d.ts.map +1 -0
- package/dist/plugin/loader/removeDirectives.js +17 -0
- package/dist/plugin/loader/removeRanges.d.ts +5 -0
- package/dist/plugin/loader/removeRanges.d.ts.map +1 -0
- package/dist/plugin/loader/removeRanges.js +20 -0
- package/dist/plugin/loader/sourceMap.d.ts +16 -24
- package/dist/plugin/loader/sourceMap.d.ts.map +1 -1
- package/dist/plugin/loader/sourceMap.js +125 -97
- package/dist/plugin/loader/transformClientModule.d.ts +9 -0
- package/dist/plugin/loader/transformClientModule.d.ts.map +1 -0
- package/dist/plugin/loader/transformClientModule.js +46 -0
- package/dist/plugin/loader/transformModule.d.ts +6 -0
- package/dist/plugin/loader/transformModule.d.ts.map +1 -0
- package/dist/plugin/loader/transformModule.js +37 -0
- package/dist/plugin/loader/transformModuleIfNeeded.d.ts +12 -1
- package/dist/plugin/loader/transformModuleIfNeeded.d.ts.map +1 -1
- package/dist/plugin/loader/transformModuleIfNeeded.js +9 -20
- 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 +72 -0
- package/dist/plugin/loader/transformServerModule.d.ts +10 -0
- package/dist/plugin/loader/transformServerModule.d.ts.map +1 -0
- package/dist/plugin/loader/transformServerModule.js +103 -0
- package/dist/plugin/loader/transformWithAcornLoose.d.ts +12 -0
- package/dist/plugin/loader/transformWithAcornLoose.d.ts.map +1 -0
- package/dist/plugin/loader/transformWithAcornLoose.js +16 -0
- package/dist/plugin/loader/types.d.ts +48 -13
- package/dist/plugin/loader/types.d.ts.map +1 -1
- package/dist/plugin/metrics/collectStreamMetrics.d.ts +9 -0
- package/dist/plugin/metrics/collectStreamMetrics.d.ts.map +1 -0
- package/dist/plugin/metrics/collectStreamMetrics.js +35 -0
- package/dist/plugin/metrics/createRenderMetrics.d.ts +3 -0
- package/dist/plugin/metrics/createRenderMetrics.d.ts.map +1 -0
- package/dist/plugin/metrics/createRenderMetrics.js +24 -0
- package/dist/plugin/metrics/createStreamMetrics.d.ts +3 -0
- package/dist/plugin/metrics/createStreamMetrics.d.ts.map +1 -0
- package/dist/plugin/metrics/createStreamMetrics.js +19 -0
- package/dist/plugin/metrics/formatMetrics.d.ts +6 -3
- package/dist/plugin/metrics/formatMetrics.d.ts.map +1 -1
- package/dist/plugin/metrics/formatMetrics.js +5 -2
- package/dist/plugin/metrics/index.d.ts +3 -1
- package/dist/plugin/metrics/index.d.ts.map +1 -1
- package/dist/plugin/metrics/index.js +9 -1
- package/dist/plugin/metrics/types.d.ts +23 -0
- package/dist/plugin/metrics/types.d.ts.map +1 -0
- package/dist/plugin/metrics/types.js +1 -0
- package/dist/plugin/plugin.client.d.ts +23 -2
- package/dist/plugin/plugin.client.d.ts.map +1 -1
- package/dist/plugin/plugin.client.js +14 -9
- package/dist/plugin/plugin.server.d.ts +13 -2
- package/dist/plugin/plugin.server.d.ts.map +1 -1
- package/dist/plugin/plugin.server.js +15 -16
- package/dist/plugin/process-env.d.ts +18 -6
- package/dist/plugin/process-env.d.ts.map +1 -1
- package/dist/plugin/process-env.js +17 -0
- package/dist/plugin/react-client/cleanupWorkerServerAction.d.ts +11 -0
- package/dist/plugin/react-client/cleanupWorkerServerAction.d.ts.map +1 -0
- package/dist/plugin/react-client/cleanupWorkerServerAction.js +18 -0
- package/dist/plugin/react-client/configureWorkerRequestHandler.d.ts +9 -9
- package/dist/plugin/react-client/configureWorkerRequestHandler.d.ts.map +1 -1
- package/dist/plugin/react-client/configureWorkerRequestHandler.js +31 -26
- package/dist/plugin/react-client/createMessageHandlers.d.ts +1 -1
- package/dist/plugin/react-client/createMessageHandlers.d.ts.map +1 -1
- package/dist/plugin/react-client/createMessageHandlers.js +15 -3
- package/dist/plugin/react-client/createWorkerStream.d.ts +12 -10
- package/dist/plugin/react-client/createWorkerStream.d.ts.map +1 -1
- package/dist/plugin/react-client/createWorkerStream.js +27 -29
- package/dist/plugin/react-client/handleWorkerRscStream.d.ts +13 -8
- package/dist/plugin/react-client/handleWorkerRscStream.d.ts.map +1 -1
- package/dist/plugin/react-client/handleWorkerRscStream.js +51 -24
- package/dist/plugin/react-client/handleWorkerServerAction.d.ts +2 -1
- package/dist/plugin/react-client/handleWorkerServerAction.d.ts.map +1 -1
- package/dist/plugin/react-client/handleWorkerServerAction.js +43 -28
- package/dist/plugin/react-client/index.d.ts +4 -1
- package/dist/plugin/react-client/index.d.ts.map +1 -1
- package/dist/plugin/react-client/index.js +10 -1
- package/dist/plugin/react-client/plugin.d.ts +5 -3
- package/dist/plugin/react-client/plugin.d.ts.map +1 -1
- package/dist/plugin/react-client/plugin.js +9 -11
- package/dist/plugin/react-client/restartWorker.d.ts +5 -4
- package/dist/plugin/react-client/restartWorker.d.ts.map +1 -1
- package/dist/plugin/react-client/restartWorker.js +14 -13
- package/dist/plugin/react-server/configureReactServer.d.ts +5 -4
- package/dist/plugin/react-server/configureReactServer.d.ts.map +1 -1
- package/dist/plugin/react-server/configureReactServer.js +106 -47
- package/dist/plugin/react-server/handleServerAction.d.ts +3 -2
- package/dist/plugin/react-server/handleServerAction.d.ts.map +1 -1
- package/dist/plugin/react-server/handleServerAction.js +14 -20
- package/dist/plugin/react-server/plugin.d.ts +3 -4
- package/dist/plugin/react-server/plugin.d.ts.map +1 -1
- package/dist/plugin/react-server/plugin.js +30 -31
- package/dist/plugin/react-static/collectHtmlWorkerContent.d.ts +8 -6
- package/dist/plugin/react-static/collectHtmlWorkerContent.d.ts.map +1 -1
- package/dist/plugin/react-static/collectHtmlWorkerContent.js +4 -4
- package/dist/plugin/react-static/collectRscContent.d.ts +8 -6
- package/dist/plugin/react-static/collectRscContent.d.ts.map +1 -1
- package/dist/plugin/react-static/collectRscContent.js +4 -4
- package/dist/plugin/react-static/configurePreviewServer.d.ts +6 -4
- package/dist/plugin/react-static/configurePreviewServer.d.ts.map +1 -1
- package/dist/plugin/react-static/configurePreviewServer.js +32 -36
- package/dist/plugin/react-static/createBuildLoader.d.ts +5 -5
- package/dist/plugin/react-static/createBuildLoader.d.ts.map +1 -1
- package/dist/plugin/react-static/createBuildLoader.js +122 -30
- package/dist/plugin/react-static/fileWriter.js +1 -1
- package/dist/plugin/react-static/plugin.d.ts +3 -4
- package/dist/plugin/react-static/plugin.d.ts.map +1 -1
- package/dist/plugin/react-static/plugin.js +62 -47
- package/dist/plugin/react-static/renderPage.d.ts +4 -2
- package/dist/plugin/react-static/renderPage.d.ts.map +1 -1
- package/dist/plugin/react-static/renderPage.js +21 -17
- package/dist/plugin/react-static/renderPages.d.ts +4 -2
- package/dist/plugin/react-static/renderPages.d.ts.map +1 -1
- package/dist/plugin/react-static/renderPages.js +7 -6
- package/dist/plugin/react-static/renderStreams.d.ts +5 -22
- package/dist/plugin/react-static/renderStreams.d.ts.map +1 -1
- package/dist/plugin/react-static/renderStreams.js +6 -6
- package/dist/plugin/react-static/rscToHtmlStream.d.ts.map +1 -1
- package/dist/plugin/react-static/rscToHtmlStream.js +1 -1
- package/dist/plugin/react-static/temporaryReferences.js +1 -1
- package/dist/plugin/react-static/types.d.ts +0 -1
- package/dist/plugin/react-static/types.d.ts.map +1 -1
- package/dist/plugin/root.js +1 -1
- package/dist/plugin/transformer/plugin.client.d.ts +29 -1
- package/dist/plugin/transformer/plugin.client.d.ts.map +1 -1
- package/dist/plugin/transformer/plugin.client.js +96 -1
- package/dist/plugin/transformer/plugin.js +1 -1
- package/dist/plugin/transformer/plugin.server.d.ts +5 -3
- package/dist/plugin/transformer/plugin.server.d.ts.map +1 -1
- package/dist/plugin/transformer/plugin.server.js +60 -69
- package/dist/plugin/types/css-tracking.d.ts +2 -2
- package/dist/plugin/types/css-tracking.d.ts.map +1 -1
- package/dist/plugin/types.d.ts +451 -192
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/plugin/types.js +2 -1
- package/dist/plugin/utils/callServer.js +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 +1 -1
- package/dist/plugin/utils/createReactFetcher.d.ts +2 -3
- package/dist/plugin/utils/createReactFetcher.d.ts.map +1 -1
- package/dist/plugin/utils/createReactFetcher.js +1 -1
- package/dist/plugin/utils/env.js +1 -1
- package/dist/plugin/utils/envUrls.node.d.ts.map +1 -1
- package/dist/plugin/utils/envUrls.node.js +3 -2
- 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 +12 -5
- package/dist/plugin/utils/routeToURL.d.ts +12 -0
- package/dist/plugin/utils/routeToURL.d.ts.map +1 -0
- package/dist/plugin/utils/routeToURL.js +26 -0
- package/dist/plugin/utils/urls.d.ts.map +1 -1
- package/dist/plugin/utils/urls.js +5 -3
- package/dist/plugin/vendor/index.js +7 -1
- package/dist/plugin/vendor/vendor.client.js +1 -1
- package/dist/plugin/vendor/vendor.js +1 -1
- package/dist/plugin/vendor/vendor.server.js +1 -1
- package/dist/plugin/worker/createWorker.d.ts +31 -17
- package/dist/plugin/worker/createWorker.d.ts.map +1 -1
- package/dist/plugin/worker/createWorker.js +18 -12
- package/dist/plugin/worker/html/createHtmlWorkerRenderState.d.ts +2 -2
- package/dist/plugin/worker/html/createHtmlWorkerRenderState.d.ts.map +1 -1
- package/dist/plugin/worker/html/createHtmlWorkerRenderState.js +5 -2
- package/dist/plugin/worker/html/html-worker.development.js +3 -3
- package/dist/plugin/worker/html/html-worker.production.js +1 -1
- package/dist/plugin/worker/html/index.d.ts +1 -1
- package/dist/plugin/worker/html/index.d.ts.map +1 -1
- package/dist/plugin/worker/html/index.js +1 -1
- 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 +9 -11
- package/dist/plugin/worker/html/sendHtmlWorkerMessage.d.ts +3 -0
- package/dist/plugin/worker/html/sendHtmlWorkerMessage.d.ts.map +1 -0
- package/dist/plugin/worker/html/sendHtmlWorkerMessage.js +2 -0
- package/dist/plugin/worker/html/types.d.ts +20 -2
- package/dist/plugin/worker/html/types.d.ts.map +1 -1
- package/dist/plugin/worker/index.d.ts +3 -0
- package/dist/plugin/worker/index.d.ts.map +1 -0
- package/dist/plugin/worker/index.js +7 -0
- package/dist/plugin/worker/registerLoaders.js +2 -2
- package/dist/plugin/worker/rsc/handleRender.d.ts +5 -3
- package/dist/plugin/worker/rsc/handleRender.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/handleRender.js +57 -38
- package/dist/plugin/worker/rsc/handlers.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/handlers.js +19 -15
- package/dist/plugin/worker/rsc/index.d.ts +1 -1
- package/dist/plugin/worker/rsc/index.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/index.js +1 -1
- 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 +22 -8
- package/dist/plugin/worker/rsc/rsc-worker.development.js +77 -11
- package/dist/plugin/worker/rsc/rsc-worker.production.js +37 -8
- package/dist/plugin/worker/rsc/sendRscWorkerMessage.d.ts +3 -0
- package/dist/plugin/worker/rsc/sendRscWorkerMessage.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/sendRscWorkerMessage.js +11 -0
- package/dist/plugin/worker/rsc/state.js +1 -1
- package/dist/plugin/worker/rsc/types.d.ts +95 -0
- package/dist/plugin/worker/rsc/types.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/types.js +1 -0
- package/dist/plugin/worker/rsc/userOptions.d.ts +1 -1
- package/dist/plugin/worker/rsc/userOptions.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/userOptions.js +3 -4
- package/dist/plugin/worker/sendMessage.d.ts +3 -4
- package/dist/plugin/worker/sendMessage.d.ts.map +1 -1
- package/dist/plugin/worker/sendMessage.js +15 -5
- package/dist/plugin/worker/types.d.ts +109 -260
- package/dist/plugin/worker/types.d.ts.map +1 -1
- package/dist/server.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +59 -26
- package/plugin/components/{css-collector-elements.tsx → css.tsx} +3 -3
- package/plugin/components/html.tsx +4 -4
- package/plugin/components/index.ts +3 -3
- package/plugin/components/root.tsx +20 -0
- package/plugin/config/autoDiscover/resolveAutoDiscover.ts +173 -134
- package/plugin/config/autoDiscover/resolveBuildPages.ts +120 -7
- package/plugin/config/createModuleID.ts +60 -39
- package/plugin/config/defaults.tsx +189 -96
- package/plugin/config/extMap.ts +51 -56
- package/plugin/config/flightBindings.ts +221 -0
- package/plugin/config/getCondition.ts +6 -0
- package/plugin/config/index.ts +17 -4
- package/plugin/config/interpolatePattern.ts +19 -0
- package/plugin/config/parsePattern.ts +81 -0
- package/plugin/config/resolveAllowedDirectives.ts +59 -0
- package/plugin/config/resolveDirectiveMatcher.ts +57 -0
- package/plugin/config/resolveEnv.ts +41 -37
- package/plugin/config/resolveOptions.ts +437 -318
- package/plugin/config/resolvePatternWithValues.ts +70 -0
- package/plugin/config/resolveRegExp.ts +89 -0
- package/plugin/config/resolveUrlOption.ts +92 -20
- package/plugin/config/resolveUserConfig.ts +427 -351
- package/plugin/env/createConfigEnv.ts +40 -0
- package/plugin/env/getArgValue.ts +56 -0
- package/plugin/env/getEnvKey.ts +61 -0
- package/plugin/env/index.ts +4 -1
- package/plugin/env/plugin.ts +13 -18
- package/plugin/env/userConfigEnv.ts +22 -0
- package/plugin/error/directiveError.ts +29 -0
- package/plugin/error/enhanceError.ts +41 -0
- package/plugin/error/index.ts +3 -0
- package/plugin/error/logError.ts +48 -0
- package/plugin/error/serializeError.ts +34 -0
- package/plugin/error/toError.ts +75 -45
- package/plugin/file-preserver/plugin.ts +3 -3
- package/plugin/getNodeEnv.ts +24 -0
- package/plugin/helpers/cleanObject.ts +2 -1
- package/plugin/helpers/collectViteModuleGraphCss.ts +138 -118
- package/plugin/helpers/createCssProps.tsx +29 -30
- package/plugin/helpers/createEventHandler.ts +1 -1
- package/plugin/helpers/createHandler.ts +40 -12
- package/plugin/helpers/createRscStream.tsx +103 -36
- package/plugin/helpers/formatMetrics.ts +2 -37
- package/plugin/helpers/getBundleManifest.ts +10 -1
- package/plugin/helpers/getRouteFiles.ts +154 -9
- package/plugin/helpers/handleServerAction.ts +12 -7
- package/plugin/helpers/hydrateUserOptions.ts +23 -0
- package/plugin/helpers/index.ts +4 -0
- package/plugin/helpers/inputNormalizer.ts +44 -24
- package/plugin/helpers/metrics.ts +4 -64
- package/plugin/helpers/moduleResolver.ts +74 -19
- package/plugin/helpers/requestInfo.ts +95 -61
- package/plugin/helpers/requestToRoute.ts +38 -12
- package/plugin/helpers/resolveComponent.ts +173 -0
- package/plugin/helpers/resolveComponents.ts +202 -0
- package/plugin/helpers/resolvePage.ts +35 -29
- package/plugin/helpers/resolvePageAndProps.ts +82 -61
- package/plugin/helpers/resolveProps.ts +100 -37
- package/plugin/helpers/resolveUserComponents.ts +190 -0
- package/plugin/helpers/serializeUserOptions.ts +190 -69
- package/plugin/helpers/stashReturnValue.ts +7 -4
- package/plugin/helpers/tryManifest.ts +1 -1
- package/plugin/loader/createDefaultLoader.ts +119 -119
- package/plugin/loader/createTransformer.ts +110 -0
- package/plugin/loader/css-loader.ts +206 -0
- package/plugin/loader/directives/addLocalExportedNames.ts +78 -0
- package/plugin/loader/directives/analyzeDirectives.ts +298 -0
- package/plugin/loader/directives/analyzeModule.ts +57 -0
- package/plugin/loader/directives/collectExports.ts +181 -0
- package/plugin/loader/directives/collectExportsFromModule.ts +25 -0
- package/plugin/loader/directives/findDirectiveMatches.ts +58 -0
- package/plugin/loader/directives/getExportedName.ts +73 -0
- package/plugin/loader/directives/getExports.ts +27 -0
- package/plugin/loader/directives/getFunctionBody.ts +32 -0
- package/plugin/loader/directives/getFunctionName.ts +70 -0
- package/plugin/loader/directives/getQualifiedName.ts +76 -0
- package/plugin/loader/directives/index.ts +13 -0
- package/plugin/loader/directives/processFunctionNode.ts +97 -0
- package/plugin/loader/directives/typeGuards.ts +160 -0
- package/plugin/loader/directives/types.ts +174 -0
- package/plugin/loader/directives/utils.ts +35 -0
- package/plugin/loader/env-loader.ts +135 -0
- package/plugin/loader/index.ts +8 -6
- package/plugin/loader/parse.ts +42 -12
- package/plugin/loader/react-loader.ts +256 -4
- package/plugin/loader/removeDirectives.ts +14 -0
- package/plugin/loader/removeRanges.ts +21 -0
- package/plugin/loader/sourceMap.ts +174 -84
- package/plugin/loader/transformClientModule.ts +60 -0
- package/plugin/loader/transformModule.ts +59 -0
- package/plugin/loader/transformModuleIfNeeded.ts +40 -40
- package/plugin/loader/transformNonServerEnvironment.ts +95 -0
- package/plugin/loader/transformServerModule.ts +167 -0
- package/plugin/loader/transformWithAcornLoose.ts +27 -0
- package/plugin/loader/types.ts +58 -13
- package/plugin/metrics/collectStreamMetrics.ts +38 -0
- package/plugin/metrics/createRenderMetrics.ts +17 -0
- package/plugin/metrics/createStreamMetrics.ts +14 -0
- package/plugin/metrics/formatMetrics.ts +7 -3
- package/plugin/metrics/index.ts +3 -1
- package/plugin/metrics/types.ts +24 -0
- package/plugin/plugin.client.ts +43 -16
- package/plugin/plugin.server.ts +41 -21
- package/plugin/process-env.ts +27 -6
- package/plugin/react-client/cleanupWorkerServerAction.ts +33 -0
- package/plugin/react-client/configureWorkerRequestHandler.ts +206 -201
- package/plugin/react-client/createMessageHandlers.ts +17 -3
- package/plugin/react-client/createWorkerStream.ts +55 -51
- package/plugin/react-client/handleWorkerRscStream.ts +130 -61
- package/plugin/react-client/handleWorkerServerAction.ts +59 -37
- package/plugin/react-client/index.ts +4 -1
- package/plugin/react-client/plugin.ts +17 -18
- package/plugin/react-client/restartWorker.ts +74 -70
- package/plugin/react-server/configureReactServer.ts +204 -142
- package/plugin/react-server/handleServerAction.ts +156 -160
- package/plugin/react-server/plugin.ts +150 -157
- package/plugin/react-static/collectHtmlWorkerContent.ts +109 -102
- package/plugin/react-static/collectRscContent.ts +55 -51
- package/plugin/react-static/configurePreviewServer.ts +99 -100
- package/plugin/react-static/createBuildLoader.ts +157 -48
- package/plugin/react-static/plugin.ts +368 -357
- package/plugin/react-static/renderPage.ts +31 -24
- package/plugin/react-static/renderPages.ts +21 -14
- package/plugin/react-static/renderStreams.ts +13 -15
- package/plugin/react-static/rscToHtmlStream.ts +4 -6
- package/plugin/react-static/types.ts +0 -3
- package/plugin/transformer/README.md +82 -8
- package/plugin/transformer/plugin.client.ts +142 -0
- package/plugin/transformer/plugin.server.ts +87 -112
- package/plugin/types/css-tracking.ts +1 -1
- package/plugin/types/global.d.ts +2 -2
- package/plugin/types/react-server-dom-esm.d.ts +12 -13
- package/plugin/types.ts +684 -309
- package/plugin/utils/createCallServer.ts +5 -5
- package/plugin/utils/createReactFetcher.ts +4 -6
- package/plugin/utils/envUrls.node.ts +15 -10
- package/plugin/utils/index.ts +2 -1
- package/plugin/utils/routeToURL.ts +34 -0
- package/plugin/utils/urls.ts +10 -7
- package/plugin/worker/createWorker.ts +67 -34
- package/plugin/worker/html/README.md +10 -0
- package/plugin/worker/html/createHtmlWorkerRenderState.tsx +7 -4
- package/plugin/worker/html/html-worker.development.tsx +4 -3
- package/plugin/worker/html/index.ts +3 -1
- package/plugin/worker/html/messageHandler.tsx +10 -16
- package/plugin/worker/html/sendHtmlWorkerMessage.ts +8 -0
- package/plugin/worker/html/types.ts +67 -1
- package/plugin/worker/index.ts +2 -0
- package/plugin/worker/registerLoaders.ts +3 -3
- package/plugin/worker/rsc/README.md +203 -1
- package/plugin/worker/rsc/handleRender.ts +75 -45
- package/plugin/worker/rsc/handlers.ts +30 -22
- package/plugin/worker/rsc/index.ts +2 -0
- package/plugin/worker/rsc/messageHandler.tsx +23 -13
- package/plugin/worker/rsc/rsc-worker.development.ts +104 -17
- package/plugin/worker/rsc/rsc-worker.production.ts +57 -10
- package/plugin/worker/rsc/sendRscWorkerMessage.ts +7 -0
- package/plugin/worker/rsc/state.ts +1 -1
- package/plugin/worker/rsc/types.ts +185 -0
- package/plugin/worker/rsc/userOptions.ts +2 -3
- package/plugin/worker/sendMessage.ts +23 -14
- package/plugin/worker/types.ts +131 -386
- package/scripts/check-react-version.mjs +3 -3
- package/scripts/fix-unused-imports.mjs +77 -0
- package/tsconfig.json +1 -1
- package/dist/_virtual/dynamic-import-helper.js.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/plugin/components/css-collector-elements.d.ts.map +0 -1
- package/dist/plugin/components/css-collector-elements.js +0 -33
- package/dist/plugin/components/css-collector-elements.js.map +0 -1
- package/dist/plugin/components/css-collector.d.ts +0 -7
- package/dist/plugin/components/css-collector.d.ts.map +0 -1
- package/dist/plugin/components/css-collector.js +0 -18
- package/dist/plugin/components/css-collector.js.map +0 -1
- package/dist/plugin/components/html.js.map +0 -1
- package/dist/plugin/components.js +0 -9
- package/dist/plugin/components.js.map +0 -1
- package/dist/plugin/config/autoDiscover/createGlobAutoDiscover.js.map +0 -1
- package/dist/plugin/config/autoDiscover/customWorkerFiles.js.map +0 -1
- package/dist/plugin/config/autoDiscover/pageAndPropFiles.js.map +0 -1
- package/dist/plugin/config/autoDiscover/resolveAutoDiscover.js.map +0 -1
- package/dist/plugin/config/autoDiscover/resolveBuildPages.js.map +0 -1
- package/dist/plugin/config/defaults.js.map +0 -1
- package/dist/plugin/config/extMap.js.map +0 -1
- package/dist/plugin/config/getCondition.js.map +0 -1
- package/dist/plugin/config/getPaths.js.map +0 -1
- package/dist/plugin/config/mimeTypes.js.map +0 -1
- package/dist/plugin/config/resolveAutoDiscoverMatcher.d.ts +0 -5
- package/dist/plugin/config/resolveAutoDiscoverMatcher.d.ts.map +0 -1
- package/dist/plugin/config/resolveAutoDiscoverMatcher.js +0 -25
- package/dist/plugin/config/resolveAutoDiscoverMatcher.js.map +0 -1
- package/dist/plugin/config/resolveEnv.js.map +0 -1
- package/dist/plugin/config/resolveOptions.js.map +0 -1
- package/dist/plugin/config/resolvePages.js.map +0 -1
- package/dist/plugin/config/resolveUrlOption.js.map +0 -1
- package/dist/plugin/config/resolveUserConfig.js.map +0 -1
- package/dist/plugin/config.js +0 -17
- package/dist/plugin/config.js.map +0 -1
- package/dist/plugin/env.js +0 -79
- package/dist/plugin/env.js.map +0 -1
- package/dist/plugin/error/toError.js.map +0 -1
- package/dist/plugin/file-preserver.js +0 -96
- package/dist/plugin/file-preserver.js.map +0 -1
- package/dist/plugin/helpers/cleanObject.js.map +0 -1
- package/dist/plugin/helpers/collectManifestCss.js.map +0 -1
- package/dist/plugin/helpers/collectViteModuleGraphCss.js.map +0 -1
- package/dist/plugin/helpers/createCssProps.js.map +0 -1
- package/dist/plugin/helpers/createEventHandler.js.map +0 -1
- package/dist/plugin/helpers/createHandler.js.map +0 -1
- package/dist/plugin/helpers/createRscStream.js.map +0 -1
- package/dist/plugin/helpers/formatMetrics.js.map +0 -1
- package/dist/plugin/helpers/getBundleManifest.js.map +0 -1
- package/dist/plugin/helpers/getRouteFiles.js.map +0 -1
- package/dist/plugin/helpers/handleServerAction.js.map +0 -1
- package/dist/plugin/helpers/inputNormalizer.js.map +0 -1
- package/dist/plugin/helpers/metrics.js.map +0 -1
- package/dist/plugin/helpers/moduleRefs.js.map +0 -1
- package/dist/plugin/helpers/requestInfo.js.map +0 -1
- package/dist/plugin/helpers/requestToRoute.js.map +0 -1
- package/dist/plugin/helpers/resolvePage.js.map +0 -1
- package/dist/plugin/helpers/resolvePageAndProps.js.map +0 -1
- package/dist/plugin/helpers/resolveProps.js.map +0 -1
- package/dist/plugin/helpers/serializeUserOptions.js.map +0 -1
- package/dist/plugin/helpers/sourceMap.d.ts +0 -8
- package/dist/plugin/helpers/sourceMap.d.ts.map +0 -1
- package/dist/plugin/helpers/sourceMap.js +0 -136
- package/dist/plugin/helpers/stashReturnValue.js.map +0 -1
- package/dist/plugin/helpers/tryManifest.js.map +0 -1
- package/dist/plugin/helpers.js +0 -27
- package/dist/plugin/helpers.js.map +0 -1
- package/dist/plugin/loader/css-loader.development.d.ts.map +0 -1
- package/dist/plugin/loader/css-loader.development.js +0 -76
- package/dist/plugin/loader/css-loader.development.js.map +0 -1
- package/dist/plugin/loader/css-loader.production.d.ts +0 -31
- package/dist/plugin/loader/css-loader.production.d.ts.map +0 -1
- package/dist/plugin/loader/css-loader.production.js +0 -45
- package/dist/plugin/loader/css-loader.production.js.map +0 -1
- package/dist/plugin/loader/env-loader.development.d.ts +0 -13
- package/dist/plugin/loader/env-loader.development.d.ts.map +0 -1
- package/dist/plugin/loader/env-loader.development.js +0 -68
- package/dist/plugin/loader/handleExports.d.ts +0 -40
- package/dist/plugin/loader/handleExports.d.ts.map +0 -1
- package/dist/plugin/loader/handleExports.js +0 -209
- package/dist/plugin/loader/handleExports.js.map +0 -1
- package/dist/plugin/loader/parse.js.map +0 -1
- package/dist/plugin/loader/react-loader.client.d.ts +0 -2
- package/dist/plugin/loader/react-loader.client.d.ts.map +0 -1
- package/dist/plugin/loader/react-loader.client.js +0 -2
- package/dist/plugin/loader/react-loader.js.map +0 -1
- package/dist/plugin/loader/react-loader.server.d.ts +0 -21
- package/dist/plugin/loader/react-loader.server.d.ts.map +0 -1
- package/dist/plugin/loader/react-loader.server.js +0 -131
- package/dist/plugin/loader/transformModuleIfNeeded.js.map +0 -1
- package/dist/plugin/loader/transformModuleWithPreservedFunctions.d.ts +0 -48
- package/dist/plugin/loader/transformModuleWithPreservedFunctions.d.ts.map +0 -1
- package/dist/plugin/loader/transformModuleWithPreservedFunctions.js +0 -428
- package/dist/plugin/loader/transformModuleWithPreservedFunctions.js.map +0 -1
- package/dist/plugin/metrics/formatMetrics.js.map +0 -1
- package/dist/plugin/metrics.js +0 -7
- package/dist/plugin/metrics.js.map +0 -1
- package/dist/plugin/plugin.client.js.map +0 -1
- package/dist/plugin/plugin.server.js.map +0 -1
- 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 -130
- package/dist/plugin/preserver/plugin.js.map +0 -1
- package/dist/plugin/react-client/configureWorkerRequestHandler.js.map +0 -1
- package/dist/plugin/react-client/createMessageHandlers.js.map +0 -1
- package/dist/plugin/react-client/createWorkerStream.js.map +0 -1
- package/dist/plugin/react-client/handleWorkerRscStream.js.map +0 -1
- package/dist/plugin/react-client/handleWorkerServerAction.js.map +0 -1
- package/dist/plugin/react-client/plugin.js.map +0 -1
- package/dist/plugin/react-client/restartWorker.js.map +0 -1
- package/dist/plugin/react-server/configureReactServer.js.map +0 -1
- package/dist/plugin/react-server/handleServerAction.js.map +0 -1
- package/dist/plugin/react-server/plugin.js.map +0 -1
- package/dist/plugin/react-static/collectHtmlWorkerContent.js.map +0 -1
- package/dist/plugin/react-static/collectRscContent.js.map +0 -1
- package/dist/plugin/react-static/configurePreviewServer.js.map +0 -1
- package/dist/plugin/react-static/createBuildLoader.js.map +0 -1
- package/dist/plugin/react-static/fileWriter.js.map +0 -1
- package/dist/plugin/react-static/plugin.js.map +0 -1
- package/dist/plugin/react-static/renderPage.js.map +0 -1
- package/dist/plugin/react-static/renderPages.js.map +0 -1
- package/dist/plugin/react-static/renderStreams.js.map +0 -1
- package/dist/plugin/react-static/rscToHtmlStream.js.map +0 -1
- package/dist/plugin/react-static/streamHandler.d.ts +0 -2
- package/dist/plugin/react-static/streamHandler.d.ts.map +0 -1
- package/dist/plugin/react-static/temporaryReferences.js.map +0 -1
- package/dist/plugin/root.js.map +0 -1
- package/dist/plugin/source-map/createMappingsSerializer.d.ts +0 -2
- package/dist/plugin/source-map/createMappingsSerializer.d.ts.map +0 -1
- package/dist/plugin/source-map/createMappingsSerializer.js +0 -129
- package/dist/plugin/source-map/createMappingsSerializer.js.map +0 -1
- package/dist/plugin/source-map/readMappings.d.ts +0 -2
- package/dist/plugin/source-map/readMappings.d.ts.map +0 -1
- package/dist/plugin/source-map/readMappings.js +0 -200
- package/dist/plugin/transformer/plugin.js.map +0 -1
- package/dist/plugin/transformer/plugin.server.js.map +0 -1
- package/dist/plugin/utils/callServer.js.map +0 -1
- package/dist/plugin/utils/createCallServer.js.map +0 -1
- package/dist/plugin/utils/createReactFetcher.js.map +0 -1
- package/dist/plugin/utils/env.js.map +0 -1
- package/dist/plugin/utils/envUrls.node.js.map +0 -1
- package/dist/plugin/utils/urls.js.map +0 -1
- package/dist/plugin/utils.js +0 -11
- package/dist/plugin/utils.js.map +0 -1
- package/dist/plugin/vendor/vendor.client.js.map +0 -1
- package/dist/plugin/vendor/vendor.js.map +0 -1
- package/dist/plugin/vendor/vendor.server.js.map +0 -1
- package/dist/plugin/vendor.js +0 -7
- package/dist/plugin/vendor.js.map +0 -1
- package/dist/plugin/worker/createWorker.js.map +0 -1
- package/dist/plugin/worker/html/createHtmlWorkerRenderState.js.map +0 -1
- package/dist/plugin/worker/html/html-worker.development.js.map +0 -1
- package/dist/plugin/worker/html/html-worker.production.js.map +0 -1
- package/dist/plugin/worker/html/index.js.map +0 -1
- package/dist/plugin/worker/html/messageHandler.js.map +0 -1
- package/dist/plugin/worker/rsc/handleRender.js.map +0 -1
- package/dist/plugin/worker/rsc/handlers.js.map +0 -1
- package/dist/plugin/worker/rsc/index.js.map +0 -1
- package/dist/plugin/worker/rsc/messageHandler.js.map +0 -1
- package/dist/plugin/worker/rsc/rsc-worker.development.js.map +0 -1
- package/dist/plugin/worker/rsc/rsc-worker.production.js.map +0 -1
- package/dist/plugin/worker/rsc/state.js.map +0 -1
- package/dist/plugin/worker/rsc/userOptions.js.map +0 -1
- package/dist/plugin/worker/sendMessage.js.map +0 -1
- package/dist/server.js.map +0 -1
- package/plugin/components/css-collector.tsx +0 -20
- package/plugin/config/resolveAutoDiscoverMatcher.ts +0 -23
- package/plugin/helpers/sourceMap.ts +0 -182
- package/plugin/loader/css-loader.development.ts +0 -135
- package/plugin/loader/css-loader.production.ts +0 -84
- package/plugin/loader/env-loader.development.ts +0 -107
- package/plugin/loader/handleExports.ts +0 -309
- package/plugin/loader/react-loader.client.ts +0 -1
- package/plugin/loader/react-loader.server.ts +0 -185
- package/plugin/loader/transformModuleWithPreservedFunctions.ts +0 -593
- package/plugin/preserver/index.ts +0 -1
- package/plugin/preserver/plugin.ts +0 -178
- package/plugin/react-static/streamHandler.ts +0 -0
- package/plugin/source-map/createMappingsSerializer.ts +0 -181
- package/plugin/source-map/readMappings.ts +0 -194
- /package/dist/plugin/{react-static/streamHandler.js → loader/directives/types.js} +0 -0
package/plugin/worker/types.ts
CHANGED
|
@@ -1,439 +1,184 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
CreateHandlerOptions,
|
|
4
|
-
CssContent,
|
|
5
|
-
InlineCssOpt,
|
|
6
|
-
PagePropOpt,
|
|
7
|
-
StreamMetrics,
|
|
8
|
-
} from "../types.js";
|
|
9
|
-
import type { MessagePort } from "node:worker_threads";
|
|
1
|
+
import type { CssContent, StreamMetrics } from "../types.js";
|
|
10
2
|
|
|
11
3
|
// Base message types
|
|
12
|
-
export
|
|
4
|
+
export type WorkerMessage = {
|
|
13
5
|
type: string;
|
|
14
6
|
id: string;
|
|
15
7
|
}
|
|
16
8
|
|
|
17
|
-
//
|
|
18
|
-
export
|
|
19
|
-
identifierPrefix?: string;
|
|
20
|
-
namespaceURI?: string;
|
|
21
|
-
nonce?: string;
|
|
22
|
-
bootstrapScriptContent?: string;
|
|
23
|
-
bootstrapScripts?: string[];
|
|
24
|
-
bootstrapModules?: string[];
|
|
25
|
-
progressiveChunkSize?: number;
|
|
26
|
-
temporaryReferences?: WeakMap<any, any>;
|
|
27
|
-
moduleBaseURL?: string;
|
|
28
|
-
importMap?: {
|
|
29
|
-
imports?: Record<string, string>;
|
|
30
|
-
};
|
|
31
|
-
onError?: (error: Error, errorInfo?: any) => void;
|
|
32
|
-
onPostpone?: (reason: string) => void;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Combined options type that includes both React DOM and React Server DOM ESM options
|
|
36
|
-
export type SerializeableRenderToPipeableStreamOptions = Omit<RenderToPipeableStreamOptions, "onShellReady" | "onShellError" | "onAllReady" | "onError" | "onPostpone">;
|
|
37
|
-
|
|
38
|
-
export interface RscRenderState {
|
|
39
|
-
id: string;
|
|
40
|
-
outDir: string;
|
|
41
|
-
moduleRootPath: string;
|
|
42
|
-
moduleBaseURL: string;
|
|
43
|
-
rscOutputPath: string;
|
|
44
|
-
componentImport: string;
|
|
45
|
-
propsImport: string;
|
|
46
|
-
pipeableStreamOptions: ReactServerDomEsmOptions;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Common Messages
|
|
50
|
-
export interface ShutdownMessage extends WorkerMessage {
|
|
51
|
-
type: "SHUTDOWN";
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface ErrorMessage extends WorkerMessage {
|
|
9
|
+
// Common message types used across workers
|
|
10
|
+
export type ErrorMessage = {
|
|
55
11
|
type: "ERROR";
|
|
56
|
-
errorInfo?:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
stack?: string | undefined;
|
|
60
|
-
name: string;
|
|
61
|
-
cause?: any;
|
|
62
|
-
};
|
|
63
|
-
id: string;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface ChunkProcessedMessage extends WorkerMessage {
|
|
67
|
-
type: "CHUNK_PROCESSED";
|
|
68
|
-
success: boolean;
|
|
69
|
-
sequence?: number;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface ChunkErrorMessage extends WorkerMessage {
|
|
73
|
-
type: "CHUNK_ERROR";
|
|
74
|
-
error: string;
|
|
75
|
-
sequence?: number;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export type StreamHandlers = {
|
|
79
|
-
onError: (id: string, error: any, errorInfo?: any) => void;
|
|
80
|
-
onData: (id: string, data: any) => void;
|
|
81
|
-
onEnd: (id: string) => void;
|
|
82
|
-
onMetrics: (id: string, metrics: any) => void;
|
|
83
|
-
onHmrAccept: (id: string, routes?: string[]) => void;
|
|
84
|
-
onHmrUpdate: (id: string, routes?: string[]) => void;
|
|
85
|
-
onServerAction?: (id: string, args: unknown[]) => void;
|
|
86
|
-
onServerActionResponse?: (id: string, result?: unknown, error?: string) => void;
|
|
87
|
-
onServerModule?: (id: string, url: string, source: string) => void;
|
|
88
|
-
onShutdown?: (id: string) => void;
|
|
89
|
-
onCssFile?: (id: string, code: string) => void;
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
// RSC Messages
|
|
93
|
-
export type RscRenderMessage<T extends PagePropOpt = PagePropOpt> = WorkerMessage & {
|
|
94
|
-
type: "RSC_RENDER";
|
|
95
|
-
} & Omit<
|
|
96
|
-
CreateHandlerOptions,
|
|
97
|
-
| "onEvent"
|
|
98
|
-
| "onMetrics"
|
|
99
|
-
| "loader"
|
|
100
|
-
| "Html"
|
|
101
|
-
| "CssCollector"
|
|
102
|
-
| "logger"
|
|
103
|
-
| "build"
|
|
104
|
-
| "autoDiscover"
|
|
105
|
-
> & {
|
|
106
|
-
build: Omit<
|
|
107
|
-
CreateHandlerOptions<T>,
|
|
108
|
-
"entryFileNames" | "chunkFileNames" | "assetFileNames" | "pages"
|
|
109
|
-
> & {pages: string[]};
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export type RscChunkInputMessage = WorkerMessage &{
|
|
113
|
-
type: "RSC_CHUNK";
|
|
114
|
-
chunk: Buffer;
|
|
115
|
-
sequence: number;
|
|
12
|
+
errorInfo?: {
|
|
13
|
+
componentStack?: string | null;
|
|
14
|
+
digest?: string | null;
|
|
116
15
|
};
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
16
|
+
error:
|
|
17
|
+
| string
|
|
18
|
+
| {
|
|
19
|
+
message: string;
|
|
20
|
+
stack?: string | undefined;
|
|
21
|
+
name: string;
|
|
22
|
+
cause?: unknown;
|
|
23
|
+
};
|
|
120
24
|
id: string;
|
|
121
|
-
|
|
122
|
-
};
|
|
25
|
+
} & WorkerMessage
|
|
123
26
|
|
|
124
|
-
export
|
|
125
|
-
type: "
|
|
27
|
+
export type ReadyMessage = {
|
|
28
|
+
type: "READY";
|
|
126
29
|
id: string;
|
|
30
|
+
env?: string;
|
|
31
|
+
pid?: number;
|
|
127
32
|
}
|
|
128
33
|
|
|
129
|
-
export
|
|
130
|
-
type: "
|
|
34
|
+
export type ShutdownMessage = {
|
|
35
|
+
type: "SHUTDOWN";
|
|
36
|
+
} & WorkerMessage
|
|
37
|
+
|
|
38
|
+
export type ShutdownCompleteMessage = {
|
|
39
|
+
type: "SHUTDOWN_COMPLETE";
|
|
131
40
|
id: string;
|
|
132
|
-
metrics: StreamMetrics;
|
|
133
41
|
}
|
|
134
42
|
|
|
135
|
-
export
|
|
43
|
+
export type ShellReadyMessage = {
|
|
136
44
|
type: "SHELL_READY";
|
|
137
|
-
}
|
|
45
|
+
} & WorkerMessage
|
|
138
46
|
|
|
139
|
-
export
|
|
47
|
+
export type AllReadyMessage = {
|
|
140
48
|
type: "ALL_READY";
|
|
141
49
|
id: string;
|
|
142
|
-
}
|
|
50
|
+
} & WorkerMessage
|
|
143
51
|
|
|
144
|
-
export
|
|
52
|
+
export type ShellErrorMessage = {
|
|
145
53
|
type: "SHELL_ERROR";
|
|
146
54
|
id: string;
|
|
147
55
|
error: {
|
|
148
56
|
message: string;
|
|
149
57
|
stack?: string | undefined;
|
|
150
58
|
name: string;
|
|
151
|
-
cause?:
|
|
59
|
+
cause?: unknown;
|
|
152
60
|
};
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export interface CssFileMessage {
|
|
156
|
-
type: "CSS_FILE";
|
|
157
|
-
id: string;
|
|
158
|
-
content: string;
|
|
159
|
-
moduleClasses?: Record<string, string>;
|
|
160
|
-
originalClasses?: Record<string, string>;
|
|
161
|
-
usedClasses?: string[];
|
|
162
|
-
}
|
|
61
|
+
} & WorkerMessage
|
|
163
62
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
63
|
+
export type ChunkProcessedMessage = {
|
|
64
|
+
type: "CHUNK_PROCESSED";
|
|
65
|
+
success: boolean;
|
|
66
|
+
sequence?: number;
|
|
67
|
+
} & WorkerMessage
|
|
168
68
|
|
|
169
|
-
export type
|
|
170
|
-
type: "
|
|
171
|
-
|
|
172
|
-
|
|
69
|
+
export type ChunkErrorMessage = {
|
|
70
|
+
type: "CHUNK_ERROR";
|
|
71
|
+
error: string;
|
|
72
|
+
sequence?: number;
|
|
73
|
+
} & WorkerMessage
|
|
173
74
|
|
|
174
75
|
export type CleanupCompleteMessage = {
|
|
175
76
|
type: "CLEANUP_COMPLETE";
|
|
176
77
|
id: string;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export type RouteReadyMessage<InlineCss extends InlineCssOpt = InlineCssOpt> = {
|
|
180
|
-
type: "ROUTE_READY";
|
|
181
|
-
id: string;
|
|
182
|
-
moduleRootPath: string;
|
|
183
|
-
moduleBaseURL: string;
|
|
184
|
-
projectRoot: string;
|
|
185
|
-
cssFiles: Map<string, CssContent<InlineCss>>;
|
|
186
|
-
pipeableStreamOptions: Omit<ReactServerDomEsmOptions, "onError" | "onPostpone">;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// HTML Worker Messages
|
|
190
|
-
export type HtmlWorkerInputMessage =
|
|
191
|
-
| RscChunkInputMessage
|
|
192
|
-
| RscEndMessage
|
|
193
|
-
| ShutdownMessage
|
|
194
|
-
| CleanupMessage
|
|
195
|
-
| CleanupCompleteMessage
|
|
196
|
-
| InitializedReactLoaderMessage
|
|
197
|
-
| InitializedCssLoaderMessage
|
|
198
|
-
| RouteReadyMessage
|
|
199
|
-
|
|
200
|
-
export type HtmlChunkMessage = {
|
|
201
|
-
type: "HTML_CHUNK";
|
|
202
|
-
id: string;
|
|
203
|
-
chunk: string;
|
|
204
|
-
encoding: string;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
export type HtmlCompleteMessage = {
|
|
208
|
-
type: "HTML_COMPLETE";
|
|
209
|
-
id: string;
|
|
210
|
-
success: boolean;
|
|
211
|
-
html?: string;
|
|
212
|
-
chunks?: string[];
|
|
213
|
-
metrics?: StreamMetrics;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
export type HtmlWorkerOutputMessage =
|
|
217
|
-
| HtmlCompleteMessage
|
|
218
|
-
| ErrorMessage
|
|
219
|
-
| ShellReadyMessage
|
|
220
|
-
| ChunkProcessedMessage
|
|
221
|
-
| ChunkErrorMessage
|
|
222
|
-
| AllReadyMessage
|
|
223
|
-
| ShellErrorMessage
|
|
224
|
-
| HtmlChunkMessage
|
|
225
|
-
| ShutdownCompleteMessage
|
|
226
|
-
| HmrAcceptMessage
|
|
227
|
-
| ReadyMessage
|
|
228
|
-
| ServerActionMessage
|
|
229
|
-
| ServerActionResponseMessage
|
|
230
|
-
| ErrorMessage
|
|
231
|
-
| CleanupCompleteMessage
|
|
232
|
-
|
|
233
|
-
export type InitializedReactLoaderMessage = {
|
|
234
|
-
type: "INITIALIZED_REACT_LOADER";
|
|
235
|
-
id: string;
|
|
236
|
-
}
|
|
237
|
-
export type InitializedCssLoaderMessage = {
|
|
238
|
-
type: "INITIALIZED_CSS_LOADER";
|
|
239
|
-
id: string;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
export type InitializedRscWorkerLoaderMessage = {
|
|
243
|
-
type: "INITIALIZED_RSC_WORKER_LOADER";
|
|
244
|
-
id: string;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export type InitializedEnvLoaderMessage = {
|
|
248
|
-
type: "INITIALIZED_ENV_LOADER";
|
|
249
|
-
id: string;
|
|
250
|
-
env: Record<string, string>;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// HMR Messages
|
|
254
|
-
export type HmrMessage = {
|
|
255
|
-
id: string;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
export type HmrUpdateMessage = HmrMessage & {
|
|
259
|
-
type: "HMR_UPDATE";
|
|
260
|
-
routes?: string[];
|
|
261
|
-
timestamp?: number;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
export type HmrCleanupMessage = HmrMessage & {
|
|
265
|
-
type: "HMR_CLEANUP";
|
|
266
|
-
routes?: string[];
|
|
267
|
-
timestamp?: number;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
export type HmrAcceptMessage = HmrMessage & {
|
|
271
|
-
type: "HMR_ACCEPT";
|
|
272
|
-
routes?: string[];
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// RSC Worker Messages
|
|
276
|
-
export type RscWorkerInputMessage =
|
|
277
|
-
| RscRenderMessage
|
|
278
|
-
| CssFileMessage
|
|
279
|
-
| ShutdownMessage
|
|
280
|
-
| ChunkProcessedMessage
|
|
281
|
-
| ClientComponentMessage
|
|
282
|
-
| InitializedReactLoaderMessage
|
|
283
|
-
| InitializedCssLoaderMessage
|
|
284
|
-
| ModuleRequestMessage
|
|
285
|
-
| InitializedRscWorkerLoaderMessage
|
|
286
|
-
| InitializedEnvLoaderMessage
|
|
287
|
-
| HmrUpdateMessage
|
|
288
|
-
| HmrAcceptMessage
|
|
289
|
-
| HmrCleanupMessage
|
|
290
|
-
| CleanupCompleteMessage
|
|
291
|
-
| ServerActionMessage
|
|
292
|
-
| ServerActionResponseMessage
|
|
293
|
-
| ServerModuleMessage;
|
|
294
|
-
|
|
295
|
-
export interface CssFileRequestMessage extends WorkerMessage {
|
|
296
|
-
type: "CSS_FILE_REQUEST";
|
|
297
|
-
id: string;
|
|
298
|
-
path: string;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
export interface ClientComponentMessage extends WorkerMessage {
|
|
302
|
-
type: "CLIENT_COMPONENT";
|
|
303
|
-
url: string;
|
|
304
|
-
source: string;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
export interface ModuleRequestMessage extends WorkerMessage {
|
|
308
|
-
type: "MODULE_REQUEST";
|
|
309
|
-
id: string;
|
|
310
|
-
path: string;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
export interface ModuleResponseMessage extends WorkerMessage {
|
|
314
|
-
type: "MODULE_RESPONSE";
|
|
315
|
-
id: string;
|
|
316
|
-
module: any;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
export interface CssProcessedMessage extends WorkerMessage {
|
|
320
|
-
type: "CSS_PROCESSED";
|
|
321
|
-
id: string;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
export type ReadyMessage = {
|
|
325
|
-
type: "READY";
|
|
326
|
-
id: string;
|
|
327
|
-
env?: string;
|
|
328
|
-
pid?: number;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
export type ShutdownCompleteMessage = {
|
|
332
|
-
type: "SHUTDOWN_COMPLETE";
|
|
333
|
-
id: string;
|
|
334
|
-
}
|
|
78
|
+
} & WorkerMessage
|
|
335
79
|
|
|
336
|
-
export
|
|
80
|
+
export type ServerActionMessage = {
|
|
337
81
|
type: "SERVER_ACTION";
|
|
338
82
|
args: unknown[];
|
|
339
|
-
}
|
|
83
|
+
} & WorkerMessage
|
|
340
84
|
|
|
341
|
-
export
|
|
85
|
+
export type ServerActionResponseMessage = {
|
|
342
86
|
type: "SERVER_ACTION_RESPONSE";
|
|
343
87
|
id: string;
|
|
344
88
|
result?: unknown;
|
|
345
89
|
error?: string;
|
|
346
|
-
}
|
|
90
|
+
} & WorkerMessage
|
|
347
91
|
|
|
348
|
-
export type
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
| AllReadyMessage
|
|
353
|
-
| ErrorMessage
|
|
354
|
-
| CssFileMessage
|
|
355
|
-
| CssFileRequestMessage
|
|
356
|
-
| ClientComponentMessage
|
|
357
|
-
| ModuleRequestMessage
|
|
358
|
-
| ModuleResponseMessage
|
|
359
|
-
| CssProcessedMessage
|
|
360
|
-
| RscMetricsMessage
|
|
361
|
-
| HmrAcceptMessage
|
|
362
|
-
| HmrUpdateMessage
|
|
363
|
-
| ReadyMessage
|
|
364
|
-
| ServerActionMessage
|
|
365
|
-
| ServerActionResponseMessage
|
|
366
|
-
| ShutdownCompleteMessage
|
|
367
|
-
| ServerModuleMessage;
|
|
92
|
+
export type HmrAcceptMessage = {
|
|
93
|
+
type: "HMR_ACCEPT";
|
|
94
|
+
routes?: string[];
|
|
95
|
+
} & WorkerMessage
|
|
368
96
|
|
|
369
|
-
export
|
|
370
|
-
type: "
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
}
|
|
97
|
+
export type RscChunkMessage = {
|
|
98
|
+
type: "RSC_CHUNK";
|
|
99
|
+
chunk: Uint8Array;
|
|
100
|
+
sequence?: number;
|
|
101
|
+
} & WorkerMessage
|
|
375
102
|
|
|
376
|
-
export
|
|
377
|
-
type: "
|
|
378
|
-
|
|
379
|
-
key: string;
|
|
380
|
-
ref: unknown;
|
|
381
|
-
}
|
|
103
|
+
export type RscEndMessage = {
|
|
104
|
+
type: "RSC_END";
|
|
105
|
+
} & WorkerMessage
|
|
382
106
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
type: "RSC_CHUNK";
|
|
386
|
-
chunk: ArrayBufferLike;
|
|
107
|
+
export type RouteReadyMessage = {
|
|
108
|
+
type: "ROUTE_READY";
|
|
387
109
|
moduleRootPath: string;
|
|
388
110
|
moduleBaseURL: string;
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
error: Error;
|
|
413
|
-
};
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
export interface TransformResult {
|
|
417
|
-
code: string;
|
|
418
|
-
map?: any;
|
|
419
|
-
modules?: {
|
|
420
|
-
[key: string]: {
|
|
421
|
-
locals: Record<string, string>;
|
|
422
|
-
exports: Record<string, string>;
|
|
423
|
-
};
|
|
111
|
+
cssFiles: Map<string, CssContent>;
|
|
112
|
+
pipeableStreamOptions: {
|
|
113
|
+
identifierPrefix?: string;
|
|
114
|
+
namespaceURI?: string;
|
|
115
|
+
nonce?: string;
|
|
116
|
+
bootstrapScriptContent?: string;
|
|
117
|
+
bootstrapScripts?: Array<
|
|
118
|
+
| string
|
|
119
|
+
| {
|
|
120
|
+
src: string;
|
|
121
|
+
integrity?: string | undefined;
|
|
122
|
+
crossOrigin?: string | undefined;
|
|
123
|
+
}
|
|
124
|
+
>;
|
|
125
|
+
bootstrapModules?: Array<
|
|
126
|
+
| string
|
|
127
|
+
| {
|
|
128
|
+
src: string;
|
|
129
|
+
integrity?: string | undefined;
|
|
130
|
+
crossOrigin?: string | undefined;
|
|
131
|
+
}
|
|
132
|
+
>;
|
|
133
|
+
progressiveChunkSize?: number;
|
|
424
134
|
};
|
|
425
|
-
|
|
135
|
+
projectRoot: string;
|
|
136
|
+
} & WorkerMessage
|
|
426
137
|
|
|
427
|
-
export type
|
|
428
|
-
type: "
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
138
|
+
export type CleanupMessage = {
|
|
139
|
+
type: "CLEANUP";
|
|
140
|
+
} & WorkerMessage
|
|
141
|
+
|
|
142
|
+
// Common handlers
|
|
143
|
+
export type StreamHandlers = {
|
|
144
|
+
onError: (id: string, error: unknown, errorInfo?: {
|
|
145
|
+
componentStack?: string | null;
|
|
146
|
+
digest?: string | null;
|
|
147
|
+
} | Record<string, unknown>) => void;
|
|
148
|
+
onData: (id: string, data: Uint8Array) => void;
|
|
149
|
+
onEnd: (id: string) => void;
|
|
150
|
+
onMetrics: (id: string, metrics: StreamMetrics) => void;
|
|
151
|
+
onHmrAccept: (id: string, routes?: string[]) => void;
|
|
152
|
+
onHmrUpdate: (id: string, routes?: string[]) => void;
|
|
153
|
+
onServerAction?: (id: string, args: unknown[]) => void;
|
|
154
|
+
onServerActionResponse?: (
|
|
155
|
+
id: string,
|
|
156
|
+
result?: unknown,
|
|
157
|
+
error?: string
|
|
158
|
+
) => void;
|
|
159
|
+
onServerModule?: (id: string, url: string, source: string) => void;
|
|
160
|
+
onShutdown?: (id: string) => void;
|
|
161
|
+
onCssFile?: (id: string, code: string) => void;
|
|
433
162
|
};
|
|
434
163
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
164
|
+
// Common options
|
|
165
|
+
export type ReactServerDomEsmOptions = {
|
|
166
|
+
identifierPrefix?: string;
|
|
167
|
+
namespaceURI?: string;
|
|
168
|
+
nonce?: string;
|
|
169
|
+
bootstrapScriptContent?: string;
|
|
170
|
+
bootstrapScripts?: string[];
|
|
171
|
+
bootstrapModules?: string[];
|
|
172
|
+
progressiveChunkSize?: number;
|
|
173
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
174
|
+
temporaryReferences?: WeakMap<any, any>;
|
|
175
|
+
moduleBaseURL?: string;
|
|
176
|
+
importMap?: {
|
|
177
|
+
imports?: Record<string, string>;
|
|
178
|
+
};
|
|
179
|
+
onError?: (error: Error, errorInfo?: {
|
|
180
|
+
componentStack?: string | null;
|
|
181
|
+
digest?: string | null;
|
|
182
|
+
}) => void;
|
|
183
|
+
onPostpone?: (reason: string) => void;
|
|
439
184
|
}
|
|
@@ -8,11 +8,11 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
8
8
|
|
|
9
9
|
// Hardcoded template version from our last successful patch
|
|
10
10
|
const TEMPLATE_VERSION = "0.0.0-experimental-0ca8420f-20250504";
|
|
11
|
-
const [
|
|
11
|
+
const [_templateVersionNumber, templateVersionSuffix] = TEMPLATE_VERSION.split("-experimental-");
|
|
12
12
|
|
|
13
13
|
// Get installed version
|
|
14
14
|
const installedVersion = React.version;
|
|
15
|
-
const [
|
|
15
|
+
const [_installedVersionNumber, installedVersionSuffix] = installedVersion.split("-experimental-");
|
|
16
16
|
|
|
17
17
|
// Get peer dependency versions
|
|
18
18
|
const peerReactVersion = packageJSON.peerDependencies.react.replace("^", "");
|
|
@@ -55,7 +55,7 @@ async function main() {
|
|
|
55
55
|
|
|
56
56
|
// Process each patch
|
|
57
57
|
for (const { template, output } of patches) {
|
|
58
|
-
|
|
58
|
+
const patchContent = await fs.readFile(template, "utf-8");
|
|
59
59
|
// Write patched file
|
|
60
60
|
const outputPath = path.resolve(userPatchesDir, output);
|
|
61
61
|
await fs.writeFile(outputPath, patchContent);
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { readFileSync, writeFileSync } from 'fs';
|
|
4
|
+
import { execSync } from 'child_process';
|
|
5
|
+
|
|
6
|
+
// Get ESLint output
|
|
7
|
+
const eslintOutput = execSync('npx eslint plugin --format json', { encoding: 'utf8' });
|
|
8
|
+
const results = JSON.parse(eslintOutput);
|
|
9
|
+
|
|
10
|
+
const filesToFix = new Map();
|
|
11
|
+
|
|
12
|
+
// Process ESLint results
|
|
13
|
+
results.forEach(result => {
|
|
14
|
+
if (result.messages.length > 0) {
|
|
15
|
+
const unusedImports = result.messages
|
|
16
|
+
.filter(msg =>
|
|
17
|
+
msg.ruleId === '@typescript-eslint/no-unused-vars' &&
|
|
18
|
+
msg.message.includes('is defined but never used')
|
|
19
|
+
)
|
|
20
|
+
.map(msg => {
|
|
21
|
+
const match = msg.message.match(/'([^']+)'/);
|
|
22
|
+
return match ? match[1] : null;
|
|
23
|
+
})
|
|
24
|
+
.filter(Boolean);
|
|
25
|
+
|
|
26
|
+
if (unusedImports.length > 0) {
|
|
27
|
+
filesToFix.set(result.filePath, unusedImports);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Fix files
|
|
33
|
+
filesToFix.forEach((unusedImports, filePath) => {
|
|
34
|
+
console.log(`Fixing ${filePath.replace(process.cwd() + '/', '')}`);
|
|
35
|
+
console.log(` Removing: ${unusedImports.join(', ')}`);
|
|
36
|
+
|
|
37
|
+
const content = readFileSync(filePath, 'utf8');
|
|
38
|
+
const lines = content.split('\n');
|
|
39
|
+
|
|
40
|
+
// Remove import lines that only contain unused imports
|
|
41
|
+
const newLines = lines.filter(line => {
|
|
42
|
+
if (!line.trim().startsWith('import ')) return true;
|
|
43
|
+
|
|
44
|
+
// Check if this import line only contains unused imports
|
|
45
|
+
const hasUsedImports = !unusedImports.every(unused => {
|
|
46
|
+
return line.includes(unused) &&
|
|
47
|
+
!line.replace(new RegExp(`\\b${unused}\\b`, 'g'), '').match(/[a-zA-Z_$][a-zA-Z0-9_$]*/);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
return hasUsedImports;
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Also remove individual unused imports from mixed import lines
|
|
54
|
+
const finalLines = newLines.map(line => {
|
|
55
|
+
if (!line.trim().startsWith('import ')) return line;
|
|
56
|
+
|
|
57
|
+
let modifiedLine = line;
|
|
58
|
+
unusedImports.forEach(unused => {
|
|
59
|
+
// Remove from destructured imports
|
|
60
|
+
modifiedLine = modifiedLine.replace(new RegExp(`\\b${unused}\\b,?\\s*`, 'g'), '');
|
|
61
|
+
modifiedLine = modifiedLine.replace(/,\s*}/, ' }');
|
|
62
|
+
modifiedLine = modifiedLine.replace(/{\s*,/, '{ ');
|
|
63
|
+
modifiedLine = modifiedLine.replace(/{\s*}/, '{}');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// Remove empty import statements
|
|
67
|
+
if (modifiedLine.match(/import\s*{\s*}\s*from/)) {
|
|
68
|
+
return '';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return modifiedLine;
|
|
72
|
+
}).filter(line => line !== '');
|
|
73
|
+
|
|
74
|
+
writeFileSync(filePath, finalLines.join('\n'));
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
console.log(`Fixed ${filesToFix.size} files`);
|
package/tsconfig.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-import-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../index.ts"],"sourcesContent":["\"use strict\";\n\nconst condition = process.env['NODE_OPTIONS']?.match(/--conditions[= ]react-server/) ? 'server' : 'client'\n\nexport const vitePluginReactServer = await import(`./plugin/react-server/plugin.${condition}.js`).then(m => {\n if(!('vitePluginReactServer' in m)){\n throw new Error(`Could not find vitePluginReactServer in ./plugin/react-server/plugin.${condition}.js`);\n }\n return m['vitePluginReactServer']\n})\n\n// types\nexport type * from './plugin/types.js'"],"names":[],"mappings":";;;;;;;AAEA,MAAM,SAAA,GAAY,QAAQ,GAAI,CAAA,cAAc,GAAG,KAAM,CAAA,8BAA8B,IAAI,QAAW,GAAA,QAAA;AAE3F,MAAM,wBAAwB,MAAM,oCAAA,mCAAA,GAAA,CAAA,6BAAA,EAAA,SAAA,CAAA,GAAA,CAAA,EAAA,CAAA,CAAgD,CAAO,KAAK,CAAK,CAAA,KAAA;AAC1G,EAAG,IAAA,EAAE,2BAA2B,CAAG,CAAA,EAAA;AACjC,IAAA,MAAM,IAAI,KAAA,CAAM,CAAwE,qEAAA,EAAA,SAAS,CAAK,GAAA,CAAA,CAAA;AAAA;AAExG,EAAA,OAAO,EAAE,uBAAuB,CAAA;AAClC,CAAC;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"css-collector-elements.d.ts","sourceRoot":"","sources":["../../../plugin/components/css-collector-elements.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,eAAO,MAAM,oBAAoB,GAAI,eAElC;IACD,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,UAAU,EAAE,CAAC;CAClD,+BAiCA,CAAC"}
|