-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
#1331 Add information about ReactNative to runtime. #2120
Conversation
Could you require package.json and read the version from there? |
@ide, sure. Don't know how to require the other way, without the relative path or recursive searching root. |
21d7578
to
4742d2b
Compare
4742d2b
to
82c4dba
Compare
Rebased, squashed. Tests has failed before because #2134, now Travis should be ok. |
Hmm, it seems TravisCI has not been triggered |
+1 for this feature, getting the version number is useful for debugging/logging in some cases. |
So this is a good feature but we don't want to add globals. Could you try requiring package.json from InitializeJavaScriptAppEngine.js directly? |
It wouldn't -- the devtools need to be made aware of workers. |
@ide This fix enables app code to find out whether it's running under react-native or not. My question is, will this functionality work under both JSC and Chrome debugger? I don't understand what it has to do with devtools. Perhaps there might be an inability to inspect the variable in the debugger? To me this is a minor issue which might be addressed in time by the devtools fix. |
@chetstone sorry, I misinterpreted your question to mean whether this would fix the devtools that aren't webworker-aware. Anyway it looks like navigator in the webworker is readonly so this wouldn't fix things in the webworker environment. I think the solution forward is to move off the Chrome debugger and run the RN code in a pristine V8 context via Node FWIW. |
There is the new related PR #4083. I'm closing mine, since it's no more relevant. |
This allows to determine what kind of react runtime used, for some purposes (#1331).
How to inject
react-native
version better than concatenating one string to another on the Server.js step? On the dependency resolver side, patchingprelude.js
? Or there are other ways to know that react native version is?