Open nandorojo opened 7 months ago
This also removes the bridge, so I think self.bridge would not be an option to use either.
About this, it seems that bridgeless mode still exposes a "bridge" in some way, probably to ensure maximum backwards compatibility
So hopefully it might not be a big hindrance
Turns out self.bridge
isn't in the source anyway so I think it's a moot point. We will have figure out findNodeHandle though
Turns out
self.bridge
isn't in the source anyway so I think it's a moot point. We will have figure out findNodeHandle though
self.bridge
is not directly utilized by react-native-ios-context-menu
, but it looks like it is heavily utilized by react-native-ios-utilities
, which react-native-ios-context-menu
depends on. Either way, I agree, both these concerns should be addressed to ensure 0.74 + bridgeless compatibility.
cc @dominicstop
Oh, got it, good to know. Well at least we know that will work then.
Hi, thanks for tagging me, the issue got buried in my inbox, so I apologize for the very late reply...
Yes, i agree that this is important, however It looks like I’ll need to do some refactors + run some experiments to support the new architecture — the one thing i’m worried about the most is that the workarounds/hacks i’ve used in the past won’t work anymore w/ fabric/JSI...
regarding findNodeHandle
, a view's associated react tag can be sent from JS to Native via an event — but you can also retrieve it via onLayout
(or reading a private property in the native component's ref
).
As for the bridge usage, i'm not sure yet if there's a corresponding replacement for all the API's i'm using...
I’m currently working on making a component that wraps UITableView
, but ran into some trouble due to the delay/async communication between native and JS.
Below is a quick demo:
The demo shows the ff. things:
UITableViewDiffableDataSource
+ UIDragDelegate
).As for the bridge usage, i'm not sure yet if there's a corresponding replacement for all the API's i'm using...
@dominicstop I haven't checked in full detail, but it seems like you're not using any APIs that the RN team has explicitly specified that the RCTBridgeProxy does not support. So, it may work "out of the box" as long as you switch to using this RCTBridgeProxy instead of the RCTBridge
Hello @dominicstop
As a heads up, RN 0.74 was officially released yesterday, which means it is likely that there will be an increase in the number of users actively experimenting with the new architecture, which will probably bring more attention to this issue.
hello, thank you for the gentle warning/reminder; i made 2 new branches so i can start working on this (i.e. react-native-ios-utilities/wip-new-arch
, and react-native-ios-context-menu/wip-new-arch
).
Unfortunately, i won't be able to support the "aux. previews" for now (i'm hoping to fix support for it in future releases); but i'll be able to make sure all the other stuff work (my best estimate is around 2-3 days).
i understand your frustration, and i apologize. In summary, i'm currently in between places (and i lost my current job that allows me to work on OSS full-time). As such, for the foreseeable future, i'm going to be supporting this library in my free time only (as a hobby), since i'm going to go back to my non-tech job again. But for now, i still have a couple of days left of paid time to work on supporting the new architecture.
TLDR: I'm working on it, and i'm hoping to finish it before the end of the month (i'll update this thread once i'm able to make a pre-release version for testing).
thank you for understanding ✨
react-native-ios-utilities
(all changes)react-native-ios-context-menu
, react-native-ios-modal
, react-native-ios-adaptive-modal
, react-native-ios-list-view
, react-native-ios-popover
.Update:2024-04-26-13:06 PST
- It turns out a lot of weird stuff is happening w/ fabric (please see the "Log + Status" section for the detailed report). I'm still looking at what i can do to fix support for fabric, but it's currently not looking good haha (it might take more than 3 days asdjshkfsdl).Update:2024-04-30-15:36 PST
- Made some small progress in making a wrapper to use swift views in fabric. Please see log for more details.Update:2024-05-23-03:16 PST
- The swift "compatibility layer" for fabric and paper has been mostly completed. E.g. most of the common API's needed for exposing native views to RN has been implemented (i.e. RNIBaseView
+ RNIContentView
).
Lifting #84 into a new issue.
Problem
New Architecture isn't working with this library.
Context
React Native 0.74 is coming with bridgeless mode and improvements for the new architecture. It appears that Expo is finally adopting it and they have a plan to test libraries for it.
How to test it
Here brent explains how to test New Architecture support with an Expo Module (it's easy): https://x.com/notbrent/status/1774931733194088465?s=20
TLDR: install
expo-build-properties
into the app you're testing, and add it to your app.json, setnewArchEnabled: true
.Show code
```json { "expo": { "name": "try-zeego", "slug": "try-zeego", "icon": "./assets/icon.png", "splash": { "image": "./assets/splash.png", "resizeMode": "contain", "backgroundColor": "#ffffff" }, "ios": { "supportsTablet": true, "bundleIdentifier": "com.example.with-new-arch" }, "android": { "package": "com.example.withnewarch" }, "plugins": [ [ "expo-build-properties", { "ios": { "newArchEnabled": true }, "android": { "newArchEnabled": true } } ] ] } } ```Here is a reproduction showing that this library does not currently work with the new architecture.
There's no crash, but the menu doesn't open.
Solution
Fabric deprecates
findNodeHandle()
, and it looks likereact-native-ios-context-menu
uses that function.I think the solution would be to remove
findNodeHandle
in favor of the component's ref.I'm not sure if other changes would be needed, but I'd assume that would fix it.
This also removes the bridge, so I think
self.bridge
would not be an option to use either.