one 1.21.13 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Root.native.js.map +1 -1
- package/dist/cjs/cli/build.cjs +9 -17
- package/dist/cjs/cli/build.native.js +8 -16
- package/dist/cjs/cli/build.native.js.map +1 -1
- package/dist/cjs/cli.native.js.map +1 -1
- package/dist/cjs/clientLoaderResolver.native.js.map +1 -1
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/constants.native.js.map +1 -1
- package/dist/cjs/constants.test.native.js.map +1 -1
- package/dist/cjs/createAPIRoute.native.js.map +1 -1
- package/dist/cjs/fork/NavigationContainer.cjs +2 -25
- package/dist/cjs/fork/NavigationContainer.native.js +1 -24
- package/dist/cjs/fork/NavigationContainer.native.js.map +1 -1
- package/dist/cjs/metro-config/withOne.test.cjs +2 -2
- package/dist/cjs/metro-config/withOne.test.native.js +2 -2
- package/dist/cjs/metro-config/withOne.test.native.js.map +1 -1
- package/dist/cjs/useLoader.native.js +0 -18
- package/dist/cjs/useLoader.native.js.map +1 -1
- package/dist/cjs/vite/one.cjs +2 -1
- package/dist/cjs/vite/one.native.js +6 -5
- package/dist/cjs/vite/one.native.js.map +1 -1
- package/dist/cjs/vite/plugins/bundledDevPlugin.cjs +130 -0
- package/dist/cjs/vite/plugins/bundledDevPlugin.native.js +154 -0
- package/dist/cjs/vite/plugins/bundledDevPlugin.native.js.map +1 -0
- package/dist/cjs/vite/plugins/devtoolsPlugin.cjs +4 -0
- package/dist/cjs/vite/plugins/devtoolsPlugin.native.js +5 -0
- package/dist/cjs/vite/plugins/devtoolsPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.cjs +5 -1
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js +5 -0
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/virtualEntryPlugin.cjs +9 -0
- package/dist/cjs/vite/plugins/virtualEntryPlugin.native.js +10 -1
- package/dist/cjs/vite/plugins/virtualEntryPlugin.native.js.map +1 -1
- package/dist/esm/cli/build.mjs +9 -17
- package/dist/esm/cli/build.mjs.map +1 -1
- package/dist/esm/cli/build.native.js +8 -16
- package/dist/esm/cli/build.native.js.map +1 -1
- package/dist/esm/fork/NavigationContainer.mjs +2 -25
- package/dist/esm/fork/NavigationContainer.mjs.map +1 -1
- package/dist/esm/fork/NavigationContainer.native.js +1 -24
- package/dist/esm/fork/NavigationContainer.native.js.map +1 -1
- package/dist/esm/metro-config/withOne.test.mjs +2 -2
- package/dist/esm/metro-config/withOne.test.mjs.map +1 -1
- package/dist/esm/metro-config/withOne.test.native.js +2 -2
- package/dist/esm/metro-config/withOne.test.native.js.map +1 -1
- package/dist/esm/router/useScreens.test.mjs +1 -1
- package/dist/esm/router/useScreens.test.mjs.map +1 -1
- package/dist/esm/useLoader.native.js +0 -18
- package/dist/esm/useLoader.native.js.map +1 -1
- package/dist/esm/vite/one.mjs +2 -1
- package/dist/esm/vite/one.mjs.map +1 -1
- package/dist/esm/vite/one.native.js +6 -5
- package/dist/esm/vite/one.native.js.map +1 -1
- package/dist/esm/vite/plugins/bundledDevPlugin.mjs +94 -0
- package/dist/esm/vite/plugins/bundledDevPlugin.mjs.map +1 -0
- package/dist/esm/vite/plugins/bundledDevPlugin.native.js +115 -0
- package/dist/esm/vite/plugins/bundledDevPlugin.native.js.map +1 -0
- package/dist/esm/vite/plugins/devtoolsPlugin.mjs +4 -0
- package/dist/esm/vite/plugins/devtoolsPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/devtoolsPlugin.native.js +5 -0
- package/dist/esm/vite/plugins/devtoolsPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.mjs +5 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js +5 -0
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/virtualEntryPlugin.mjs +9 -0
- package/dist/esm/vite/plugins/virtualEntryPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/virtualEntryPlugin.native.js +10 -1
- package/dist/esm/vite/plugins/virtualEntryPlugin.native.js.map +1 -1
- package/package.json +27 -27
- package/src/cli/build.ts +25 -37
- package/src/fork/NavigationContainer.tsx +10 -37
- package/src/metro-config/withOne.test.ts +6 -3
- package/src/useLoader.ts +6 -2
- package/src/vite/one.ts +3 -0
- package/src/vite/plugins/bundledDevPlugin.ts +116 -0
- package/src/vite/plugins/devtoolsPlugin.ts +19 -0
- package/src/vite/plugins/fileSystemRouterPlugin.tsx +14 -1
- package/src/vite/plugins/virtualEntryPlugin.ts +27 -0
- package/src/vite/types.ts +11 -0
- package/types/cli/build.d.ts.map +1 -1
- package/types/fork/NavigationContainer.d.ts.map +1 -1
- package/types/fork/useLinking.native.d.ts +4 -4
- package/types/layouts/Drawer.d.ts +4 -4
- package/types/layouts/Stack.d.ts +4 -4
- package/types/layouts/Tabs.d.ts +4 -4
- package/types/ui/TabContext.d.ts +7 -7
- package/types/ui/TabRouter.d.ts +5 -5
- package/types/ui/TabRouter.d.ts.map +1 -1
- package/types/ui/Tabs.d.ts +9 -9
- package/types/useLoader.d.ts.map +1 -1
- package/types/vite/one.d.ts.map +1 -1
- package/types/vite/plugins/bundledDevPlugin.d.ts +3 -0
- package/types/vite/plugins/bundledDevPlugin.d.ts.map +1 -0
- package/types/vite/plugins/devtoolsPlugin.d.ts.map +1 -1
- package/types/vite/plugins/fileSystemRouterPlugin.d.ts.map +1 -1
- package/types/vite/plugins/virtualEntryPlugin.d.ts.map +1 -1
- package/types/vite/types.d.ts +10 -0
- package/types/vite/types.d.ts.map +1 -1
- package/vendor/react-dom/package.json +1 -1
- package/dist/cjs/fork/SSRNavigationContainer.cjs +0 -149
- package/dist/cjs/fork/SSRNavigationContainer.native.js +0 -199
- package/dist/cjs/fork/SSRNavigationContainer.native.js.map +0 -1
- package/dist/esm/fork/SSRNavigationContainer.mjs +0 -124
- package/dist/esm/fork/SSRNavigationContainer.mjs.map +0 -1
- package/dist/esm/fork/SSRNavigationContainer.native.js +0 -160
- package/dist/esm/fork/SSRNavigationContainer.native.js.map +0 -1
- package/src/fork/SSRNavigationContainer.tsx +0 -148
- package/types/fork/SSRNavigationContainer.d.ts +0 -16
- package/types/fork/SSRNavigationContainer.d.ts.map +0 -1
|
@@ -53,9 +53,6 @@ declare global {
|
|
|
53
53
|
|
|
54
54
|
globalThis.REACT_NAVIGATION_DEVTOOLS = new WeakMap()
|
|
55
55
|
|
|
56
|
-
// @modified - SSR-optimized container (bypasses BaseNavigationContainer's 32+ hooks)
|
|
57
|
-
import { SSRNavigationContainer } from './SSRNavigationContainer'
|
|
58
|
-
|
|
59
56
|
type Props<ParamList extends {}> = NavigationContainerProps & {
|
|
60
57
|
direction?: LocaleDirection
|
|
61
58
|
linking?: LinkingOptions<ParamList>
|
|
@@ -80,42 +77,18 @@ type Props<ParamList extends {}> = NavigationContainerProps & {
|
|
|
80
77
|
* @param props.ref Ref object which refers to the navigation object containing helper methods.
|
|
81
78
|
*/
|
|
82
79
|
function NavigationContainerInner(
|
|
83
|
-
|
|
80
|
+
{
|
|
81
|
+
direction = I18nManager.getConstants().isRTL ? 'rtl' : 'ltr',
|
|
82
|
+
theme = DefaultTheme,
|
|
83
|
+
linking,
|
|
84
|
+
fallback = null,
|
|
85
|
+
documentTitle,
|
|
86
|
+
onReady,
|
|
87
|
+
onStateChange,
|
|
88
|
+
...rest
|
|
89
|
+
}: Props<ParamListBase>,
|
|
84
90
|
ref?: React.Ref<NavigationContainerRef<ParamListBase> | null>
|
|
85
91
|
) {
|
|
86
|
-
// @modified - SSR fast path: bypass BaseNavigationContainer entirely
|
|
87
|
-
// BaseNavigationContainer has 32+ hooks and 7 providers that are all
|
|
88
|
-
// unnecessary on SSR (event emitters, child listeners, state sync, etc.)
|
|
89
|
-
// we provide only the minimal contexts that child navigators read
|
|
90
|
-
// @modified - SSR fast path: bypass BaseNavigationContainer entirely
|
|
91
|
-
// eliminates 32+ hooks and reduces 8 providers to 4
|
|
92
|
-
if (typeof window === 'undefined') {
|
|
93
|
-
const { theme = DefaultTheme, initialState, linking, children } = props
|
|
94
|
-
return (
|
|
95
|
-
<SSRNavigationContainer initialState={initialState} theme={theme} linking={linking}>
|
|
96
|
-
{children}
|
|
97
|
-
</SSRNavigationContainer>
|
|
98
|
-
)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return <NavigationContainerClientInner {...props} forwardedRef={ref} />
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// @modified - full client NavigationContainer with all hooks and providers
|
|
105
|
-
function NavigationContainerClientInner({
|
|
106
|
-
forwardedRef,
|
|
107
|
-
direction = I18nManager.getConstants().isRTL ? 'rtl' : 'ltr',
|
|
108
|
-
theme = DefaultTheme,
|
|
109
|
-
linking,
|
|
110
|
-
fallback = null,
|
|
111
|
-
documentTitle,
|
|
112
|
-
onReady,
|
|
113
|
-
onStateChange,
|
|
114
|
-
...rest
|
|
115
|
-
}: Props<ParamListBase> & {
|
|
116
|
-
forwardedRef?: React.Ref<NavigationContainerRef<ParamListBase> | null>
|
|
117
|
-
}) {
|
|
118
|
-
const ref = forwardedRef
|
|
119
92
|
const isLinkingEnabled = linking ? linking.enabled !== false : false
|
|
120
93
|
|
|
121
94
|
if (linking?.config) {
|
|
@@ -120,13 +120,16 @@ describe('withOne', () => {
|
|
|
120
120
|
const config = (await withOne(projectRoot, { loadViteConfig: false })) as any
|
|
121
121
|
const rewriteRequestUrl = config.server.rewriteRequestUrl
|
|
122
122
|
|
|
123
|
+
// the entry is resolved relative to metro's server root, so the prefix depends on
|
|
124
|
+
// how `one` is linked (`node_modules/one` when installed, a workspace path in a
|
|
125
|
+
// monorepo). only the entry itself and the preserved query are meaningful here.
|
|
123
126
|
expect(
|
|
124
127
|
rewriteRequestUrl('/.expo/.virtual-metro-entry.bundle?platform=ios&dev=true')
|
|
125
|
-
).
|
|
128
|
+
).toMatch(/\/one\/metro-entry\.bundle\?platform=ios&dev=true$/)
|
|
126
129
|
expect(
|
|
127
130
|
rewriteRequestUrl('/index.bundle?platform=ios&dev=true&hot=true&minify=false')
|
|
128
|
-
).
|
|
129
|
-
|
|
131
|
+
).toMatch(
|
|
132
|
+
/\/one\/metro-entry\.bundle\?platform=ios&dev=true&hot=true&minify=false$/
|
|
130
133
|
)
|
|
131
134
|
})
|
|
132
135
|
})
|
package/src/useLoader.ts
CHANGED
|
@@ -54,8 +54,12 @@ const recordLoaderTiming =
|
|
|
54
54
|
if (loaderTimingHistory.length > MAX_TIMING_HISTORY) {
|
|
55
55
|
loaderTimingHistory.pop()
|
|
56
56
|
}
|
|
57
|
-
//
|
|
58
|
-
if (
|
|
57
|
+
// dispatch event for web devtools only
|
|
58
|
+
if (
|
|
59
|
+
process.env.TAMAGUI_TARGET !== 'native' &&
|
|
60
|
+
typeof window !== 'undefined' &&
|
|
61
|
+
typeof CustomEvent !== 'undefined'
|
|
62
|
+
) {
|
|
59
63
|
window.dispatchEvent(new CustomEvent('one-loader-timing', { detail: entry }))
|
|
60
64
|
|
|
61
65
|
// Also dispatch error event if there was an error
|
package/src/vite/one.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { setServerGlobals } from '../server/setServerGlobals'
|
|
|
18
18
|
import { getRouterRootFromOneOptions } from '../utils/getRouterRootFromOneOptions'
|
|
19
19
|
import { ensureTSConfig } from './ensureTsConfig'
|
|
20
20
|
import { setOneOptions } from './loadConfig'
|
|
21
|
+
import { bundledDevPlugin } from './plugins/bundledDevPlugin'
|
|
21
22
|
import { clientTreeShakePlugin } from './plugins/clientTreeShakePlugin'
|
|
22
23
|
import { createDevtoolsPlugin } from './plugins/devtoolsPlugin'
|
|
23
24
|
import { createFileSystemRouterPlugin } from './plugins/fileSystemRouterPlugin'
|
|
@@ -285,6 +286,8 @@ export function one(options: One.PluginOptions = {}): PluginOption {
|
|
|
285
286
|
},
|
|
286
287
|
},
|
|
287
288
|
|
|
289
|
+
bundledDevPlugin(!!options.web?.experimentalBundledDev),
|
|
290
|
+
|
|
288
291
|
environmentGuardPlugin(options.environmentGuards),
|
|
289
292
|
|
|
290
293
|
criticalCSSPlugin(),
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
import type { Plugin } from 'vite'
|
|
4
|
+
import { virtualEntryId } from './virtualEntryConstants'
|
|
5
|
+
|
|
6
|
+
// Vite 8.1 experimental bundled dev (FullBundleDevEnvironment): a rolldown-powered
|
|
7
|
+
// single-bundle web client. This plugin wires up the pieces One needs to run under
|
|
8
|
+
// it. Enable with `one({ web: { experimentalBundledDev: true } })`. Only active in
|
|
9
|
+
// dev (serve); a no-op for builds and for non-web environments.
|
|
10
|
+
//
|
|
11
|
+
// Companion changes live where they're structurally required:
|
|
12
|
+
// - virtualEntryPlugin: installs the react-refresh preamble into the bundled
|
|
13
|
+
// client entry (the separate /@one/dev.js path can't, since /@vite/client isn't
|
|
14
|
+
// a standalone module in bundled mode).
|
|
15
|
+
// - fileSystemRouterPlugin: serves the bundled entry url and drops /@vite/client
|
|
16
|
+
// from preloads.
|
|
17
|
+
// - devtoolsPlugin: stubs /@vite/client + /@react-refresh imports in /@one/dev.js.
|
|
18
|
+
|
|
19
|
+
const MIME: Record<string, string> = {
|
|
20
|
+
png: 'image/png',
|
|
21
|
+
jpg: 'image/jpeg',
|
|
22
|
+
jpeg: 'image/jpeg',
|
|
23
|
+
gif: 'image/gif',
|
|
24
|
+
webp: 'image/webp',
|
|
25
|
+
avif: 'image/avif',
|
|
26
|
+
bmp: 'image/bmp',
|
|
27
|
+
ico: 'image/x-icon',
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// rolldown's native asset handling drops default-import asset specifiers
|
|
31
|
+
// (`import logo from './logo.png'`) coming from raw-bundled node_modules deps under
|
|
32
|
+
// One's client env — the binding is elided while its usage is kept, crashing with
|
|
33
|
+
// "X is not defined" (e.g. @react-navigation/elements' icon Assets). transform() DOES
|
|
34
|
+
// run in the FullBundleDev pipeline, so rewrite those imports to inline data-uris.
|
|
35
|
+
//
|
|
36
|
+
// The same data-uri must be produced on the SERVER too: SSR otherwise emits the
|
|
37
|
+
// original asset URL (e.g. `<img src="/features/.../mj.jpg">`), which both 404s under
|
|
38
|
+
// FullBundleDev and diverges from the client's inlined data-uri → React hydration
|
|
39
|
+
// mismatch. So the inliner runs on client (rolldown plugin) and ssr (top-level
|
|
40
|
+
// transform) alike — see bundledDevPlugin().
|
|
41
|
+
function inlineAssetImports(code: string, id: string): { code: string; map: null } | null {
|
|
42
|
+
if (!/\.(png|jpe?g|gif|webp|avif|bmp|ico)/.test(code)) return null
|
|
43
|
+
const importRe =
|
|
44
|
+
/import\s+(\w+)\s+from\s*['"]([^'"?]+\.(?:png|jpe?g|gif|webp|avif|bmp|ico))['"]\s*;?/g
|
|
45
|
+
const base = id.split('?')[0]
|
|
46
|
+
let result = code
|
|
47
|
+
let changed = false
|
|
48
|
+
let m: RegExpExecArray | null
|
|
49
|
+
const edits: { full: string; name: string; uri: string }[] = []
|
|
50
|
+
while ((m = importRe.exec(code))) {
|
|
51
|
+
const [full, name, spec] = m
|
|
52
|
+
const abs = spec.startsWith('.') ? path.resolve(path.dirname(base), spec) : null
|
|
53
|
+
if (!abs || !fs.existsSync(abs)) continue
|
|
54
|
+
const ext = path.extname(abs).slice(1).toLowerCase()
|
|
55
|
+
const uri = `data:${MIME[ext] || 'application/octet-stream'};base64,${fs.readFileSync(abs).toString('base64')}`
|
|
56
|
+
edits.push({ full, name, uri })
|
|
57
|
+
}
|
|
58
|
+
for (const e of edits) {
|
|
59
|
+
result = result.replace(e.full, `const ${e.name} = ${JSON.stringify(e.uri)};`)
|
|
60
|
+
changed = true
|
|
61
|
+
}
|
|
62
|
+
return changed ? { code: result, map: null } : null
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function webBundledAssetPlugin() {
|
|
66
|
+
return {
|
|
67
|
+
name: 'one:web-bundled-asset',
|
|
68
|
+
transform: (code: string, id: string) => inlineAssetImports(code, id),
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function bundledDevPlugin(enabled: boolean): Plugin {
|
|
73
|
+
return {
|
|
74
|
+
name: 'one:bundled-dev',
|
|
75
|
+
|
|
76
|
+
// mirror the client's asset inlining on the server env so SSR emits the same
|
|
77
|
+
// data-uris (the rolldown client plugin above can't reach the ssr pipeline).
|
|
78
|
+
transform(code, id) {
|
|
79
|
+
if (!enabled) return
|
|
80
|
+
const env = (this as any).environment
|
|
81
|
+
if (!env || env.name !== 'ssr' || env.mode !== 'dev') return
|
|
82
|
+
return inlineAssetImports(code, id)
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
config(_userConfig, env) {
|
|
86
|
+
if (!enabled || env.command !== 'serve') return
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
experimental: { bundledDev: true },
|
|
90
|
+
environments: {
|
|
91
|
+
client: {
|
|
92
|
+
build: {
|
|
93
|
+
rolldownOptions: {
|
|
94
|
+
// bundle the virtual entry so FullBundleDev serves it at
|
|
95
|
+
// /assets/_virtual_one-entry.js
|
|
96
|
+
input: [virtualEntryId],
|
|
97
|
+
plugins: [webBundledAssetPlugin()],
|
|
98
|
+
experimental: {
|
|
99
|
+
// rolldown 1.1.0 defaulted lazyBarrel ON, which breaks One's
|
|
100
|
+
// index.mjs barrel re-exports under FullBundleDev (e.g. `Slot`
|
|
101
|
+
// resolves to undefined). pin it off.
|
|
102
|
+
lazyBarrel: false,
|
|
103
|
+
},
|
|
104
|
+
// react-native packages import native-only exports
|
|
105
|
+
// (codegenNativeComponent, TurboModuleRegistry, …) from react-native
|
|
106
|
+
// → aliased to react-native-web, which doesn't export them. shim as
|
|
107
|
+
// undefined instead of failing the build (matches the dep optimizer).
|
|
108
|
+
shimMissingExports: true,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -18,6 +18,13 @@ export function createDevtoolsPlugin(options: DevtoolsPluginOptions = {}): Plugi
|
|
|
18
18
|
apply: 'serve', // only in dev
|
|
19
19
|
|
|
20
20
|
configureServer(server) {
|
|
21
|
+
// vite 8.1 bundledDev: /@vite/client and /@react-refresh aren't standalone
|
|
22
|
+
// modules (the HMR client + refresh runtime are bundled into the entry), so
|
|
23
|
+
// dev.mjs's top-level imports of them 404 / fail MIME checks and take the whole
|
|
24
|
+
// devtools script down. stub them: HMR (route/loader/css/cursor) becomes a
|
|
25
|
+
// no-op here and the refresh preamble is installed by the bundled entry instead.
|
|
26
|
+
const isBundledDev = !!(server.config as any).experimental?.bundledDev
|
|
27
|
+
|
|
21
28
|
// serve the devtools script by reading and combining the source files
|
|
22
29
|
server.middlewares.use(async (req, res, next) => {
|
|
23
30
|
if (req.url === DEVTOOLS_VIRTUAL_ID) {
|
|
@@ -31,6 +38,18 @@ export function createDevtoolsPlugin(options: DevtoolsPluginOptions = {}): Plugi
|
|
|
31
38
|
.replace("import './devtools.mjs'", '')
|
|
32
39
|
.replace("import './source-inspector.mjs'", '')
|
|
33
40
|
|
|
41
|
+
if (isBundledDev) {
|
|
42
|
+
code = code
|
|
43
|
+
.replace(
|
|
44
|
+
"import { createHotContext } from '/@vite/client'",
|
|
45
|
+
'const createHotContext = () => ({ on() {}, off() {}, accept() {}, dispose() {}, prune() {}, send() {}, invalidate() {} })'
|
|
46
|
+
)
|
|
47
|
+
.replace(
|
|
48
|
+
"import { injectIntoGlobalHook } from '/@react-refresh'",
|
|
49
|
+
'const injectIntoGlobalHook = () => {}'
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
34
53
|
// only include devtools UI if enabled
|
|
35
54
|
if (includeUI) {
|
|
36
55
|
const devtoolsPath = resolvePath('one/devtools/devtools.mjs')
|
|
@@ -45,7 +45,10 @@ const routeTypeColors: Record<string, (s: string) => string> = {
|
|
|
45
45
|
const USE_SERVER_ENV = false //!!process.env.USE_SERVER_ENV
|
|
46
46
|
|
|
47
47
|
export function createFileSystemRouterPlugin(options: One.PluginOptions): Plugin {
|
|
48
|
-
|
|
48
|
+
// under vite 8.1 bundledDev the client entry is bundled and served at a fixed
|
|
49
|
+
// /assets url instead of the unbundled /@id/__x00__virtual url. swapped in
|
|
50
|
+
// configureServer once we can see whether the client env is bundled.
|
|
51
|
+
let preloads = ['/@vite/client', virtalEntryIdClient]
|
|
49
52
|
|
|
50
53
|
let runner: ModuleRunner
|
|
51
54
|
let server: ViteDevServer
|
|
@@ -673,6 +676,16 @@ export function createFileSystemRouterPlugin(options: One.PluginOptions): Plugin
|
|
|
673
676
|
configureServer(serverIn) {
|
|
674
677
|
server = serverIn
|
|
675
678
|
|
|
679
|
+
// vite 8.1 bundledDev: the client env bundles the virtual entry and serves
|
|
680
|
+
// it at /assets/_virtual_one-entry.js. the unbundled /@id/__x00__virtual url
|
|
681
|
+
// 404s in this mode, so point preloads (and bootstrap) at the bundled url.
|
|
682
|
+
const clientEnv = server.environments?.client as any
|
|
683
|
+
if (clientEnv?.config?.isBundled || clientEnv?.bundledDev) {
|
|
684
|
+
// bundled mode: the HMR client + refresh runtime are bundled into the
|
|
685
|
+
// entry; /@vite/client doesn't exist as a standalone module (404s).
|
|
686
|
+
preloads = ['/assets/_virtual_one-entry.js']
|
|
687
|
+
}
|
|
688
|
+
|
|
676
689
|
// change this to .server to test using the indepedently scoped env
|
|
677
690
|
runner = createServerModuleRunner(
|
|
678
691
|
USE_SERVER_ENV ? server.environments.server : server.environments.ssr
|
|
@@ -226,12 +226,39 @@ export function createVirtualEntry(options: {
|
|
|
226
226
|
const linkingArg = options.router?.linking
|
|
227
227
|
? `linking: ${JSON.stringify(options.router.linking)},`
|
|
228
228
|
: ''
|
|
229
|
+
|
|
230
|
+
// vite 8.1 bundledDev: the client is a single bundle, so the react-refresh
|
|
231
|
+
// preamble normally provided by /@one/dev.js (which imports /@vite/client —
|
|
232
|
+
// a module that doesn't exist in bundled mode) never installs $RefreshReg$,
|
|
233
|
+
// and every compiler-wrapped route module then throws "preamble was not
|
|
234
|
+
// loaded". install it here instead — this runs at entry-body time, before
|
|
235
|
+
// the lazily-globbed route modules evaluate. ('one' and /@react-refresh are
|
|
236
|
+
// node_modules / the runtime, so neither is refresh-wrapped.)
|
|
237
|
+
// `isBundled` is true for EVERY environment during build, so it alone can't
|
|
238
|
+
// gate this — a prod build would emit an import of /@react-refresh, which
|
|
239
|
+
// only exists while serving. dev mode is what makes the preamble necessary.
|
|
240
|
+
const isBundledClient =
|
|
241
|
+
this.environment.mode === 'dev' &&
|
|
242
|
+
this.environment.name === 'client' &&
|
|
243
|
+
!!(this.environment.config as any)?.isBundled
|
|
244
|
+
const refreshPreambleImport = isBundledClient
|
|
245
|
+
? `import { injectIntoGlobalHook as __oneInjectRefresh } from '/@react-refresh'`
|
|
246
|
+
: ''
|
|
247
|
+
const refreshPreambleSetup = isBundledClient
|
|
248
|
+
? `if (typeof window !== 'undefined' && !window.$RefreshReg$) {
|
|
249
|
+
__oneInjectRefresh(window)
|
|
250
|
+
window.$RefreshReg$ = () => {}
|
|
251
|
+
window.$RefreshSig$ = () => (type) => type
|
|
252
|
+
}`
|
|
253
|
+
: ''
|
|
229
254
|
return `
|
|
230
255
|
${setupResult.promiseDeclaration}
|
|
231
256
|
${nativewindImport}
|
|
257
|
+
${refreshPreambleImport}
|
|
232
258
|
|
|
233
259
|
import { createApp, registerPreloadedRoute as _registerPreloadedRoute } from 'one'
|
|
234
260
|
${setupResult.importStatement}
|
|
261
|
+
${refreshPreambleSetup}
|
|
235
262
|
|
|
236
263
|
// Export registerPreloadedRoute so preload files can import it from this bundle
|
|
237
264
|
// Named export that wraps the original function
|
package/src/vite/types.ts
CHANGED
|
@@ -544,6 +544,17 @@ export namespace One {
|
|
|
544
544
|
* @default false
|
|
545
545
|
*/
|
|
546
546
|
suspendRoutes?: boolean
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Experimental: serve the web client through Vite 8.1's bundled dev mode
|
|
550
|
+
* (rolldown-powered FullBundleDevEnvironment) instead of unbundled ESM dev.
|
|
551
|
+
* Fewer requests / faster parse, especially for apps with large icon/util
|
|
552
|
+
* imports. Dev-only; ignored for builds.
|
|
553
|
+
*
|
|
554
|
+
* @experimental
|
|
555
|
+
* @default false
|
|
556
|
+
*/
|
|
557
|
+
experimentalBundledDev?: boolean
|
|
547
558
|
}
|
|
548
559
|
|
|
549
560
|
/**
|
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":"AAmXA,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,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/cli/build.ts"],"names":[],"mappings":"AAmXA,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,iBAuxCA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationContainer.d.ts","sourceRoot":"","sources":["../../src/fork/NavigationContainer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAKL,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAK5B,MAAM,wBAAwB,CAAA;AAO/B,OAAO,EAEL,KAAK,oBAAoB,EAEzB,KAAK,cAAc,EAEnB,KAAK,eAAe,EAErB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,OAAO,CAAC,MAAM,CAAC;IAGb,IAAI,yBAAyB,EAAE,OAAO,CACpC,sBAAsB,CAAC,GAAG,CAAC,EAC3B;QAAE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,CAAA;KAAE,CAC1C,CAAA;CACF;
|
|
1
|
+
{"version":3,"file":"NavigationContainer.d.ts","sourceRoot":"","sources":["../../src/fork/NavigationContainer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAKL,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAK5B,MAAM,wBAAwB,CAAA;AAO/B,OAAO,EAEL,KAAK,oBAAoB,EAEzB,KAAK,cAAc,EAEnB,KAAK,eAAe,EAErB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,OAAO,CAAC,MAAM,CAAC;IAGb,IAAI,yBAAyB,EAAE,OAAO,CACpC,sBAAsB,CAAC,GAAG,CAAC,EAC3B;QAAE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,CAAA;KAAE,CAC1C,CAAA;CACF;AAID,KAAK,KAAK,CAAC,SAAS,SAAS,EAAE,IAAI,wBAAwB,GAAG;IAC5D,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,aAAa,CAAC,EAAE,oBAAoB,CAAA;CACrC,CAAA;AA2ID,eAAO,MAAM,mBAAmB,EAAiD,CAC/E,aAAa,SAAS,EAAE,GAAG,eAAe,CAAC,aAAa,EAExD,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG;IAC5B,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,CAAA;CACvD,KACE,KAAK,CAAC,YAAY,CAAA"}
|
|
@@ -15,24 +15,24 @@ export declare function useLinking(ref: React.RefObject<NavigationContainerRef<P
|
|
|
15
15
|
index: number;
|
|
16
16
|
routeNames: string[];
|
|
17
17
|
history?: unknown[];
|
|
18
|
-
routes: import("@react-navigation/
|
|
18
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
19
19
|
type: string;
|
|
20
20
|
stale: false;
|
|
21
21
|
}>, "stale" | "routes">> & Readonly<{
|
|
22
22
|
stale?: true;
|
|
23
|
-
routes: import("@react-navigation/
|
|
23
|
+
routes: import("@react-navigation/core").PartialRoute<import("@react-navigation/core").Route<string, object | undefined>>[];
|
|
24
24
|
}> & {
|
|
25
25
|
state?: Partial<Omit<Readonly<{
|
|
26
26
|
key: string;
|
|
27
27
|
index: number;
|
|
28
28
|
routeNames: string[];
|
|
29
29
|
history?: unknown[];
|
|
30
|
-
routes: import("@react-navigation/
|
|
30
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
31
31
|
type: string;
|
|
32
32
|
stale: false;
|
|
33
33
|
}>, "stale" | "routes">> & Readonly<{
|
|
34
34
|
stale?: true;
|
|
35
|
-
routes: import("@react-navigation/
|
|
35
|
+
routes: import("@react-navigation/core").PartialRoute<import("@react-navigation/core").Route<string, object | undefined>>[];
|
|
36
36
|
}> & /*elided*/ any;
|
|
37
37
|
}) | undefined>;
|
|
38
38
|
};
|
|
@@ -11,7 +11,7 @@ type DrawerExtraProps = {
|
|
|
11
11
|
*/
|
|
12
12
|
render?: DrawerRender;
|
|
13
13
|
};
|
|
14
|
-
export declare const Drawer: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@react-navigation/drawer").DrawerNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/
|
|
14
|
+
export declare const Drawer: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@react-navigation/drawer").DrawerNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/core").DefaultRouterOptions<string> & ({
|
|
15
15
|
children: React.ReactNode;
|
|
16
16
|
layout?: ((props: {
|
|
17
17
|
state: DrawerNavigationState<ParamListBase>;
|
|
@@ -56,13 +56,13 @@ export declare const Drawer: React.ForwardRefExoticComponent<Omit<Omit<Omit<impo
|
|
|
56
56
|
payload?: object;
|
|
57
57
|
source?: string;
|
|
58
58
|
target?: string;
|
|
59
|
-
}>>(original: import("@react-navigation/
|
|
59
|
+
}>>(original: import("@react-navigation/core").Router<DrawerNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/core").Router<DrawerNavigationState<ParamListBase>, Action>>) | undefined;
|
|
60
60
|
UNSTABLE_routeNamesChangeBehavior?: "firstMatch" | "lastUnhandled";
|
|
61
61
|
} & ({
|
|
62
62
|
id?: undefined;
|
|
63
63
|
} | {
|
|
64
64
|
id: string;
|
|
65
|
-
})), "children"> & Partial<Pick<Omit<import("@react-navigation/drawer").DrawerNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/
|
|
65
|
+
})), "children"> & Partial<Pick<Omit<import("@react-navigation/drawer").DrawerNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/core").DefaultRouterOptions<string> & ({
|
|
66
66
|
children: React.ReactNode;
|
|
67
67
|
layout?: ((props: {
|
|
68
68
|
state: DrawerNavigationState<ParamListBase>;
|
|
@@ -107,7 +107,7 @@ export declare const Drawer: React.ForwardRefExoticComponent<Omit<Omit<Omit<impo
|
|
|
107
107
|
payload?: object;
|
|
108
108
|
source?: string;
|
|
109
109
|
target?: string;
|
|
110
|
-
}>>(original: import("@react-navigation/
|
|
110
|
+
}>>(original: import("@react-navigation/core").Router<DrawerNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/core").Router<DrawerNavigationState<ParamListBase>, Action>>) | undefined;
|
|
111
111
|
UNSTABLE_routeNamesChangeBehavior?: "firstMatch" | "lastUnhandled";
|
|
112
112
|
} & ({
|
|
113
113
|
id?: undefined;
|
package/types/layouts/Stack.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ type StackExtraProps = {
|
|
|
12
12
|
*/
|
|
13
13
|
render?: StackRender;
|
|
14
14
|
};
|
|
15
|
-
export declare const Stack: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@react-navigation/native-stack").NativeStackNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/
|
|
15
|
+
export declare const Stack: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@react-navigation/native-stack").NativeStackNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/core").DefaultRouterOptions<string> & ({
|
|
16
16
|
children: React.ReactNode;
|
|
17
17
|
layout?: ((props: {
|
|
18
18
|
state: StackNavigationState<ParamListBase>;
|
|
@@ -53,13 +53,13 @@ export declare const Stack: React.ForwardRefExoticComponent<Omit<Omit<Omit<impor
|
|
|
53
53
|
payload?: object;
|
|
54
54
|
source?: string;
|
|
55
55
|
target?: string;
|
|
56
|
-
}>>(original: import("@react-navigation/
|
|
56
|
+
}>>(original: import("@react-navigation/core").Router<StackNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/core").Router<StackNavigationState<ParamListBase>, Action>>) | undefined;
|
|
57
57
|
UNSTABLE_routeNamesChangeBehavior?: "firstMatch" | "lastUnhandled";
|
|
58
58
|
} & ({
|
|
59
59
|
id?: undefined;
|
|
60
60
|
} | {
|
|
61
61
|
id: string;
|
|
62
|
-
})), "children"> & Partial<Pick<Omit<import("@react-navigation/native-stack").NativeStackNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/
|
|
62
|
+
})), "children"> & Partial<Pick<Omit<import("@react-navigation/native-stack").NativeStackNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/core").DefaultRouterOptions<string> & ({
|
|
63
63
|
children: React.ReactNode;
|
|
64
64
|
layout?: ((props: {
|
|
65
65
|
state: StackNavigationState<ParamListBase>;
|
|
@@ -100,7 +100,7 @@ export declare const Stack: React.ForwardRefExoticComponent<Omit<Omit<Omit<impor
|
|
|
100
100
|
payload?: object;
|
|
101
101
|
source?: string;
|
|
102
102
|
target?: string;
|
|
103
|
-
}>>(original: import("@react-navigation/
|
|
103
|
+
}>>(original: import("@react-navigation/core").Router<StackNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/core").Router<StackNavigationState<ParamListBase>, Action>>) | undefined;
|
|
104
104
|
UNSTABLE_routeNamesChangeBehavior?: "firstMatch" | "lastUnhandled";
|
|
105
105
|
} & ({
|
|
106
106
|
id?: undefined;
|
package/types/layouts/Tabs.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ type TabsExtraProps = {
|
|
|
11
11
|
*/
|
|
12
12
|
render?: TabsRender;
|
|
13
13
|
};
|
|
14
|
-
export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@react-navigation/bottom-tabs").BottomTabNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/
|
|
14
|
+
export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@react-navigation/bottom-tabs").BottomTabNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/core").DefaultRouterOptions<string> & ({
|
|
15
15
|
children: React.ReactNode;
|
|
16
16
|
layout?: ((props: {
|
|
17
17
|
state: TabNavigationState<ParamListBase>;
|
|
@@ -52,13 +52,13 @@ export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<Omit<import
|
|
|
52
52
|
payload?: object;
|
|
53
53
|
source?: string;
|
|
54
54
|
target?: string;
|
|
55
|
-
}>>(original: import("@react-navigation/
|
|
55
|
+
}>>(original: import("@react-navigation/core").Router<TabNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/core").Router<TabNavigationState<ParamListBase>, Action>>) | undefined;
|
|
56
56
|
UNSTABLE_routeNamesChangeBehavior?: "firstMatch" | "lastUnhandled";
|
|
57
57
|
} & ({
|
|
58
58
|
id?: undefined;
|
|
59
59
|
} | {
|
|
60
60
|
id: string;
|
|
61
|
-
})), "children"> & Partial<Pick<Omit<import("@react-navigation/bottom-tabs").BottomTabNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/
|
|
61
|
+
})), "children"> & Partial<Pick<Omit<import("@react-navigation/bottom-tabs").BottomTabNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/core").DefaultRouterOptions<string> & ({
|
|
62
62
|
children: React.ReactNode;
|
|
63
63
|
layout?: ((props: {
|
|
64
64
|
state: TabNavigationState<ParamListBase>;
|
|
@@ -99,7 +99,7 @@ export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<Omit<import
|
|
|
99
99
|
payload?: object;
|
|
100
100
|
source?: string;
|
|
101
101
|
target?: string;
|
|
102
|
-
}>>(original: import("@react-navigation/
|
|
102
|
+
}>>(original: import("@react-navigation/core").Router<TabNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/core").Router<TabNavigationState<ParamListBase>, Action>>) | undefined;
|
|
103
103
|
UNSTABLE_routeNamesChangeBehavior?: "firstMatch" | "lastUnhandled";
|
|
104
104
|
} & ({
|
|
105
105
|
id?: undefined;
|
package/types/ui/TabContext.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ export declare const TabsDescriptorsContext: import("react").Context<Record<stri
|
|
|
75
75
|
merge?: boolean;
|
|
76
76
|
} : never): void;
|
|
77
77
|
preload<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined] : never): void;
|
|
78
|
-
reset(state: TabNavigationState<any> | import("@react-navigation/
|
|
78
|
+
reset(state: TabNavigationState<any> | import("@react-navigation/core").PartialState<TabNavigationState<any>>): void;
|
|
79
79
|
goBack(): void;
|
|
80
80
|
isFocused(): boolean;
|
|
81
81
|
canGoBack(): boolean;
|
|
@@ -88,7 +88,7 @@ export declare const TabsDescriptorsContext: import("react").Context<Record<stri
|
|
|
88
88
|
index: number;
|
|
89
89
|
routeNames: string[];
|
|
90
90
|
history?: unknown[];
|
|
91
|
-
routes: import("@react-navigation/
|
|
91
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
92
92
|
type: string;
|
|
93
93
|
stale: false;
|
|
94
94
|
}>, {}, {}> | undefined>(id?: string | undefined): T;
|
|
@@ -111,7 +111,7 @@ export declare const TabsNavigatorContext: import("react").Context<({
|
|
|
111
111
|
index: number;
|
|
112
112
|
routeNames: string[];
|
|
113
113
|
history?: unknown[];
|
|
114
|
-
routes: import("@react-navigation/
|
|
114
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
115
115
|
type: string;
|
|
116
116
|
stale: false;
|
|
117
117
|
}>>) => Readonly<{
|
|
@@ -151,15 +151,15 @@ export declare const TabsNavigatorContext: import("react").Context<({
|
|
|
151
151
|
index: number;
|
|
152
152
|
routeNames: string[];
|
|
153
153
|
history?: unknown[];
|
|
154
|
-
routes: import("@react-navigation/
|
|
154
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
155
155
|
type: string;
|
|
156
156
|
stale: false;
|
|
157
|
-
}> | import("@react-navigation/
|
|
157
|
+
}> | import("@react-navigation/core").PartialState<Readonly<{
|
|
158
158
|
key: string;
|
|
159
159
|
index: number;
|
|
160
160
|
routeNames: string[];
|
|
161
161
|
history?: unknown[];
|
|
162
|
-
routes: import("@react-navigation/
|
|
162
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
163
163
|
type: string;
|
|
164
164
|
stale: false;
|
|
165
165
|
}>>): void;
|
|
@@ -173,7 +173,7 @@ export declare const TabsNavigatorContext: import("react").Context<({
|
|
|
173
173
|
index: number;
|
|
174
174
|
routeNames: string[];
|
|
175
175
|
history?: unknown[];
|
|
176
|
-
routes: import("@react-navigation/
|
|
176
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
177
177
|
type: string;
|
|
178
178
|
stale: false;
|
|
179
179
|
}>;
|
package/types/ui/TabRouter.d.ts
CHANGED
|
@@ -44,15 +44,15 @@ export declare function ExpoTabRouter(options: ExpoTabRouterOptions): Router<Tab
|
|
|
44
44
|
index: number;
|
|
45
45
|
routeNames: string[];
|
|
46
46
|
history?: unknown[];
|
|
47
|
-
routes: import("@react-navigation/
|
|
47
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
48
48
|
type: string;
|
|
49
49
|
stale: false;
|
|
50
|
-
}> | import("@react-navigation/
|
|
50
|
+
}> | import("@react-navigation/core").PartialState<Readonly<{
|
|
51
51
|
key: string;
|
|
52
52
|
index: number;
|
|
53
53
|
routeNames: string[];
|
|
54
54
|
history?: unknown[];
|
|
55
|
-
routes: import("@react-navigation/
|
|
55
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
56
56
|
type: string;
|
|
57
57
|
stale: false;
|
|
58
58
|
}>> | (Omit<Readonly<{
|
|
@@ -60,11 +60,11 @@ export declare function ExpoTabRouter(options: ExpoTabRouterOptions): Router<Tab
|
|
|
60
60
|
index: number;
|
|
61
61
|
routeNames: string[];
|
|
62
62
|
history?: unknown[];
|
|
63
|
-
routes: import("@react-navigation/
|
|
63
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
64
64
|
type: string;
|
|
65
65
|
stale: false;
|
|
66
66
|
}>, "routes"> & {
|
|
67
|
-
routes: Omit<import("@react-navigation/
|
|
67
|
+
routes: Omit<import("@react-navigation/core").Route<string>, "key">[];
|
|
68
68
|
})) | undefined;
|
|
69
69
|
source?: string;
|
|
70
70
|
target?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabRouter.d.ts","sourceRoot":"","sources":["../../src/ui/TabRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,aAAa,IAAI,eAAe,EAErC,KAAK,gBAAgB,IAAI,kBAAkB,EAC3C,KAAK,MAAM,EACX,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,GAAG;IACtD,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,iBAAiB,GACzB,eAAe,GACf,sBAAsB,GACtB;IACE,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,YAAY,CAAC,EAAE,OAAO,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAEL,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB;;;;;;;;
|
|
1
|
+
{"version":3,"file":"TabRouter.d.ts","sourceRoot":"","sources":["../../src/ui/TabRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,aAAa,IAAI,eAAe,EAErC,KAAK,gBAAgB,IAAI,kBAAkB,EAC3C,KAAK,MAAM,EACX,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,GAAG;IACtD,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,iBAAiB,GACzB,eAAe,GACf,sBAAsB,GACtB;IACE,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,YAAY,CAAC,EAAE,OAAO,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAEL,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB;;;;;;;;cAdpC,CAAC;YACV,CAAC;aACG,CAAC;WAEX,CAAC;;;;;;;;cAUO,CAAC;aAAuB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAS9B,CAAC;;;;;;;cAEoB,CAAC;;;;;;;;cAKC,CAAC;;;;;UA1BvB,SAAS;aACN,MAAM;aACN,MAAM;aACN;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,YAAY,CAAC,EAAE,OAAO,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB;GA0EN"}
|