Repository navigation
fix(repack): support flow-parser in React Native 0.88 - #1476
Conversation
…ogic - Updated references from `loadHermesParser` to `loadReactNativeParser` in babelLoader and utils. - Adjusted the transform function to utilize the new parser. - Modified codegen transform rules to use the new React Native syntax plugin. - Added new integration tests for React Native parser handling Flow, TypeScript, and TSX files. - Introduced new fixture files for testing React Native components and their parsing. - Updated package dependencies in pnpm-lock.yaml and package.json for Babel runtime and React Native presets.
🦋 Changeset detectedLatest commit: 546d223 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@whydidoo is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for this! The parser change looks right to me. I checked the @react-native/babel-preset@0.88.0-rc.3 source: it uses require('flow-parser/babel-plugin') with parseLangTypes: 'flow' and reactRuntimeTarget: '19'. flow-parser@0.327.0 accepts the same parse() options Re.Pack already passes (babel, reactRuntimeTarget, sourceType), and it defaults to flow: 'detect' just like hermes-parser. So it's a drop-in swap.
Which is separate one, it errors only when enablePackageExports: false. not related to this PR. |
Thanks for testing this! RN 0.88 exposes these entry points through package exports, so |
…e documentation for package exports in Re.Pack
|
@CristiCeban all were fixed |
|
nice work, thanks @whydidoo 🙏 |
Summary
React Native 0.88 replaces the Hermes parser dependency in its Babel preset with
flow-parser, which breaks Re.Pack's hard-coded parser lookup.Resolve the parser and matching Babel syntax plugin from the application's React Native preset. Use the same resolution for the Babel loader, codegen, and Reanimated, while keeping support for older Hermes-based presets.
Fixes #1474.
Test plan
RN 0.87 builds used a targeted ReactNativeFeatureFlags alias for an existing package exports issue, also reproduced with the old loader. RN 0.88 RC passed without it.