#reactnative
question: is this an acceptable way to use RNGH? I don't want the identity of `nativeGesture` to change, so as `drawerGesture` changes I just keep adding them endlessly in an effect
seems cursed but fixes a gnarly perf problem!
I can't tell if it's a problem that it'll leave a pile dead gestures attached to it. like I guess they'll never be garbage collected
2 2PR here
the dan in the back of my head says it does not pass the vibe check but I'm frankly out of ideas at this point
github.com/bluesky-soci...
[Perf] Fix drawer jank issue (maybe) by mozzius · Pull Request #8947 · bluesky-social/social-app
The cause of the drawer jank is due to our use of the drawer gesture, as we use it to set requireExternalGestureToFail on the main home screen pager.
Unfortunately, the drawer gesture is in a useMe...
github.com
hmmmm. the real question is: why is something that should be entirely UI thread getting janked up by the JS thread?
looking at the drawer code, it looks like it calls `runOnJS` *prior* to triggering the animation. maybe we should start the anim first
also, these are optional callbacks 🤔
react-navigation/packages/react-native-drawer-layout/src/views/Drawer.native.tsx at main · react-navigation/react-navigation
Routing and navigation for React Native and Web apps - react-navigation/react-navigation
github.com
waiiit - it doesn't use the final translation value. it might be a one line patch fix 🤦♂️
[Perf] Better fix for drawer jitter by mozzius · Pull Request #8949 · bluesky-social/social-app
Better fix for #8947
I found a better fix for the jitter issue! While #8947 improves things by reducing the amount of work the device is doing and thus hiding the problem better, the real issue is ...
github.com
yeah lol this completely works on device. love a one-liner
will open a pr with react navigation and finally end the scourge of every react native app having laggy drawers 😇
2 93 lessons here
1. remember to profile your stuff
2. profiling isn’t everything, think deeply about what’s *actually* going on
3. if your fix is suspicious (telltale signs: useEffect, setTimeout, eslint-ignore) it probably is not the optimal solution, and you should keep digging
4 2 13update: I was completely wrong and a future version of React Navigation already has the fix
I was wrong. it was a third thing: the drawer would start animating, it would change the `open` prop, and then an effect would fire starting the animation again (hence jittering back to a previous position)
luckily has already been fixed upstream 😁
recently I’ve been using the React Profiler more seriously and I’m quickly finding it to be a very fun and extremely satisfying kind of puzzle
in related news, the drawer menu jank might be fixed soon 🎉
2 1 48I still don’t have a good intuition about when parents/children changing will cause rerenders, especially with “donut” components
1 8the cause of the Drawer Jank was every time the drawer opens, it causes the RNGH gesture for the drawer to change, which causes a GestureDetector to rerender, which causes the entire Home Screen to rerender.
perf pro tip: don’t make the entire screen rerender
14now that Taylor is getting married to the platonic ideal of “man” which celebrity are we gonna baselessly speculate is gay
6 1 41wait they’re actually cleaning the grimy disgusting glass ceiling at London Liverpool Street? London is so back
3 28atproto in one post
atproto is like if you could post tweets to your own website and then twitter would be able to draw in all the tweets from across the web into a normal-looking social app
do people who work on advanced type systems have special keyboards or something or do they google for "weird rounded e unicode" every time
18 1 66@expo.dev config plugin for politely asking the phone to give your app more RAM
expo-request-more-ram
config plugin for requesting increased memory limits. Latest version: 1.0.0, last published: 2 minutes ago. Start using expo-request-more-ram in your project by running `npm i expo-request-more-ram`. ...
npmjs.com
source code is of course on @tangled.sh
@samuel.bsky.team/expo-request-more-ram
config plugin for requesting increased memory limits
tangled.sh