-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[React Native] Devtools can't find React within the Web Worker (help wanted) #229
Comments
I don't know how to fix this. I now remember that this is why we didn't merge that RN pull request originally. |
There's a way to do it, but I imagine it will slow things down more. I'll On 4:41PM, Sat, Sep 26, 2015 Ben Alpert notifications@github.com wrote:
|
@jaredly Why would it slow things down? It is already an async bridge and potentially we could communicate directly from the Worker to the Dev Tools. It'd be good to have multiple host support for multiple Workers and iframes regardless. |
Multiple hosts is a good point. |
:/ looks like there's no way to go from webworker to devtools from the apis. You can eval in an |
This needs to be fixed. @jaredly have you made any progress? |
Is it related to my problem: the react tab won't show up in Chrome with RN 0.12? (for an RN app running in the simulator, and websocket connection well established) |
Yes, the devtools currently do not work with RN. |
👍 |
+1 to this, it's quiet possibly the most annoying thing ever. |
This sounds like also perhaps the reason |
It's pretty major. Wouldn't it make sense to roll the chrome debugging related changes back and reimplement when the overall issue is fixed? |
@jaredly are you actively looking into this? Or if not can you add a Help Wanted label so someone who wants this feature can submit a PR? |
Nope. Even though it's impacting my productivity, I haven't got a clue how this aspect works. So, it's not likely I will jump into this. |
I haven't gotten it running w/ the chrome extension yet, but I've been putting this app together for debugging things like embedded WebViews and electron-based apps -- it's an independent app that talks to react via a websocket. I believe it would be fairly simple to do the same thing from a WebWorker. |
@jaredly this is great work. How's the speed on the web socket stuff? Acceptable? (I'd imagine it's fine) |
@jaredly fantastic! that's really cool. |
@skevy yeah speed hasn't been an issue from what I've seen |
Awesome. I'm checking this out tonight. |
I got the electron app running (had to manually install I'm running React Native 0.12. |
@evansolomon ok I just checked it out, and it looks like there was a missing piece. Just make a PR, but it's a one line fix if you want to do it manually facebook/react-native#3431 |
Maybe that was a bad habit, but, in dev mode, I was used to expose |
@despairblue great! thanks |
@despairblue Didn't know that was a thing, but works perfectly. Greatly appreciated! |
Works! Thanks! No React tab yet, but at least debugging works again |
@ide Perfect. If we don't want to wait for Node 6, we could use Jam3/devtool temporarily. That would save us from a couple more months of torture. 😛 I'm just happy this is going to be resolved soon. 👍 |
Node 6.3 is here so it's possible to start building today, there's nothing to wait for. I wrote up a game plan here to provide some guidance: facebook/react-native#8641 |
Sorry, I was referring to this line. I don't see why |
Summary: Currently, DevTools only work under ios (although this is undocumented!), because the JavaScriptEngine initialization process skips setupDevTools() on android. DevTools work fine with Android, as tested on 0.26, 0.27, and 0.28 using Nuclide's inspector. For reference, [the relevant issue on react-devtools](facebook/react-devtools#229). Closes facebook#8095 Reviewed By: bestander Differential Revision: D3430206 Pulled By: javache fbshipit-source-id: 826f0252fff3f0ec2c843149540a0109e34d1d18
Summary: Currently, DevTools only work under ios (although this is undocumented!), because the JavaScriptEngine initialization process skips setupDevTools() on android. DevTools work fine with Android, as tested on 0.26, 0.27, and 0.28 using Nuclide's inspector. For reference, [the relevant issue on react-devtools](facebook/react-devtools#229). Closes facebook#8095 Reviewed By: bestander Differential Revision: D3430206 Pulled By: javache fbshipit-source-id: 76f19407271a3779e12bd244f1bc31ef3a8659c7
Summary: Currently, DevTools only work under ios (although this is undocumented!), because the JavaScriptEngine initialization process skips setupDevTools() on android. DevTools work fine with Android, as tested on 0.26, 0.27, and 0.28 using Nuclide's inspector. For reference, [the relevant issue on react-devtools](facebook/react-devtools#229). Closes facebook#8095 Reviewed By: javache Differential Revision: D3443980 Pulled By: andreicoman11 fbshipit-source-id: 3d7b2e83cf4158a1228d2e21510509ab63411a5d
Summary: Currently, DevTools only work under ios (although this is undocumented!), because the JavaScriptEngine initialization process skips setupDevTools() on android. DevTools work fine with Android, as tested on 0.26, 0.27, and 0.28 using Nuclide's inspector. For reference, [the relevant issue on react-devtools](facebook/react-devtools#229). Closes facebook#8095 Reviewed By: javache Differential Revision: D3443980 Pulled By: bestander fbshipit-source-id: ce0f7dd62ae0f7dfe6654380821660f8660318a6
Summary: Currently, DevTools only work under ios (although this is undocumented!), because the JavaScriptEngine initialization process skips setupDevTools() on android. DevTools work fine with Android, as tested on 0.26, 0.27, and 0.28 using Nuclide's inspector. For reference, [the relevant issue on react-devtools](facebook/react-devtools#229). Closes facebook#8095 Reviewed By: bestander Differential Revision: D3430206 Pulled By: javache fbshipit-source-id: 826f0252fff3f0ec2c843149540a0109e34d1d18
Summary: Currently, DevTools only work under ios (although this is undocumented!), because the JavaScriptEngine initialization process skips setupDevTools() on android. DevTools work fine with Android, as tested on 0.26, 0.27, and 0.28 using Nuclide's inspector. For reference, [the relevant issue on react-devtools](facebook/react-devtools#229). Closes facebook#8095 Reviewed By: bestander Differential Revision: D3430206 Pulled By: javache fbshipit-source-id: 76f19407271a3779e12bd244f1bc31ef3a8659c7
Summary: Currently, DevTools only work under ios (although this is undocumented!), because the JavaScriptEngine initialization process skips setupDevTools() on android. DevTools work fine with Android, as tested on 0.26, 0.27, and 0.28 using Nuclide's inspector. For reference, [the relevant issue on react-devtools](facebook/react-devtools#229). Closes facebook#8095 Reviewed By: javache Differential Revision: D3443980 Pulled By: andreicoman11 fbshipit-source-id: 3d7b2e83cf4158a1228d2e21510509ab63411a5d
Summary: Currently, DevTools only work under ios (although this is undocumented!), because the JavaScriptEngine initialization process skips setupDevTools() on android. DevTools work fine with Android, as tested on 0.26, 0.27, and 0.28 using Nuclide's inspector. For reference, [the relevant issue on react-devtools](facebook/react-devtools#229). Closes facebook#8095 Reviewed By: javache Differential Revision: D3443980 Pulled By: bestander fbshipit-source-id: ce0f7dd62ae0f7dfe6654380821660f8660318a6
What's the update for using chrome dev tools (or I guess node-based devtools if that becomes the holistic direction)? I'd venture to say only a minority of RN developers are using Nuclide. Last time I checked, Nuclide's React inspector was extremely slow, had problems staying connected, and was ultimately unusable. It seems the optimum (and most up to date) experience will always be in chrome devtools. We should strive to make that priority and not settle on just Nuclide support. It seems we're going the holistic node debugging route for RN--what are we waiting on there to make that happen? And what challenges will it pose to things like Redux Devtools if any? |
To debug RN today, use the standalone DevTools package. |
@gaearon is there any way to debug the standalone devtools when the it gets stuck on "Connecting to React..."? Thanks :) |
You can try to apply these changes locally: facebook/react-native@7a3ab96 They fix the flakiness due to race conditions in existing code. When they're in a stable RN release, everything should be good out of the box. As I said in the comment above:
|
Perfect! Will give that a go now, thanks again :) |
Let me know if it helps! (I hope it should.) |
@gaearon, here's an update on this, it seems that it wasn't a problem with the packages that are published on npm but instead an conflict with Debug JS Remotely. If that option is enabled, the devtools get stuck in the connecting message. If I disable it, after reloading both, the simulator and the devtools it works alright :). |
Just leaving that here: https://github.com/jhen0409/react-native-debugger |
@cwagner22 This package has a few extra tools but it uses exactly the same code underneath. @dariocravero Do you mind sending a PR to package README explaining this? I don't know anything about the "Debug JS Remotely" option—first time hearing about it. So yes, I never tested with it, and maybe it won't work. If you could explain what exactly it is doing maybe we can figure it out. Thanks! |
@dariocravero I guess the problem the same with #476 (comment), we should ensure |
This is interesting. Can you please file an issue in this repo so I could take a look? |
Using React DevTools in React Native is now officially documented: I'll lock this issue. If you have any further problems please file new issues. |
Update from Maintainers: DevTools works with React Native again! Follow these instructions: http://facebook.github.io/react-native/docs/debugging.html#react-developer-tools
React Native now runs within a Web Worker on Chrome so that it gets a more pure and isolated JS environment that more closely mimics JSC on the device but this breaks the React devtools. @skevy pointed this out and I didn't see a task open yet. The fix might need to happen on the RN side but I figured that people thinking about the devtools are more likely to have a solution come to mind.
Repro: Run an app with RN master, run it in the Chrome debugger, try to use React devtools but "React" option doesn't show in the Web Inspector.
The text was updated successfully, but these errors were encountered: