software-mansion / react-native-ide

https://ide.swmansion.com
Other
705 stars 21 forks source link

Rewrite wrapper code to properly support cases when devtools connect with some delay #375

Closed kmagiera closed 2 weeks ago

kmagiera commented 2 weeks ago

This PR rewrites the logic responsible for dealing with devtools agent inside the main app wrapper that's a part of RNIDE runtime.

The previous implementation was quite messy and not well organized. Specifically, handling changes of some of the callbacks wasn't implemented properly and might've resulted in certain events triggering old versions of callbacks.

This rewrite aims to organize this implementation a bit better. Here are some key points of the work being done here: 1) we extract individual elements into separate effects with proper dependency arrays 2) we make sure that event callbacks registered with devtools agent are also disconnected 3) properly handle the case when layout event comes before agent is present (before we'd never trigger "app ready" event in such case

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 12, 2024 9:52pm