-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Enable New Architecture in Bluesky on RN 0.76 #6755
base: main
Are you sure you want to change the base?
Conversation
I'm happy to help investigate some of the issues if you'd like it @haileyok. We've already got much experience with all things New Arch related, like: |
Makes sense. Thanks for the details. |
@gaearon We came back to the office yesterday and I was finally able to dig deeper into the issue. As I said before the laggy animation is a result of the JS thread being heavily utilized (since we need to synchronize the updates applied on the JS thread with the animation). This is what it looks like:
After some digging it seems that the This is the trace after I removed it from the app: The trace looks better now (and the animation seems to work better) - there is still some room for improvement here (but on the reanimated side). The JS thread now is mostly occupied with c++ state updates that are invoked to synchronize the scroll position with the |
Could be an RN bug! But not sure how to file it. Can you reproduce the same in a minimal app? I'm not sure what the reproducing instructions would be. |
We can definitely remove it to work around. |
Yes, I was able to reproduce it in an expo app with simply this code. Codeimport { Profiler } from "react";
import { StyleSheet, Text, View } from "react-native";
import Animated from "react-native-reanimated";
const data = new Array(200);
function onRender(id: string, phase: string, actualDuration: number) {}
export default function App() {
return (
<Profiler id="app" onRender={onRender}>
<View style={styles.container}>
<Animated.FlatList
data={data}
renderItem={(x) => {
return (
<View style={{ backgroundColor: "red", width: 200, height: 300 }}>
<Text>{x.index}</Text>
</View>
);
}}
/>
</View>
</Profiler>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
},
message: {
textAlign: "center",
paddingBottom: 10,
},
camera: {
flex: 1,
},
buttonContainer: {
flex: 1,
flexDirection: "row",
backgroundColor: "transparent",
margin: 64,
},
button: {
flex: 1,
alignSelf: "flex-end",
alignItems: "center",
},
text: {
fontSize: 24,
fontWeight: "bold",
color: "white",
},
}); |
Ok perfect! I will merge |
Ok I merged the newest |
I'm working on a few gesture-related fixes so we'll need to make sure those don't regress with the transition. Let me finish up that work first and then I'll give this PR another spin. |
I'm done with the gesture fixes so we can revive this. Would it be a good idea to bump RN here as well? Either to 0.76.6 or 0.77? This got me a bit worried: facebook/react-native#47490 (comment) |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Hmm, dismissing the composer keeps the keyboard on for me |
Pressables in post thread (e.g. click into a post, try to click like/repost/comment buttons) are strangely unresponsive. They get hover states but not generating presses |
Swiping the drawer left and right is very laggy (this is all on low-end Android) |
FWIW feed scrolling perf feels improved to me |
I'd start with 0.76.6 since it will be easier. Also 0.77 is not yet officially supported by expo, but it should come any moment. |
We looked into it a bit but haven't got to the root of the problem. We can see some really have rerenders on animation start and end (lasting about 200ms on fast device). It shouldn't happen since we simply set Or are we missing something and |
On iOS, I've been finding that any animations that are not native are very slow. The drawer seems a particular problem. Unless there is absolutely nothing going on, the drawer will stutter. A simple test is to have a video playing in the app. Perfectly smooth until you enable the new architecture. |
The simplest way to find out would probably be to use the Profiler tab in React DevTools and to check the commits, have you tried that? |
Ok that one is not true anymore: https://expo.dev/changelog/2025/01-21-react-native-0.77 so we could try with the newest RN version too. |
@gaearon We only profiled with the Android Studio Profiler, and have seen that there were some heavy |
PR enabling New Architecture in the app. Based on work from @haileyok in #6211 and a bit on #4853. Great work on those PRs so far 💪
There are still some issues like small input text on iOS, glitches with bottomsheet on both platforms and probably some more.