Skip to content
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

feat: support bridgeless #633

Merged
merged 39 commits into from
Jun 5, 2024
Merged

feat: support bridgeless #633

merged 39 commits into from
Jun 5, 2024

Conversation

jbroma
Copy link
Member

@jbroma jbroma commented May 29, 2024

Summary

add support for bridgeless in new arch for RN >= 0.74 with compat for all other variants. RN 0.74 introduced way more compatibility layers to handle bridgeless on new arch which was not possible on 0.73. Since there is no way to get into the runtime on bridgeless on 0.73, it is excluded from support (it was not turned on by default before 0.74 so it's a rare scenario). This seems to be rather common amongst other libraries having similar issues.

Notes

  • CPP Native Turbomodule would be nice but we still need to support old arch, at least for now
  • Implemented using CallInvoker API on both platforms
  • Android uses BridgelessCatalystInstance since it was introduced in 0.74 - thanks to that we don't need to fork the code needed to fork the code on Android because of FrameworkAPI requirement that causes compilation error 😔

Test plan

Platform 0.74 0.73 0.72
Android OldArch
Android NewArch
Android NewArch Bridgeless -
iOS OldArch
iOS NewArch
iOS NewArch Bridgeless -

Copy link

vercel bot commented May 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
repack-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 9:49pm

Copy link

changeset-bot bot commented May 29, 2024

🦋 Changeset detected

Latest commit: cc84ed3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@callstack/repack Minor
@callstack/repack-dev-server Minor
@callstack/repack-init Minor

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

@jbroma jbroma marked this pull request as draft May 29, 2024 10:54
@jbroma jbroma marked this pull request as ready for review June 3, 2024 17:20
@jbroma
Copy link
Member Author

jbroma commented Jun 3, 2024

Everything looks green, except for the RN 0.73 bridgeless which is expected.

I've also fixed multiple issues on Android:

@jbroma
Copy link
Member Author

jbroma commented Jun 3, 2024

Canary build for testing available here: https://www.npmjs.com/package/@callstack/repack/v/4.0.1-canary-20240603172122

Copy link
Member

@okwasniewski okwasniewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! I've left few minor comments

packages/TesterApp/ios/TesterApp/AppDelegate.mm Outdated Show resolved Hide resolved
packages/repack/android/CMakeLists.txt Outdated Show resolved Hide resolved
packages/repack/ios/ScriptConfig.h Outdated Show resolved Hide resolved
packages/repack/ios/ScriptManager.mm Show resolved Hide resolved
packages/repack/ios/ScriptManager.mm Outdated Show resolved Hide resolved
@jbroma
Copy link
Member Author

jbroma commented Jun 4, 2024

cpp & objc is now reformatted with clang-format 🎉

@jbroma jbroma merged commit 38a9ff0 into main Jun 5, 2024
5 checks passed
@jbroma jbroma deleted the feat/support-bridgeless branch June 5, 2024 11: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.

2 participants