vxrn 2.7.6 → 2.8.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/config/getBaseViteConfigOnly.mjs +1 -1
- package/dist/config/getBaseViteConfigOnly.mjs.map +1 -1
- package/dist/config/getBaseViteConfigOnly.native.js +1 -1
- package/dist/config/getBaseViteConfigOnly.native.js.map +1 -1
- package/dist/config/getOptimizeDeps.mjs +1 -1
- package/dist/config/getOptimizeDeps.mjs.map +1 -1
- package/dist/config/getOptimizeDeps.native.js +3 -1
- package/dist/config/getOptimizeDeps.native.js.map +1 -1
- package/dist/config/getReactNativePlugins.mjs +1 -2
- package/dist/config/getReactNativePlugins.mjs.map +1 -1
- package/dist/config/getReactNativePlugins.native.js +4 -2
- package/dist/config/getReactNativePlugins.native.js.map +1 -1
- package/dist/exports/prebuildWithoutExpo.mjs +26 -97
- package/dist/exports/prebuildWithoutExpo.mjs.map +1 -1
- package/dist/exports/prebuildWithoutExpo.native.js +47 -133
- package/dist/exports/prebuildWithoutExpo.native.js.map +1 -1
- package/dist/plugins/autoDepOptimizePlugin.mjs +5 -2
- package/dist/plugins/autoDepOptimizePlugin.mjs.map +1 -1
- package/dist/plugins/autoDepOptimizePlugin.native.js +10 -7
- package/dist/plugins/autoDepOptimizePlugin.native.js.map +1 -1
- package/dist/rn-commands/bundle/buildBundle.mjs +5 -4
- package/dist/rn-commands/bundle/buildBundle.mjs.map +1 -1
- package/dist/rn-commands/bundle/buildBundle.native.js +5 -4
- package/dist/rn-commands/bundle/buildBundle.native.js.map +1 -1
- package/dist/utils/createNativeDevEngine.mjs +30 -7
- package/dist/utils/createNativeDevEngine.mjs.map +1 -1
- package/dist/utils/createNativeDevEngine.native.js +64 -10
- package/dist/utils/createNativeDevEngine.native.js.map +1 -1
- package/package.json +27 -20
- package/src/config/getBaseViteConfigOnly.ts +1 -1
- package/src/config/getOptimizeDeps.ts +3 -1
- package/src/config/getReactNativePlugins.ts +8 -4
- package/src/config/ssrVendorOptimization.test.ts +115 -0
- package/src/exports/prebuildWithoutExpo.test.ts +62 -157
- package/src/exports/prebuildWithoutExpo.ts +31 -125
- package/src/plugins/autoDepOptimizeExternal.test.ts +101 -0
- package/src/plugins/autoDepOptimizePlugin.ts +12 -6
- package/src/plugins/rnCodegenPlugin.ts +1 -2
- package/src/rn-commands/bundle/buildBundle.ts +8 -7
- package/src/utils/createNativeDevEngine.test.ts +308 -9
- package/src/utils/createNativeDevEngine.ts +71 -29
- package/types/config/getOptimizeDeps.d.ts.map +1 -1
- package/types/config/getReactNativePlugins.d.ts +3 -2
- package/types/config/getReactNativePlugins.d.ts.map +1 -1
- package/types/exports/prebuildWithoutExpo.d.ts.map +1 -1
- package/types/plugins/autoDepOptimizePlugin.d.ts +1 -0
- package/types/plugins/autoDepOptimizePlugin.d.ts.map +1 -1
- package/types/plugins/rnCodegenPlugin.d.ts.map +1 -1
- package/types/rn-commands/bundle/buildBundle.d.ts +1 -1
- package/types/rn-commands/bundle/buildBundle.d.ts.map +1 -1
- package/types/utils/createNativeDevEngine.d.ts +3 -4
- package/types/utils/createNativeDevEngine.d.ts.map +1 -1
- package/src/plugins/autoDepOptimizePlugin.test.ts +0 -42
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync, realpathSync } from 'node:fs'
|
|
2
|
-
import { mkdir, mkdtemp, readFile, rm, symlink, writeFile } from 'node:fs/promises'
|
|
2
|
+
import { mkdir, mkdtemp, readFile, rename, rm, symlink, writeFile } from 'node:fs/promises'
|
|
3
3
|
import { tmpdir } from 'node:os'
|
|
4
4
|
import { join } from 'node:path'
|
|
5
5
|
import { createContext, runInContext, runInNewContext } from 'node:vm'
|
|
@@ -28,6 +28,14 @@ import {
|
|
|
28
28
|
type NativePluginContext,
|
|
29
29
|
} from './createNativeDevEngine'
|
|
30
30
|
|
|
31
|
+
// an edit made while the engine watches, landing the way an editor's safe save
|
|
32
|
+
// does. writeFile truncates first, and a loaded runner can deliver that empty
|
|
33
|
+
// file to the watcher as an edit of its own before the content arrives
|
|
34
|
+
const saveFile = async (path: string, data: string) => {
|
|
35
|
+
await writeFile(`${path}.tmp`, data)
|
|
36
|
+
await rename(`${path}.tmp`, path)
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
it.each(['edit', 'create', 'delete'] as const)(
|
|
32
40
|
'loads routes and applies %s HMR through symlinked node_modules',
|
|
33
41
|
async (change) => {
|
|
@@ -295,6 +303,132 @@ it.each(['react-native-nitro-modules', 'react-native-worklets'])(
|
|
|
295
303
|
}
|
|
296
304
|
)
|
|
297
305
|
|
|
306
|
+
async function writeStubReactNative(
|
|
307
|
+
directory: string,
|
|
308
|
+
owner: string,
|
|
309
|
+
files: Record<string, string> = {}
|
|
310
|
+
) {
|
|
311
|
+
await mkdir(join(directory, 'src/private/assets'), { recursive: true })
|
|
312
|
+
await mkdir(join(directory, 'Libraries/Core'), { recursive: true })
|
|
313
|
+
await writeFile(
|
|
314
|
+
join(directory, 'package.json'),
|
|
315
|
+
JSON.stringify({
|
|
316
|
+
name: 'react-native',
|
|
317
|
+
main: './index.js',
|
|
318
|
+
exports: {
|
|
319
|
+
'.': './index.js',
|
|
320
|
+
'./Libraries/*': './Libraries/*.js',
|
|
321
|
+
'./asset-registry': './src/asset-registry.js',
|
|
322
|
+
'./setup-env': { default: './src/setup-env.js' },
|
|
323
|
+
'./package.json': './package.json',
|
|
324
|
+
},
|
|
325
|
+
})
|
|
326
|
+
)
|
|
327
|
+
await writeFile(
|
|
328
|
+
join(directory, 'index.js'),
|
|
329
|
+
`import './src/private/assets/AssetRegistry.js'\nexport const owner = '${owner}'\nexport const AppRegistry = { registerComponent() {} }\n`
|
|
330
|
+
)
|
|
331
|
+
await writeFile(
|
|
332
|
+
join(directory, 'src/private/assets/AssetRegistry.js'),
|
|
333
|
+
`globalThis.__owners = globalThis.__owners || []\nglobalThis.__owners.push('${owner}:AssetRegistry')\nexport const registryOwner = '${owner}'\n`
|
|
334
|
+
)
|
|
335
|
+
await writeFile(
|
|
336
|
+
join(directory, 'src/asset-registry.js'),
|
|
337
|
+
`export * from './private/assets/AssetRegistry.js'\n`
|
|
338
|
+
)
|
|
339
|
+
await writeFile(
|
|
340
|
+
join(directory, 'src/setup-env.js'),
|
|
341
|
+
`import './private/assets/AssetRegistry.js'\nglobalThis.__owners.push('${owner}:SetupEnv')\n`
|
|
342
|
+
)
|
|
343
|
+
await writeFile(
|
|
344
|
+
join(directory, 'Libraries/Core/InitializeCore.js'),
|
|
345
|
+
`globalThis.__owners.push('${owner}:InitializeCore')\nexport const core = '${owner}'\n`
|
|
346
|
+
)
|
|
347
|
+
for (const [name, code] of Object.entries(files)) {
|
|
348
|
+
await mkdir(join(directory, ...name.split('/').slice(0, -1)), { recursive: true })
|
|
349
|
+
await writeFile(join(directory, name), code)
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
async function writeStubExpo(directory: string, launchCode: string) {
|
|
354
|
+
await mkdir(join(directory, 'build/launch'), { recursive: true })
|
|
355
|
+
await writeFile(
|
|
356
|
+
join(directory, 'package.json'),
|
|
357
|
+
JSON.stringify({
|
|
358
|
+
name: 'expo',
|
|
359
|
+
main: './build/Expo.js',
|
|
360
|
+
exports: {
|
|
361
|
+
'.': './build/Expo.js',
|
|
362
|
+
'./launch/registerRootComponent': './build/launch/registerRootComponent.js',
|
|
363
|
+
'./package.json': './package.json',
|
|
364
|
+
},
|
|
365
|
+
})
|
|
366
|
+
)
|
|
367
|
+
await writeFile(join(directory, 'build/Expo.js'), `export const expo = true\n`)
|
|
368
|
+
await writeFile(join(directory, 'build/launch/registerRootComponent.js'), launchCode)
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
it('shares the app react-native singleton for bare and deep imports across nested installs', async () => {
|
|
372
|
+
const root = await mkdtemp(join(tmpdir(), 'vxrn-native-rn-singleton-'))
|
|
373
|
+
try {
|
|
374
|
+
await writeStubReactNative(join(root, 'node_modules/react-native'), 'app')
|
|
375
|
+
const expoDir = join(root, 'node_modules/expo')
|
|
376
|
+
await writeStubExpo(
|
|
377
|
+
expoDir,
|
|
378
|
+
`import { AppRegistry } from 'react-native'\nimport 'react-native/Libraries/Core/InitializeCore'\nimport 'react-native/setup-env'\nexport default function registerRootComponent(c) { return [c, AppRegistry] }\n`
|
|
379
|
+
)
|
|
380
|
+
await writeStubReactNative(join(expoDir, 'node_modules/react-native'), 'nested')
|
|
381
|
+
await writeFile(join(root, 'package.json'), '{}')
|
|
382
|
+
await writeFile(
|
|
383
|
+
join(root, 'entry.js'),
|
|
384
|
+
`import 'react-native'\nimport registerRootComponent from 'expo/launch/registerRootComponent'\nglobalThis.__register = typeof registerRootComponent\n`
|
|
385
|
+
)
|
|
386
|
+
const { code } = await buildNativeBundle({
|
|
387
|
+
root,
|
|
388
|
+
platform: 'ios',
|
|
389
|
+
dev: true,
|
|
390
|
+
entryFile: 'entry.js',
|
|
391
|
+
})
|
|
392
|
+
const context = { console, setTimeout, clearTimeout }
|
|
393
|
+
runInNewContext(code, context)
|
|
394
|
+
expect(Reflect.get(context, '__register')).toBe('function')
|
|
395
|
+
expect([...Reflect.get(context, '__owners')].sort()).toEqual([
|
|
396
|
+
'app:AssetRegistry',
|
|
397
|
+
'app:InitializeCore',
|
|
398
|
+
'app:SetupEnv',
|
|
399
|
+
])
|
|
400
|
+
} finally {
|
|
401
|
+
await rm(root, { recursive: true, force: true })
|
|
402
|
+
}
|
|
403
|
+
})
|
|
404
|
+
|
|
405
|
+
it('refuses the nested react-native copy when the app copy lacks the file', async () => {
|
|
406
|
+
const root = await mkdtemp(join(tmpdir(), 'vxrn-native-rn-skew-'))
|
|
407
|
+
try {
|
|
408
|
+
await writeStubReactNative(join(root, 'node_modules/react-native'), 'app')
|
|
409
|
+
const expoDir = join(root, 'node_modules/expo')
|
|
410
|
+
await writeStubExpo(
|
|
411
|
+
expoDir,
|
|
412
|
+
`import { AppRegistry } from 'react-native'\nimport 'react-native/Libraries/Skew/OnlyFile'\nexport default function registerRootComponent(c) { return [c, AppRegistry] }\n`
|
|
413
|
+
)
|
|
414
|
+
// the nested copy still ships a file the app copy removed. resolving it
|
|
415
|
+
// from the nested copy would initialize the native runtime twice.
|
|
416
|
+
await writeStubReactNative(join(expoDir, 'node_modules/react-native'), 'nested', {
|
|
417
|
+
'Libraries/Skew/OnlyFile.js': `import '../../src/private/assets/AssetRegistry.js'\nexport const skew = 'nested'\n`,
|
|
418
|
+
})
|
|
419
|
+
await writeFile(join(root, 'package.json'), '{}')
|
|
420
|
+
await writeFile(
|
|
421
|
+
join(root, 'entry.js'),
|
|
422
|
+
`import 'react-native'\nimport registerRootComponent from 'expo/launch/registerRootComponent'\nglobalThis.__register = typeof registerRootComponent\n`
|
|
423
|
+
)
|
|
424
|
+
await expect(
|
|
425
|
+
buildNativeBundle({ root, platform: 'ios', dev: true, entryFile: 'entry.js' })
|
|
426
|
+
).rejects.toThrow("missing from the app's react-native")
|
|
427
|
+
} finally {
|
|
428
|
+
await rm(root, { recursive: true, force: true })
|
|
429
|
+
}
|
|
430
|
+
})
|
|
431
|
+
|
|
298
432
|
const nativeTransformProbe = `
|
|
299
433
|
export const transformProbe = () => {
|
|
300
434
|
'worklet'
|
|
@@ -676,11 +810,8 @@ if (import.meta.hot) import.meta.hot.accept(() => {})
|
|
|
676
810
|
fn = runInContext(`(${worklet.__initData.code})`, ui)
|
|
677
811
|
compiled.set(worklet.__workletHash, fn!)
|
|
678
812
|
}
|
|
679
|
-
const closure =
|
|
680
|
-
|
|
681
|
-
name,
|
|
682
|
-
typeof value === 'function' ? reconstruct(value) : value,
|
|
683
|
-
])
|
|
813
|
+
const closure = worklet.__closure.map((value: unknown) =>
|
|
814
|
+
typeof value === 'function' ? reconstruct(value) : value
|
|
684
815
|
)
|
|
685
816
|
return fn!.bind({ __closure: closure })
|
|
686
817
|
}
|
|
@@ -1025,7 +1156,7 @@ if (import.meta.hot) import.meta.hot.accept(() => {})
|
|
|
1025
1156
|
// and the test immediately restores the file to component-v1 upon
|
|
1026
1157
|
// seeing hmr-session-ready.
|
|
1027
1158
|
sourceMapPromise = native.getSourceMap()
|
|
1028
|
-
void
|
|
1159
|
+
void saveFile(childPath, childSource('component-v1'))
|
|
1029
1160
|
} else if (updates.length === 2) {
|
|
1030
1161
|
resolveSecondUpdate(update)
|
|
1031
1162
|
}
|
|
@@ -1056,7 +1187,7 @@ if (import.meta.hot) import.meta.hot.accept(() => {})
|
|
|
1056
1187
|
runtime = context.__rolldown_runtime__
|
|
1057
1188
|
await native.engine.registerClient(runtime.clientId)
|
|
1058
1189
|
|
|
1059
|
-
await
|
|
1190
|
+
await saveFile(childPath, childSource('hmr-session-ready'))
|
|
1060
1191
|
const secondUpdate = await secondUpdateReceived
|
|
1061
1192
|
expect(await sourceMapPromise).toBe(initial.map)
|
|
1062
1193
|
expect(updates).toHaveLength(2)
|
|
@@ -2796,6 +2927,74 @@ globalThis.__vxrnConditionalExportProbe = helper()
|
|
|
2796
2927
|
}
|
|
2797
2928
|
)
|
|
2798
2929
|
|
|
2930
|
+
it.each([false, true])(
|
|
2931
|
+
'preserves external native defaults and raw namespaces (minify=%s)',
|
|
2932
|
+
async (minify) => {
|
|
2933
|
+
const root = await mkdtemp(join(tmpdir(), 'vxrn-external-default-'))
|
|
2934
|
+
await writeFile(join(root, 'package.json'), JSON.stringify({ type: 'module' }))
|
|
2935
|
+
await writeFile(
|
|
2936
|
+
join(root, 'entry.js'),
|
|
2937
|
+
`
|
|
2938
|
+
import Component, { marker } from 'external-helper'
|
|
2939
|
+
import Scoped from '@external/helper/deep'
|
|
2940
|
+
import Plain from 'plain-helper'
|
|
2941
|
+
globalThis.externalDefaults = [Component, marker, Scoped, Plain, require('external-helper')]
|
|
2942
|
+
`
|
|
2943
|
+
)
|
|
2944
|
+
const component = () => 42
|
|
2945
|
+
const namespace = { default: component, marker: 42, __esModule: true }
|
|
2946
|
+
try {
|
|
2947
|
+
const result = await buildNativeBundle({
|
|
2948
|
+
root,
|
|
2949
|
+
platform: 'ios',
|
|
2950
|
+
entryFile: 'entry.js',
|
|
2951
|
+
minify,
|
|
2952
|
+
plugins: [
|
|
2953
|
+
{
|
|
2954
|
+
name: 'external-default-probe',
|
|
2955
|
+
resolveId(id) {
|
|
2956
|
+
if (
|
|
2957
|
+
['external-helper', '@external/helper/deep', 'plain-helper'].includes(
|
|
2958
|
+
id
|
|
2959
|
+
)
|
|
2960
|
+
) {
|
|
2961
|
+
return { id, external: true }
|
|
2962
|
+
}
|
|
2963
|
+
},
|
|
2964
|
+
outputOptions(options) {
|
|
2965
|
+
return { ...options, format: 'cjs', intro: '' }
|
|
2966
|
+
},
|
|
2967
|
+
},
|
|
2968
|
+
],
|
|
2969
|
+
})
|
|
2970
|
+
const context = {
|
|
2971
|
+
module: { exports: {} },
|
|
2972
|
+
exports: {},
|
|
2973
|
+
console,
|
|
2974
|
+
require(id: string) {
|
|
2975
|
+
if (id === 'plain-helper') return component
|
|
2976
|
+
if (id === 'external-helper' || id === '@external/helper/deep')
|
|
2977
|
+
return namespace
|
|
2978
|
+
throw new Error(`unexpected external: ${id}`)
|
|
2979
|
+
},
|
|
2980
|
+
}
|
|
2981
|
+
runInNewContext(result.code, context)
|
|
2982
|
+
expect(Reflect.get(context, 'externalDefaults')).toEqual([
|
|
2983
|
+
component,
|
|
2984
|
+
42,
|
|
2985
|
+
component,
|
|
2986
|
+
component,
|
|
2987
|
+
namespace,
|
|
2988
|
+
])
|
|
2989
|
+
const values = Reflect.get(context, 'externalDefaults')
|
|
2990
|
+
if (!Array.isArray(values)) throw new Error('external probe did not execute')
|
|
2991
|
+
expect(values[4]).toBe(namespace)
|
|
2992
|
+
} finally {
|
|
2993
|
+
await rm(root, { recursive: true, force: true })
|
|
2994
|
+
}
|
|
2995
|
+
}
|
|
2996
|
+
)
|
|
2997
|
+
|
|
2799
2998
|
it('unwraps the default export of Babel CommonJS modules in production output', async () => {
|
|
2800
2999
|
const testRoot = await mkdtemp(join(tmpdir(), 'vxrn-native-prod-cjs-default-'))
|
|
2801
3000
|
const packageRoot = join(testRoot, 'node_modules/default-export-helper')
|
|
@@ -2834,6 +3033,106 @@ globalThis.__vxrnConditionalExportProbe = helper()
|
|
|
2834
3033
|
})
|
|
2835
3034
|
|
|
2836
3035
|
describe('native Flow sources', () => {
|
|
3036
|
+
it.each([true, false])(
|
|
3037
|
+
'preserves codegen, worklets and maps with dev=%s',
|
|
3038
|
+
async (dev) => {
|
|
3039
|
+
const compiler = await import('@vxrn/compiler')
|
|
3040
|
+
const root = await createWorkletsProject(false)
|
|
3041
|
+
const id = join(root, 'ProbeNativeComponent.js')
|
|
3042
|
+
const source = `/* library license */
|
|
3043
|
+
// @flow
|
|
3044
|
+
import type { ViewProps, HostComponent } from 'react-native';
|
|
3045
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
3046
|
+
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
3047
|
+
export type Value = number;
|
|
3048
|
+
type Props = $ReadOnly<{...ViewProps, enabled?: boolean}>;
|
|
3049
|
+
interface NativeCommands {
|
|
3050
|
+
reload: (ref: React.ElementRef<HostComponent<Props>>, value: number) => void;
|
|
3051
|
+
}
|
|
3052
|
+
export const Commands = codegenNativeCommands<NativeCommands>({supportedCommands: ['reload']});
|
|
3053
|
+
export function twice(x: Value): Value { 'worklet'; return x * 2; }
|
|
3054
|
+
export const marker = 'flow-map-marker';
|
|
3055
|
+
export default codegenNativeComponent<Props>('FlowProbe');
|
|
3056
|
+
`
|
|
3057
|
+
const rn = join(root, 'node_modules/react-native')
|
|
3058
|
+
await mkdir(join(rn, 'Libraries/NativeComponent'), { recursive: true })
|
|
3059
|
+
await mkdir(join(rn, 'Libraries/ReactNative'), { recursive: true })
|
|
3060
|
+
await mkdir(join(rn, 'Libraries/Utilities'), { recursive: true })
|
|
3061
|
+
await writeFile(
|
|
3062
|
+
join(rn, 'package.json'),
|
|
3063
|
+
JSON.stringify({ name: 'react-native', main: 'index.js' })
|
|
3064
|
+
)
|
|
3065
|
+
await writeFile(
|
|
3066
|
+
join(rn, 'Libraries/NativeComponent/NativeComponentRegistry.js'),
|
|
3067
|
+
'exports.get = (name, config) => ({name, config: config()})'
|
|
3068
|
+
)
|
|
3069
|
+
await writeFile(
|
|
3070
|
+
join(rn, 'Libraries/ReactNative/RendererProxy.js'),
|
|
3071
|
+
'exports.dispatchCommand = (ref, name, args) => { globalThis.command = [ref, name, args] }'
|
|
3072
|
+
)
|
|
3073
|
+
for (const name of ['codegenNativeComponent', 'codegenNativeCommands']) {
|
|
3074
|
+
await writeFile(
|
|
3075
|
+
join(rn, `Libraries/Utilities/${name}.js`),
|
|
3076
|
+
`module.exports = () => { throw new Error('codegen was not run') }`
|
|
3077
|
+
)
|
|
3078
|
+
}
|
|
3079
|
+
await writeFile(id, source)
|
|
3080
|
+
// ordinary published Flow without a pragma must also reach native lowering.
|
|
3081
|
+
await writeFile(
|
|
3082
|
+
join(root, 'fetch.js'),
|
|
3083
|
+
'export default function fetch(value: number) { return value + 1 }'
|
|
3084
|
+
)
|
|
3085
|
+
await writeFile(
|
|
3086
|
+
join(root, 'entry.js'),
|
|
3087
|
+
`import component, { Commands, twice, marker } from './ProbeNativeComponent';
|
|
3088
|
+
import fetch from './fetch';
|
|
3089
|
+
globalThis.flowProbe = { component, twice, marker, fetched: fetch(8) };
|
|
3090
|
+
Commands.reload('ref', 9);`
|
|
3091
|
+
)
|
|
3092
|
+
compiler.configureVXRNCompilerPlugin({
|
|
3093
|
+
enableReanimated: true,
|
|
3094
|
+
enableNativeWorklets: true,
|
|
3095
|
+
enableCompiler: false,
|
|
3096
|
+
})
|
|
3097
|
+
try {
|
|
3098
|
+
const output = await buildNativeBundle({
|
|
3099
|
+
root,
|
|
3100
|
+
platform: 'ios',
|
|
3101
|
+
entryFile: 'entry.js',
|
|
3102
|
+
dev,
|
|
3103
|
+
sourcemap: true,
|
|
3104
|
+
minify: false,
|
|
3105
|
+
})
|
|
3106
|
+
const context: any = { console }
|
|
3107
|
+
runInNewContext(output.code, context)
|
|
3108
|
+
expect(context.flowProbe.component.name).toBe('FlowProbe')
|
|
3109
|
+
expect(context.flowProbe.component.config.validAttributes.enabled).toBe(true)
|
|
3110
|
+
expect(context.command).toEqual(['ref', 'reload', [9]])
|
|
3111
|
+
expect(context.flowProbe.fetched).toBe(9)
|
|
3112
|
+
expect(context.flowProbe.twice(4)).toBe(8)
|
|
3113
|
+
expect(context.flowProbe.twice.__workletHash).toBeTypeOf('number')
|
|
3114
|
+
const ui = runInNewContext(`(${context.flowProbe.twice.__initData.code})`)
|
|
3115
|
+
expect(ui.call({ __closure: context.flowProbe.twice.__closure }, 5)).toBe(10)
|
|
3116
|
+
const lines = output.code.split('\n')
|
|
3117
|
+
const line = lines.findIndex((line) => line.includes('flow-map-marker'))
|
|
3118
|
+
expect(line).toBeGreaterThanOrEqual(0)
|
|
3119
|
+
const position = originalPositionFor(new TraceMap(output.map!), {
|
|
3120
|
+
line: line + 1,
|
|
3121
|
+
column: lines[line].indexOf('flow-map-marker'),
|
|
3122
|
+
})
|
|
3123
|
+
expect(position.source).toContain('ProbeNativeComponent.js')
|
|
3124
|
+
expect(position.line).toBe(
|
|
3125
|
+
source.split('\n').findIndex((line) => line.includes('flow-map-marker')) + 1
|
|
3126
|
+
)
|
|
3127
|
+
} finally {
|
|
3128
|
+
compiler.configureVXRNCompilerPlugin({
|
|
3129
|
+
enableReanimated: false,
|
|
3130
|
+
enableNativeWorklets: false,
|
|
3131
|
+
})
|
|
3132
|
+
await rm(root, { recursive: true, force: true })
|
|
3133
|
+
}
|
|
3134
|
+
}
|
|
3135
|
+
)
|
|
2837
3136
|
it('strips typed arrows and class fields without a Flow pragma or type import', async () => {
|
|
2838
3137
|
const root = await mkdtemp(join(tmpdir(), 'vxrn-native-unmarked-flow-'))
|
|
2839
3138
|
await writeFile(
|
|
@@ -3148,7 +3447,7 @@ describe('native zero-client edit recoverability', () => {
|
|
|
3148
3447
|
expect(fullBuildCount).toBe(1)
|
|
3149
3448
|
|
|
3150
3449
|
// no client is registered here: this is the app that never connected.
|
|
3151
|
-
await
|
|
3450
|
+
await saveFile(childPath, childSource('component-v2'))
|
|
3152
3451
|
const staleDeadline = Date.now() + 10_000
|
|
3153
3452
|
let stale = false
|
|
3154
3453
|
while (Date.now() < staleDeadline) {
|
|
@@ -292,18 +292,11 @@ function getNativePlugins(
|
|
|
292
292
|
cssStubPlugin(),
|
|
293
293
|
// handle import.meta.glob (used by One's route system)
|
|
294
294
|
viteImportGlobPlugin({ root }),
|
|
295
|
-
//
|
|
296
|
-
// react-native codegen, react compiler, same pipeline as metro. runs before
|
|
297
|
-
// flowStripPlugin so react-native's Flow `.js` specs reach codegen with their
|
|
298
|
-
// type argument intact. stripping Flow first would erase it (which is why the
|
|
299
|
-
// codegen "didn't run for <Component>" warning fired).
|
|
300
|
-
vxrnCompilerPlugin(platform, dev, root, sourceMaps),
|
|
301
|
-
// react-native codegen: transforms TurboModule / Fabric specs before Flow stripping
|
|
295
|
+
// native codegen needs the original type declarations.
|
|
302
296
|
rnCodegenPlugin({ projectRoot: root }),
|
|
303
|
-
//
|
|
304
|
-
// handle, the guaranteed safety net before rolldown's oxc core parse (which
|
|
305
|
-
// can't parse Flow). now downstream of the compiler, so codegen sees the types.
|
|
297
|
+
// lower Flow before worklets and react compiler parse the source with oxc.
|
|
306
298
|
flowStripPlugin(),
|
|
299
|
+
vxrnCompilerPlugin(platform, dev, root, sourceMaps),
|
|
307
300
|
// guard undefined native methods in NativeAnimatedHelper
|
|
308
301
|
nativeAnimatedGuardPlugin(),
|
|
309
302
|
// handle asset imports (.png, .jpg, .ttf, etc.)
|
|
@@ -351,9 +344,9 @@ function getNativeOutputOptions(
|
|
|
351
344
|
*/
|
|
352
345
|
export function normalizeNativeCommonJSInterop(code: string): string {
|
|
353
346
|
// native packages expose Babel defaults through exports.default. apply the
|
|
354
|
-
// same interop to bundled
|
|
347
|
+
// same interop to external bindings, bundled helpers and HMR export lookups.
|
|
355
348
|
return code.replace(
|
|
356
|
-
/(\b__toESM(?:\$\d+)?\(\s*(?:require[\w$]*\(\)|__rolldown_runtime__\.loadExports\("(?:\\.|[^"\\])*"\))\s*),\s*1(\s*\))/g,
|
|
349
|
+
/(\b__toESM(?:\$\d+)?\(\s*(?:require[\w$]*\(\)|[\w$]+|__rolldown_runtime__\.loadExports\("(?:\\.|[^"\\])*"\))\s*),\s*1(\s*\))/g,
|
|
357
350
|
'$1$2'
|
|
358
351
|
)
|
|
359
352
|
}
|
|
@@ -637,7 +630,7 @@ export async function createNativeDevEngine(
|
|
|
637
630
|
// is never minified.
|
|
638
631
|
...getNativeOutputOptions(prelude, true, false),
|
|
639
632
|
// open the HMR socket with RN's WebSocket module (not the global, which is
|
|
640
|
-
// only polyfilled once
|
|
633
|
+
// only polyfilled once setup-env has run) and hand it to the runtime,
|
|
641
634
|
// which owns every message it carries. handed over immediately rather than
|
|
642
635
|
// from an open handler: a host that does not honor `socket.onopen = fn`
|
|
643
636
|
// would otherwise silently never get Fast Refresh. the socket goes to the
|
|
@@ -706,17 +699,38 @@ try {
|
|
|
706
699
|
// triggered by the HMR message cannot land while the watcher is stopped.
|
|
707
700
|
await engine?.ensureCurrentBuildFinish()
|
|
708
701
|
|
|
702
|
+
// adding or deleting a route changes a route map that was expanded when
|
|
703
|
+
// the entry transformed. only a full build re-expands it, and rolldown
|
|
704
|
+
// tells no client that happened, so the reload is sent from here. this
|
|
705
|
+
// comes first: a deleted route fails its own patch while the registry
|
|
706
|
+
// still imports it, and the registry update supersedes that failure.
|
|
707
|
+
if (await rebuildIfRouteGraphChanged()) return
|
|
708
|
+
|
|
709
709
|
if (result instanceof Error) {
|
|
710
|
+
// an import of a route that an earlier registry listed and the current
|
|
711
|
+
// one dropped is a deleted route the registry was already rewritten for,
|
|
712
|
+
// and that rewrite builds and reports again.
|
|
713
|
+
const { removedFiles, registryId } = virtualEntry.routes
|
|
714
|
+
const errors: Array<{ code?: string; id?: string; exporter?: string }> =
|
|
715
|
+
(result as any).errors ?? []
|
|
716
|
+
if (
|
|
717
|
+
registryId &&
|
|
718
|
+
errors.length &&
|
|
719
|
+
errors.every((e) => {
|
|
720
|
+
if (e.code !== 'UNRESOLVED_IMPORT' || e.id !== registryId || !e.exporter) {
|
|
721
|
+
return false
|
|
722
|
+
}
|
|
723
|
+
const file = normalizePath(resolve(dirname(e.id), e.exporter))
|
|
724
|
+
return removedFiles.has(file)
|
|
725
|
+
})
|
|
726
|
+
) {
|
|
727
|
+
return
|
|
728
|
+
}
|
|
710
729
|
console.error('[vxrn] HMR error:', result.message)
|
|
711
730
|
onHmrUpdate?.({ type: 'hmr:error' })
|
|
712
731
|
return
|
|
713
732
|
}
|
|
714
733
|
|
|
715
|
-
// adding or deleting a route changes a route map that was expanded when
|
|
716
|
-
// the entry transformed. only a full build re-expands it, and rolldown
|
|
717
|
-
// tells no client that happened, so the reload is sent from here.
|
|
718
|
-
if (await rebuildIfRouteGraphChanged()) return
|
|
719
|
-
|
|
720
734
|
for (const { clientId, update } of result.updates) {
|
|
721
735
|
if (update.type === 'Patch' && update.code) {
|
|
722
736
|
await engine.notifyPayloadDelivered(update.filename)
|
|
@@ -1009,6 +1023,10 @@ interface NativeRouteRegistry {
|
|
|
1009
1023
|
isRouteFile: (file: string) => boolean
|
|
1010
1024
|
scanFiles: () => Set<string>
|
|
1011
1025
|
updateFiles: (files: Set<string>) => void
|
|
1026
|
+
// the registry module's resolved id, as rolldown reports it in errors
|
|
1027
|
+
registryId?: string
|
|
1028
|
+
// routes an earlier registry listed that the current one does not
|
|
1029
|
+
removedFiles: Set<string>
|
|
1012
1030
|
}
|
|
1013
1031
|
|
|
1014
1032
|
function nativeVirtualEntryPlugin(
|
|
@@ -1075,14 +1093,16 @@ globalThis.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform;
|
|
|
1075
1093
|
|
|
1076
1094
|
const entryCode = () => `
|
|
1077
1095
|
${refreshSetup}
|
|
1078
|
-
|
|
1096
|
+
// retain the namespace so rolldown dev eagerly initializes the RN environment
|
|
1097
|
+
// before app modules, even when the renderer also requires this entry.
|
|
1098
|
+
import * as ReactNativeEnvironment from 'react-native/setup-env';
|
|
1079
1099
|
import NativeWebSocket from 'react-native/Libraries/WebSocket/WebSocket';
|
|
1080
1100
|
import DevSettings from 'react-native/Libraries/Utilities/DevSettings';
|
|
1081
1101
|
${setupFileImport}
|
|
1082
1102
|
${routeImports}
|
|
1083
1103
|
import { createApp } from 'one';
|
|
1084
1104
|
|
|
1085
|
-
void
|
|
1105
|
+
void ReactNativeEnvironment;
|
|
1086
1106
|
globalThis.WebSocket = NativeWebSocket;
|
|
1087
1107
|
globalThis.__VXRN_RELOAD_NATIVE_DEV_BUNDLE__ = function(reason) {
|
|
1088
1108
|
DevSettings.reload(reason);
|
|
@@ -1139,15 +1159,19 @@ ${routeHmr}
|
|
|
1139
1159
|
const routes: NativeRouteRegistry = {
|
|
1140
1160
|
routeRoot,
|
|
1141
1161
|
files: new Set(),
|
|
1162
|
+
removedFiles: new Set(),
|
|
1142
1163
|
isRouteFile,
|
|
1143
1164
|
scanFiles,
|
|
1144
1165
|
updateFiles(files) {
|
|
1166
|
+
for (const file of routes.files) if (!files.has(file)) routes.removedFiles.add(file)
|
|
1167
|
+
for (const file of files) routes.removedFiles.delete(file)
|
|
1145
1168
|
routes.files = files
|
|
1146
1169
|
if (!useDynamicRouteRegistry) return
|
|
1147
1170
|
|
|
1148
1171
|
mkdirSync(dirname(registryPath), { recursive: true })
|
|
1149
1172
|
// rolldown resolves the registry through symlinked node_modules before its imports.
|
|
1150
1173
|
const registryDir = realpathSync(dirname(registryPath))
|
|
1174
|
+
routes.registryId = join(registryDir, basename(registryPath))
|
|
1151
1175
|
const source = `export const routes = {\n${[...files]
|
|
1152
1176
|
.sort()
|
|
1153
1177
|
.map((file) => {
|
|
@@ -1560,7 +1584,7 @@ function nativePackageDedupePlugin(root: string): Plugin {
|
|
|
1560
1584
|
function reactNativeDedupePlugin(root: string): Plugin {
|
|
1561
1585
|
// package managers can install the same react native version at multiple
|
|
1562
1586
|
// physical paths. rolldown assigns each path a module identity, so resolving
|
|
1563
|
-
// every entry through the app's instance prevents
|
|
1587
|
+
// every entry through the app's instance prevents setup-env from running twice.
|
|
1564
1588
|
//
|
|
1565
1589
|
// resolving through the filesystem also keeps react native 0.87's narrow
|
|
1566
1590
|
// package.json `exports` (it dropped `./*` and `./src/*`) from rejecting deep
|
|
@@ -1570,7 +1594,7 @@ function reactNativeDedupePlugin(root: string): Plugin {
|
|
|
1570
1594
|
|
|
1571
1595
|
return {
|
|
1572
1596
|
name: 'vxrn:react-native-dedupe',
|
|
1573
|
-
async resolveId(source, importer) {
|
|
1597
|
+
async resolveId(source, importer, options) {
|
|
1574
1598
|
if (source !== 'react-native' && !source.startsWith('react-native/')) return
|
|
1575
1599
|
|
|
1576
1600
|
if (reactNativeRoot === undefined) {
|
|
@@ -1587,11 +1611,30 @@ function reactNativeDedupePlugin(root: string): Plugin {
|
|
|
1587
1611
|
}
|
|
1588
1612
|
if (!reactNativeRoot) return
|
|
1589
1613
|
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1614
|
+
// public subpaths can map to different filenames through package exports.
|
|
1615
|
+
// resolve them from the app before handling private filesystem imports.
|
|
1616
|
+
const exported = await this.resolve(source, join(root, 'package.json'), {
|
|
1593
1617
|
skipSelf: true,
|
|
1618
|
+
kind: options.kind,
|
|
1594
1619
|
})
|
|
1620
|
+
if (exported) return exported
|
|
1621
|
+
|
|
1622
|
+
const subpath =
|
|
1623
|
+
source === 'react-native' ? 'index.js' : source.slice('react-native/'.length)
|
|
1624
|
+
const unified = await this.resolve(
|
|
1625
|
+
normalizePath(resolve(reactNativeRoot, subpath)),
|
|
1626
|
+
importer,
|
|
1627
|
+
{ skipSelf: true, kind: options.kind }
|
|
1628
|
+
)
|
|
1629
|
+
if (unified) return unified
|
|
1630
|
+
// never fall through to importer-relative resolution: a nested copy
|
|
1631
|
+
// would load beside the app copy and initialize the runtime twice. a
|
|
1632
|
+
// file missing from the app copy is version skew, and skew must fail
|
|
1633
|
+
// loudly instead of forking the singleton.
|
|
1634
|
+
this.error(
|
|
1635
|
+
`[vxrn] '${source}' is missing from the app's react-native (${reactNativeRoot}), ` +
|
|
1636
|
+
`imported by '${importer}'. refusing the nested copy so the native runtime stays a singleton.`
|
|
1637
|
+
)
|
|
1595
1638
|
},
|
|
1596
1639
|
}
|
|
1597
1640
|
}
|
|
@@ -1615,10 +1658,9 @@ function cssStubPlugin(): Plugin {
|
|
|
1615
1658
|
}
|
|
1616
1659
|
|
|
1617
1660
|
/**
|
|
1618
|
-
*
|
|
1619
|
-
*
|
|
1620
|
-
* react
|
|
1621
|
-
* same pipeline as metro, single babel pass per file.
|
|
1661
|
+
* pipe files through @vxrn/compiler's babel transforms.
|
|
1662
|
+
* handles reanimated worklet compilation, async generator downleveling,
|
|
1663
|
+
* react compiler, and react-refresh (dev only).
|
|
1622
1664
|
*/
|
|
1623
1665
|
export function vxrnCompilerPlugin(
|
|
1624
1666
|
platform: string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOptimizeDeps.d.ts","sourceRoot":"","sources":["../../src/config/getOptimizeDeps.ts"],"names":[],"mappings":"AAKA,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"getOptimizeDeps.d.ts","sourceRoot":"","sources":["../../src/config/getOptimizeDeps.ts"],"names":[],"mappings":"AAKA,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO;;;;;;;;;;gBA0I7C,UAAU;;;gBAaV,MAAM;oBACJ,qBAAqB;;;;;;;;;;;EAiBhC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { MetroPluginOptions } from '@vxrn/vite-plugin-metro';
|
|
2
|
+
import type { PluginOption } from 'vite';
|
|
2
3
|
import type { VXRNOptionsFilled } from './getOptionsFilled';
|
|
3
4
|
export declare function getReactNativePlugins(config?: Partial<Pick<VXRNOptionsFilled, 'cacheDir' | 'debugBundle' | 'debugBundlePaths' | 'entries'>>, { metro, }?: {
|
|
4
5
|
/** Passing a non-null value will enable metro mode */
|
|
5
6
|
metro?: MetroPluginOptions | null;
|
|
6
|
-
}):
|
|
7
|
+
}): PluginOption[];
|
|
7
8
|
//# sourceMappingURL=getReactNativePlugins.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getReactNativePlugins.d.ts","sourceRoot":"","sources":["../../src/config/getReactNativePlugins.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"getReactNativePlugins.d.ts","sourceRoot":"","sources":["../../src/config/getReactNativePlugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAExC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAO3D,wBAAgB,qBAAqB,CACnC,MAAM,CAAC,EAAE,OAAO,CACd,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,aAAa,GAAG,kBAAkB,GAAG,SAAS,CAAC,CACrF,EACD,EACE,KAAK,GACN,GAAE;IACD,sDAAsD;IACtD,KAAK,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAA;CAC7B,GACL,YAAY,EAAE,CA4BhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prebuildWithoutExpo.d.ts","sourceRoot":"","sources":["../../src/exports/prebuildWithoutExpo.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,iBAAiB,EACjB,KAAK,iBAAiB,EAEvB,MAAM,+BAA+B,CAAA;AAsEtC,YAAY,EAAE,iBAAiB,IAAI,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAE3F,eAAO,MAAM,mBAAmB,0BAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"prebuildWithoutExpo.d.ts","sourceRoot":"","sources":["../../src/exports/prebuildWithoutExpo.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,iBAAiB,EACjB,KAAK,iBAAiB,EAEvB,MAAM,+BAA+B,CAAA;AAsEtC,YAAY,EAAE,iBAAiB,IAAI,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAE3F,eAAO,MAAM,mBAAmB,0BAAoB,CAAA;AA6EpD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAwChE;AA0ID,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,MAAM,CA8CrI;AAg8BD,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB;AAyfD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACvC,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAA;IAC3B,GAAG,EAAE,iBAAiB,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,GAAG,oBAAoB,CAg8BvB;AAED,eAAO,MAAM,mBAAmB,SACxB,MAAM,YACF,KAAK,GAAG,SAAS,OACtB,iBAAiB,WACd,MAAM,kBAqEf,CAAA;AAgCD,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,QA6EvD;AAID,wBAAsB,qBAAqB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,iBAsDzF;AAyFD,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAClD,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,iBAAiB,CAAA;IACtB,SAAS,EAAE,SAAS,yBAAyB,EAAE,CAAA;CAChD,GAAG,IAAI,CA8BP;AAID,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,yBAAyB,EAAE,CAAC,CA+BtC;AAKD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,CAAA;CACtC,GAAG,IAAI,CAaP"}
|
|
@@ -9,6 +9,7 @@ export declare function autoDepOptimizePlugin(props: FindDepsOptions): Plugin;
|
|
|
9
9
|
export declare const getSSRExternalsCachePath: (root: string) => string;
|
|
10
10
|
type FindDepsOptionsByMode = FindDepsOptions & {
|
|
11
11
|
mode: string;
|
|
12
|
+
external?: string[] | true;
|
|
12
13
|
};
|
|
13
14
|
export declare function getScannedOptimizeDepsConfig(props: FindDepsOptionsByMode): Promise<{
|
|
14
15
|
ssr: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autoDepOptimizePlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/autoDepOptimizePlugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,MAAM,CAAA;AAChD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAC1D,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,6BAA6B,CAAA;AAQpC,KAAK,eAAe,GAAG,0BAA0B,GAAG;IAClD,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAA;CACjD,CAAA;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"autoDepOptimizePlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/autoDepOptimizePlugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,MAAM,CAAA;AAChD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAC1D,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,6BAA6B,CAAA;AAQpC,KAAK,eAAe,GAAG,0BAA0B,GAAG;IAClD,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAA;CACjD,CAAA;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CA2CpE;AAED,eAAO,MAAM,wBAAwB,SAAU,MAAM,WAEpD,CAAA;AAED,KAAK,qBAAqB,GAAG,eAAe,GAAG;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;CAC3B,CAAA;AAED,wBAAsB,4BAA4B,CAAC,KAAK,EAAE,qBAAqB;;QAoBzE,YAAY;YACV,OAAO;YACP,OAAO;;QAET,UAAU;;GAGf;AAID,wBAAsB,kBAAkB,CAAC,EACvC,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,GACR,EAAE,qBAAqB,2BA6EvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rnCodegenPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/rnCodegenPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"rnCodegenPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/rnCodegenPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAKlC,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA;AAE5D,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAW1E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BundleCommandArgs } from '@vxrn/vite-plugin-metro/rn-commands';
|
|
2
2
|
export type { BundleCommandArgs };
|
|
3
3
|
export declare function buildBundle(_argv: Array<string>, ctx: any, args: BundleCommandArgs, bundleImpl?: any): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=buildBundle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildBundle.d.ts","sourceRoot":"","sources":["../../../src/rn-commands/bundle/buildBundle.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"buildBundle.d.ts","sourceRoot":"","sources":["../../../src/rn-commands/bundle/buildBundle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AAK5E,YAAY,EAAE,iBAAiB,EAAE,CAAA;AAEjC,wBAAsB,WAAW,CAC/B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EACpB,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,iBAAiB,EACvB,UAAU,GAAE,GAAU,GACrB,OAAO,CAAC,IAAI,CAAC,CAiGf"}
|
|
@@ -127,10 +127,9 @@ export declare function nativeAnimatedGuardPlugin(): Plugin;
|
|
|
127
127
|
*/
|
|
128
128
|
export declare function hmrClientNoopPlugin(): Plugin;
|
|
129
129
|
/**
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* react
|
|
133
|
-
* same pipeline as metro, single babel pass per file.
|
|
130
|
+
* pipe files through @vxrn/compiler's babel transforms.
|
|
131
|
+
* handles reanimated worklet compilation, async generator downleveling,
|
|
132
|
+
* react compiler, and react-refresh (dev only).
|
|
134
133
|
*/
|
|
135
134
|
export declare function vxrnCompilerPlugin(platform: string, dev: boolean, projectRoot?: string, sourceMaps?: boolean): Plugin;
|
|
136
135
|
type NativeAssetData = {
|