React Native 0.74 (Bridgeless) Support
oktaysenkan opened this issue · 16 comments
Hello,
React Native is transitioning to bridgeless architecture with version 0.74. This architecture aims to improve performance and maintainability by removing the JavaScript bridge, which has traditionally been a bottleneck.
I am currently using your library react-native-code-push
in my project. It's been incredibly useful, and I appreciate all the effort that goes into maintaining it. With the changes in React Native 0.74, it appears that the library may require updates to ensure full compatibility with the new architecture.
Links
About the New Architecture
New Architecture working group
Library support for New Architecture + Bridgeless in 2024
Already migrated libs to take as an example
Is anyone looking at this? @MikhailSuendukov
As we do not have plans to add support for this feature in the next year, I'm closing the issue.
@oktaysenkan fwiw we have managed to get codepush OTA updates working in bridgeless / interop mode on rn0.74.5 using the simple patch below. It serves our use case of simple OTA updates, both forced and optional. Please let me know if it works for you, happy to investigate further if additional changes are required
@lucen-ms Checking on this topic since I noticed you're contributor on the standalone codepush server as well. Can this change be part of the standalone repo? Is there a plan / vision how requests by the community can be made part of the standalone repo without having many forks?
As we stated in the readme of the standalone version, we do not accept pull requests for features. We will only maintain security updates till March 31, 2025. Hence for adding features, we recommend implementing them in your fork. E.g. there is already a fork with AWS support.
@oktaysenkan fwiw we have managed to get codepush OTA updates working in bridgeless / interop mode on rn0.74.5 using the simple patch below. It serves our use case of simple OTA updates, both forced and optional. Please let me know if it works for you, happy to investigate further if additional changes are required
@BenIrving tried implementing your patch but I'm getting this error like the invalidateCurrentInstance
is being called or the package isn't being added to the generated PackageList. I verified that the generated autolinking PackageList has this CodePush initialization in there. I'm on react-native 0.75.4 with react-native-code-push 8.3.1 with the new architecture enabled and bridgeless mode enabled. when bridgeless mode is disabled this error doesn't occur. any thoughts or other suggestions?
E Unhandled SoftException
com.facebook.react.bridge.ReactNoCrashSoftException: raiseSoftException(getOrCreateDestroyTask()): handleHostException(message = "null")
at com.facebook.react.runtime.ReactHostImpl.raiseSoftException(SourceFile:0)
at com.facebook.react.runtime.ReactHostImpl.getOrCreateDestroyTask(Unknown Source:5)
at com.facebook.react.runtime.ReactHostImpl.lambda$destroy$7(Unknown Source:25)
at com.facebook.react.runtime.ReactHostImpl.$r8$lambda$uso21_D6dCZdcf-JomVD56kdG4c(SourceFile:0)
at com.facebook.react.runtime.ReactHostImpl$$ExternalSyntheticLambda44.call(SourceFile:0)
at com.facebook.react.runtime.internal.bolts.Task$2.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at expo.modules.ReactNativeHostWrapperBase.invokeDelegateMethod$expo_release(Unknown Source:36)
at expo.modules.ReactNativeHostWrapperBase.getJSBundleFile(Unknown Source:27)
at expo.modules.ExpoReactHostFactory$ExpoReactHostDelegate.getJsBundleLoader(Unknown Source:17)
at com.facebook.react.runtime.ReactHostImpl.lambda$getJsBundleLoader$26(Unknown Source:2)
at com.facebook.react.runtime.ReactHostImpl.$r8$lambda$7mHFCl1T6X_2-pYKdhDvi-JqDUI(SourceFile:0)
at com.facebook.react.runtime.ReactHostImpl$$ExternalSyntheticLambda14.call(SourceFile:0)
at com.facebook.react.runtime.internal.bolts.Task$2.run(Unknown Source:4)
at com.facebook.react.runtime.internal.bolts.Executors$ImmediateExecutor.execute(Unknown Source:0)
at com.facebook.react.runtime.internal.bolts.Task.call(SourceFile:0)
at com.facebook.react.runtime.internal.bolts.Task.call(SourceFile:0)
at com.facebook.react.runtime.ReactHostImpl.getJsBundleLoader(Unknown Source:34)
at com.facebook.react.runtime.ReactHostImpl.lambda$getOrCreateReactInstanceTask$24(Unknown Source:13)
at com.facebook.react.runtime.ReactHostImpl.$r8$lambda$bTI5MePZZsV3HRHvI1gYwNMIwCY(SourceFile:0)
at com.facebook.react.runtime.ReactHostImpl$$ExternalSyntheticLambda31.get(SourceFile:0)
at com.facebook.react.runtime.BridgelessAtomicRef.getOrCreate(Unknown Source:38)
at com.facebook.react.runtime.ReactHostImpl.getOrCreateReactInstanceTask(Unknown Source:12)
at com.facebook.react.runtime.ReactHostImpl.waitThenCallGetOrCreateReactInstanceTaskWithRetries(Unknown Source:64)
at com.facebook.react.runtime.ReactHostImpl.waitThenCallGetOrCreateReactInstanceTask(Unknown Source:2)
at com.facebook.react.runtime.ReactHostImpl.$r8$lambda$pQZAQOO5LKYIY0sOQYajWrj6-Rc(SourceFile:0)
at com.facebook.react.runtime.ReactHostImpl$$ExternalSyntheticLambda15.call(SourceFile:0)
... 4 more
Caused by: com.microsoft.codepush.react.CodePushNotInitializedException: A CodePush instance has not been created yet. Have you added it to your app's list of ReactPackages?
at com.microsoft.codepush.react.CodePush.getJSBundleFile(SourceFile:0)
at com.microsoft.codepush.react.CodePush.getJSBundleFile(SourceFile:0)
at com.[company].MainApplication$reactNativeHost$1.getJSBundleFile(Unknown Source:0)
... 25 more
@vir-skiplagged have you found any solution?
@vir-skiplagged have you found any solution?
@FightFarewellFearless haven't found a fix yet. are you running into the same issue?
@vir-skiplagged have you found any solution?
@FightFarewellFearless haven't found a fix yet. are you running into the same issue?
Yes, same issue here running on react native 0.75.1
@vir-skiplagged have you found any solution?
@FightFarewellFearless haven't found a fix yet. are you running into the same issue?
Yes, same issue here running on react native 0.75.1
@FightFarewellFearless I feel like the issue has something to do with the changes to autolinking but I've been trying a variety of things without success. if you figure it out let me know, I'll do the same. hopefully maybe someone else has solved this issue or can point us in the right direction
sure, i'll try something in the next weekend
@FightFarewellFearless just a bit of an update. I figured it out a bit but haven't solved the issue. So we're integrating expo modules into a bare react native project. From MainApplication.kt
here https://docs.expo.dev/bare/installing-expo-modules/#configuration-for-android if you revert to the bare react native stuff for everything other than the ApplicationLifecycleDispatcher
and onConfigurationChanged
changes, it will build for me. digging in further
Oops, forgot to mention my project is already having expo modules integrated, thank you for letting me know. I haven't done anything related to this issue, I guess we could try rewriting this module into expo modules and get the new architecture works out of the box, but i think this is require so much effort