one 1.25.13 → 1.25.15
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/cjs/cli/build.cjs +29 -25
- package/dist/cjs/cli/build.native.js +262 -219
- package/dist/cjs/cli/build.native.js.map +1 -1
- package/dist/cjs/cli/buildPage.cjs +7 -7
- package/dist/cjs/cli/buildPage.native.js +7 -7
- package/dist/cjs/cli/buildPage.native.js.map +1 -1
- package/dist/cjs/cli/buildPageWorker.cjs +1 -1
- package/dist/cjs/cli/buildPageWorker.native.js +1 -1
- package/dist/cjs/cli/buildPageWorker.native.js.map +1 -1
- package/dist/cjs/cli/serverRouteModules.cjs +47 -0
- package/dist/cjs/cli/serverRouteModules.native.js +52 -0
- package/dist/cjs/cli/serverRouteModules.native.js.map +1 -0
- package/dist/cjs/cli/workerPool.native.js.map +1 -1
- package/dist/cjs/createApp.cjs +3 -0
- package/dist/cjs/headless-server.native.js.map +1 -1
- package/dist/cjs/headless.cjs +4 -0
- package/dist/cjs/headless.native.js +4 -0
- package/dist/cjs/headless.native.js.map +1 -1
- package/dist/cjs/router/diagnoseRouteLoadFailure.native.js.map +1 -1
- package/dist/cjs/router/useViteRoutes.cjs +9 -1
- package/dist/cjs/router/useViteRoutes.native.js +9 -1
- package/dist/cjs/router/useViteRoutes.native.js.map +1 -1
- package/dist/cjs/server/oneServe.cjs +23 -4
- package/dist/cjs/server/oneServe.native.js +25 -6
- package/dist/cjs/server/oneServe.native.js.map +1 -1
- package/dist/cjs/server/routeExportsFromEntry.cjs +47 -0
- package/dist/cjs/server/routeExportsFromEntry.native.js +52 -0
- package/dist/cjs/server/routeExportsFromEntry.native.js.map +1 -0
- package/dist/cjs/server/workerHandler.cjs +19 -6
- package/dist/cjs/server/workerHandler.native.js +20 -6
- package/dist/cjs/server/workerHandler.native.js.map +1 -1
- package/dist/cjs/server/workerHandler.test.cjs +24 -16
- package/dist/cjs/server/workerHandler.test.native.js +27 -16
- package/dist/cjs/server/workerHandler.test.native.js.map +1 -1
- package/dist/cjs/views/ScrollBehavior.native.js.map +1 -1
- package/dist/cjs/vite/cloudflareWranglerConfig.native.js.map +1 -1
- package/dist/cjs/vite/one.native.js.map +1 -1
- package/dist/cjs/vite/plugins/virtualEntryPlugin.cjs +7 -6
- package/dist/cjs/vite/plugins/virtualEntryPlugin.native.js +9 -6
- package/dist/cjs/vite/plugins/virtualEntryPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/workerdDevPlugin.cjs +0 -13
- package/dist/cjs/vite/plugins/workerdDevPlugin.native.js +26 -58
- package/dist/cjs/vite/plugins/workerdDevPlugin.native.js.map +1 -1
- package/dist/cjs/vite/replaceLoader.cjs +6 -3
- package/dist/cjs/vite/replaceLoader.native.js +8 -3
- package/dist/cjs/vite/replaceLoader.native.js.map +1 -1
- package/dist/esm/cli/build.mjs +30 -26
- package/dist/esm/cli/build.mjs.map +1 -1
- package/dist/esm/cli/build.native.js +263 -220
- package/dist/esm/cli/build.native.js.map +1 -1
- package/dist/esm/cli/buildPage.mjs +7 -7
- package/dist/esm/cli/buildPage.mjs.map +1 -1
- package/dist/esm/cli/buildPage.native.js +7 -7
- package/dist/esm/cli/buildPage.native.js.map +1 -1
- package/dist/esm/cli/buildPageWorker.mjs +1 -1
- package/dist/esm/cli/buildPageWorker.mjs.map +1 -1
- package/dist/esm/cli/buildPageWorker.native.js +1 -1
- package/dist/esm/cli/buildPageWorker.native.js.map +1 -1
- package/dist/esm/cli/serverRouteModules.mjs +22 -0
- package/dist/esm/cli/serverRouteModules.mjs.map +1 -0
- package/dist/esm/cli/serverRouteModules.native.js +24 -0
- package/dist/esm/cli/serverRouteModules.native.js.map +1 -0
- package/dist/esm/cli/workerPool.mjs.map +1 -1
- package/dist/esm/cli/workerPool.native.js.map +1 -1
- package/dist/esm/createApp.mjs +4 -1
- package/dist/esm/createApp.mjs.map +1 -1
- package/dist/esm/fork/useLinking.native.test.mjs +1 -1
- package/dist/esm/getURL.native.test.mjs +1 -1
- package/dist/esm/headless-server.mjs.map +1 -1
- package/dist/esm/headless-server.native.js.map +1 -1
- package/dist/esm/headless.mjs +4 -0
- package/dist/esm/headless.mjs.map +1 -1
- package/dist/esm/headless.native.js +4 -0
- package/dist/esm/headless.native.js.map +1 -1
- package/dist/esm/router/diagnoseRouteLoadFailure.mjs.map +1 -1
- package/dist/esm/router/diagnoseRouteLoadFailure.native.js.map +1 -1
- package/dist/esm/router/hmrImport.native.test.mjs +1 -1
- package/dist/esm/router/routeHmr.native.test.mjs +1 -1
- package/dist/esm/router/routeHmr.native.test.mjs.map +1 -1
- package/dist/esm/router/useViteRoutes.mjs +9 -1
- package/dist/esm/router/useViteRoutes.mjs.map +1 -1
- package/dist/esm/router/useViteRoutes.native.js +9 -1
- package/dist/esm/router/useViteRoutes.native.js.map +1 -1
- package/dist/esm/server/oneServe.mjs +23 -4
- package/dist/esm/server/oneServe.mjs.map +1 -1
- package/dist/esm/server/oneServe.native.js +25 -6
- package/dist/esm/server/oneServe.native.js.map +1 -1
- package/dist/esm/server/routeExportsFromEntry.mjs +21 -0
- package/dist/esm/server/routeExportsFromEntry.mjs.map +1 -0
- package/dist/esm/server/routeExportsFromEntry.native.js +23 -0
- package/dist/esm/server/routeExportsFromEntry.native.js.map +1 -0
- package/dist/esm/server/workerHandler.mjs +19 -6
- package/dist/esm/server/workerHandler.mjs.map +1 -1
- package/dist/esm/server/workerHandler.native.js +20 -6
- package/dist/esm/server/workerHandler.native.js.map +1 -1
- package/dist/esm/server/workerHandler.test.mjs +24 -16
- package/dist/esm/server/workerHandler.test.mjs.map +1 -1
- package/dist/esm/server/workerHandler.test.native.js +27 -16
- package/dist/esm/server/workerHandler.test.native.js.map +1 -1
- package/dist/esm/views/ScrollBehavior.mjs.map +1 -1
- package/dist/esm/views/ScrollBehavior.native.js.map +1 -1
- package/dist/esm/vite/cloudflareWranglerConfig.mjs.map +1 -1
- package/dist/esm/vite/cloudflareWranglerConfig.native.js.map +1 -1
- package/dist/esm/vite/one.mjs.map +1 -1
- package/dist/esm/vite/one.native.js.map +1 -1
- package/dist/esm/vite/plugins/virtualEntryPlugin.mjs +7 -6
- package/dist/esm/vite/plugins/virtualEntryPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/virtualEntryPlugin.native.js +9 -6
- package/dist/esm/vite/plugins/virtualEntryPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/workerdDevPlugin.mjs +0 -13
- package/dist/esm/vite/plugins/workerdDevPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/workerdDevPlugin.native.js +26 -58
- package/dist/esm/vite/plugins/workerdDevPlugin.native.js.map +1 -1
- package/dist/esm/vite/replaceLoader.mjs +6 -3
- package/dist/esm/vite/replaceLoader.mjs.map +1 -1
- package/dist/esm/vite/replaceLoader.native.js +8 -3
- package/dist/esm/vite/replaceLoader.native.js.map +1 -1
- package/package.json +9 -9
- package/src/cli/build.ts +41 -32
- package/src/cli/buildPage.ts +9 -7
- package/src/cli/buildPageWorker.ts +1 -0
- package/src/cli/serverRouteModules.ts +33 -0
- package/src/cli/workerPool.ts +1 -0
- package/src/createApp.tsx +5 -1
- package/src/headless-server.ts +0 -1
- package/src/headless.tsx +5 -0
- package/src/router/diagnoseRouteLoadFailure.ts +3 -1
- package/src/router/useViteRoutes.tsx +9 -1
- package/src/server/oneServe.ts +40 -16
- package/src/server/routeExportsFromEntry.ts +59 -0
- package/src/server/workerHandler.test.ts +21 -16
- package/src/server/workerHandler.ts +25 -7
- package/src/views/ScrollBehavior.tsx +5 -1
- package/src/vite/cloudflareWranglerConfig.ts +8 -4
- package/src/vite/one.ts +4 -1
- package/src/vite/plugins/virtualEntryPlugin.ts +10 -8
- package/src/vite/plugins/workerdDevPlugin.ts +6 -16
- package/src/vite/replaceLoader.ts +10 -2
- package/types/cli/build.d.ts.map +1 -1
- package/types/cli/buildPage.d.ts +1 -1
- package/types/cli/buildPage.d.ts.map +1 -1
- package/types/cli/serverRouteModules.d.ts +2 -0
- package/types/cli/serverRouteModules.d.ts.map +1 -0
- package/types/cli/workerPool.d.ts +1 -0
- package/types/cli/workerPool.d.ts.map +1 -1
- package/types/createApp.d.ts.map +1 -1
- package/types/headless-server.d.ts +0 -1
- package/types/headless-server.d.ts.map +1 -1
- package/types/headless.d.ts.map +1 -1
- package/types/router/diagnoseRouteLoadFailure.d.ts.map +1 -1
- package/types/router/useViteRoutes.d.ts.map +1 -1
- package/types/server/oneServe.d.ts +1 -1
- package/types/server/oneServe.d.ts.map +1 -1
- package/types/server/routeExportsFromEntry.d.ts +29 -0
- package/types/server/routeExportsFromEntry.d.ts.map +1 -0
- package/types/server/workerHandler.d.ts +1 -1
- package/types/server/workerHandler.d.ts.map +1 -1
- package/types/views/ScrollBehavior.d.ts.map +1 -1
- package/types/vite/cloudflareWranglerConfig.d.ts.map +1 -1
- package/types/vite/one.d.ts.map +1 -1
- package/types/vite/plugins/virtualEntryPlugin.d.ts.map +1 -1
- package/types/vite/plugins/workerdDevPlugin.d.ts.map +1 -1
- package/types/vite/replaceLoader.d.ts +2 -1
- package/types/vite/replaceLoader.d.ts.map +1 -1
|
@@ -28,7 +28,9 @@ function collectImports(source: string, base: string): string[] {
|
|
|
28
28
|
out.push(new URL(spec, base).href)
|
|
29
29
|
} catch {}
|
|
30
30
|
}
|
|
31
|
-
for (const m of source.matchAll(
|
|
31
|
+
for (const m of source.matchAll(
|
|
32
|
+
/(?:^|[\s;}])(?:import|export)[^'"]{0,300}?from\s*["']([^"']+)["']/g
|
|
33
|
+
))
|
|
32
34
|
add(m[1])
|
|
33
35
|
for (const m of source.matchAll(/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g)) add(m[1])
|
|
34
36
|
for (const m of source.matchAll(/(?:^|[\s;}])import\s*["']([^"']+)["']/g)) add(m[1])
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { GlobbedRouteImports } from '../types'
|
|
2
2
|
import type { One } from '../vite/types'
|
|
3
|
+
import { handleSkewError, isChunkLoadError } from '../utils/dynamicImport'
|
|
3
4
|
import { diagnoseRouteLoadFailure } from './diagnoseRouteLoadFailure'
|
|
4
5
|
import { hmrImport } from './hmrImport'
|
|
5
6
|
|
|
@@ -146,7 +147,11 @@ export async function preloadRouteModules(href: string): Promise<void> {
|
|
|
146
147
|
.then((mod: any) => {
|
|
147
148
|
preloadedModules[key] = mod
|
|
148
149
|
})
|
|
149
|
-
.catch(() => {
|
|
150
|
+
.catch((err: any) => {
|
|
151
|
+
if (isChunkLoadError(err)) {
|
|
152
|
+
handleSkewError()
|
|
153
|
+
}
|
|
154
|
+
})
|
|
150
155
|
)
|
|
151
156
|
}
|
|
152
157
|
}
|
|
@@ -284,6 +289,9 @@ export function globbedRoutesToRouteContext(
|
|
|
284
289
|
})
|
|
285
290
|
.catch((err) => {
|
|
286
291
|
console.error(`Error loading route`, id, err, new Error().stack)
|
|
292
|
+
if (isChunkLoadError(err)) {
|
|
293
|
+
handleSkewError()
|
|
294
|
+
}
|
|
287
295
|
// rendering an empty component keeps one bad route from taking down the
|
|
288
296
|
// app, but it also makes the failure invisible: nothing inside the route
|
|
289
297
|
// mounts and the only trace is the line above. in dev, hand it to the
|
package/src/server/oneServe.ts
CHANGED
|
@@ -16,10 +16,12 @@ import {
|
|
|
16
16
|
} from '../createHandleRequest'
|
|
17
17
|
import type { RenderAppProps } from '../types'
|
|
18
18
|
import { getPathFromLoaderPath } from '../utils/cleanUrl'
|
|
19
|
+
import { getRouterRootFromOneOptions } from '../utils/getRouterRootFromOneOptions'
|
|
19
20
|
import { toAbsoluteUrl } from '../utils/toAbsolute'
|
|
20
21
|
import { toServerOutputPath } from '../utils/toServerOutputPath'
|
|
21
22
|
import type { One } from '../vite/types'
|
|
22
23
|
import type { RouteInfoCompiled } from './createRoutesManifest'
|
|
24
|
+
import { getRouteExportsFromEntry } from './routeExportsFromEntry'
|
|
23
25
|
import { setSSRLoaderData } from './ssrLoaderData'
|
|
24
26
|
import { getFetchStaticHtml } from './staticHtmlFetcher'
|
|
25
27
|
|
|
@@ -74,8 +76,8 @@ async function readStaticHtml(htmlPath: string, outDir = 'dist'): Promise<string
|
|
|
74
76
|
* Modules are loaded on-demand when a route is matched, not all upfront.
|
|
75
77
|
*/
|
|
76
78
|
type LazyRoutes = {
|
|
79
|
+
pages?: Record<string, () => Promise<any>>
|
|
77
80
|
serverEntry: () => Promise<{ default: { render: (props: any) => any } }>
|
|
78
|
-
pages: Record<string, () => Promise<any>>
|
|
79
81
|
api: Record<string, () => Promise<any>>
|
|
80
82
|
middlewares: Record<string, () => Promise<any>>
|
|
81
83
|
}
|
|
@@ -150,6 +152,7 @@ export async function oneServe(
|
|
|
150
152
|
}
|
|
151
153
|
|
|
152
154
|
const apiCJS = oneOptions.build?.api?.outputFormat === 'cjs'
|
|
155
|
+
const routerRoot = getRouterRootFromOneOptions(oneOptions)
|
|
153
156
|
|
|
154
157
|
// pre-computed constants to avoid per-request overhead
|
|
155
158
|
const useStreaming = !process.env.ONE_BUFFERED_SSR
|
|
@@ -169,6 +172,26 @@ export async function oneServe(
|
|
|
169
172
|
{ promise: Promise<any>; expires: number }
|
|
170
173
|
>()
|
|
171
174
|
|
|
175
|
+
// route modules are resolved through the built server entry, see
|
|
176
|
+
// routeExportsFromEntry
|
|
177
|
+
async function importRouteModule(
|
|
178
|
+
lazyKey: string | undefined,
|
|
179
|
+
serverPath: string | undefined
|
|
180
|
+
): Promise<any> {
|
|
181
|
+
if (lazyKey && options?.lazyRoutes?.pages?.[lazyKey]) {
|
|
182
|
+
return await options.lazyRoutes.pages[lazyKey]()
|
|
183
|
+
}
|
|
184
|
+
if (lazyKey) {
|
|
185
|
+
const entry = await loadServerEntry()
|
|
186
|
+
const exported = await getRouteExportsFromEntry(entry, routerRoot, lazyKey)
|
|
187
|
+
if (exported) return exported
|
|
188
|
+
}
|
|
189
|
+
// layouts and middlewares outside the router root still resolve by path
|
|
190
|
+
return await import(
|
|
191
|
+
toAbsoluteUrl(toServerOutputPath(serverPath || lazyKey || '', outDir))
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
|
|
172
195
|
// resolve a route module's loader - sync on cache hit, async on cold start
|
|
173
196
|
function resolveLoaderSync(
|
|
174
197
|
serverPath: string | undefined,
|
|
@@ -180,18 +203,11 @@ export async function oneServe(
|
|
|
180
203
|
|
|
181
204
|
// cold path - async import
|
|
182
205
|
return (async () => {
|
|
183
|
-
const pathToResolve = serverPath || lazyKey || ''
|
|
184
|
-
const resolvedPath = toServerOutputPath(pathToResolve, outDir)
|
|
185
|
-
|
|
186
206
|
let routeExported: any
|
|
187
207
|
if (moduleImportCache.has(cacheKey)) {
|
|
188
208
|
routeExported = moduleImportCache.get(cacheKey)
|
|
189
209
|
} else {
|
|
190
|
-
routeExported = lazyKey
|
|
191
|
-
? options?.lazyRoutes?.pages?.[lazyKey]
|
|
192
|
-
? await options.lazyRoutes.pages[lazyKey]()
|
|
193
|
-
: await import(toAbsoluteUrl(resolvedPath))
|
|
194
|
-
: await import(toAbsoluteUrl(serverPath!))
|
|
210
|
+
routeExported = await importRouteModule(lazyKey, serverPath)
|
|
195
211
|
setBounded(moduleImportCache, cacheKey, routeExported, MODULE_CACHE_MAX)
|
|
196
212
|
}
|
|
197
213
|
|
|
@@ -286,18 +302,26 @@ export async function oneServe(
|
|
|
286
302
|
let render: ((props: RenderAppProps) => any) | null = null
|
|
287
303
|
let renderStream: ((props: RenderAppProps) => Promise<ReadableStream>) | null = null
|
|
288
304
|
let renderLoading: Promise<void> | null = null
|
|
305
|
+
let entryLoading: Promise<any> | null = null
|
|
289
306
|
|
|
290
|
-
function
|
|
291
|
-
if (
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
? await options.lazyRoutes.serverEntry()
|
|
296
|
-
: await import(
|
|
307
|
+
function loadServerEntry(): Promise<any> {
|
|
308
|
+
if (!entryLoading) {
|
|
309
|
+
entryLoading = options?.lazyRoutes?.serverEntry
|
|
310
|
+
? options.lazyRoutes.serverEntry()
|
|
311
|
+
: import(
|
|
297
312
|
toAbsoluteUrl(
|
|
298
313
|
`${serverOptions.root}/${outDir}/server/_virtual_one-entry.${typeof oneOptions.build?.server === 'object' && oneOptions.build.server.outputFormat === 'cjs' ? 'c' : ''}js`
|
|
299
314
|
)
|
|
300
315
|
)
|
|
316
|
+
}
|
|
317
|
+
return entryLoading
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function ensureRenderLoaded(): void | Promise<void> {
|
|
321
|
+
if (render) return // sync!
|
|
322
|
+
if (renderLoading) return renderLoading
|
|
323
|
+
renderLoading = (async () => {
|
|
324
|
+
const entry = await loadServerEntry()
|
|
301
325
|
render = entry.default.render as (props: RenderAppProps) => any
|
|
302
326
|
renderStream = entry.default.renderStream as
|
|
303
327
|
| ((props: RenderAppProps) => Promise<ReadableStream>)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* route modules have to be read through the built server entry's own route map,
|
|
3
|
+
* never by importing whichever output chunk happens to contain them.
|
|
4
|
+
*
|
|
5
|
+
* a bundler makes no promise that a chunk re-exports a module's bindings under
|
|
6
|
+
* their source names. when a route is both dynamically imported by the entry and
|
|
7
|
+
* statically imported by another route (docs pages mirrored under a second url,
|
|
8
|
+
* say), or when the app sets `output.strictExecutionOrder`, rolldown emits the
|
|
9
|
+
* chunk as
|
|
10
|
+
*
|
|
11
|
+
* export { loader as a, init__slug_ as i, _slug__exports as n, generateStaticParams as r }
|
|
12
|
+
*
|
|
13
|
+
* so every read by source name comes back undefined: the build then reports a
|
|
14
|
+
* route that exports generateStaticParams as missing it, and any loader on that
|
|
15
|
+
* route silently stops running.
|
|
16
|
+
*
|
|
17
|
+
* the entry's `import.meta.glob` map is written by the bundler itself, which
|
|
18
|
+
* rewrites each entry to whatever preserves the real namespace
|
|
19
|
+
* (`import(chunk).then((n) => (n.i(), n.n))` for the wrapped case above). so it
|
|
20
|
+
* resolves correctly no matter how the chunking lands.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** the key the entry's globs use: `./posts/[slug]+ssg.tsx` -> `/app/posts/[slug]+ssg.tsx` */
|
|
24
|
+
export function routeEntryKey(routerRoot: string, routeFile: string) {
|
|
25
|
+
return `/${routerRoot}/${routeFile.replace(/^\.?\//, '')}`
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* resolve one route's exports out of an already-loaded server entry namespace.
|
|
30
|
+
* returns null when the entry has no such route.
|
|
31
|
+
*/
|
|
32
|
+
export async function getRouteExportsFromEntry(
|
|
33
|
+
entry: any,
|
|
34
|
+
routerRoot: string,
|
|
35
|
+
routeFile: string
|
|
36
|
+
): Promise<Record<string, any> | null> {
|
|
37
|
+
const key = routeEntryKey(routerRoot, routeFile)
|
|
38
|
+
|
|
39
|
+
// a route that declares spa by filename or parent directory is stubbed out of
|
|
40
|
+
// the route map, so the server never holds its page component. every stubbed
|
|
41
|
+
// route has an entry in this parallel per-export map whether or not it
|
|
42
|
+
// actually exports a loader, which is what tells a stub from a real route. a
|
|
43
|
+
// route that is spa only because of `web.defaultRenderMode` is never stubbed.
|
|
44
|
+
const spaExports = entry?.oneServerSpaRouteExports
|
|
45
|
+
if (spaExports?.loader && key in spaExports.loader) {
|
|
46
|
+
const [loader, loaderCache, generateStaticParams, sitemap] = await Promise.all([
|
|
47
|
+
spaExports.loader[key](),
|
|
48
|
+
spaExports.loaderCache?.[key]?.(),
|
|
49
|
+
spaExports.generateStaticParams?.[key]?.(),
|
|
50
|
+
spaExports.sitemap?.[key]?.(),
|
|
51
|
+
])
|
|
52
|
+
return { loader, loaderCache, generateStaticParams, sitemap }
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// some output formats nest the entry default one level deeper
|
|
56
|
+
const app = entry?.default?.options ? entry.default : entry?.default?.default
|
|
57
|
+
const importRoute = app?.options?.routes?.[key]
|
|
58
|
+
return importRoute ? await importRoute() : null
|
|
59
|
+
}
|
|
@@ -2,8 +2,9 @@ import { afterEach, describe, expect, it, vi } from 'vitest'
|
|
|
2
2
|
import type { One } from '../vite/types'
|
|
3
3
|
import { createWorkerHandler, type LazyRoutes } from './workerHandler'
|
|
4
4
|
|
|
5
|
+
// route files are router-root relative, the way createRoutesManifest emits them
|
|
5
6
|
const pageRoute = {
|
|
6
|
-
file: '
|
|
7
|
+
file: './some-page.tsx',
|
|
7
8
|
page: '/some-page',
|
|
8
9
|
namedRegex: '^/some-page(?:/)?$',
|
|
9
10
|
urlPath: '/some-page',
|
|
@@ -14,7 +15,7 @@ const pageRoute = {
|
|
|
14
15
|
} satisfies One.BuildInfo['manifest']['pageRoutes'][number]
|
|
15
16
|
|
|
16
17
|
const apiRoute = {
|
|
17
|
-
file: '
|
|
18
|
+
file: './api/status+api.ts',
|
|
18
19
|
page: '/api/status',
|
|
19
20
|
namedRegex: '^/api/status(?:/)?$',
|
|
20
21
|
urlPath: '/api/status',
|
|
@@ -57,15 +58,21 @@ const buildInfo = {
|
|
|
57
58
|
loaders: {},
|
|
58
59
|
} satisfies One.BuildInfo
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
// route modules are reached through the server entry's own route map, keyed by
|
|
62
|
+
// the router-root prefixed path its `import.meta.glob` produces
|
|
63
|
+
const routeKey = `/app/${pageRoute.file.slice(2)}`
|
|
64
|
+
|
|
65
|
+
const makeServerEntry =
|
|
66
|
+
(importPage: () => Promise<any> = async () => ({})) =>
|
|
67
|
+
async () => ({
|
|
62
68
|
default: {
|
|
63
69
|
render: () => '<html></html>',
|
|
70
|
+
options: { routes: { [routeKey]: importPage } },
|
|
64
71
|
},
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
const lazyRoutes = {
|
|
75
|
+
serverEntry: makeServerEntry(),
|
|
69
76
|
api: {
|
|
70
77
|
[apiRoute.page]: async () => ({
|
|
71
78
|
HEAD: () => new Response(null, { status: 204 }),
|
|
@@ -77,7 +84,7 @@ const lazyRoutes = {
|
|
|
77
84
|
function createHandler() {
|
|
78
85
|
vi.stubEnv('ONE_BUFFERED_SSR', '1')
|
|
79
86
|
return createWorkerHandler({
|
|
80
|
-
oneOptions: { web: { defaultRenderMode: 'ssr' } },
|
|
87
|
+
oneOptions: { router: { root: 'app' }, web: { defaultRenderMode: 'ssr' } },
|
|
81
88
|
buildInfo,
|
|
82
89
|
lazyRoutes,
|
|
83
90
|
}).handleRequest
|
|
@@ -127,17 +134,15 @@ describe('createWorkerHandler', () => {
|
|
|
127
134
|
vi.stubEnv('ONE_BUFFERED_SSR', '1')
|
|
128
135
|
let imports = 0
|
|
129
136
|
const handleRequest = createWorkerHandler({
|
|
130
|
-
oneOptions: { web: { defaultRenderMode: 'ssr' } },
|
|
137
|
+
oneOptions: { router: { root: 'app' }, web: { defaultRenderMode: 'ssr' } },
|
|
131
138
|
buildInfo,
|
|
132
139
|
disableModuleCache: true,
|
|
133
140
|
lazyRoutes: {
|
|
134
141
|
...lazyRoutes,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
},
|
|
140
|
-
},
|
|
142
|
+
serverEntry: makeServerEntry(async () => {
|
|
143
|
+
imports += 1
|
|
144
|
+
return {}
|
|
145
|
+
}),
|
|
141
146
|
},
|
|
142
147
|
}).handleRequest
|
|
143
148
|
|
|
@@ -15,21 +15,23 @@ import {
|
|
|
15
15
|
} from '../createHandleRequest'
|
|
16
16
|
import type { RenderAppProps } from '../types'
|
|
17
17
|
import { getPathFromLoaderPath } from '../utils/cleanUrl'
|
|
18
|
+
import { getRouterRootFromOneOptions } from '../utils/getRouterRootFromOneOptions'
|
|
18
19
|
import { isResponse } from '../utils/isResponse'
|
|
19
20
|
import { resolveResponse } from '../vite/resolveResponse'
|
|
20
21
|
import type { One } from '../vite/types'
|
|
21
22
|
import type { RouteInfoCompiled } from './createRoutesManifest'
|
|
23
|
+
import { getRouteExportsFromEntry } from './routeExportsFromEntry'
|
|
22
24
|
import { setSSRLoaderData } from './ssrLoaderData'
|
|
23
25
|
import { getFetchStaticHtml } from './staticHtmlFetcher'
|
|
24
26
|
|
|
25
27
|
export type LazyRoutes = {
|
|
28
|
+
pages?: Record<string, () => Promise<any>>
|
|
26
29
|
serverEntry: () => Promise<{
|
|
27
30
|
default: {
|
|
28
31
|
render: (props: any) => any
|
|
29
32
|
renderStream?: (props: any) => Promise<ReadableStream>
|
|
30
33
|
}
|
|
31
34
|
}>
|
|
32
|
-
pages: Record<string, () => Promise<any>>
|
|
33
35
|
api: Record<string, () => Promise<any>>
|
|
34
36
|
middlewares: Record<string, () => Promise<any>>
|
|
35
37
|
}
|
|
@@ -46,6 +48,7 @@ type WorkerHandlerOptions = {
|
|
|
46
48
|
export function createWorkerHandler(options: WorkerHandlerOptions) {
|
|
47
49
|
const { oneOptions } = options
|
|
48
50
|
const disableModuleCache = !!options.disableModuleCache
|
|
51
|
+
const routerRoot = getRouterRootFromOneOptions(oneOptions)
|
|
49
52
|
|
|
50
53
|
// mutable state for route swapping
|
|
51
54
|
let currentLazyRoutes = options.lazyRoutes
|
|
@@ -95,13 +98,21 @@ export function createWorkerHandler(options: WorkerHandlerOptions) {
|
|
|
95
98
|
let renderStream: ((props: RenderAppProps) => Promise<ReadableStream>) | null = null
|
|
96
99
|
let renderLoading: Promise<void> | null = null
|
|
97
100
|
let renderGeneration = 0
|
|
101
|
+
let entryLoading: Promise<any> | null = null
|
|
102
|
+
|
|
103
|
+
// route modules are resolved through the built server entry, see
|
|
104
|
+
// routeExportsFromEntry
|
|
105
|
+
function loadServerEntry(): Promise<any> {
|
|
106
|
+
if (!entryLoading) entryLoading = currentLazyRoutes.serverEntry()
|
|
107
|
+
return entryLoading
|
|
108
|
+
}
|
|
98
109
|
|
|
99
110
|
function ensureRenderLoaded(): void | Promise<void> {
|
|
100
111
|
if (render) return
|
|
101
112
|
if (renderLoading) return renderLoading
|
|
102
113
|
const gen = ++renderGeneration
|
|
103
114
|
renderLoading = (async () => {
|
|
104
|
-
const entry = await
|
|
115
|
+
const entry = await loadServerEntry()
|
|
105
116
|
// if updateRoutes was called while we were loading, discard stale entry
|
|
106
117
|
if (gen !== renderGeneration) return
|
|
107
118
|
render = entry.default.render as any
|
|
@@ -150,13 +161,19 @@ export function createWorkerHandler(options: WorkerHandlerOptions) {
|
|
|
150
161
|
let routeExported: any
|
|
151
162
|
if (!disableModuleCache && moduleImportCache.has(cacheKey)) {
|
|
152
163
|
routeExported = moduleImportCache.get(cacheKey)
|
|
153
|
-
} else if (
|
|
154
|
-
routeExported = await currentLazyRoutes.pages[
|
|
164
|
+
} else if (currentLazyRoutes.pages?.[cacheKey]) {
|
|
165
|
+
routeExported = await currentLazyRoutes.pages[cacheKey]()
|
|
155
166
|
if (!disableModuleCache) moduleImportCache.set(cacheKey, routeExported)
|
|
156
167
|
} else {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
168
|
+
routeExported = lazyKey
|
|
169
|
+
? await getRouteExportsFromEntry(await loadServerEntry(), routerRoot, lazyKey)
|
|
170
|
+
: null
|
|
171
|
+
if (!routeExported) {
|
|
172
|
+
console.warn(`[one/worker] no lazy route for ${cacheKey}`)
|
|
173
|
+
if (!disableModuleCache) loaderCache.set(cacheKey, null)
|
|
174
|
+
return null
|
|
175
|
+
}
|
|
176
|
+
if (!disableModuleCache) moduleImportCache.set(cacheKey, routeExported)
|
|
160
177
|
}
|
|
161
178
|
|
|
162
179
|
const loader = routeExported?.loader || null
|
|
@@ -797,6 +814,7 @@ export function createWorkerHandler(options: WorkerHandlerOptions) {
|
|
|
797
814
|
render = null
|
|
798
815
|
renderStream = null
|
|
799
816
|
renderLoading = null
|
|
817
|
+
entryLoading = null
|
|
800
818
|
}
|
|
801
819
|
|
|
802
820
|
return { handleRequest, updateRoutes }
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { useEffect } from 'react'
|
|
2
2
|
import { setLastAction } from '../router/lastAction'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
routeInfo,
|
|
5
|
+
subscribeToLoadingState,
|
|
6
|
+
subscribeToRootState,
|
|
7
|
+
} from '../router/router'
|
|
4
8
|
|
|
5
9
|
const KEY = 'one-sr'
|
|
6
10
|
const GROUP_KEY = 'one-sr-groups'
|
|
@@ -122,9 +122,10 @@ export function hasUserWranglerConfig(root: string): boolean {
|
|
|
122
122
|
return false
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
function parseUserWranglerFile(
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
function parseUserWranglerFile(configPath: string): {
|
|
126
|
+
path: string
|
|
127
|
+
config: Record<string, JsonValue>
|
|
128
|
+
} {
|
|
128
129
|
const contents = readFileSync(configPath, 'utf-8')
|
|
129
130
|
let parsed: unknown
|
|
130
131
|
try {
|
|
@@ -242,7 +243,10 @@ export function isExperimentalWorkerDevEnabled(): boolean {
|
|
|
242
243
|
|
|
243
244
|
export function shouldEnableWorkerdDev(deploy: unknown, root: string): boolean {
|
|
244
245
|
if (!isExperimentalWorkerDevEnabled()) return false
|
|
245
|
-
const target =
|
|
246
|
+
const target =
|
|
247
|
+
typeof deploy === 'string'
|
|
248
|
+
? deploy
|
|
249
|
+
: (deploy as { target?: string } | undefined)?.target
|
|
246
250
|
if (target === 'cloudflare') return true
|
|
247
251
|
return hasUserWranglerConfig(root)
|
|
248
252
|
}
|
package/src/vite/one.ts
CHANGED
|
@@ -34,7 +34,10 @@ import { SSRCSSPlugin } from './plugins/SSRCSSPlugin'
|
|
|
34
34
|
import { virtualEntryId } from './plugins/virtualEntryConstants'
|
|
35
35
|
import { createVirtualEntry } from './plugins/virtualEntryPlugin'
|
|
36
36
|
import { environmentGuardPlugin } from './plugins/environmentGuardPlugin'
|
|
37
|
-
import {
|
|
37
|
+
import {
|
|
38
|
+
createWorkerdDevPlugins,
|
|
39
|
+
shouldEnableWorkerdDev,
|
|
40
|
+
} from './plugins/workerdDevPlugin'
|
|
38
41
|
import type { One } from './types'
|
|
39
42
|
|
|
40
43
|
type MetroOptions = MetroPluginOptions
|
|
@@ -211,12 +211,12 @@ export function createVirtualEntry(options: {
|
|
|
211
211
|
const serverSpaBuildGlobs = serverSpaRouteFiles.map(
|
|
212
212
|
(file) => `/${options.root}/${file}`
|
|
213
213
|
)
|
|
214
|
+
const serverSpaExportGlob = (name: string) =>
|
|
215
|
+
` ${name}: import.meta.glob(${JSON.stringify(serverSpaBuildGlobs)}, { exhaustive: true, import: '${name}', query: '?one-spa-build' })`
|
|
214
216
|
const serverSpaBuildRoutes = serverSpaBuildGlobs.length
|
|
215
|
-
? `{
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
sitemap: import.meta.glob(${JSON.stringify(serverSpaBuildGlobs)}, { exhaustive: true, import: 'sitemap', query: '?one-spa-build' })
|
|
219
|
-
}`
|
|
217
|
+
? `{\n${['loader', 'loaderCache', 'generateStaticParams', 'sitemap']
|
|
218
|
+
.map(serverSpaExportGlob)
|
|
219
|
+
.join(',\n')}\n}`
|
|
220
220
|
: '{}'
|
|
221
221
|
const webRouteGlobs = [
|
|
222
222
|
...routeGlobs,
|
|
@@ -301,9 +301,11 @@ if (typeof window !== 'undefined') {
|
|
|
301
301
|
window.__oneRegisterPreloadedRoute = registerPreloadedRoute
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
//
|
|
305
|
-
//
|
|
306
|
-
export
|
|
304
|
+
// a route that declares spa by filename or parent directory is stubbed out of
|
|
305
|
+
// the route map below so the server never holds its page component. its
|
|
306
|
+
// server-side exports come from here instead, one glob per export so the page
|
|
307
|
+
// never comes with them.
|
|
308
|
+
export const oneServerSpaRouteExports = ${serverSpaBuildRoutes}
|
|
307
309
|
|
|
308
310
|
// globbing ${JSON.stringify(webRouteGlobs)}
|
|
309
311
|
export default createApp({
|
|
@@ -46,7 +46,9 @@ function toImportHref(root: string, routerRoot: string, routeFile: string): stri
|
|
|
46
46
|
|
|
47
47
|
function serializeImportMap(entries: Array<[string, string]>): string {
|
|
48
48
|
return entries
|
|
49
|
-
.map(
|
|
49
|
+
.map(
|
|
50
|
+
([key, href]) => ` ${JSON.stringify(key)}: () => import(${JSON.stringify(href)})`
|
|
51
|
+
)
|
|
50
52
|
.join(',\n')
|
|
51
53
|
}
|
|
52
54
|
|
|
@@ -107,22 +109,11 @@ export function generateWorkerdDevEntryModule(args: {
|
|
|
107
109
|
throw new Error('[one] workerd dev: no routes manifest')
|
|
108
110
|
}
|
|
109
111
|
|
|
110
|
-
const pageImports = new Map<string, string>()
|
|
111
112
|
const apiImports = new Map<string, string>()
|
|
112
113
|
const middlewareImports = new Map<string, string>()
|
|
113
114
|
const routeToBuildInfo: One.BuildInfo['routeToBuildInfo'] = {}
|
|
114
115
|
|
|
115
|
-
const registerPage = (routeFile: string | undefined) => {
|
|
116
|
-
if (!routeFile) return
|
|
117
|
-
if (pageImports.has(routeFile)) return
|
|
118
|
-
pageImports.set(routeFile, toImportHref(root, routerRoot, routeFile))
|
|
119
|
-
}
|
|
120
|
-
|
|
121
116
|
for (const route of manifest.pageRoutes) {
|
|
122
|
-
registerPage(route.file)
|
|
123
|
-
for (const layout of route.layouts || []) {
|
|
124
|
-
registerPage(layout.contextKey)
|
|
125
|
-
}
|
|
126
117
|
for (const middleware of route.middlewares || []) {
|
|
127
118
|
if (!middleware.contextKey || middlewareImports.has(middleware.contextKey)) continue
|
|
128
119
|
middlewareImports.set(
|
|
@@ -184,9 +175,6 @@ import { serve, setFetchStaticHtml } from 'one/serve-worker'
|
|
|
184
175
|
|
|
185
176
|
const lazyRoutes = {
|
|
186
177
|
serverEntry: () => import(${JSON.stringify(virtualEntryId)}),
|
|
187
|
-
pages: {
|
|
188
|
-
${serializeImportMap([...pageImports])}
|
|
189
|
-
},
|
|
190
178
|
api: {
|
|
191
179
|
${serializeImportMap([...apiImports])}
|
|
192
180
|
},
|
|
@@ -358,7 +346,9 @@ export function createWorkerdDevPlugins(
|
|
|
358
346
|
`Expected wrangler config at ${wranglerInputPath}.`
|
|
359
347
|
)
|
|
360
348
|
}
|
|
361
|
-
console.info(
|
|
349
|
+
console.info(
|
|
350
|
+
'[one] experimental workerd dev enabled (ONE_EXPERIMENTAL_WORKER_DEV=1)'
|
|
351
|
+
)
|
|
362
352
|
},
|
|
363
353
|
}
|
|
364
354
|
|
|
@@ -4,12 +4,19 @@
|
|
|
4
4
|
// minified (rolldown): return`./loader-refetch/index.tsx`
|
|
5
5
|
const routeIdReturnRegex = /return\s*["'`]\.\/[^"'`]+["'`]/
|
|
6
6
|
|
|
7
|
+
// a chunk can hold more than one route's stub once the bundler merges routes,
|
|
8
|
+
// so target this route's own id when we know it rather than the first stub
|
|
9
|
+
const routeIdReturnRegexFor = (routeId: string) =>
|
|
10
|
+
new RegExp(`return\\s*["'\`]${routeId.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}["'\`]`)
|
|
11
|
+
|
|
7
12
|
export function replaceLoader({
|
|
8
13
|
code,
|
|
9
14
|
loaderData,
|
|
15
|
+
routeId,
|
|
10
16
|
}: {
|
|
11
17
|
code: string
|
|
12
18
|
loaderData: object
|
|
19
|
+
routeId?: string
|
|
13
20
|
}) {
|
|
14
21
|
const stringifiedData = JSON.stringify(loaderData)
|
|
15
22
|
const safeData = stringifiedData.replace(/\$/g, '$$$$')
|
|
@@ -28,8 +35,9 @@ export function replaceLoader({
|
|
|
28
35
|
|
|
29
36
|
// new-style routeId stub from clientTreeShakePlugin
|
|
30
37
|
// works with both minified (return"./path") and non-minified (return "./path") code
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
const stubRegex = routeId ? routeIdReturnRegexFor(routeId) : routeIdReturnRegex
|
|
39
|
+
if (stubRegex.test(code)) {
|
|
40
|
+
return code.replace(stubRegex, 'return ' + safeData)
|
|
33
41
|
}
|
|
34
42
|
|
|
35
43
|
return code + `\nexport const loader = () => (${stringifiedData})`
|
package/types/cli/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/cli/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/cli/build.ts"],"names":[],"mappings":"AA2LA,wBAAsB,KAAK,CAAC,IAAI,EAAE;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,SAAS,CAAA;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,iBAkzCA"}
|
package/types/cli/buildPage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { One, RouteInfo } from '../vite/types';
|
|
2
2
|
export declare function printBuildTimings(): void;
|
|
3
|
-
export declare function buildPage(serverEntry: string, path: string, relativeId: string, params: any, foundRoute: RouteInfo<string>, clientManifestEntry: any, staticDir: string, clientDir: string, builtMiddlewares: Record<string, string>, serverJsPath: string, preloads: string[], allCSS: string[], layoutCSS: string[], routePreloads: Record<string, string>, allCSSContents?: string[], criticalPreloads?: string[], deferredPreloads?: string[], useAfterLCP?: boolean, useAfterLCPAggressive?: boolean): Promise<One.RouteBuildInfo>;
|
|
3
|
+
export declare function buildPage(serverEntry: string, routerRoot: string, path: string, relativeId: string, params: any, foundRoute: RouteInfo<string>, clientManifestEntry: any, staticDir: string, clientDir: string, builtMiddlewares: Record<string, string>, serverJsPath: string, preloads: string[], allCSS: string[], layoutCSS: string[], routePreloads: Record<string, string>, allCSSContents?: string[], criticalPreloads?: string[], deferredPreloads?: string[], useAfterLCP?: boolean, useAfterLCPAggressive?: boolean): Promise<One.RouteBuildInfo>;
|
|
4
4
|
//# sourceMappingURL=buildPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildPage.d.ts","sourceRoot":"","sources":["../../src/cli/buildPage.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"buildPage.d.ts","sourceRoot":"","sources":["../../src/cli/buildPage.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAmBnD,wBAAgB,iBAAiB,SAUhC;AAED,wBAAsB,SAAS,CAC7B,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,GAAG,EACX,UAAU,EAAE,SAAS,CAAC,MAAM,CAAC,EAC7B,mBAAmB,EAAE,GAAG,EACxB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACxC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAAE,EAClB,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,EAAE,MAAM,EAAE,EACnB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,cAAc,CAAC,EAAE,MAAM,EAAE,EACzB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAC3B,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAC3B,WAAW,CAAC,EAAE,OAAO,EACrB,qBAAqB,CAAC,EAAE,OAAO,GAC9B,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAkb7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverRouteModules.d.ts","sourceRoot":"","sources":["../../src/cli/serverRouteModules.ts"],"names":[],"mappings":"AAeA,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAa9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workerPool.d.ts","sourceRoot":"","sources":["../../src/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;
|
|
1
|
+
{"version":3,"file":"createApp.d.ts","sourceRoot":"","sources":["../src/createApp.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAA;AAWhB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAMzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAEvC,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;IAC9C,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,GAAG,CAAC,KAAK,CAAA;IACjB,OAAO,CAAC,EAAE,gBAAgB,CAAA;IAC1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CACzC,CAAA;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,cAAc;;oBAUrB,cAAc;0BAwGR,cAAc,KAAG,OAAO,CAAC,cAAc,CAAC;EAyJzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headless-server.d.ts","sourceRoot":"","sources":["../src/headless-server.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"headless-server.d.ts","sourceRoot":"","sources":["../src/headless-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,mBAAmB,EAAE,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACnF,YAAY,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAIvC,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAEvC,MAAM,MAAM,qBAAqB,GAAG;IAClC,6DAA6D;IAC7D,UAAU,EAAE,GAAG,CAAC,aAAa,CAAA;IAE7B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IAElC,kCAAkC;IAClC,MAAM,EAAE,UAAU,CAAA;IAElB;;;OAGG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;CACrC,CAAA;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,qBAAqB;IAwB7D,wEAAwE;;IAGxE,6DAA6D;8BACnC,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,cAAc,UAAU;GAS9E"}
|
package/types/headless.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headless.d.ts","sourceRoot":"","sources":["../src/headless.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"headless.d.ts","sourceRoot":"","sources":["../src/headless.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAK7B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAEvC,OAAO,EAAE,IAAI,EAAE,CAAA;AAEf,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;IAC9C,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,GAAG,CAAC,KAAK,CAAA;IACjB,OAAO,CAAC,EAAE,gBAAgB,CAAA;IAC1B,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CACzC,CAAA;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,sBAAsB,iBAqCxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnoseRouteLoadFailure.d.ts","sourceRoot":"","sources":["../../src/router/diagnoseRouteLoadFailure.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"diagnoseRouteLoadFailure.d.ts","sourceRoot":"","sources":["../../src/router/diagnoseRouteLoadFailure.ts"],"names":[],"mappings":"AAuCA;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAsChF;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgBxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useViteRoutes.d.ts","sourceRoot":"","sources":["../../src/router/useViteRoutes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"useViteRoutes.d.ts","sourceRoot":"","sources":["../../src/router/useViteRoutes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAWxC,wBAAgB,aAAa,CAC3B,MAAM,EAAE,mBAAmB,EAC3B,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,GAAG,CAAC,YAAY,EAC1B,OAAO,CAAC,EAAE,MAAM,OAmBjB;AAKD,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI,CAErE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAEnD;AAED,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAEjD;AAgDD;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDrE;AAED,wBAAgB,UAAU,CACxB,KAAK,EAAE,mBAAmB,EAC1B,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,GAAG,CAAC,YAAY,OAM3B;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,mBAAmB,EAC1B,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,GAAG,CAAC,YAAY,GACzB,GAAG,CAAC,YAAY,CA0KlB"}
|