@reckona/mreact-router 0.0.181 → 0.0.182
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/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +20 -8
- package/dist/actions.js.map +1 -1
- package/dist/built-assets.d.ts.map +1 -1
- package/dist/built-assets.js +2 -2
- package/dist/built-assets.js.map +1 -1
- package/dist/cache-config.d.ts +1 -1
- package/dist/cache-config.d.ts.map +1 -1
- package/dist/cache-config.js.map +1 -1
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +18 -1
- package/dist/cache.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +16 -6
- package/dist/client.js.map +1 -1
- package/dist/csrf.js +10 -6
- package/dist/csrf.js.map +1 -1
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +14 -1
- package/dist/navigation.js.map +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +81 -38
- package/dist/render.js.map +1 -1
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +5 -3
- package/dist/vite.js.map +1 -1
- package/package.json +11 -11
- package/src/actions.ts +26 -9
- package/src/built-assets.ts +2 -3
- package/src/cache-config.ts +1 -0
- package/src/cache.ts +20 -1
- package/src/client.ts +16 -6
- package/src/csrf.ts +13 -6
- package/src/navigation.ts +16 -1
- package/src/render.ts +168 -70
- package/src/vite.ts +6 -3
package/dist/vite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAQA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,UAAU,EAEhB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE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6B,CAC3C,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,kBAAkB,CAc5B;AA4FD;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,CAAA;CAAO,GACjF,OAAO,CAAC,QAAQ,CAAC,CAuEnB"}
|
package/dist/vite.js
CHANGED
|
@@ -110,6 +110,7 @@ export function createAppRouterVitePlugin(options) {
|
|
|
110
110
|
// built-in CSS plugin) whose `transform` requires a dev-server environment the
|
|
111
111
|
// lightweight navigation scan cannot provide. Mirrors what the build forwards.
|
|
112
112
|
let userVitePlugins;
|
|
113
|
+
let devServerModuleCacheVersion = 0;
|
|
113
114
|
const plugin = {
|
|
114
115
|
[mreactRouterConfigKey]: {
|
|
115
116
|
...project,
|
|
@@ -159,6 +160,7 @@ export function createAppRouterVitePlugin(options) {
|
|
|
159
160
|
const middlewareOptions = {
|
|
160
161
|
...options,
|
|
161
162
|
define: server.config.define,
|
|
163
|
+
devServerModuleCacheVersion: () => `dev:${devServerModuleCacheVersion}`,
|
|
162
164
|
navigationScanVitePlugins: userVitePlugins ?? [],
|
|
163
165
|
viteDevServer: server,
|
|
164
166
|
vitePlugins: server.config.plugins,
|
|
@@ -171,6 +173,7 @@ export function createAppRouterVitePlugin(options) {
|
|
|
171
173
|
if (!normalizedSourceDirs.some((directory) => normalizedFile.startsWith(directory))) {
|
|
172
174
|
return;
|
|
173
175
|
}
|
|
176
|
+
devServerModuleCacheVersion += 1;
|
|
174
177
|
const timestamp = Date.now();
|
|
175
178
|
const updates = Array.from(context.server.moduleGraph.idToModuleMap.values())
|
|
176
179
|
.filter((moduleNode) => isMreactClientDevModuleId(moduleNode.id))
|
|
@@ -409,6 +412,7 @@ async function handleAppRouterViteRequest(options, incoming, outgoing, next) {
|
|
|
409
412
|
routeMatcher,
|
|
410
413
|
routes,
|
|
411
414
|
serverActions: options.serverActions,
|
|
415
|
+
devServerModuleCacheVersion: options.devServerModuleCacheVersion?.(),
|
|
412
416
|
vitePlugins: routeTransformPlugins,
|
|
413
417
|
}));
|
|
414
418
|
}
|
|
@@ -632,9 +636,7 @@ async function devNavigationScripts(appDir, routes, readSource, inferenceCache,
|
|
|
632
636
|
if (navigationRuntimeDiagnostic !== undefined) {
|
|
633
637
|
console.warn(formatClientRouteInferenceDiagnostic(navigationRuntimeDiagnostic));
|
|
634
638
|
}
|
|
635
|
-
return navigation
|
|
636
|
-
? [route.path, navigationRuntimeScriptForDev()]
|
|
637
|
-
: undefined;
|
|
639
|
+
return navigation ? [route.path, navigationRuntimeScriptForDev()] : undefined;
|
|
638
640
|
}));
|
|
639
641
|
return new Map(entries.filter((entry) => entry !== undefined));
|
|
640
642
|
}
|
package/dist/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,aAAa,GAMd,MAAM,MAAM,CAAC;AAGd,OAAO,EACL,8BAA8B,GAG/B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,oCAAoC,EACpC,mBAAmB,EACnB,uCAAuC,EACvC,wBAAwB,GAEzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,2BAA2B,EAC3B,mBAAmB,EACnB,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC;AAC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CAAC;gBACb,OAAO;YACT,CAAC;YACD,QAAQ,GAAG,IAAI,CAAC;YAChB,QAAQ,CAAC,GAAG,GAAG,WAAW,CAAC;YAC3B,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;gBACjC,OAAO,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACN,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,cAAc,CAAC;YAC3C,CAAC;QACH,CAAC,CAAC;QAEF,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACrD,YAAY,CAAC,GAAG,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;QACxC,QAAQ,CAAC,GAAG,GAAG,GAAG,UAAU,IAAI,YAAY,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC1D,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,oBAAoB,CAAC;QAC/C,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACjC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAChC,IAAI,EAAE,CAAC;IACT,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAO;;;;EAIP,IAAI;;;;;;;;;;CAUL,CAAC;AACF,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport type { ServerResponse } from \"node:http\";\nimport { dirname } from \"node:path\";\nimport { formatDiagnostic } from \"@reckona/mreact-compiler\";\nimport {\n createCompilerModuleContext,\n transformCompilerModuleContext,\n} from \"@reckona/mreact-compiler/internal\";\nimport {\n normalizePath,\n type Connect,\n type Plugin,\n type PluginOption,\n type UserConfig,\n type ViteDevServer,\n} from \"vite\";\nimport type { AppRouterServerActionOptions } from \"./actions.js\";\nimport type { AppRouterCache } from \"./cache.js\";\nimport {\n resolveAppRouterProjectOptions,\n type AppRouterProjectOptions,\n type ResolvedAppRouterProject,\n} from \"./config.js\";\nimport type { AppRouterImportPolicy } from \"./import-policy.js\";\nimport {\n collectClientRouteReferences,\n createClientRouteInferenceCache,\n formatClientRouteInferenceDiagnostic,\n isClientRouteSource,\n navigationRuntimeLinkDisabledDiagnostic,\n resolveNavigationRuntime,\n type ClientRouteInferenceCache,\n} from \"./client-route-inference.js\";\nimport {\n buildNavigationRuntimeBundle,\n buildClientRouteBundle,\n buildClientRouteEntrySource,\n clientScriptForPath,\n navigationRuntimeScriptForDev,\n} from \"./navigation-runtime.js\";\nimport { nodeRequestToWebRequest, sendResponse } from \"./http.js\";\nimport type { AppRouterLogger } from \"./logger.js\";\nimport { renderAppRequest } from \"./render.js\";\nimport { stripRouteClientOnlyExports } from \"./route-source.js\";\nimport {\n collectRouteCssHrefs,\n collectSpecialBoundaryFiles,\n createCachedRouteSourceReader,\n} from \"./route-styles.js\";\nimport { createRouteMatcher, scanAppRoutes, type AppRoute } from \"./routes.js\";\nimport { resolveRequestHost, type RequestHostPolicy } from \"./serve.js\";\nimport { hasJsxSyntax } from \"./source-jsx.js\";\nimport { prependTailwindSourceDirectives } from \"./tailwind-source.js\";\nimport { workspacePackageFile } from \"./workspace-packages.js\";\n\n/**\n * Configures the app-router Vite middleware used by development servers.\n */\nexport interface AppRouterViteMiddlewareOptions extends AppRouterProjectOptions {\n allowedHosts?: readonly string[] | undefined;\n define?: UserConfig[\"define\"] | undefined;\n hostPolicy?: RequestHostPolicy | undefined;\n importPolicy?: AppRouterImportPolicy | undefined;\n logger?: AppRouterLogger | undefined;\n routeCache?: AppRouterCache | undefined;\n serverActions?: AppRouterServerActionOptions | undefined;\n vitePlugins?: readonly PluginOption[] | undefined;\n}\n\ntype AppRouterViteRuntimeMiddlewareOptions = AppRouterViteMiddlewareOptions & {\n clientRouteInferenceCache?: ClientRouteInferenceCache | undefined;\n navigationScanVitePlugins?: readonly PluginOption[] | undefined;\n viteDevServer?: ViteDevServer | undefined;\n};\n\n/**\n * Configures the app-router Vite plugin.\n */\nexport interface AppRouterVitePluginOptions extends AppRouterProjectOptions {\n allowedHosts?: readonly string[] | undefined;\n hostPolicy?: RequestHostPolicy | undefined;\n importPolicy?: AppRouterImportPolicy | undefined;\n logger?: AppRouterLogger | undefined;\n routeCache?: AppRouterCache | undefined;\n serverActions?: AppRouterServerActionOptions | undefined;\n}\n\nconst clientPrefix = \"/_mreact/client/\";\nconst devCssPrefix = \"/_mreact/dev-css/\";\nconst devCssSourceQuery = \"mreact-router-dev-css-source\";\nconst clientRouteModuleQuery = \"mreact-router-client-route\";\nconst virtualClientPrefix = \"\\0mreact-router-client:\";\nconst virtualReactiveCoreId = \"\\0mreact-router-reactive-core\";\nconst virtualReactiveDevtoolsId = \"\\0mreact-router-reactive-devtools\";\nconst mreactRouterConfigKey = \"__mreactRouterConfig\";\n\ntype MreactRouterPluginConfig = ResolvedAppRouterProject & {\n importPolicy?: AppRouterImportPolicy | undefined;\n};\n\ntype MreactRouterPlugin = Plugin & {\n [mreactRouterConfigKey]: MreactRouterPluginConfig;\n};\n\n/**\n * Creates the app-router Vite plugin for route compilation and development middleware.\n */\nexport function createAppRouterVitePlugin(options: AppRouterVitePluginOptions): Plugin {\n const project = resolveAppRouterProjectOptions(options);\n const normalizedSourceDirs = project.allowedSourceDirs.map((directory) =>\n normalizePath(directory),\n );\n const packageFile = (monorepoDir: string, packageName: string, entry: string): string =>\n workspacePackageFile({\n currentFileUrl: import.meta.url,\n entry,\n monorepoDir,\n packageName,\n });\n const reactiveCorePath = packageFile(\"reactive-core\", \"@reckona/mreact-reactive-core\", \"index\");\n const reactiveCoreDir = normalizePath(dirname(reactiveCorePath));\n const reactiveDomPath = packageFile(\"reactive-dom\", \"@reckona/mreact-reactive-dom\", \"index\");\n const reactiveDomDir = normalizePath(dirname(reactiveDomPath));\n const reactPath = packageFile(\"react\", \"@reckona/mreact\", \"index\");\n const reactDir = normalizePath(dirname(reactPath));\n const reactCompatPath = packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"index\");\n const reactCompatDir = normalizePath(dirname(reactCompatPath));\n const runtimePackageDirs = [reactiveCoreDir, reactiveDomDir, reactDir, reactCompatDir];\n const runtimePackageNames = [\n \"@reckona/mreact\",\n \"@reckona/mreact-reactive-core\",\n \"@reckona/mreact-reactive-dom\",\n \"@reckona/mreact-compat\",\n ];\n const runtimePaths = new Map([\n [\"react\", reactCompatPath],\n [\"react-dom\", reactCompatPath],\n [\"react-dom/client\", reactCompatPath],\n [\"react-dom/server\", reactCompatPath],\n [\n \"react/jsx-dev-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-dev-runtime\"),\n ],\n [\"react/jsx-runtime\", packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-runtime\")],\n [\"@reckona/mreact\", reactPath],\n [\n \"@reckona/mreact-reactive-core/internal\",\n packageFile(\"reactive-core\", \"@reckona/mreact-reactive-core\", \"internal\"),\n ],\n [\"@reckona/mreact-reactive-dom\", reactiveDomPath],\n [\"@reckona/mreact-compat\", reactCompatPath],\n [\n \"@reckona/mreact-compat/event-priority\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"event-priority\"),\n ],\n [\n \"@reckona/mreact-compat/flight\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"flight\"),\n ],\n [\n \"@reckona/mreact-compat/hooks\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"hooks-entry\"),\n ],\n [\n \"@reckona/mreact-compat/internal\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"internal\"),\n ],\n [\n \"@reckona/mreact-compat/jsx-dev-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-dev-runtime\"),\n ],\n [\n \"@reckona/mreact-compat/jsx-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-runtime\"),\n ],\n [\n \"@reckona/mreact-compat/scheduler\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"scheduler\"),\n ],\n [\"@reckona/mreact-router/link\", packageFile(\"router\", \"@reckona/mreact-router\", \"link\")],\n [\n \"@reckona/mreact-router/navigation-state\",\n packageFile(\"router\", \"@reckona/mreact-router\", \"navigation-state\"),\n ],\n [\n \"@reckona/mreact-shared/url-safety\",\n packageFile(\"shared\", \"@reckona/mreact-shared\", \"url-safety\"),\n ],\n ]);\n\n // User-declared plugins captured from the resolving config. Unlike the fully\n // resolved `server.config.plugins`, this excludes Vite internals (e.g. the\n // built-in CSS plugin) whose `transform` requires a dev-server environment the\n // lightweight navigation scan cannot provide. Mirrors what the build forwards.\n let userVitePlugins: readonly PluginOption[] | undefined;\n\n const plugin: MreactRouterPlugin = {\n [mreactRouterConfigKey]: {\n ...project,\n ...(options.importPolicy === undefined ? {} : { importPolicy: options.importPolicy }),\n },\n enforce: \"pre\",\n name: \"mreact-router\",\n config(userConfig) {\n userVitePlugins = routeTransformUserVitePlugins(userConfig.plugins);\n\n return {\n optimizeDeps: {\n // Every client-importable mreact package must resolve through the\n // same dev module graph. Prebundling any of them inlines a second\n // reactive-core (and devtools) copy into the deps chunk, which\n // silently breaks cross-package cell tracking, and also bypasses the\n // react/react-dom alias resolution this plugin provides.\n exclude: [\n \"react\",\n \"react-dom\",\n \"react-dom/client\",\n \"react-dom/server\",\n \"react/jsx-dev-runtime\",\n \"react/jsx-runtime\",\n \"@reckona/mreact\",\n \"@reckona/mreact-auth\",\n \"@reckona/mreact-compat\",\n \"@reckona/mreact-devtools\",\n \"@reckona/mreact-dom\",\n \"@reckona/mreact-forms\",\n \"@reckona/mreact-next\",\n \"@reckona/mreact-query\",\n \"@reckona/mreact-reactive-core\",\n \"@reckona/mreact-reactive-dom\",\n \"@reckona/mreact-router\",\n \"@reckona/mreact-scheduler\",\n \"@reckona/mreact-shared\",\n \"@reckona/mreact-store\",\n \"@reckona/mreact-test-utils\",\n \"@reckona/mreact-virtual\",\n ],\n },\n };\n },\n configureServer(server) {\n server.middlewares.use(createDevCssProxyMiddleware());\n\n return () => {\n const middlewareOptions: AppRouterViteRuntimeMiddlewareOptions = {\n ...options,\n define: server.config.define,\n navigationScanVitePlugins: userVitePlugins ?? [],\n viteDevServer: server,\n vitePlugins: server.config.plugins,\n };\n\n server.middlewares.use(createAppRouterViteMiddleware(middlewareOptions));\n };\n },\n handleHotUpdate(context) {\n const normalizedFile = normalizePath(context.file);\n\n if (!normalizedSourceDirs.some((directory) => normalizedFile.startsWith(directory))) {\n return;\n }\n\n const timestamp = Date.now();\n const updates = Array.from(context.server.moduleGraph.idToModuleMap.values())\n .filter((moduleNode) => isMreactClientDevModuleId(moduleNode.id))\n .map((moduleNode) => {\n context.server.moduleGraph.invalidateModule(moduleNode);\n\n return {\n acceptedPath: moduleNode.url,\n path: moduleNode.url,\n timestamp,\n type: \"js-update\" as const,\n };\n });\n\n if (updates.length > 0) {\n context.server.ws.send({ type: \"update\", updates });\n }\n\n return [];\n },\n load(id) {\n if (isDevCssSourceModuleId(id)) {\n return loadDevCssSourceModule({\n cssFile: clientRequestPath(id),\n sourceDirs: project.allowedSourceDirs,\n });\n }\n\n if (id === virtualReactiveCoreId) {\n return `import { cell as nativeCell } from ${JSON.stringify(reactiveCorePath)};\nexport * from ${JSON.stringify(reactiveCorePath)};\nexport function cell(initial) {\n const routeCell = globalThis.__mreactRouteCell;\n return typeof routeCell === \"function\" ? routeCell(nativeCell, initial) : nativeCell(initial);\n}`;\n }\n\n if (id === virtualReactiveDevtoolsId) {\n return `export function emitReactiveDevtoolsEvent() {}\nexport function hasReactiveDevtoolsEmitter() { return false; }\nexport function currentDevtoolsEmitter() { return undefined; }\nexport function currentReactiveDevtools() { return undefined; }`;\n }\n\n if (id.startsWith(virtualClientPrefix)) {\n return renderAppRouterClientAsset(project.routesDir, id.slice(virtualClientPrefix.length), {\n dev: true,\n }).then(async (response) => {\n if (!response.ok) {\n const message = await response.text();\n throw new Error(message || `MReact client route asset was not found: ${id}`);\n }\n\n return response.text();\n });\n }\n\n const requestPath = clientRouteModuleRequestPath(id);\n\n return requestPath === undefined\n ? undefined\n : renderAppRouterClientRouteDevModule(project.routesDir, requestPath);\n },\n transform(code, id, options) {\n if (options?.ssr === true) {\n return undefined;\n }\n\n if (isMreactClientDevModuleId(id)) {\n return undefined;\n }\n\n const filename = clientRequestPath(id);\n\n if (!isMreactClientSourceDependency(filename, normalizedSourceDirs)) {\n return undefined;\n }\n\n const moduleContext = createCompilerModuleContext({ code, filename });\n\n if (!hasJsxSyntax(moduleContext.program)) {\n return undefined;\n }\n\n const output = transformCompilerModuleContext({\n code,\n dev: true,\n filename,\n mode: isCompatSourcePath(filename) ? \"compat\" : \"reactive\",\n moduleContext,\n target: \"client\",\n });\n\n if (output.diagnostics.length > 0) {\n throw new Error(\n output.diagnostics.map((diagnostic) => formatDiagnostic(filename, diagnostic)).join(\"\\n\"),\n );\n }\n\n return {\n code: output.code,\n map: null,\n };\n },\n async resolveId(id, importer) {\n const runtimePath = runtimePaths.get(id);\n\n if (id === \"@reckona/mreact-reactive-core\") {\n if (importerInRuntimePackage(importer, runtimePackageDirs, runtimePackageNames)) {\n return reactiveCorePath;\n }\n\n return virtualReactiveCoreId;\n }\n\n if (\n id === \"./devtools.js\" &&\n importerInRuntimePackage(importer, [reactiveCoreDir], [\"@reckona/mreact-reactive-core\"])\n ) {\n return virtualReactiveDevtoolsId;\n }\n\n if (runtimePath !== undefined) {\n return runtimePath;\n }\n\n const requestPath = clientRequestPath(id);\n\n if (requestPath === `${clientPrefix}${navigationRuntimeScriptForDev()}`) {\n return `${virtualClientPrefix}${requestPath}`;\n }\n\n if (!requestPath.startsWith(clientPrefix)) {\n return undefined;\n }\n\n const route = await clientRouteForRequestPath(project.routesDir, requestPath);\n\n return route === undefined ? undefined : clientRouteModuleId(route.file, requestPath);\n },\n };\n\n return plugin;\n}\n\nfunction isMreactClientSourceDependency(\n filename: string,\n normalizedSourceDirs: readonly string[],\n): boolean {\n const normalized = normalizePath(filename);\n\n return (\n /\\.(?:mreact\\.)?[cm]?[jt]sx?$/.test(normalized) &&\n !normalized.includes(\"/node_modules/\") &&\n normalizedSourceDirs.some(\n (directory) => normalized === directory || normalized.startsWith(`${directory}/`),\n )\n );\n}\n\nfunction isCompatSourcePath(filename: string): boolean {\n return /\\.compat(?:\\.mreact)?(?:\\.[cm]?[jt]sx?)?$/.test(filename);\n}\n\n/**\n * Alias for `createAppRouterVitePlugin()` used by Vite config files.\n */\nexport const mreactRouter = createAppRouterVitePlugin;\n\nfunction routeTransformUserVitePlugins(\n pluginOptions: readonly PluginOption[] | undefined,\n): PluginOption[] {\n const plugins: PluginOption[] = [];\n const visit = (option: PluginOption | null | false | undefined): void => {\n if (option === false || option === null || option === undefined) {\n return;\n }\n\n if (Array.isArray(option)) {\n for (const child of option) {\n visit(child);\n }\n return;\n }\n\n if (typeof option === \"object\" && \"then\" in option) {\n return;\n }\n\n if (typeof option === \"object\" && mreactRouterConfigKey in option) {\n return;\n }\n\n plugins.push(option);\n };\n\n for (const option of pluginOptions ?? []) {\n visit(option);\n }\n\n return plugins;\n}\n\n/**\n * Reads resolved app-router project config from a Vite plugin list.\n */\nexport function mreactRouterConfigFromPlugins(\n plugins: readonly unknown[],\n): ResolvedAppRouterProject | undefined {\n for (const plugin of plugins.flat(Infinity)) {\n if (plugin !== null && typeof plugin === \"object\" && mreactRouterConfigKey in plugin) {\n const config = (plugin as MreactRouterPlugin)[mreactRouterConfigKey];\n\n if (\"project\" in config) {\n return (config as unknown as { project: ResolvedAppRouterProject }).project;\n }\n\n return config as unknown as ResolvedAppRouterProject;\n }\n }\n\n return undefined;\n}\n\n/**\n * Creates Connect middleware that renders app-router requests during Vite development.\n */\nexport function createAppRouterViteMiddleware(\n options: AppRouterViteMiddlewareOptions,\n): Connect.NextHandleFunction {\n // Reused across requests so dev navigation-script detection memoizes module\n // contexts/analyses instead of re-walking every route's import graph per\n // request. The source-keyed caches keep only the latest content version per\n // file (see setLatestModuleCacheEntry), so repeated edits do not accumulate\n // stale entries over a long dev session.\n const runtimeOptions: AppRouterViteRuntimeMiddlewareOptions = {\n ...options,\n clientRouteInferenceCache: createClientRouteInferenceCache(),\n };\n\n return (request, response, next) => {\n void handleAppRouterViteRequest(runtimeOptions, request, response, next);\n };\n}\n\nasync function handleAppRouterViteRequest(\n options: AppRouterViteRuntimeMiddlewareOptions,\n incoming: Connect.IncomingMessage,\n outgoing: ServerResponse,\n next: Connect.NextFunction,\n): Promise<void> {\n try {\n const project = resolveAppRouterProjectOptions(options);\n const host = resolveRequestHost({\n allowedHosts: options.allowedHosts,\n fallbackHost: \"localhost\",\n hostPolicy: options.hostPolicy,\n rawHost: incoming.headers.host,\n });\n const origin = `http://${host}`;\n const url = new URL(incoming.url ?? \"/\", origin);\n\n if (url.pathname.startsWith(clientPrefix)) {\n if (options.viteDevServer !== undefined) {\n const transformed = await options.viteDevServer.transformRequest(\n `${url.pathname}${url.search}`,\n );\n\n if (transformed !== null) {\n await sendResponse(\n outgoing,\n new Response(transformed.code, {\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n }),\n );\n return;\n }\n }\n\n await sendResponse(\n outgoing,\n await renderAppRouterClientAsset(project.routesDir, url.pathname, {\n vitePlugins: options.vitePlugins,\n }),\n );\n return;\n }\n\n const request = nodeRequestToWebRequest(incoming, origin);\n const routeTransformPlugins = options.navigationScanVitePlugins ?? options.vitePlugins;\n const routes = await scanAppRoutes({ appDir: project.routesDir });\n const routeMatcher = createRouteMatcher(routes);\n const readRouteSource = createCachedRouteSourceReader();\n const [clientStyles, clientStylesByFile, navigationScripts] = await Promise.all([\n devRouteStyles(project, routes, readRouteSource),\n devSpecialRouteStyles(project, readRouteSource),\n devNavigationScripts(\n project.routesDir,\n routes,\n readRouteSource,\n options.clientRouteInferenceCache,\n routeTransformPlugins,\n ),\n ]);\n\n await sendResponse(\n outgoing,\n await renderAppRequest({\n appDir: project.routesDir,\n define: options.define,\n dev: true,\n importPolicy: {\n ...options.importPolicy,\n allowedSourceDirs: project.allowedSourceDirs,\n projectRoot: project.projectRoot,\n },\n clientStyles,\n clientStylesByFile,\n clientRouteInferenceCache: options.clientRouteInferenceCache,\n navigationScripts,\n request,\n logger: options.logger,\n routeCache: options.routeCache,\n routeMatcher,\n routes,\n serverActions: options.serverActions,\n vitePlugins: routeTransformPlugins,\n }),\n );\n } catch (error) {\n next(error);\n }\n}\n\n/**\n * Renders a development client asset generated by the app-router Vite integration.\n */\nexport async function renderAppRouterClientAsset(\n appDir: string,\n pathname: string,\n options: { dev?: boolean; vitePlugins?: readonly PluginOption[] | undefined } = {},\n): Promise<Response> {\n if (pathname === `/_mreact/client/${navigationRuntimeScriptForDev()}`) {\n const output = await buildNavigationRuntimeBundle();\n\n return new Response(options.dev === true ? withViteHmrRuntime(output.code) : output.code, {\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n });\n }\n\n const routes = await scanAppRoutes({ appDir });\n const route = routes.find(\n (candidate) =>\n candidate.kind === \"page\" &&\n `/_mreact/client/${clientScriptForPath(candidate.path)}` === pathname,\n );\n\n if (route === undefined || route.kind !== \"page\") {\n return new Response(\"Not Found\", { status: 404 });\n }\n\n const code = await readFile(route.file, \"utf8\");\n const clientSource = stripRouteClientOnlyExports(code, route.file);\n let references: Awaited<ReturnType<typeof collectClientRouteReferences>>;\n\n try {\n references = await collectClientRouteReferences({\n appDir,\n code: clientSource,\n filename: route.file,\n vitePlugins: options.vitePlugins,\n });\n } catch (error) {\n return clientAssetBuildErrorResponse(route.file, error);\n }\n\n if (!references.client) {\n if (isClientRouteSource(clientSource)) {\n return clientAssetBuildErrorResponse(\n route.file,\n new Error(\n [\n \"Client route analysis did not produce a client asset.\",\n \"Browser build cannot import Node builtins or other server-only modules.\",\n ...references.diagnostics.map((diagnostic) => diagnostic.message),\n ].join(\"\\n\"),\n ),\n );\n }\n\n return new Response(\"Not Found\", { status: 404 });\n }\n\n let bundle: string;\n\n try {\n bundle = await buildClientRouteBundle({\n code: clientSource,\n clientBoundaryImports: references.clientBoundaryImports,\n clientReferenceImports: references.clientReferenceImports,\n clientReferenceManifest: references.clientReferenceManifest,\n filename: route.file,\n routePath: route.path,\n vitePlugins: options.vitePlugins,\n });\n } catch (error) {\n return clientAssetBuildErrorResponse(route.file, error);\n }\n\n return new Response(options.dev === true ? withViteHmrRuntime(bundle) : bundle, {\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n });\n}\n\nasync function renderAppRouterClientRouteDevModule(\n appDir: string,\n pathname: string,\n options: { vitePlugins?: readonly PluginOption[] | undefined } = {},\n): Promise<string> {\n const route = await clientRouteForRequestPath(appDir, pathname);\n\n if (route === undefined) {\n throw new Error(`MReact client route asset was not found: ${pathname}`);\n }\n\n const code = await readFile(route.file, \"utf8\");\n const clientSource = stripRouteClientOnlyExports(code, route.file);\n const references = await collectClientRouteReferences({\n appDir,\n code: clientSource,\n filename: route.file,\n vitePlugins: options.vitePlugins,\n });\n\n if (!references.client) {\n throw new Error(\n isClientRouteSource(clientSource)\n ? [\n \"Client route analysis did not produce a client asset.\",\n \"Browser build cannot import Node builtins or other server-only modules.\",\n ...references.diagnostics.map((diagnostic) => diagnostic.message),\n ].join(\"\\n\")\n : `MReact client route asset was not found: ${pathname}`,\n );\n }\n\n const entry = await buildClientRouteEntrySource({\n code: clientSource,\n clientBoundaryImports: references.clientBoundaryImports,\n clientReferenceImports: references.clientReferenceImports,\n clientReferenceManifest: references.clientReferenceManifest,\n filename: route.file,\n routePath: route.path,\n vitePlugins: options.vitePlugins,\n });\n\n return withViteHmrRuntime(entry.code);\n}\n\nasync function clientRouteForRequestPath(appDir: string, pathname: string) {\n const routes = await scanAppRoutes({ appDir });\n\n return routes.find(\n (candidate) =>\n candidate.kind === \"page\" &&\n `/_mreact/client/${clientScriptForPath(candidate.path)}` === pathname,\n );\n}\n\nfunction clientRequestPath(id: string): string {\n const [path] = id.split(/[?#]/, 1);\n\n return path ?? id;\n}\n\nfunction clientRouteModuleId(filename: string, requestPath: string): string {\n return `${normalizePath(filename)}?${clientRouteModuleQuery}=${encodeURIComponent(requestPath)}`;\n}\n\nfunction clientRouteModuleRequestPath(id: string): string | undefined {\n const queryStart = id.indexOf(\"?\");\n\n if (queryStart === -1) {\n return undefined;\n }\n\n const params = new URLSearchParams(id.slice(queryStart + 1));\n const value = params.get(clientRouteModuleQuery);\n\n return value === null ? undefined : value;\n}\n\nfunction isMreactClientDevModuleId(id: string | null | undefined): boolean {\n return (\n id?.startsWith(virtualClientPrefix) === true ||\n id?.includes(`?${clientRouteModuleQuery}=`) === true ||\n id?.includes(`&${clientRouteModuleQuery}=`) === true\n );\n}\n\nfunction isDevCssSourceModuleId(id: string): boolean {\n return new URLSearchParams(id.slice(id.indexOf(\"?\") + 1)).has(devCssSourceQuery);\n}\n\nasync function loadDevCssSourceModule(options: {\n cssFile: string;\n sourceDirs: readonly string[];\n}): Promise<string | undefined> {\n const code = await readFile(options.cssFile, \"utf8\");\n\n return prependTailwindSourceDirectives({\n code,\n cssFile: options.cssFile,\n sourceDirs: options.sourceDirs,\n });\n}\n\nfunction importerInRuntimePackage(\n importer: string | undefined,\n directories: readonly string[],\n packageNames: readonly string[],\n): boolean {\n if (importer === undefined) {\n return false;\n }\n\n const normalizedImporter = normalizePath(importer);\n return (\n directories.some((directory) => normalizedImporter.startsWith(`${directory}/`)) ||\n packageNames.some((packageName) => normalizedImporter.includes(`/node_modules/${packageName}/`))\n );\n}\n\nfunction clientAssetBuildErrorResponse(filename: string, error: unknown): Response {\n const message = [\n `Failed to build mreact client route asset for ${filename}.`,\n error instanceof Error ? error.message : String(error),\n ].join(\"\\n\");\n\n return new Response(`throw new Error(${JSON.stringify(message)});\\n`, {\n status: 500,\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n });\n}\n\nasync function devRouteStyles(\n project: ResolvedAppRouterProject,\n routes: readonly AppRoute[],\n readSource: (file: string) => Promise<string | undefined>,\n): Promise<ReadonlyMap<string, readonly string[]>> {\n const entries = await Promise.all(\n routes.map(async (route) => {\n if (route.kind !== \"page\") {\n return undefined;\n }\n\n const hrefs = await collectRouteCssHrefs({\n appDir: project.routesDir,\n hrefPrefix: devCssPrefix,\n pageFile: route.file,\n projectRoot: project.projectRoot,\n readSource,\n });\n\n return hrefs.length === 0 ? undefined : ([route.path, hrefs as readonly string[]] as const);\n }),\n );\n const routeStyles = entries.filter(\n (entry): entry is readonly [string, readonly string[]] => entry !== undefined,\n );\n\n return new Map<string, readonly string[]>(routeStyles);\n}\n\nasync function devSpecialRouteStyles(\n project: ResolvedAppRouterProject,\n readSource: (file: string) => Promise<string | undefined>,\n): Promise<ReadonlyMap<string, readonly string[]>> {\n const entries = await Promise.all(\n (await collectSpecialBoundaryFiles(project.routesDir)).map(async (file) => {\n const hrefs = await collectRouteCssHrefs({\n appDir: project.routesDir,\n hrefPrefix: devCssPrefix,\n pageFile: file,\n projectRoot: project.projectRoot,\n readSource,\n });\n\n return hrefs.length === 0 ? undefined : ([file, hrefs as readonly string[]] as const);\n }),\n );\n const routeStyles = entries.filter(\n (entry): entry is readonly [string, readonly string[]] => entry !== undefined,\n );\n\n return new Map<string, readonly string[]>(routeStyles);\n}\n\nasync function devNavigationScripts(\n appDir: string,\n routes: readonly AppRoute[],\n readSource: (file: string) => Promise<string | undefined>,\n inferenceCache?: ClientRouteInferenceCache | undefined,\n vitePlugins?: readonly PluginOption[] | undefined,\n): Promise<ReadonlyMap<string, string>> {\n const cache = inferenceCache ?? createClientRouteInferenceCache();\n const entries = await Promise.all(\n routes.map(async (route) => {\n if (route.kind !== \"page\") {\n return undefined;\n }\n\n const source = await readSource(route.file);\n if (source === undefined) {\n return undefined;\n }\n const references = await collectClientRouteReferences({\n appDir,\n cache,\n code: source,\n filename: route.file,\n routePath: route.path,\n vitePlugins,\n });\n const navigation = await resolveNavigationRuntime({\n appDir,\n cache,\n code: source,\n filename: route.file,\n references,\n vitePlugins,\n });\n\n for (const diagnostic of references.diagnostics) {\n console.warn(formatClientRouteInferenceDiagnostic(diagnostic));\n }\n const navigationRuntimeDiagnostic = navigationRuntimeLinkDisabledDiagnostic({\n filename: route.file,\n references,\n routePath: route.path,\n source,\n });\n\n if (navigationRuntimeDiagnostic !== undefined) {\n console.warn(formatClientRouteInferenceDiagnostic(navigationRuntimeDiagnostic));\n }\n\n return navigation\n ? ([route.path, navigationRuntimeScriptForDev()] as const)\n : undefined;\n }),\n );\n\n return new Map(\n entries.filter((entry): entry is readonly [string, string] => entry !== undefined),\n );\n}\n\nfunction createDevCssProxyMiddleware(): Connect.NextHandleFunction {\n return (incoming, outgoing, next) => {\n const originalUrl = incoming.url ?? \"/\";\n const url = new URL(originalUrl, \"http://mreact.local\");\n\n if (!url.pathname.startsWith(devCssPrefix)) {\n next();\n return;\n }\n\n const sourcePath = `/${url.pathname.slice(devCssPrefix.length)}`;\n\n if (sourcePath === \"/\" || sourcePath.includes(\"\\0\")) {\n next();\n return;\n }\n\n const originalAccept = incoming.headers.accept;\n let restored = false;\n const restore = () => {\n if (restored) {\n return;\n }\n restored = true;\n incoming.url = originalUrl;\n if (originalAccept === undefined) {\n delete incoming.headers.accept;\n } else {\n incoming.headers.accept = originalAccept;\n }\n };\n\n const sourceSearch = new URLSearchParams(url.search);\n sourceSearch.set(devCssSourceQuery, \"\");\n incoming.url = `${sourcePath}?${sourceSearch.toString()}`;\n incoming.headers.accept = \"text/css,*/*;q=0.1\";\n outgoing.once(\"finish\", restore);\n outgoing.once(\"close\", restore);\n next();\n };\n}\n\nfunction withViteHmrRuntime(code: string): string {\n return `import \"/@vite/client\";\nif (import.meta.hot?.data.__mreactRouteStates) {\n globalThis.__mreactRouteStates = import.meta.hot.data.__mreactRouteStates;\n}\n${code}\nif (import.meta.hot) {\n const __mreactPreserveRouteState = () => {\n import.meta.hot.data.__mreactRouteStates = globalThis.__mreactRouteStates;\n };\n import.meta.hot.dispose(__mreactPreserveRouteState);\n import.meta.hot.accept((module) => {\n module?.__mreactHydrateRoute?.();\n });\n}\n`;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"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AG,UAAU,IAAI,YAAY,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC1D,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,oBAAoB,CAAC;QAC/C,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACjC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAChC,IAAI,EAAE,CAAC;IACT,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAO;;;;EAIP,IAAI;;;;;;;;;;CAUL,CAAC;AACF,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport type { ServerResponse } from \"node:http\";\nimport { dirname } from \"node:path\";\nimport { formatDiagnostic } from \"@reckona/mreact-compiler\";\nimport {\n createCompilerModuleContext,\n transformCompilerModuleContext,\n} from \"@reckona/mreact-compiler/internal\";\nimport {\n normalizePath,\n type Connect,\n type Plugin,\n type PluginOption,\n type UserConfig,\n type ViteDevServer,\n} from \"vite\";\nimport type { AppRouterServerActionOptions } from \"./actions.js\";\nimport type { AppRouterCache } from \"./cache.js\";\nimport {\n resolveAppRouterProjectOptions,\n type AppRouterProjectOptions,\n type ResolvedAppRouterProject,\n} from \"./config.js\";\nimport type { AppRouterImportPolicy } from \"./import-policy.js\";\nimport {\n collectClientRouteReferences,\n createClientRouteInferenceCache,\n formatClientRouteInferenceDiagnostic,\n isClientRouteSource,\n navigationRuntimeLinkDisabledDiagnostic,\n resolveNavigationRuntime,\n type ClientRouteInferenceCache,\n} from \"./client-route-inference.js\";\nimport {\n buildNavigationRuntimeBundle,\n buildClientRouteBundle,\n buildClientRouteEntrySource,\n clientScriptForPath,\n navigationRuntimeScriptForDev,\n} from \"./navigation-runtime.js\";\nimport { nodeRequestToWebRequest, sendResponse } from \"./http.js\";\nimport type { AppRouterLogger } from \"./logger.js\";\nimport { renderAppRequest } from \"./render.js\";\nimport { stripRouteClientOnlyExports } from \"./route-source.js\";\nimport {\n collectRouteCssHrefs,\n collectSpecialBoundaryFiles,\n createCachedRouteSourceReader,\n} from \"./route-styles.js\";\nimport { createRouteMatcher, scanAppRoutes, type AppRoute } from \"./routes.js\";\nimport { resolveRequestHost, type RequestHostPolicy } from \"./serve.js\";\nimport { hasJsxSyntax } from \"./source-jsx.js\";\nimport { prependTailwindSourceDirectives } from \"./tailwind-source.js\";\nimport { workspacePackageFile } from \"./workspace-packages.js\";\n\n/**\n * Configures the app-router Vite middleware used by development servers.\n */\nexport interface AppRouterViteMiddlewareOptions extends AppRouterProjectOptions {\n allowedHosts?: readonly string[] | undefined;\n define?: UserConfig[\"define\"] | undefined;\n hostPolicy?: RequestHostPolicy | undefined;\n importPolicy?: AppRouterImportPolicy | undefined;\n logger?: AppRouterLogger | undefined;\n routeCache?: AppRouterCache | undefined;\n serverActions?: AppRouterServerActionOptions | undefined;\n vitePlugins?: readonly PluginOption[] | undefined;\n}\n\ntype AppRouterViteRuntimeMiddlewareOptions = AppRouterViteMiddlewareOptions & {\n clientRouteInferenceCache?: ClientRouteInferenceCache | undefined;\n devServerModuleCacheVersion?: (() => string | undefined) | undefined;\n navigationScanVitePlugins?: readonly PluginOption[] | undefined;\n viteDevServer?: ViteDevServer | undefined;\n};\n\n/**\n * Configures the app-router Vite plugin.\n */\nexport interface AppRouterVitePluginOptions extends AppRouterProjectOptions {\n allowedHosts?: readonly string[] | undefined;\n hostPolicy?: RequestHostPolicy | undefined;\n importPolicy?: AppRouterImportPolicy | undefined;\n logger?: AppRouterLogger | undefined;\n routeCache?: AppRouterCache | undefined;\n serverActions?: AppRouterServerActionOptions | undefined;\n}\n\nconst clientPrefix = \"/_mreact/client/\";\nconst devCssPrefix = \"/_mreact/dev-css/\";\nconst devCssSourceQuery = \"mreact-router-dev-css-source\";\nconst clientRouteModuleQuery = \"mreact-router-client-route\";\nconst virtualClientPrefix = \"\\0mreact-router-client:\";\nconst virtualReactiveCoreId = \"\\0mreact-router-reactive-core\";\nconst virtualReactiveDevtoolsId = \"\\0mreact-router-reactive-devtools\";\nconst mreactRouterConfigKey = \"__mreactRouterConfig\";\n\ntype MreactRouterPluginConfig = ResolvedAppRouterProject & {\n importPolicy?: AppRouterImportPolicy | undefined;\n};\n\ntype MreactRouterPlugin = Plugin & {\n [mreactRouterConfigKey]: MreactRouterPluginConfig;\n};\n\n/**\n * Creates the app-router Vite plugin for route compilation and development middleware.\n */\nexport function createAppRouterVitePlugin(options: AppRouterVitePluginOptions): Plugin {\n const project = resolveAppRouterProjectOptions(options);\n const normalizedSourceDirs = project.allowedSourceDirs.map((directory) =>\n normalizePath(directory),\n );\n const packageFile = (monorepoDir: string, packageName: string, entry: string): string =>\n workspacePackageFile({\n currentFileUrl: import.meta.url,\n entry,\n monorepoDir,\n packageName,\n });\n const reactiveCorePath = packageFile(\"reactive-core\", \"@reckona/mreact-reactive-core\", \"index\");\n const reactiveCoreDir = normalizePath(dirname(reactiveCorePath));\n const reactiveDomPath = packageFile(\"reactive-dom\", \"@reckona/mreact-reactive-dom\", \"index\");\n const reactiveDomDir = normalizePath(dirname(reactiveDomPath));\n const reactPath = packageFile(\"react\", \"@reckona/mreact\", \"index\");\n const reactDir = normalizePath(dirname(reactPath));\n const reactCompatPath = packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"index\");\n const reactCompatDir = normalizePath(dirname(reactCompatPath));\n const runtimePackageDirs = [reactiveCoreDir, reactiveDomDir, reactDir, reactCompatDir];\n const runtimePackageNames = [\n \"@reckona/mreact\",\n \"@reckona/mreact-reactive-core\",\n \"@reckona/mreact-reactive-dom\",\n \"@reckona/mreact-compat\",\n ];\n const runtimePaths = new Map([\n [\"react\", reactCompatPath],\n [\"react-dom\", reactCompatPath],\n [\"react-dom/client\", reactCompatPath],\n [\"react-dom/server\", reactCompatPath],\n [\n \"react/jsx-dev-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-dev-runtime\"),\n ],\n [\"react/jsx-runtime\", packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-runtime\")],\n [\"@reckona/mreact\", reactPath],\n [\n \"@reckona/mreact-reactive-core/internal\",\n packageFile(\"reactive-core\", \"@reckona/mreact-reactive-core\", \"internal\"),\n ],\n [\"@reckona/mreact-reactive-dom\", reactiveDomPath],\n [\"@reckona/mreact-compat\", reactCompatPath],\n [\n \"@reckona/mreact-compat/event-priority\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"event-priority\"),\n ],\n [\n \"@reckona/mreact-compat/flight\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"flight\"),\n ],\n [\n \"@reckona/mreact-compat/hooks\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"hooks-entry\"),\n ],\n [\n \"@reckona/mreact-compat/internal\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"internal\"),\n ],\n [\n \"@reckona/mreact-compat/jsx-dev-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-dev-runtime\"),\n ],\n [\n \"@reckona/mreact-compat/jsx-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-runtime\"),\n ],\n [\n \"@reckona/mreact-compat/scheduler\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"scheduler\"),\n ],\n [\"@reckona/mreact-router/link\", packageFile(\"router\", \"@reckona/mreact-router\", \"link\")],\n [\n \"@reckona/mreact-router/navigation-state\",\n packageFile(\"router\", \"@reckona/mreact-router\", \"navigation-state\"),\n ],\n [\n \"@reckona/mreact-shared/url-safety\",\n packageFile(\"shared\", \"@reckona/mreact-shared\", \"url-safety\"),\n ],\n ]);\n\n // User-declared plugins captured from the resolving config. Unlike the fully\n // resolved `server.config.plugins`, this excludes Vite internals (e.g. the\n // built-in CSS plugin) whose `transform` requires a dev-server environment the\n // lightweight navigation scan cannot provide. Mirrors what the build forwards.\n let userVitePlugins: readonly PluginOption[] | undefined;\n let devServerModuleCacheVersion = 0;\n\n const plugin: MreactRouterPlugin = {\n [mreactRouterConfigKey]: {\n ...project,\n ...(options.importPolicy === undefined ? {} : { importPolicy: options.importPolicy }),\n },\n enforce: \"pre\",\n name: \"mreact-router\",\n config(userConfig) {\n userVitePlugins = routeTransformUserVitePlugins(userConfig.plugins);\n\n return {\n optimizeDeps: {\n // Every client-importable mreact package must resolve through the\n // same dev module graph. Prebundling any of them inlines a second\n // reactive-core (and devtools) copy into the deps chunk, which\n // silently breaks cross-package cell tracking, and also bypasses the\n // react/react-dom alias resolution this plugin provides.\n exclude: [\n \"react\",\n \"react-dom\",\n \"react-dom/client\",\n \"react-dom/server\",\n \"react/jsx-dev-runtime\",\n \"react/jsx-runtime\",\n \"@reckona/mreact\",\n \"@reckona/mreact-auth\",\n \"@reckona/mreact-compat\",\n \"@reckona/mreact-devtools\",\n \"@reckona/mreact-dom\",\n \"@reckona/mreact-forms\",\n \"@reckona/mreact-next\",\n \"@reckona/mreact-query\",\n \"@reckona/mreact-reactive-core\",\n \"@reckona/mreact-reactive-dom\",\n \"@reckona/mreact-router\",\n \"@reckona/mreact-scheduler\",\n \"@reckona/mreact-shared\",\n \"@reckona/mreact-store\",\n \"@reckona/mreact-test-utils\",\n \"@reckona/mreact-virtual\",\n ],\n },\n };\n },\n configureServer(server) {\n server.middlewares.use(createDevCssProxyMiddleware());\n\n return () => {\n const middlewareOptions: AppRouterViteRuntimeMiddlewareOptions = {\n ...options,\n define: server.config.define,\n devServerModuleCacheVersion: () => `dev:${devServerModuleCacheVersion}`,\n navigationScanVitePlugins: userVitePlugins ?? [],\n viteDevServer: server,\n vitePlugins: server.config.plugins,\n };\n\n server.middlewares.use(createAppRouterViteMiddleware(middlewareOptions));\n };\n },\n handleHotUpdate(context) {\n const normalizedFile = normalizePath(context.file);\n\n if (!normalizedSourceDirs.some((directory) => normalizedFile.startsWith(directory))) {\n return;\n }\n\n devServerModuleCacheVersion += 1;\n const timestamp = Date.now();\n const updates = Array.from(context.server.moduleGraph.idToModuleMap.values())\n .filter((moduleNode) => isMreactClientDevModuleId(moduleNode.id))\n .map((moduleNode) => {\n context.server.moduleGraph.invalidateModule(moduleNode);\n\n return {\n acceptedPath: moduleNode.url,\n path: moduleNode.url,\n timestamp,\n type: \"js-update\" as const,\n };\n });\n\n if (updates.length > 0) {\n context.server.ws.send({ type: \"update\", updates });\n }\n\n return [];\n },\n load(id) {\n if (isDevCssSourceModuleId(id)) {\n return loadDevCssSourceModule({\n cssFile: clientRequestPath(id),\n sourceDirs: project.allowedSourceDirs,\n });\n }\n\n if (id === virtualReactiveCoreId) {\n return `import { cell as nativeCell } from ${JSON.stringify(reactiveCorePath)};\nexport * from ${JSON.stringify(reactiveCorePath)};\nexport function cell(initial) {\n const routeCell = globalThis.__mreactRouteCell;\n return typeof routeCell === \"function\" ? routeCell(nativeCell, initial) : nativeCell(initial);\n}`;\n }\n\n if (id === virtualReactiveDevtoolsId) {\n return `export function emitReactiveDevtoolsEvent() {}\nexport function hasReactiveDevtoolsEmitter() { return false; }\nexport function currentDevtoolsEmitter() { return undefined; }\nexport function currentReactiveDevtools() { return undefined; }`;\n }\n\n if (id.startsWith(virtualClientPrefix)) {\n return renderAppRouterClientAsset(project.routesDir, id.slice(virtualClientPrefix.length), {\n dev: true,\n }).then(async (response) => {\n if (!response.ok) {\n const message = await response.text();\n throw new Error(message || `MReact client route asset was not found: ${id}`);\n }\n\n return response.text();\n });\n }\n\n const requestPath = clientRouteModuleRequestPath(id);\n\n return requestPath === undefined\n ? undefined\n : renderAppRouterClientRouteDevModule(project.routesDir, requestPath);\n },\n transform(code, id, options) {\n if (options?.ssr === true) {\n return undefined;\n }\n\n if (isMreactClientDevModuleId(id)) {\n return undefined;\n }\n\n const filename = clientRequestPath(id);\n\n if (!isMreactClientSourceDependency(filename, normalizedSourceDirs)) {\n return undefined;\n }\n\n const moduleContext = createCompilerModuleContext({ code, filename });\n\n if (!hasJsxSyntax(moduleContext.program)) {\n return undefined;\n }\n\n const output = transformCompilerModuleContext({\n code,\n dev: true,\n filename,\n mode: isCompatSourcePath(filename) ? \"compat\" : \"reactive\",\n moduleContext,\n target: \"client\",\n });\n\n if (output.diagnostics.length > 0) {\n throw new Error(\n output.diagnostics.map((diagnostic) => formatDiagnostic(filename, diagnostic)).join(\"\\n\"),\n );\n }\n\n return {\n code: output.code,\n map: null,\n };\n },\n async resolveId(id, importer) {\n const runtimePath = runtimePaths.get(id);\n\n if (id === \"@reckona/mreact-reactive-core\") {\n if (importerInRuntimePackage(importer, runtimePackageDirs, runtimePackageNames)) {\n return reactiveCorePath;\n }\n\n return virtualReactiveCoreId;\n }\n\n if (\n id === \"./devtools.js\" &&\n importerInRuntimePackage(importer, [reactiveCoreDir], [\"@reckona/mreact-reactive-core\"])\n ) {\n return virtualReactiveDevtoolsId;\n }\n\n if (runtimePath !== undefined) {\n return runtimePath;\n }\n\n const requestPath = clientRequestPath(id);\n\n if (requestPath === `${clientPrefix}${navigationRuntimeScriptForDev()}`) {\n return `${virtualClientPrefix}${requestPath}`;\n }\n\n if (!requestPath.startsWith(clientPrefix)) {\n return undefined;\n }\n\n const route = await clientRouteForRequestPath(project.routesDir, requestPath);\n\n return route === undefined ? undefined : clientRouteModuleId(route.file, requestPath);\n },\n };\n\n return plugin;\n}\n\nfunction isMreactClientSourceDependency(\n filename: string,\n normalizedSourceDirs: readonly string[],\n): boolean {\n const normalized = normalizePath(filename);\n\n return (\n /\\.(?:mreact\\.)?[cm]?[jt]sx?$/.test(normalized) &&\n !normalized.includes(\"/node_modules/\") &&\n normalizedSourceDirs.some(\n (directory) => normalized === directory || normalized.startsWith(`${directory}/`),\n )\n );\n}\n\nfunction isCompatSourcePath(filename: string): boolean {\n return /\\.compat(?:\\.mreact)?(?:\\.[cm]?[jt]sx?)?$/.test(filename);\n}\n\n/**\n * Alias for `createAppRouterVitePlugin()` used by Vite config files.\n */\nexport const mreactRouter = createAppRouterVitePlugin;\n\nfunction routeTransformUserVitePlugins(\n pluginOptions: readonly PluginOption[] | undefined,\n): PluginOption[] {\n const plugins: PluginOption[] = [];\n const visit = (option: PluginOption | null | false | undefined): void => {\n if (option === false || option === null || option === undefined) {\n return;\n }\n\n if (Array.isArray(option)) {\n for (const child of option) {\n visit(child);\n }\n return;\n }\n\n if (typeof option === \"object\" && \"then\" in option) {\n return;\n }\n\n if (typeof option === \"object\" && mreactRouterConfigKey in option) {\n return;\n }\n\n plugins.push(option);\n };\n\n for (const option of pluginOptions ?? []) {\n visit(option);\n }\n\n return plugins;\n}\n\n/**\n * Reads resolved app-router project config from a Vite plugin list.\n */\nexport function mreactRouterConfigFromPlugins(\n plugins: readonly unknown[],\n): ResolvedAppRouterProject | undefined {\n for (const plugin of plugins.flat(Infinity)) {\n if (plugin !== null && typeof plugin === \"object\" && mreactRouterConfigKey in plugin) {\n const config = (plugin as MreactRouterPlugin)[mreactRouterConfigKey];\n\n if (\"project\" in config) {\n return (config as unknown as { project: ResolvedAppRouterProject }).project;\n }\n\n return config as unknown as ResolvedAppRouterProject;\n }\n }\n\n return undefined;\n}\n\n/**\n * Creates Connect middleware that renders app-router requests during Vite development.\n */\nexport function createAppRouterViteMiddleware(\n options: AppRouterViteMiddlewareOptions,\n): Connect.NextHandleFunction {\n // Reused across requests so dev navigation-script detection memoizes module\n // contexts/analyses instead of re-walking every route's import graph per\n // request. The source-keyed caches keep only the latest content version per\n // file (see setLatestModuleCacheEntry), so repeated edits do not accumulate\n // stale entries over a long dev session.\n const runtimeOptions: AppRouterViteRuntimeMiddlewareOptions = {\n ...options,\n clientRouteInferenceCache: createClientRouteInferenceCache(),\n };\n\n return (request, response, next) => {\n void handleAppRouterViteRequest(runtimeOptions, request, response, next);\n };\n}\n\nasync function handleAppRouterViteRequest(\n options: AppRouterViteRuntimeMiddlewareOptions,\n incoming: Connect.IncomingMessage,\n outgoing: ServerResponse,\n next: Connect.NextFunction,\n): Promise<void> {\n try {\n const project = resolveAppRouterProjectOptions(options);\n const host = resolveRequestHost({\n allowedHosts: options.allowedHosts,\n fallbackHost: \"localhost\",\n hostPolicy: options.hostPolicy,\n rawHost: incoming.headers.host,\n });\n const origin = `http://${host}`;\n const url = new URL(incoming.url ?? \"/\", origin);\n\n if (url.pathname.startsWith(clientPrefix)) {\n if (options.viteDevServer !== undefined) {\n const transformed = await options.viteDevServer.transformRequest(\n `${url.pathname}${url.search}`,\n );\n\n if (transformed !== null) {\n await sendResponse(\n outgoing,\n new Response(transformed.code, {\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n }),\n );\n return;\n }\n }\n\n await sendResponse(\n outgoing,\n await renderAppRouterClientAsset(project.routesDir, url.pathname, {\n vitePlugins: options.vitePlugins,\n }),\n );\n return;\n }\n\n const request = nodeRequestToWebRequest(incoming, origin);\n const routeTransformPlugins = options.navigationScanVitePlugins ?? options.vitePlugins;\n const routes = await scanAppRoutes({ appDir: project.routesDir });\n const routeMatcher = createRouteMatcher(routes);\n const readRouteSource = createCachedRouteSourceReader();\n const [clientStyles, clientStylesByFile, navigationScripts] = await Promise.all([\n devRouteStyles(project, routes, readRouteSource),\n devSpecialRouteStyles(project, readRouteSource),\n devNavigationScripts(\n project.routesDir,\n routes,\n readRouteSource,\n options.clientRouteInferenceCache,\n routeTransformPlugins,\n ),\n ]);\n\n await sendResponse(\n outgoing,\n await renderAppRequest({\n appDir: project.routesDir,\n define: options.define,\n dev: true,\n importPolicy: {\n ...options.importPolicy,\n allowedSourceDirs: project.allowedSourceDirs,\n projectRoot: project.projectRoot,\n },\n clientStyles,\n clientStylesByFile,\n clientRouteInferenceCache: options.clientRouteInferenceCache,\n navigationScripts,\n request,\n logger: options.logger,\n routeCache: options.routeCache,\n routeMatcher,\n routes,\n serverActions: options.serverActions,\n devServerModuleCacheVersion: options.devServerModuleCacheVersion?.(),\n vitePlugins: routeTransformPlugins,\n }),\n );\n } catch (error) {\n next(error);\n }\n}\n\n/**\n * Renders a development client asset generated by the app-router Vite integration.\n */\nexport async function renderAppRouterClientAsset(\n appDir: string,\n pathname: string,\n options: { dev?: boolean; vitePlugins?: readonly PluginOption[] | undefined } = {},\n): Promise<Response> {\n if (pathname === `/_mreact/client/${navigationRuntimeScriptForDev()}`) {\n const output = await buildNavigationRuntimeBundle();\n\n return new Response(options.dev === true ? withViteHmrRuntime(output.code) : output.code, {\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n });\n }\n\n const routes = await scanAppRoutes({ appDir });\n const route = routes.find(\n (candidate) =>\n candidate.kind === \"page\" &&\n `/_mreact/client/${clientScriptForPath(candidate.path)}` === pathname,\n );\n\n if (route === undefined || route.kind !== \"page\") {\n return new Response(\"Not Found\", { status: 404 });\n }\n\n const code = await readFile(route.file, \"utf8\");\n const clientSource = stripRouteClientOnlyExports(code, route.file);\n let references: Awaited<ReturnType<typeof collectClientRouteReferences>>;\n\n try {\n references = await collectClientRouteReferences({\n appDir,\n code: clientSource,\n filename: route.file,\n vitePlugins: options.vitePlugins,\n });\n } catch (error) {\n return clientAssetBuildErrorResponse(route.file, error);\n }\n\n if (!references.client) {\n if (isClientRouteSource(clientSource)) {\n return clientAssetBuildErrorResponse(\n route.file,\n new Error(\n [\n \"Client route analysis did not produce a client asset.\",\n \"Browser build cannot import Node builtins or other server-only modules.\",\n ...references.diagnostics.map((diagnostic) => diagnostic.message),\n ].join(\"\\n\"),\n ),\n );\n }\n\n return new Response(\"Not Found\", { status: 404 });\n }\n\n let bundle: string;\n\n try {\n bundle = await buildClientRouteBundle({\n code: clientSource,\n clientBoundaryImports: references.clientBoundaryImports,\n clientReferenceImports: references.clientReferenceImports,\n clientReferenceManifest: references.clientReferenceManifest,\n filename: route.file,\n routePath: route.path,\n vitePlugins: options.vitePlugins,\n });\n } catch (error) {\n return clientAssetBuildErrorResponse(route.file, error);\n }\n\n return new Response(options.dev === true ? withViteHmrRuntime(bundle) : bundle, {\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n });\n}\n\nasync function renderAppRouterClientRouteDevModule(\n appDir: string,\n pathname: string,\n options: { vitePlugins?: readonly PluginOption[] | undefined } = {},\n): Promise<string> {\n const route = await clientRouteForRequestPath(appDir, pathname);\n\n if (route === undefined) {\n throw new Error(`MReact client route asset was not found: ${pathname}`);\n }\n\n const code = await readFile(route.file, \"utf8\");\n const clientSource = stripRouteClientOnlyExports(code, route.file);\n const references = await collectClientRouteReferences({\n appDir,\n code: clientSource,\n filename: route.file,\n vitePlugins: options.vitePlugins,\n });\n\n if (!references.client) {\n throw new Error(\n isClientRouteSource(clientSource)\n ? [\n \"Client route analysis did not produce a client asset.\",\n \"Browser build cannot import Node builtins or other server-only modules.\",\n ...references.diagnostics.map((diagnostic) => diagnostic.message),\n ].join(\"\\n\")\n : `MReact client route asset was not found: ${pathname}`,\n );\n }\n\n const entry = await buildClientRouteEntrySource({\n code: clientSource,\n clientBoundaryImports: references.clientBoundaryImports,\n clientReferenceImports: references.clientReferenceImports,\n clientReferenceManifest: references.clientReferenceManifest,\n filename: route.file,\n routePath: route.path,\n vitePlugins: options.vitePlugins,\n });\n\n return withViteHmrRuntime(entry.code);\n}\n\nasync function clientRouteForRequestPath(appDir: string, pathname: string) {\n const routes = await scanAppRoutes({ appDir });\n\n return routes.find(\n (candidate) =>\n candidate.kind === \"page\" &&\n `/_mreact/client/${clientScriptForPath(candidate.path)}` === pathname,\n );\n}\n\nfunction clientRequestPath(id: string): string {\n const [path] = id.split(/[?#]/, 1);\n\n return path ?? id;\n}\n\nfunction clientRouteModuleId(filename: string, requestPath: string): string {\n return `${normalizePath(filename)}?${clientRouteModuleQuery}=${encodeURIComponent(requestPath)}`;\n}\n\nfunction clientRouteModuleRequestPath(id: string): string | undefined {\n const queryStart = id.indexOf(\"?\");\n\n if (queryStart === -1) {\n return undefined;\n }\n\n const params = new URLSearchParams(id.slice(queryStart + 1));\n const value = params.get(clientRouteModuleQuery);\n\n return value === null ? undefined : value;\n}\n\nfunction isMreactClientDevModuleId(id: string | null | undefined): boolean {\n return (\n id?.startsWith(virtualClientPrefix) === true ||\n id?.includes(`?${clientRouteModuleQuery}=`) === true ||\n id?.includes(`&${clientRouteModuleQuery}=`) === true\n );\n}\n\nfunction isDevCssSourceModuleId(id: string): boolean {\n return new URLSearchParams(id.slice(id.indexOf(\"?\") + 1)).has(devCssSourceQuery);\n}\n\nasync function loadDevCssSourceModule(options: {\n cssFile: string;\n sourceDirs: readonly string[];\n}): Promise<string | undefined> {\n const code = await readFile(options.cssFile, \"utf8\");\n\n return prependTailwindSourceDirectives({\n code,\n cssFile: options.cssFile,\n sourceDirs: options.sourceDirs,\n });\n}\n\nfunction importerInRuntimePackage(\n importer: string | undefined,\n directories: readonly string[],\n packageNames: readonly string[],\n): boolean {\n if (importer === undefined) {\n return false;\n }\n\n const normalizedImporter = normalizePath(importer);\n return (\n directories.some((directory) => normalizedImporter.startsWith(`${directory}/`)) ||\n packageNames.some((packageName) => normalizedImporter.includes(`/node_modules/${packageName}/`))\n );\n}\n\nfunction clientAssetBuildErrorResponse(filename: string, error: unknown): Response {\n const message = [\n `Failed to build mreact client route asset for ${filename}.`,\n error instanceof Error ? error.message : String(error),\n ].join(\"\\n\");\n\n return new Response(`throw new Error(${JSON.stringify(message)});\\n`, {\n status: 500,\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n });\n}\n\nasync function devRouteStyles(\n project: ResolvedAppRouterProject,\n routes: readonly AppRoute[],\n readSource: (file: string) => Promise<string | undefined>,\n): Promise<ReadonlyMap<string, readonly string[]>> {\n const entries = await Promise.all(\n routes.map(async (route) => {\n if (route.kind !== \"page\") {\n return undefined;\n }\n\n const hrefs = await collectRouteCssHrefs({\n appDir: project.routesDir,\n hrefPrefix: devCssPrefix,\n pageFile: route.file,\n projectRoot: project.projectRoot,\n readSource,\n });\n\n return hrefs.length === 0 ? undefined : ([route.path, hrefs as readonly string[]] as const);\n }),\n );\n const routeStyles = entries.filter(\n (entry): entry is readonly [string, readonly string[]] => entry !== undefined,\n );\n\n return new Map<string, readonly string[]>(routeStyles);\n}\n\nasync function devSpecialRouteStyles(\n project: ResolvedAppRouterProject,\n readSource: (file: string) => Promise<string | undefined>,\n): Promise<ReadonlyMap<string, readonly string[]>> {\n const entries = await Promise.all(\n (await collectSpecialBoundaryFiles(project.routesDir)).map(async (file) => {\n const hrefs = await collectRouteCssHrefs({\n appDir: project.routesDir,\n hrefPrefix: devCssPrefix,\n pageFile: file,\n projectRoot: project.projectRoot,\n readSource,\n });\n\n return hrefs.length === 0 ? undefined : ([file, hrefs as readonly string[]] as const);\n }),\n );\n const routeStyles = entries.filter(\n (entry): entry is readonly [string, readonly string[]] => entry !== undefined,\n );\n\n return new Map<string, readonly string[]>(routeStyles);\n}\n\nasync function devNavigationScripts(\n appDir: string,\n routes: readonly AppRoute[],\n readSource: (file: string) => Promise<string | undefined>,\n inferenceCache?: ClientRouteInferenceCache | undefined,\n vitePlugins?: readonly PluginOption[] | undefined,\n): Promise<ReadonlyMap<string, string>> {\n const cache = inferenceCache ?? createClientRouteInferenceCache();\n const entries = await Promise.all(\n routes.map(async (route) => {\n if (route.kind !== \"page\") {\n return undefined;\n }\n\n const source = await readSource(route.file);\n if (source === undefined) {\n return undefined;\n }\n const references = await collectClientRouteReferences({\n appDir,\n cache,\n code: source,\n filename: route.file,\n routePath: route.path,\n vitePlugins,\n });\n const navigation = await resolveNavigationRuntime({\n appDir,\n cache,\n code: source,\n filename: route.file,\n references,\n vitePlugins,\n });\n\n for (const diagnostic of references.diagnostics) {\n console.warn(formatClientRouteInferenceDiagnostic(diagnostic));\n }\n const navigationRuntimeDiagnostic = navigationRuntimeLinkDisabledDiagnostic({\n filename: route.file,\n references,\n routePath: route.path,\n source,\n });\n\n if (navigationRuntimeDiagnostic !== undefined) {\n console.warn(formatClientRouteInferenceDiagnostic(navigationRuntimeDiagnostic));\n }\n\n return navigation ? ([route.path, navigationRuntimeScriptForDev()] as const) : undefined;\n }),\n );\n\n return new Map(\n entries.filter((entry): entry is readonly [string, string] => entry !== undefined),\n );\n}\n\nfunction createDevCssProxyMiddleware(): Connect.NextHandleFunction {\n return (incoming, outgoing, next) => {\n const originalUrl = incoming.url ?? \"/\";\n const url = new URL(originalUrl, \"http://mreact.local\");\n\n if (!url.pathname.startsWith(devCssPrefix)) {\n next();\n return;\n }\n\n const sourcePath = `/${url.pathname.slice(devCssPrefix.length)}`;\n\n if (sourcePath === \"/\" || sourcePath.includes(\"\\0\")) {\n next();\n return;\n }\n\n const originalAccept = incoming.headers.accept;\n let restored = false;\n const restore = () => {\n if (restored) {\n return;\n }\n restored = true;\n incoming.url = originalUrl;\n if (originalAccept === undefined) {\n delete incoming.headers.accept;\n } else {\n incoming.headers.accept = originalAccept;\n }\n };\n\n const sourceSearch = new URLSearchParams(url.search);\n sourceSearch.set(devCssSourceQuery, \"\");\n incoming.url = `${sourcePath}?${sourceSearch.toString()}`;\n incoming.headers.accept = \"text/css,*/*;q=0.1\";\n outgoing.once(\"finish\", restore);\n outgoing.once(\"close\", restore);\n next();\n };\n}\n\nfunction withViteHmrRuntime(code: string): string {\n return `import \"/@vite/client\";\nif (import.meta.hot?.data.__mreactRouteStates) {\n globalThis.__mreactRouteStates = import.meta.hot.data.__mreactRouteStates;\n}\n${code}\nif (import.meta.hot) {\n const __mreactPreserveRouteState = () => {\n import.meta.hot.data.__mreactRouteStates = globalThis.__mreactRouteStates;\n };\n import.meta.hot.dispose(__mreactPreserveRouteState);\n import.meta.hot.accept((module) => {\n module?.__mreactHydrateRoute?.();\n });\n}\n`;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reckona/mreact-router",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.182",
|
|
4
4
|
"description": "File-system app router, SSR, actions, and deployment adapters for mreact.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jsx",
|
|
@@ -105,20 +105,20 @@
|
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
107
|
"typescript": "^6.0.3",
|
|
108
|
-
"@reckona/mreact": "0.0.
|
|
109
|
-
"@reckona/mreact-compat": "0.0.
|
|
110
|
-
"@reckona/mreact-
|
|
111
|
-
"@reckona/mreact-query": "0.0.
|
|
112
|
-
"@reckona/mreact-
|
|
113
|
-
"@reckona/mreact-reactive-
|
|
114
|
-
"@reckona/mreact-reactive-
|
|
115
|
-
"@reckona/mreact-server": "0.0.
|
|
116
|
-
"@reckona/mreact-shared": "0.0.
|
|
108
|
+
"@reckona/mreact": "0.0.182",
|
|
109
|
+
"@reckona/mreact-compat": "0.0.182",
|
|
110
|
+
"@reckona/mreact-devtools": "0.0.182",
|
|
111
|
+
"@reckona/mreact-query": "0.0.182",
|
|
112
|
+
"@reckona/mreact-compiler": "0.0.182",
|
|
113
|
+
"@reckona/mreact-reactive-dom": "0.0.182",
|
|
114
|
+
"@reckona/mreact-reactive-core": "0.0.182",
|
|
115
|
+
"@reckona/mreact-server": "0.0.182",
|
|
116
|
+
"@reckona/mreact-shared": "0.0.182"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
119
|
"vite": ">=8 <9"
|
|
120
120
|
},
|
|
121
121
|
"optionalDependencies": {
|
|
122
|
-
"@reckona/mreact-router-native": "0.0.
|
|
122
|
+
"@reckona/mreact-router-native": "0.0.182"
|
|
123
123
|
}
|
|
124
124
|
}
|
package/src/actions.ts
CHANGED
|
@@ -40,13 +40,18 @@ import {
|
|
|
40
40
|
function isProductionEnvironment(): boolean {
|
|
41
41
|
return process.env.NODE_ENV === "production";
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
function isLocalServerActionEnvironment(): boolean {
|
|
45
|
+
return process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
|
|
46
|
+
}
|
|
43
47
|
const formFieldModuleId = "__mreact_module_id";
|
|
44
48
|
const formFieldExportName = "__mreact_export_name";
|
|
45
49
|
const formFieldNonce = "__mreact_action_nonce";
|
|
46
50
|
const formFieldActionToken = "__mreact_action_token";
|
|
47
51
|
const csrfTokenPlaceholder = "__mreact_action_csrf_placeholder__";
|
|
48
52
|
const actionNoncePlaceholder = "__mreact_action_nonce_placeholder__";
|
|
49
|
-
const
|
|
53
|
+
const MIN_ACTION_TOKEN_SECRET_BYTES = 32;
|
|
54
|
+
const actionTokenSecret = configuredActionTokenSecret(process.env.MREACT_SERVER_ACTION_SECRET);
|
|
50
55
|
// Bounded default replay store for form-action nonces. The previous
|
|
51
56
|
// implementation was an unbounded Set that grew with every successful
|
|
52
57
|
// submission (Issue 069). Production callers should still pass a shared
|
|
@@ -92,6 +97,20 @@ function defaultActionTokenSecret(): string {
|
|
|
92
97
|
return randomBytes(32).toString("base64url");
|
|
93
98
|
}
|
|
94
99
|
|
|
100
|
+
function configuredActionTokenSecret(value: string | undefined): string {
|
|
101
|
+
if (value === undefined) {
|
|
102
|
+
return defaultActionTokenSecret();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (Buffer.byteLength(value, "utf8") < MIN_ACTION_TOKEN_SECRET_BYTES) {
|
|
106
|
+
throw new Error(
|
|
107
|
+
`MREACT_SERVER_ACTION_SECRET must be at least ${MIN_ACTION_TOKEN_SECRET_BYTES} bytes.`,
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return value;
|
|
112
|
+
}
|
|
113
|
+
|
|
95
114
|
class BoundedReplayStore {
|
|
96
115
|
private readonly entries = new Map<string, number>();
|
|
97
116
|
|
|
@@ -890,7 +909,7 @@ function warnIfUnrestrictedServerActions(
|
|
|
890
909
|
): void {
|
|
891
910
|
if (
|
|
892
911
|
allowedActions !== undefined ||
|
|
893
|
-
|
|
912
|
+
isLocalServerActionEnvironment() ||
|
|
894
913
|
warnedUnrestrictedServerActions
|
|
895
914
|
) {
|
|
896
915
|
return;
|
|
@@ -905,7 +924,7 @@ function warnIfUnrestrictedServerActions(
|
|
|
905
924
|
function validateServerActionManifest(
|
|
906
925
|
allowedActions: readonly AppRouterAllowedServerAction[] | "any" | undefined,
|
|
907
926
|
): Response | undefined {
|
|
908
|
-
if (allowedActions !== undefined ||
|
|
927
|
+
if (allowedActions !== undefined || isLocalServerActionEnvironment()) {
|
|
909
928
|
return undefined;
|
|
910
929
|
}
|
|
911
930
|
|
|
@@ -1437,10 +1456,6 @@ function moduleIdForFile(appDir: string, file: string): string {
|
|
|
1437
1456
|
}
|
|
1438
1457
|
|
|
1439
1458
|
function validateServerActionRequestOrigin(request: Request): Response | undefined {
|
|
1440
|
-
if (!isProductionEnvironment()) {
|
|
1441
|
-
return undefined;
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
1459
|
const expectedOrigin = new URL(request.url).origin;
|
|
1445
1460
|
const origin = request.headers.get("origin");
|
|
1446
1461
|
|
|
@@ -1452,8 +1467,10 @@ function validateServerActionRequestOrigin(request: Request): Response | undefin
|
|
|
1452
1467
|
|
|
1453
1468
|
const referer = request.headers.get("referer");
|
|
1454
1469
|
|
|
1455
|
-
if (referer === null) {
|
|
1456
|
-
return
|
|
1470
|
+
if (referer === null || isLocalServerActionEnvironment()) {
|
|
1471
|
+
return isLocalServerActionEnvironment()
|
|
1472
|
+
? undefined
|
|
1473
|
+
: jsonResponse({ ok: false, error: "Origin not allowed." }, 403);
|
|
1457
1474
|
}
|
|
1458
1475
|
|
|
1459
1476
|
try {
|
package/src/built-assets.ts
CHANGED
|
@@ -87,9 +87,8 @@ export async function readBuiltPublicAsset(
|
|
|
87
87
|
return undefined;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
const normalized =
|
|
91
|
-
|
|
92
|
-
if (isAbsolute(normalized) || normalized === ".." || normalized.startsWith("../")) {
|
|
90
|
+
const normalized = safeBuiltClientAssetPath(relativePath);
|
|
91
|
+
if (normalized === undefined) {
|
|
93
92
|
return undefined;
|
|
94
93
|
}
|
|
95
94
|
|
package/src/cache-config.ts
CHANGED
package/src/cache.ts
CHANGED
|
@@ -203,6 +203,11 @@ export function routeCachePolicyFromSource(code: string): RouteCachePolicy | und
|
|
|
203
203
|
const seconds = match?.groups?.seconds === undefined ? undefined : Number(match.groups.seconds);
|
|
204
204
|
|
|
205
205
|
if (seconds === undefined || !Number.isFinite(seconds)) {
|
|
206
|
+
if (/^\s*export\s+const\s+revalidate\s*=/m.test(code)) {
|
|
207
|
+
console.warn(
|
|
208
|
+
"export const revalidate must be a plain integer literal, e.g. export const revalidate = 3600",
|
|
209
|
+
);
|
|
210
|
+
}
|
|
206
211
|
return undefined;
|
|
207
212
|
}
|
|
208
213
|
|
|
@@ -362,8 +367,10 @@ function requestCarriesCredentials(request: Request | undefined): boolean {
|
|
|
362
367
|
lower === "x-api-key" ||
|
|
363
368
|
lower === "cf-access-jwt-assertion" ||
|
|
364
369
|
lower === "proxy-authorization" ||
|
|
370
|
+
lower === "x-access-token" ||
|
|
365
371
|
lower === "x-auth-token" ||
|
|
366
372
|
lower === "x-authenticated-user" ||
|
|
373
|
+
lower === "x-id-token" ||
|
|
367
374
|
lower === "x-forwarded-user" ||
|
|
368
375
|
lower === "x-session-id" ||
|
|
369
376
|
lower === "x-user-email" ||
|
|
@@ -380,7 +387,7 @@ function requestCarriesCredentials(request: Request | undefined): boolean {
|
|
|
380
387
|
return true;
|
|
381
388
|
}
|
|
382
389
|
|
|
383
|
-
|
|
390
|
+
continue;
|
|
384
391
|
}
|
|
385
392
|
|
|
386
393
|
return false;
|
|
@@ -391,12 +398,18 @@ const PUBLIC_ROUTE_CACHE_REQUEST_HEADERS = new Set([
|
|
|
391
398
|
"accept-encoding",
|
|
392
399
|
"accept-language",
|
|
393
400
|
"cache-control",
|
|
401
|
+
"cf-connecting-ip",
|
|
402
|
+
"cf-ipcountry",
|
|
403
|
+
"cf-ray",
|
|
394
404
|
"connection",
|
|
395
405
|
"dnt",
|
|
396
406
|
"host",
|
|
407
|
+
"if-none-match",
|
|
397
408
|
"pragma",
|
|
409
|
+
"priority",
|
|
398
410
|
"purpose",
|
|
399
411
|
"referer",
|
|
412
|
+
"save-data",
|
|
400
413
|
"sec-ch-prefers-color-scheme",
|
|
401
414
|
"sec-ch-prefers-reduced-motion",
|
|
402
415
|
"sec-ch-ua",
|
|
@@ -408,8 +421,14 @@ const PUBLIC_ROUTE_CACHE_REQUEST_HEADERS = new Set([
|
|
|
408
421
|
"sec-fetch-user",
|
|
409
422
|
"upgrade-insecure-requests",
|
|
410
423
|
"user-agent",
|
|
424
|
+
"via",
|
|
411
425
|
"x-mreact-navigation",
|
|
412
426
|
"x-mreact-navigation-cache",
|
|
427
|
+
"x-real-ip",
|
|
428
|
+
"x-request-id",
|
|
429
|
+
"x-forwarded-for",
|
|
430
|
+
"x-forwarded-host",
|
|
431
|
+
"x-forwarded-proto",
|
|
413
432
|
]);
|
|
414
433
|
|
|
415
434
|
/**
|
package/src/client.ts
CHANGED
|
@@ -3849,6 +3849,20 @@ function __mreactObserveViewportPrefetchAnchors(root) {
|
|
|
3849
3849
|
|
|
3850
3850
|
function __mreactApplyOutOfOrderFragments(root) {
|
|
3851
3851
|
const fragments = Array.from(root.querySelectorAll("template[data-mreact-oob-fragment]"));
|
|
3852
|
+
const completionMarkers = new Map();
|
|
3853
|
+
for (const marker of root.querySelectorAll("[data-mreact-oob-complete]")) {
|
|
3854
|
+
const id = marker.getAttribute("data-mreact-oob-complete");
|
|
3855
|
+
if (!completionMarkers.has(id)) {
|
|
3856
|
+
completionMarkers.set(id, marker);
|
|
3857
|
+
}
|
|
3858
|
+
}
|
|
3859
|
+
const placeholders = new Map();
|
|
3860
|
+
for (const placeholder of root.querySelectorAll("[data-mreact-oob-placeholder]")) {
|
|
3861
|
+
const id = placeholder.getAttribute("data-mreact-oob-placeholder");
|
|
3862
|
+
if (!placeholders.has(id)) {
|
|
3863
|
+
placeholders.set(id, placeholder);
|
|
3864
|
+
}
|
|
3865
|
+
}
|
|
3852
3866
|
|
|
3853
3867
|
for (const fragment of fragments) {
|
|
3854
3868
|
const id = fragment.getAttribute("data-mreact-oob-fragment");
|
|
@@ -3857,16 +3871,12 @@ function __mreactApplyOutOfOrderFragments(root) {
|
|
|
3857
3871
|
continue;
|
|
3858
3872
|
}
|
|
3859
3873
|
|
|
3860
|
-
const completionMarker =
|
|
3861
|
-
.find((candidate) => candidate.getAttribute("data-mreact-oob-complete") === id);
|
|
3862
|
-
|
|
3874
|
+
const completionMarker = completionMarkers.get(id);
|
|
3863
3875
|
if (completionMarker === undefined) {
|
|
3864
3876
|
continue;
|
|
3865
3877
|
}
|
|
3866
3878
|
|
|
3867
|
-
const placeholder =
|
|
3868
|
-
.find((candidate) => candidate.getAttribute("data-mreact-oob-placeholder") === id);
|
|
3869
|
-
|
|
3879
|
+
const placeholder = placeholders.get(id);
|
|
3870
3880
|
if (placeholder === undefined) {
|
|
3871
3881
|
continue;
|
|
3872
3882
|
}
|
package/src/csrf.ts
CHANGED
|
@@ -8,7 +8,7 @@ const formFieldCsrf = "__mreact_csrf";
|
|
|
8
8
|
export const formCsrfFieldName = formFieldCsrf;
|
|
9
9
|
|
|
10
10
|
export function serverActionCookie(csrfToken: string): string {
|
|
11
|
-
const
|
|
11
|
+
const secure = shouldUseSecureCsrfCookie();
|
|
12
12
|
const parts = [
|
|
13
13
|
`${currentCsrfCookieName()}=${encodeURIComponent(csrfToken)}`,
|
|
14
14
|
"Path=/",
|
|
@@ -16,7 +16,7 @@ export function serverActionCookie(csrfToken: string): string {
|
|
|
16
16
|
"HttpOnly",
|
|
17
17
|
];
|
|
18
18
|
|
|
19
|
-
if (
|
|
19
|
+
if (secure) {
|
|
20
20
|
parts.push("Secure");
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -97,16 +97,23 @@ function randomToken(): string {
|
|
|
97
97
|
return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
function
|
|
101
|
-
return
|
|
100
|
+
function isLocalCsrfEnvironment(): boolean {
|
|
101
|
+
return (
|
|
102
|
+
typeof process !== "undefined" &&
|
|
103
|
+
(process.env?.NODE_ENV === "development" || process.env?.NODE_ENV === "test")
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function shouldUseSecureCsrfCookie(): boolean {
|
|
108
|
+
return !isLocalCsrfEnvironment();
|
|
102
109
|
}
|
|
103
110
|
|
|
104
111
|
function currentCsrfCookieName(): string {
|
|
105
|
-
return
|
|
112
|
+
return shouldUseSecureCsrfCookie() ? csrfCookieNameProduction : csrfCookieNameDevelopment;
|
|
106
113
|
}
|
|
107
114
|
|
|
108
115
|
function csrfCookieNamesRead(): readonly string[] {
|
|
109
|
-
return
|
|
116
|
+
return shouldUseSecureCsrfCookie()
|
|
110
117
|
? [csrfCookieNameProduction]
|
|
111
118
|
: [csrfCookieNameProduction, csrfCookieNameDevelopment];
|
|
112
119
|
}
|