Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/compiler/.depcheckrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ignores:
- "babel-plugin-react-compiler"
- "@babel/plugin-transform-destructuring"
- "@babel/plugin-transform-flow-strip-types"
- "@react-native/babel-plugin-codegen"
- "@babel/plugin-transform-react-jsx"
- "@babel/plugin-transform-regenerator"
Expand Down
1 change: 1 addition & 0 deletions packages/compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"dependencies": {
"@babel/core": "^7.28.5",
"@babel/plugin-transform-destructuring": "^7.28.5",
"@babel/plugin-transform-flow-strip-types": "^7.27.1",
"@babel/plugin-transform-react-jsx": "^7.27.1",
"@babel/plugin-transform-regenerator": "^7.28.4",
"@react-native/babel-plugin-codegen": "^0.83.0",
Expand Down
11 changes: 11 additions & 0 deletions packages/compiler/src/transformBabel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ export async function transformBabel(
: '',
...(options.presets || []),
].filter(Boolean),
// Non-TS files use React Native's Flow dialect — RN's own component specs are
// Flow `.js` (`import type`, `codegenNativeComponent<T>(…)`, `(expr: Type)` casts).
// Enable Flow syntax parsing + stripping, mirroring the TypeScript preset above
// (`@react-native/babel-preset` does the same: TS → preset-typescript, JS → this
// plugin). Without it babel can't parse Flow, so plugins like
// @react-native/babel-plugin-codegen silently fail on RN specs and the runtime
// "Codegen didn't run" warning fires. TS path is byte-identical (empty slice).
plugins: [
...(options.plugins || []),
...(isTS ? [] : ['@babel/plugin-transform-flow-strip-types']),
],
}

try {
Expand Down
13 changes: 9 additions & 4 deletions packages/vxrn/src/utils/createNativeDevEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,20 @@ function getNativePlugins(
cssStubPlugin(),
// handle import.meta.glob (used by One's route system)
viteImportGlobPlugin({ root }),
// strip Flow types from react-native and @react-native packages
// @vxrn/compiler babel transforms: reanimated worklets, async generators,
// react-native codegen, react compiler — same pipeline as metro. Runs BEFORE
// flowStripPlugin so react-native's Flow `.js` specs reach codegen with their
// type argument intact — stripping Flow first would erase it (which is why the
// codegen "didn't run for <Component>" warning fired).
vxrnCompilerPlugin(platform, dev),
// strip Flow from any react-native / @react-native `.js` the compiler didn't
// handle — the guaranteed safety net before rolldown's oxc core parse (which
// can't parse Flow). Now downstream of the compiler, so codegen sees the types.
flowStripPlugin(),
// guard undefined native methods in NativeAnimatedHelper
nativeAnimatedGuardPlugin(),
// handle asset imports (.png, .jpg, .ttf, etc.)
assetPlugin({ root, platform, assetsDest }),
// @vxrn/compiler babel transforms: reanimated worklets, async generators,
// react-native codegen, react compiler — same pipeline as metro
vxrnCompilerPlugin(platform, dev),
// hermes compat: transform class properties and private fields
hermesCompatSWCPlugin(dev),
]
Expand Down