one 1.19.3 → 1.19.5
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/hooks.cjs +3 -5
- package/dist/cjs/hooks.native.js +3 -5
- package/dist/cjs/hooks.native.js.map +1 -1
- package/dist/cjs/router/Route.cjs +2 -1
- package/dist/cjs/router/Route.native.js +2 -1
- package/dist/cjs/router/Route.native.js.map +1 -1
- package/dist/cjs/router/path.cjs +73 -0
- package/dist/cjs/router/path.native.js +98 -0
- package/dist/cjs/router/path.native.js.map +1 -0
- package/dist/cjs/router/path.test.cjs +62 -0
- package/dist/cjs/router/path.test.native.js +65 -0
- package/dist/cjs/router/path.test.native.js.map +1 -0
- package/dist/cjs/router/router.cjs +7 -12
- package/dist/cjs/router/router.native.js +7 -12
- package/dist/cjs/router/router.native.js.map +1 -1
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.cjs +26 -0
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js +26 -0
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.test.cjs +125 -0
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.test.native.js +129 -0
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.test.native.js.map +1 -1
- package/dist/esm/hooks.mjs +3 -5
- package/dist/esm/hooks.mjs.map +1 -1
- package/dist/esm/hooks.native.js +3 -5
- package/dist/esm/hooks.native.js.map +1 -1
- package/dist/esm/router/Route.mjs +2 -1
- package/dist/esm/router/Route.mjs.map +1 -1
- package/dist/esm/router/Route.native.js +2 -1
- package/dist/esm/router/Route.native.js.map +1 -1
- package/dist/esm/router/path.mjs +42 -0
- package/dist/esm/router/path.mjs.map +1 -0
- package/dist/esm/router/path.native.js +64 -0
- package/dist/esm/router/path.native.js.map +1 -0
- package/dist/esm/router/path.test.mjs +63 -0
- package/dist/esm/router/path.test.mjs.map +1 -0
- package/dist/esm/router/path.test.native.js +63 -0
- package/dist/esm/router/path.test.native.js.map +1 -0
- package/dist/esm/router/router.mjs +4 -10
- package/dist/esm/router/router.mjs.map +1 -1
- package/dist/esm/router/router.native.js +4 -10
- package/dist/esm/router/router.native.js.map +1 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.mjs +26 -0
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js +26 -0
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.test.mjs +125 -0
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.test.mjs.map +1 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.test.native.js +129 -0
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.test.native.js.map +1 -1
- package/package.json +9 -9
- package/src/hooks.tsx +9 -9
- package/src/router/Route.tsx +5 -6
- package/src/router/path.test.ts +95 -0
- package/src/router/path.ts +69 -0
- package/src/router/router.ts +5 -20
- package/src/vite/plugins/fileSystemRouterPlugin.test.ts +133 -0
- package/src/vite/plugins/fileSystemRouterPlugin.tsx +29 -1
- package/types/hooks.d.ts.map +1 -1
- package/types/router/Route.d.ts.map +1 -1
- package/types/router/path.d.ts +8 -0
- package/types/router/path.d.ts.map +1 -0
- package/types/router/path.test.d.ts +2 -0
- package/types/router/path.test.d.ts.map +1 -0
- package/types/router/router.d.ts +1 -1
- package/types/router/router.d.ts.map +1 -1
- package/types/vite/plugins/fileSystemRouterPlugin.d.ts.map +1 -1
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { afterEach, describe, expect, it } from 'vitest'
|
|
2
|
+
import {
|
|
3
|
+
getPathWithRecoveredDynamicSegment,
|
|
4
|
+
getPathnameWithRecoveredDynamicSegment,
|
|
5
|
+
hasLostDynamicSegment,
|
|
6
|
+
normalizeRoutePathname,
|
|
7
|
+
} from './path'
|
|
8
|
+
|
|
9
|
+
const originalBaseUrl = process.env.EXPO_BASE_URL
|
|
10
|
+
const originalNodeEnv = process.env.NODE_ENV
|
|
11
|
+
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
if (originalBaseUrl === undefined) {
|
|
14
|
+
delete process.env.EXPO_BASE_URL
|
|
15
|
+
} else {
|
|
16
|
+
process.env.EXPO_BASE_URL = originalBaseUrl
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (originalNodeEnv === undefined) {
|
|
20
|
+
delete process.env.NODE_ENV
|
|
21
|
+
} else {
|
|
22
|
+
process.env.NODE_ENV = originalNodeEnv
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
describe('hasLostDynamicSegment', () => {
|
|
27
|
+
it('detects a literal "undefined" segment', () => {
|
|
28
|
+
expect(hasLostDynamicSegment('/p/undefined')).toBe(true)
|
|
29
|
+
expect(hasLostDynamicSegment('/users/undefined/posts')).toBe(true)
|
|
30
|
+
expect(hasLostDynamicSegment('/undefined')).toBe(true)
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('does not match "undefined" inside another segment', () => {
|
|
34
|
+
expect(hasLostDynamicSegment('/p/undefined-things')).toBe(false)
|
|
35
|
+
expect(hasLostDynamicSegment('/p/notundefined')).toBe(false)
|
|
36
|
+
expect(hasLostDynamicSegment('/p/foo-undefined-bar')).toBe(false)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('ignores search and hash values', () => {
|
|
40
|
+
expect(hasLostDynamicSegment('/p/undefined?tab=profile')).toBe(true)
|
|
41
|
+
expect(hasLostDynamicSegment('/p/mai1015?x=undefined')).toBe(false)
|
|
42
|
+
expect(hasLostDynamicSegment('/p/mai1015#undefined')).toBe(false)
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
describe('normalizeRoutePathname', () => {
|
|
47
|
+
it('strips search, hash, and trailing slash', () => {
|
|
48
|
+
expect(normalizeRoutePathname('/p/mai1015/?tab=profile#top')).toBe('/p/mai1015')
|
|
49
|
+
expect(normalizeRoutePathname('/')).toBe('/')
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it('strips the production base url', () => {
|
|
53
|
+
process.env.NODE_ENV = 'production'
|
|
54
|
+
process.env.EXPO_BASE_URL = '/expo/prefix'
|
|
55
|
+
|
|
56
|
+
expect(normalizeRoutePathname('/expo/prefix/p/mai1015?tab=profile')).toBe(
|
|
57
|
+
'/p/mai1015'
|
|
58
|
+
)
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
describe('getPathWithRecoveredDynamicSegment', () => {
|
|
63
|
+
it('uses the first uncorrupted candidate path', () => {
|
|
64
|
+
expect(
|
|
65
|
+
getPathWithRecoveredDynamicSegment(
|
|
66
|
+
['/p/undefined', '/p/mai1015?tab=profile'],
|
|
67
|
+
'/p/browser?tab=profile'
|
|
68
|
+
)
|
|
69
|
+
).toBe('/p/mai1015?tab=profile')
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
it('keeps an empty uncorrupted candidate path', () => {
|
|
73
|
+
expect(getPathWithRecoveredDynamicSegment([''], '/browser')).toBe('')
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
it('falls back when every candidate path is corrupted', () => {
|
|
77
|
+
expect(
|
|
78
|
+
getPathWithRecoveredDynamicSegment(['/p/undefined'], '/p/browser?tab=profile')
|
|
79
|
+
).toBe('/p/browser?tab=profile')
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
describe('getPathnameWithRecoveredDynamicSegment', () => {
|
|
84
|
+
it('normalizes the recovered browser pathname', () => {
|
|
85
|
+
process.env.NODE_ENV = 'production'
|
|
86
|
+
process.env.EXPO_BASE_URL = '/expo/prefix'
|
|
87
|
+
|
|
88
|
+
expect(
|
|
89
|
+
getPathnameWithRecoveredDynamicSegment(
|
|
90
|
+
'/p/undefined',
|
|
91
|
+
'/expo/prefix/p/mai1015?tab=profile'
|
|
92
|
+
)
|
|
93
|
+
).toBe('/p/mai1015')
|
|
94
|
+
})
|
|
95
|
+
})
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { stripBaseUrl } from '../fork/getStateFromPath-mods'
|
|
2
|
+
|
|
3
|
+
function stripPathSuffix(path: string): string {
|
|
4
|
+
const queryIndex = path.indexOf('?')
|
|
5
|
+
const hashIndex = path.indexOf('#')
|
|
6
|
+
let end = path.length
|
|
7
|
+
|
|
8
|
+
if (queryIndex >= 0) end = Math.min(end, queryIndex)
|
|
9
|
+
if (hashIndex >= 0) end = Math.min(end, hashIndex)
|
|
10
|
+
|
|
11
|
+
return path.slice(0, end)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function stripTrailingSlash(pathname: string): string {
|
|
15
|
+
return pathname.length > 1 && pathname.endsWith('/') ? pathname.slice(0, -1) : pathname
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function normalizeRoutePathname(pathname: string): string {
|
|
19
|
+
return stripTrailingSlash(stripBaseUrl(stripPathSuffix(pathname)))
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// react navigation serializes missing dynamic params as literal path segments.
|
|
23
|
+
export function hasLostDynamicSegment(path: string): boolean {
|
|
24
|
+
return stripPathSuffix(path).split('/').includes('undefined')
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// rn runtimes (expo/hermes) can polyfill `document` while leaving
|
|
28
|
+
// `window.location` undefined, so `typeof document` is not a safe web check.
|
|
29
|
+
// the only reliable signal is an actual string pathname on window.location.
|
|
30
|
+
export function getSafeWindowPathname(): string | undefined {
|
|
31
|
+
if (
|
|
32
|
+
typeof window === 'undefined' ||
|
|
33
|
+
!window.location ||
|
|
34
|
+
typeof window.location.pathname !== 'string'
|
|
35
|
+
) {
|
|
36
|
+
return undefined
|
|
37
|
+
}
|
|
38
|
+
return window.location.pathname
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function getSafeWindowPath(): string | undefined {
|
|
42
|
+
const pathname = getSafeWindowPathname()
|
|
43
|
+
if (pathname === undefined) return undefined
|
|
44
|
+
return pathname + (window.location.search || '')
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function getPathWithRecoveredDynamicSegment(
|
|
48
|
+
paths: readonly (string | undefined)[],
|
|
49
|
+
fallbackPath = getSafeWindowPath()
|
|
50
|
+
): string | undefined {
|
|
51
|
+
// when navigator state loses a dynamic segment, the browser url remains the
|
|
52
|
+
// source of truth.
|
|
53
|
+
for (const path of paths) {
|
|
54
|
+
if (path !== undefined && !hasLostDynamicSegment(path)) {
|
|
55
|
+
return path
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return fallbackPath
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function getPathnameWithRecoveredDynamicSegment(
|
|
63
|
+
pathname: string,
|
|
64
|
+
fallbackPath = getSafeWindowPath()
|
|
65
|
+
): string {
|
|
66
|
+
return normalizeRoutePathname(
|
|
67
|
+
getPathWithRecoveredDynamicSegment([pathname], fallbackPath) ?? pathname
|
|
68
|
+
)
|
|
69
|
+
}
|
package/src/router/router.ts
CHANGED
|
@@ -47,6 +47,7 @@ import { getRouteInfo } from './getRouteInfo'
|
|
|
47
47
|
import { getRoutes } from './getRoutes'
|
|
48
48
|
import { setLastAction } from './lastAction'
|
|
49
49
|
import { getResolvedLinking, resetLinking, setupLinking } from './linkingConfig'
|
|
50
|
+
import { getSafeWindowPathname, normalizeRoutePathname, stripTrailingSlash } from './path'
|
|
50
51
|
import type { RouteNode } from './Route'
|
|
51
52
|
import { sortRoutes } from './sortRoutes'
|
|
52
53
|
import { getQualifiedRouteComponent } from './useScreens'
|
|
@@ -67,6 +68,8 @@ import {
|
|
|
67
68
|
setNotFoundState,
|
|
68
69
|
} from '../notFoundState'
|
|
69
70
|
|
|
71
|
+
export { getSafeWindowPathname } from './path'
|
|
72
|
+
|
|
70
73
|
// Module-scoped variables
|
|
71
74
|
export let routeNode: RouteNode | null = null
|
|
72
75
|
export let rootComponent: ComponentType
|
|
@@ -592,27 +595,9 @@ export function routeInfoSnapshot() {
|
|
|
592
595
|
return routeInfo!
|
|
593
596
|
}
|
|
594
597
|
|
|
595
|
-
function normalizePathname(pathname: string) {
|
|
596
|
-
return pathname.length > 1 && pathname.endsWith('/') ? pathname.slice(0, -1) : pathname
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
// RN runtimes (Expo/Hermes) can polyfill `document` while leaving
|
|
600
|
-
// `window.location` undefined, so `typeof document` is not a safe web check.
|
|
601
|
-
// the only reliable signal is an actual string pathname on window.location.
|
|
602
|
-
export function getSafeWindowPathname(): string | undefined {
|
|
603
|
-
if (
|
|
604
|
-
typeof window === 'undefined' ||
|
|
605
|
-
!window.location ||
|
|
606
|
-
typeof window.location.pathname !== 'string'
|
|
607
|
-
) {
|
|
608
|
-
return undefined
|
|
609
|
-
}
|
|
610
|
-
return window.location.pathname
|
|
611
|
-
}
|
|
612
|
-
|
|
613
598
|
function getBrowserPathname() {
|
|
614
599
|
const pathname = getSafeWindowPathname()
|
|
615
|
-
return pathname === undefined ? undefined :
|
|
600
|
+
return pathname === undefined ? undefined : normalizeRoutePathname(pathname)
|
|
616
601
|
}
|
|
617
602
|
|
|
618
603
|
function shouldKeepPendingNavigationState(currentState: OneRouter.ResultState) {
|
|
@@ -1314,7 +1299,7 @@ export async function linkTo(
|
|
|
1314
1299
|
|
|
1315
1300
|
// a bit hacky until can figure out a reliable way to tie it to the state
|
|
1316
1301
|
nextOptions = options ?? null
|
|
1317
|
-
pendingNavigationPathname =
|
|
1302
|
+
pendingNavigationPathname = stripTrailingSlash(extractPathnameFromHref(href))
|
|
1318
1303
|
pendingNavigationAction =
|
|
1319
1304
|
event === 'PUSH' || event === 'REPLACE' || event === 'NAVIGATE' ? event : undefined
|
|
1320
1305
|
// record the user-intended pathname so late-mounting navigators (e.g. an
|
|
@@ -14,8 +14,17 @@ vi.mock('vite', async () => {
|
|
|
14
14
|
}
|
|
15
15
|
})
|
|
16
16
|
|
|
17
|
+
type MiddlewareHandler = (
|
|
18
|
+
req: object,
|
|
19
|
+
res: object,
|
|
20
|
+
next: (error?: unknown) => void
|
|
21
|
+
) => void | Promise<void>
|
|
22
|
+
|
|
23
|
+
type WatcherListener = (...args: string[]) => void | Promise<void>
|
|
24
|
+
|
|
17
25
|
describe('createFileSystemRouterPlugin', () => {
|
|
18
26
|
const previousIsVxrnCli = process.env.IS_VXRN_CLI
|
|
27
|
+
const previousViteEnvironment = process.env.VITE_ENVIRONMENT
|
|
19
28
|
let previousVxrnPluginConfig: unknown
|
|
20
29
|
let tempRoot: string | undefined
|
|
21
30
|
|
|
@@ -34,6 +43,11 @@ describe('createFileSystemRouterPlugin', () => {
|
|
|
34
43
|
} else {
|
|
35
44
|
process.env.IS_VXRN_CLI = previousIsVxrnCli
|
|
36
45
|
}
|
|
46
|
+
if (previousViteEnvironment === undefined) {
|
|
47
|
+
delete process.env.VITE_ENVIRONMENT
|
|
48
|
+
} else {
|
|
49
|
+
process.env.VITE_ENVIRONMENT = previousViteEnvironment
|
|
50
|
+
}
|
|
37
51
|
|
|
38
52
|
if (previousVxrnPluginConfig === undefined) {
|
|
39
53
|
delete (globalThis as any).__vxrnPluginConfig__
|
|
@@ -103,4 +117,123 @@ describe('createFileSystemRouterPlugin', () => {
|
|
|
103
117
|
expect.any(Error)
|
|
104
118
|
)
|
|
105
119
|
})
|
|
120
|
+
|
|
121
|
+
it('caches dev ssg html until the module runner is invalidated', async () => {
|
|
122
|
+
process.env.VITE_ENVIRONMENT = 'ssr'
|
|
123
|
+
tempRoot = mkdtempSync(path.join(tmpdir(), 'one-router-ssg-cache-'))
|
|
124
|
+
const appDir = path.join(tempRoot, 'app')
|
|
125
|
+
const routeFile = path.join(appDir, 'index+ssg.tsx')
|
|
126
|
+
writeFileSync(path.join(tempRoot, 'package.json'), '{}\n')
|
|
127
|
+
mkdirSync(appDir)
|
|
128
|
+
writeFileSync(routeFile, 'export default function Index() { return null }\n')
|
|
129
|
+
|
|
130
|
+
const { createServerModuleRunner } = await import('vite')
|
|
131
|
+
const { createFileSystemRouterPlugin } = await import('./fileSystemRouterPlugin')
|
|
132
|
+
const { virtualEntryId } = await import('./virtualEntryConstants')
|
|
133
|
+
|
|
134
|
+
let renderCount = 0
|
|
135
|
+
const render = vi.fn(async () => `<html><body>${++renderCount}</body></html>`)
|
|
136
|
+
const runner = {
|
|
137
|
+
clearCache: vi.fn(),
|
|
138
|
+
import: vi.fn(async (id: string) => {
|
|
139
|
+
if (id === virtualEntryId) {
|
|
140
|
+
return { default: { render } }
|
|
141
|
+
}
|
|
142
|
+
if (id === routeFile) {
|
|
143
|
+
return { default: () => null }
|
|
144
|
+
}
|
|
145
|
+
return {}
|
|
146
|
+
}),
|
|
147
|
+
}
|
|
148
|
+
vi.mocked(createServerModuleRunner).mockReturnValue(runner as any)
|
|
149
|
+
|
|
150
|
+
const middlewareHandlers: MiddlewareHandler[] = []
|
|
151
|
+
const watcherListeners = new Map<string, WatcherListener[]>()
|
|
152
|
+
const server = {
|
|
153
|
+
environments: {
|
|
154
|
+
ssr: {},
|
|
155
|
+
},
|
|
156
|
+
hot: {
|
|
157
|
+
send: vi.fn(),
|
|
158
|
+
},
|
|
159
|
+
middlewares: {
|
|
160
|
+
use: vi.fn((handler: MiddlewareHandler) => {
|
|
161
|
+
middlewareHandlers.push(handler)
|
|
162
|
+
}),
|
|
163
|
+
},
|
|
164
|
+
watcher: {
|
|
165
|
+
add: vi.fn(),
|
|
166
|
+
addListener: vi.fn((event: string, listener: WatcherListener) => {
|
|
167
|
+
watcherListeners.set(event, [...(watcherListeners.get(event) || []), listener])
|
|
168
|
+
}),
|
|
169
|
+
on: vi.fn((event: string, listener: WatcherListener) => {
|
|
170
|
+
watcherListeners.set(event, [...(watcherListeners.get(event) || []), listener])
|
|
171
|
+
}),
|
|
172
|
+
},
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const plugin = createFileSystemRouterPlugin({
|
|
176
|
+
router: {
|
|
177
|
+
root: appDir,
|
|
178
|
+
},
|
|
179
|
+
server: {
|
|
180
|
+
loggingEnabled: false,
|
|
181
|
+
},
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
const installMiddlewares = (plugin as any).configureServer(server)
|
|
185
|
+
installMiddlewares()
|
|
186
|
+
|
|
187
|
+
const routeMiddleware = middlewareHandlers.at(-1)
|
|
188
|
+
if (!routeMiddleware) {
|
|
189
|
+
throw new Error('Expected route middleware to be registered')
|
|
190
|
+
}
|
|
191
|
+
const handleRouteRequest = routeMiddleware
|
|
192
|
+
|
|
193
|
+
async function request(pathname: string) {
|
|
194
|
+
const chunks: string[] = []
|
|
195
|
+
const req = {
|
|
196
|
+
originalUrl: pathname,
|
|
197
|
+
url: pathname,
|
|
198
|
+
headers: {
|
|
199
|
+
host: 'localhost',
|
|
200
|
+
},
|
|
201
|
+
method: 'GET',
|
|
202
|
+
}
|
|
203
|
+
const res = {
|
|
204
|
+
setHeader: vi.fn(),
|
|
205
|
+
appendHeader: vi.fn(),
|
|
206
|
+
writeHead: vi.fn(),
|
|
207
|
+
write: vi.fn((chunk: string) => {
|
|
208
|
+
chunks.push(chunk)
|
|
209
|
+
}),
|
|
210
|
+
end: vi.fn(),
|
|
211
|
+
}
|
|
212
|
+
const next = vi.fn((error?: unknown) => {
|
|
213
|
+
if (error) {
|
|
214
|
+
throw error
|
|
215
|
+
}
|
|
216
|
+
throw new Error('Expected One router middleware to handle request')
|
|
217
|
+
})
|
|
218
|
+
|
|
219
|
+
await handleRouteRequest(req, res, next)
|
|
220
|
+
expect(res.end).toHaveBeenCalled()
|
|
221
|
+
return chunks.join('')
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
await expect(request('/')).resolves.toContain('<body>1</body>')
|
|
225
|
+
await expect(request('/')).resolves.toContain('<body>1</body>')
|
|
226
|
+
expect(render).toHaveBeenCalledTimes(1)
|
|
227
|
+
|
|
228
|
+
const allListeners = watcherListeners.get('all') || []
|
|
229
|
+
const invalidateRunner = allListeners[0]
|
|
230
|
+
if (!invalidateRunner) {
|
|
231
|
+
throw new Error('Expected runner invalidation listener to be registered')
|
|
232
|
+
}
|
|
233
|
+
invalidateRunner('change', routeFile)
|
|
234
|
+
|
|
235
|
+
await expect(request('/')).resolves.toContain('<body>2</body>')
|
|
236
|
+
expect(render).toHaveBeenCalledTimes(2)
|
|
237
|
+
expect(runner.clearCache).toHaveBeenCalledTimes(2)
|
|
238
|
+
})
|
|
106
239
|
})
|
|
@@ -17,7 +17,7 @@ import { promiseWithResolvers } from '../../utils/promiseWithResolvers'
|
|
|
17
17
|
import { isRouteFileWatchEvent } from '../../utils/routeFileWatch'
|
|
18
18
|
import { trackLoaderDependencies } from '../../utils/trackLoaderDependencies'
|
|
19
19
|
import { replaceLoader } from '../../vite/replaceLoader'
|
|
20
|
-
import type { One } from '../../vite/types'
|
|
20
|
+
import type { One, RouteInfo } from '../../vite/types'
|
|
21
21
|
import { setServerContext } from '../one-server-only'
|
|
22
22
|
import { virtalEntryIdClient, virtualEntryId } from './virtualEntryConstants'
|
|
23
23
|
|
|
@@ -74,6 +74,11 @@ export function createFileSystemRouterPlugin(options: One.PluginOptions): Plugin
|
|
|
74
74
|
let handleRequest = createRequestHandler()
|
|
75
75
|
// handle only one at a time in dev mode to avoid "Detected multiple renderers concurrently" errors
|
|
76
76
|
let renderPromise: Promise<void> | null = null
|
|
77
|
+
const ssgHtmlCache = new Map<string, string>()
|
|
78
|
+
|
|
79
|
+
function getSsgHtmlCacheKey(route: RouteInfo<string>, url: URL) {
|
|
80
|
+
return `${route.file}\n${url.pathname}\n${url.search}`
|
|
81
|
+
}
|
|
77
82
|
|
|
78
83
|
function createRequestHandler() {
|
|
79
84
|
const routerRoot = getRouterRootFromOneOptions(options)
|
|
@@ -108,6 +113,14 @@ export function createFileSystemRouterPlugin(options: One.PluginOptions): Plugin
|
|
|
108
113
|
return createHandleRequest(
|
|
109
114
|
{
|
|
110
115
|
async handlePage({ route, url, loaderProps }) {
|
|
116
|
+
const ssgCacheKey = route.type === 'ssg' ? getSsgHtmlCacheKey(route, url) : null
|
|
117
|
+
if (ssgCacheKey && !needsCacheClear) {
|
|
118
|
+
const cachedHtml = ssgHtmlCache.get(ssgCacheKey)
|
|
119
|
+
if (cachedHtml) {
|
|
120
|
+
return cachedHtml
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
111
124
|
if (options.server?.loggingEnabled !== false) {
|
|
112
125
|
const colorType = routeTypeColors[route.type] || colors.white
|
|
113
126
|
const pathname =
|
|
@@ -143,6 +156,13 @@ export function createFileSystemRouterPlugin(options: One.PluginOptions): Plugin
|
|
|
143
156
|
await renderPromise
|
|
144
157
|
}
|
|
145
158
|
|
|
159
|
+
if (ssgCacheKey && !needsCacheClear) {
|
|
160
|
+
const cachedHtml = ssgHtmlCache.get(ssgCacheKey)
|
|
161
|
+
if (cachedHtml) {
|
|
162
|
+
return cachedHtml
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
146
166
|
const { promise, resolve: resolveRender } = promiseWithResolvers<void>()
|
|
147
167
|
renderPromise = promise
|
|
148
168
|
|
|
@@ -155,6 +175,7 @@ export function createFileSystemRouterPlugin(options: One.PluginOptions): Plugin
|
|
|
155
175
|
const routeFile = isGeneratedNotFound ? '' : path.join(routerRoot, route.file)
|
|
156
176
|
if (needsCacheClear) {
|
|
157
177
|
runner.clearCache()
|
|
178
|
+
ssgHtmlCache.clear()
|
|
158
179
|
needsCacheClear = false
|
|
159
180
|
}
|
|
160
181
|
|
|
@@ -377,6 +398,10 @@ export function createFileSystemRouterPlugin(options: One.PluginOptions): Plugin
|
|
|
377
398
|
})
|
|
378
399
|
}
|
|
379
400
|
|
|
401
|
+
if (ssgCacheKey) {
|
|
402
|
+
ssgHtmlCache.set(ssgCacheKey, html)
|
|
403
|
+
}
|
|
404
|
+
|
|
380
405
|
return html
|
|
381
406
|
} catch (err) {
|
|
382
407
|
// allow throwing a response in a loader (e.g. redirect)
|
|
@@ -547,6 +572,8 @@ export function createFileSystemRouterPlugin(options: One.PluginOptions): Plugin
|
|
|
547
572
|
function recreateRequestHandler(changedPath: string) {
|
|
548
573
|
try {
|
|
549
574
|
handleRequest = createRequestHandler()
|
|
575
|
+
ssgHtmlCache.clear()
|
|
576
|
+
needsCacheClear = true
|
|
550
577
|
} catch (error) {
|
|
551
578
|
console.warn(`[one] Failed to rebuild routes after ${changedPath} changed.`, error)
|
|
552
579
|
}
|
|
@@ -679,6 +706,7 @@ export function createFileSystemRouterPlugin(options: One.PluginOptions): Plugin
|
|
|
679
706
|
event: 'one:loader-data-update',
|
|
680
707
|
data: { routePaths: [...routePaths] },
|
|
681
708
|
})
|
|
709
|
+
ssgHtmlCache.clear()
|
|
682
710
|
}
|
|
683
711
|
}, 100)
|
|
684
712
|
|
package/types/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAYpD,KAAK,YAAY,GAAG,SAAS,CAAC,YAAY,CAAA;AAE1C;;;;;GAKG;AACH,wBAAgB,sBAAsB,0BAErC;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,wDAoB3B;AAED,uJAAuJ;AACvJ,wBAAgB,yBAAyB,4BAExC;AAED,eAAO,MAAM,YAAY,wBAAuB,CAAA;AAEhD;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,IAAI,SAAS,CAAC,MAAM,CAE5C;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,SAAS,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,KAAK,SAAS,CAE9E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAepC;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,OAAO,SAAS,MAAM,GAAG,YAAY,KAClC,OAAO,CAAC,OAAO,CAAC,CAEpB;AAED,mCAAmC;AACnC,eAAO,MAAM,oBAAoB,kBAAY,CAAA;AAE7C,yCAAyC;AACzC,eAAO,MAAM,qBAAqB,wBAAkB,CAAA;AAEpD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,OAAO,SAAS,MAAM,GAAG,YAAY,KAAK,OAAO,CAAC,OAAO,CAAC,CAmCnF;AAcD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,EAAE,MAAc,EAAE;;CAAK,GAAG,eAAe,CAqBxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../../src/router/Route.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAExE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../../src/router/Route.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAExE,OA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E,UAAU,CAAC,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,kBAAkB,+DAE1B,CAAA;AAQL,+DAA+D;AAC/D,wBAAgB,YAAY,IAAI,SAAS,GAAG,IAAI,CAE/C;AAED,wBAAgB,aAAa,IAAI,MAAM,CAMtC;AA4BD,iEAAiE;AACjE,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,IAAI,EACJ,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,SAAS,CAAA;IACnB,IAAI,EAAE,SAAS,CAAA;IACf,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;KAC5C,CAAA;CACF,2CA6BA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function stripTrailingSlash(pathname: string): string;
|
|
2
|
+
export declare function normalizeRoutePathname(pathname: string): string;
|
|
3
|
+
export declare function hasLostDynamicSegment(path: string): boolean;
|
|
4
|
+
export declare function getSafeWindowPathname(): string | undefined;
|
|
5
|
+
export declare function getSafeWindowPath(): string | undefined;
|
|
6
|
+
export declare function getPathWithRecoveredDynamicSegment(paths: readonly (string | undefined)[], fallbackPath?: string | undefined): string | undefined;
|
|
7
|
+
export declare function getPathnameWithRecoveredDynamicSegment(pathname: string, fallbackPath?: string | undefined): string;
|
|
8
|
+
//# sourceMappingURL=path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/router/path.ts"],"names":[],"mappings":"AAaA,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE/D;AAGD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE3D;AAKD,wBAAgB,qBAAqB,IAAI,MAAM,GAAG,SAAS,CAS1D;AAED,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAItD;AAED,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,EACtC,YAAY,qBAAsB,GACjC,MAAM,GAAG,SAAS,CAUpB;AAED,wBAAgB,sCAAsC,CACpD,QAAQ,EAAE,MAAM,EAChB,YAAY,qBAAsB,GACjC,MAAM,CAIR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.test.d.ts","sourceRoot":"","sources":["../../src/router/path.test.ts"],"names":[],"mappings":""}
|
package/types/router/router.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { One } from '../vite/types';
|
|
|
11
11
|
import type { UrlObject } from './getNormalizedStatePath';
|
|
12
12
|
import type { RouteNode } from './Route';
|
|
13
13
|
import type { RouteMatch } from '../useMatches';
|
|
14
|
+
export { getSafeWindowPathname } from './path';
|
|
14
15
|
export declare let routeNode: RouteNode | null;
|
|
15
16
|
export declare let rootComponent: ComponentType;
|
|
16
17
|
/**
|
|
@@ -85,7 +86,6 @@ export declare function snapshot(): {
|
|
|
85
86
|
};
|
|
86
87
|
export declare function rootStateSnapshot(): OneRouter.ResultState;
|
|
87
88
|
export declare function routeInfoSnapshot(): UrlObject;
|
|
88
|
-
export declare function getSafeWindowPathname(): string | undefined;
|
|
89
89
|
export declare function useOneRouter(): {
|
|
90
90
|
linkTo: typeof linkTo;
|
|
91
91
|
routeNode: RouteNode | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/router/router.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,iCAAiC,EACtC,KAAK,eAAe,EAErB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,KAAK,aAAa,EAKnB,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,EAAE,SAAS,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aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;AACtE,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,aAAa,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA;AA2DD,wBAAgB,iBAAiB,IAAI,YAAY,EAAE,CAElD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,UAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,CA8CtF;AA4DD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,QAGtD;AAED,wBAAsB,MAAM,CAC1B,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,SAAS,CAAC,aAAa,iBAkWlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileSystemRouterPlugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/fileSystemRouterPlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,MAAM,EAAiB,MAAM,MAAM,CAAA;AAe1D,OAAO,KAAK,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"fileSystemRouterPlugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/fileSystemRouterPlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,MAAM,EAAiB,MAAM,MAAM,CAAA;AAe1D,OAAO,KAAK,EAAE,GAAG,EAAa,MAAM,kBAAkB,CAAA;AAiBtD,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,GAAG,CAAC,aAAa,GAAG,MAAM,CAqzB/E"}
|