-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
chore: improve bridgeless interop layer compatibility #2290
base: main
Are you sure you want to change the base?
chore: improve bridgeless interop layer compatibility #2290
Conversation
@dcvz It would be good to have bridgeless working before |
@dcvz - any chance you could review this? react-native-track-player came up as one of the top 400 most popular packages in the react-native and we're hoping to get as many popular libraries as possible compatible leading up to the launch of react-native@0.74 - reactwg/react-native-new-architecture#167 |
thank you for the work @behenate I put together a bare minimum example app for the event issue, it's actually none of the hooks/useEvents work anymore; the addEventListener inside doesnt do anything I believe. however TP.addEventListener as in SetupService works. tbh i'm completely lost with the new arch stuff, if anyone have any insight, thank you very much in advance notification is a bigger issue imo bc all of that should be native. |
I guess somehow bridge and bridgeless are running concurrently? RNTP internal hooks is registered as NOBRIDGE and listeners added via AppRegistry.registerHeadlessTask is registered in the bridge? they use different NativeEventEmitters and the nobridge ones arent updating at all.
|
This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This PR was closed because it has been stalled for 7 days with no activity. |
Hi there! @lovegaoshi @behenate RN version 0.75.1 has already been released. Does anyone have plans to improve this case, or have you found any solution for it? |
There’s some stuff in the works, but still needs more time to be refined. |
Thanks a lot, there are many guys here who are working on their startups and are using your invaluable package. I think this needs to be resolved as quickly as possible. If there are any needs from my side, I'm always happy to help in any way I can. :) |
Hey guys, any news ? I would like to help if needed |
sure if u can help on facebook/react-native#46050
tia
…On Thu, Aug 29, 2024, 2:32 PM Miguel Daipré ***@***.***> wrote:
Hey guys, any news ? I would like to help if needed
—
Reply to this email directly, view it on GitHub
<#2290 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZMOVVVWXR7JLNS37ORSRGDZT6HODAVCNFSM6AAAAABFZJVFBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJZGA2TKMJWGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
@lovegaoshi Hi! This issue is not only Android related, it also breaks the connection between the Metro bundler and the native side on iOS) |
uh sure, u r welcome to report to fb too. im not an ios person.
…On Sun, Sep 1, 2024, 5:11 AM Medkhat ***@***.***> wrote:
@lovegaoshi <https://github.com/lovegaoshi> Hi! This issue is not only
Android related, it also breaks the connection between the Metro bundler
and the native side on iOS)
—
Reply to this email directly, view it on GitHub
<#2290 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZMOVVUIJHQLRBZXVG76LCDZUL76NAVCNFSM6AAAAABFZJVFBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRTGMYTENZUG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Why
In
react-native 0.74
when new architecture is enabled bridgeless mode will be enabled by default.By default modules which use the bridge will use an interop layer but it's not perfect. After creating a project, which uses
react-native 0.74.0-rc.6
both Android and iOS don't work at all under bridgeless.How
I managed to get the features of the example app working on iOS by removing some declarations from
RNTrackPlayerBridge.m
:getSleepTimerProgress
,setSleepTimer
,sleepWhenActiveTrackReachesEnd
andclearSleepTimer
are declared, but never implemented (correct me if I'm wrong), which causes a segmentation fault when using bridgeless. Removing them fixes the issue. All of the functionality seems to be working ok after the fix.On Android some of the
@ReactMethod
annotated functions are assigned a value ofscope.launch
. This causes the interop layer to unnecessarily try to pass the returnedJob
s to the JS side, which fails. Added a wrapper forscope.launch
, so that the assignment can be kept for better readability, but the function return type is changed toUnit
.Unfortunately some things still don't work well with bridgeless on Android. Some of the events aren't sent correctly (eq. the
PlaybackActiveTrackChanged
). For some reason all of the notification controls become broken. Those issues are likely easy fixes, but I currently don't have time to learn the codebase and fix them 😕