Skip to content

refactor: RN$Bridgeless as isFabric #7043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 24, 2025
Merged

refactor: RN$Bridgeless as isFabric #7043

merged 4 commits into from
Feb 24, 2025

Conversation

tjzel
Copy link
Collaborator

@tjzel tjzel commented Feb 18, 2025

Summary

Since Bridgeless by default RN$Bridgeless global property is injected before any library code is executed. We don't support "Bridgeful" mode anymore so we can depend on this variable to detect the architecture.

Test plan

See that console.log(globalThis.RN$Bridgeless); yields true when added in top-level scope of any file.

@tjzel tjzel requested review from tomekzaw and piaskowyk February 18, 2025 11:58
kkafar pushed a commit to software-mansion/react-native-screens that referenced this pull request Feb 20, 2025
## Description

Since 0.74 `RN$Bridgeless` is always defined in the global object and
bridgeless mode isn't supported anymore. Therefore checking
`RN$Bridgeless` for Fabric is safer than depending on `_IS_FABRIC`
variable which we intend to remove in the future. `RN$Bridgeless` is
added to `global` much faster than `_IS_FABRIC`.

See
software-mansion/react-native-reanimated#7043

## Changes

👍 

## Screenshots / GIFs

:shipit: 

## Test code and steps to reproduce

🚀 

## Checklist

- [x] Included code example that can be used to test this change
- [x] Updated TS types
- [x] Updated documentation: <!-- For adding new props to native-stack
-->
- [x]
https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md
- [x]
https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md
- [x]
https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx
- [x]
https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx
- [x] Ensured that CI passes
@tjzel tjzel added this pull request to the merge queue Feb 24, 2025
Merged via the queue into main with commit c288e54 Feb 24, 2025
19 checks passed
@tjzel tjzel deleted the @tjzel/refactor-is-fabric branch February 24, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants