Commit Graph

54 Commits

Author SHA1 Message Date
Riley Dulin 3c3f8ca270 Add a special case for assert in installConsoleFunction
Summary:
The Hermes inspector always logged the message for `console.assert`.
It instead should check the first argument, and only if that argument
is false should it log.

Also remove the polyfill code that tried to avoid this situation.

Changelog: [Internal]

Reviewed By: mhorowitz

Differential Revision: D22299186

fbshipit-source-id: cdf4f8957d4db3d171d6673a82c7fc32b7152af3
2020-06-30 21:15:52 -07:00
Riley Dulin 9bb7e06747 Remove calls to AllocationLocationTracker for native memory
Summary:
`getStackTracesTreeNodeForAlloc` only works for memory that was tracked with `newAlloc`.
For now, that is only memory that goes through GC APIs.

Various places were calling this function on native memory which was allocated
with `malloc`, not GC memory. This led to SIGSEGV on nullptr when trying to take heap profiles
of these objects.

`newAlloc` could, in theory, work with native memory as well. But building out support for that
is outside the scope of this fix.

Changelog: [Internal]

Reviewed By: jbower-fb

Differential Revision: D21667842

fbshipit-source-id: 8403a6668e5ec607972ce6819f78fedb89da3f37
2020-05-28 12:15:48 -07:00
Daniel Weaver b4f4f2d33e Update Hermes attribution labels
Summary:
Internal target attribution update.

Changelog: [Internal]

Reviewed By: janettec

Differential Revision: D21519089

fbshipit-source-id: 1aa1b57f5e1a1405db32f5cfb9973f27a13bcfdf
2020-05-18 13:36:01 -07:00
Will Holen 452cb9a78a Add support for Debugger.runIfWaitingForDebugger
Summary:
This call is used to continue execution when the app has just been
started in a "wait for debugger" mode. This is the only case
in which it has an effect.

Notably, it should do nothing in the following cases, which a layperson
may be tempted to classify as "WaitingForDebugger":

* The app was running detached and hit a 'debugger;' statement
* The app is paused because of a breakpoint or hitting the Pause button
* The app stopped on an instrumentation breakpoint, and expects
  the debugger to collect data and potentially auto-resume.

Changelog: [Internal] Add Hermes support for Debugger.runIfWaitingForDebugger

Reviewed By: mhorowitz

Differential Revision: D21557446

fbshipit-source-id: 790cec7444ddc61908d2ef9d92e4649b535d678f
2020-05-15 12:42:38 -07:00
Martin Sherburn 77ef8f881f When debugger is attached continue to receive console messages
Summary:
I noticed an issue when the hermes debugger was attached. Console messages would no longer appear in the terminal. This is because the hermes inspector overrides the console object with its own to intercept messages and send them to the debug client.
With this change I made it so that messages are sent to the original console as well instead of completely replacing it.

Changelog:
[General][Fixed] - When Hermes debugger is enabled continue to send log messages to the console

Reviewed By: mhorowitz

Differential Revision: D21509895

fbshipit-source-id: 6d91c4b82682e404679533be14b3e5f12e687e79
2020-05-13 07:20:20 -07:00
Kevin Gozali 164d47f30a label react-native-github targets
Summary:
For internal code attribution.

Changelog: [Internal]

Reviewed By: zlern2k

Differential Revision: D21468924

fbshipit-source-id: 59cd2a52e0ae46bedbf54816820a5f40b684da8b
2020-05-08 00:36:17 -07:00
Will Holen bf837d6373 Add support for Debugger.setInstrumentationBreakpoint
Summary:
This diff adds support for the "beforeScriptWithSourceMapExecution" instrumentation
breakpoint via "Debugger.setInstrumentationBreakpoint".

CDP describes it as a breakpoint, but we just set a flag in the inspector. A
fake breakpoint ID is synthesized for optional removal later.

Changelog: [Internal] Add Debugger.setInstrumentationBreakpoint to Hermes Inspector

Reviewed By: mhorowitz

Differential Revision: D21418218

fbshipit-source-id: 90fa49c0954980993815322d3a7effee416ed5db
2020-05-07 21:05:30 -07:00
Will Holen 938aa86013 Remove Hermes.setPauseOnLoad message
Summary:
This removes the Hermes.setPauseOnLoad. It will be replaced by the more standard
Debugger.setInstrumentationBreakpoint's "beforeScriptExecution" event.

ChangeLog: [Internal] Remove Hermes.setPauseOnLoad message (to be replaced)

Reviewed By: mhorowitz

Differential Revision: D21418219

fbshipit-source-id: 93c53801c23487f9336b322c2bd737663ec21b97
2020-05-07 21:05:30 -07:00
Nikita Lutsenko f4815fbad3 third-party | Move glog from xplat/third-party to third-party and create temporary redirect.
Summary:
Move and create an empty rule that redirects as well, to handle //arvr rules
Need to do this way, since ovrsource sync rules are in different repo.

allow_many_files
allow-large-files

Steps:
- [X] Move glog from xplat/third-party to /third-party
- [ ] Update references in ovrsource to translate to //third-party instead of //xplat/third-party
- [ ] Get rid of temporary rule
- [ ] Update fbsource/third-party/glog to 0.3.5 (what we have in ovrsource)

Changelog: [Internal] Update reference for glog from xplat/third-party to /third-party.

Reviewed By: yfeldblum

Differential Revision: D21363584

fbshipit-source-id: c1ffe2dd615077170b03d98dcfb77121537793c9
2020-05-06 19:04:33 -07:00
Will Holen 4459c08219 Make column match fuzzy
Summary:
We are currently very strict about breakpoint location matching. This
diff allows some fuzz in the column, but not in the line.

Changelog: [Internal] Setting Hermes breakpoints no longer requires exact column match

Reviewed By: avp

Differential Revision: D21343198

fbshipit-source-id: a59786a9d63f9fe1ed576835ed660ba3343affe1
2020-05-05 12:04:10 -07:00
Panagiotis Vekris 57fee33898 Flow 0.123.0 in xplat/js
Summary:
Changelog: [Internal]

## Sync of generated files

Ran
```
js1 upgrade www-shared -p core_windowless
```
but had to manually revert
```
RKJSModules/Libraries/www-shared/core_windowless/logging/FBLoggerType.flow.js
RKJSModules/Libraries/www-shared/core_windowless/logging/FBLogger.js
```
because they introduced more errors

## Flow version bump
```
~/fbsource/fbcode/flow/facebook/deploy_xplat.sh 0.123.0
```

Reviewed By: gkz

Differential Revision: D21159821

fbshipit-source-id: e106fcb43e4fc525b9185f8fc8a246e6c3a6b14f
2020-04-21 22:43:24 -07:00
Will Holen 33ccc0a0bc Implement Hermes.setPauseOnLoad
Summary:
This Hermes-specific mode is similar to Debugger.setPauseOnExceptions
and lets the VM know that it should enter a Pause state whenever a new
script is loaded/executed.

The debugger can then take its time to parse the source map and update
any breakpoints, before automatically continuing.

Changelog: [Internal] Implement a Hermes.setPauseOnLoad CDP call

Reviewed By: bestander

Differential Revision: D20754604

fbshipit-source-id: 7f9d0638706c99e9dcb534699b633f658e364909
2020-04-20 14:06:51 -07:00
Will Holen 04bc315eba Add support for generating custom messages
Summary:
Until now we've generated scaffolding entirely based on the official devtools
protocol spec. This diff adds support for defining custom domains in `custom.json`
which will be merged with the upstream protocol JSON definition.

ChangeLog: [Internal] Add support for Hermes-specific CDP messages

Reviewed By: bestander

Differential Revision: D20754605

fbshipit-source-id: a8075f81816a40114d1a3332192c7aa076b17848
2020-04-20 14:06:51 -07:00
Jacob Bower ed3054927c Plumb through memory allocation profiler feature to Chrome Inspector
Summary: Changelog: Make allocation profiler feature of Chome Inspector work

Reviewed By: dulinriley

Differential Revision: D20383003

fbshipit-source-id: 8a10c310d5a639a6644763adb53f2f0017057587
2020-03-31 11:02:41 -07:00
Jacob Bower 8454975d2c Save/restore IP when leaving the interpreter
Summary:
This diff implements the instruction pointer save/restore trick Tzvetan came up with; allowing us to observe and modify the IP from outside the interpreter loop with negligible overhead.

From Tzvetan's internal post on the subject:

> [Today] the interpreter IP is just a local variable in the interpreter function, so there is no way to get to its value from outside the function. It lives in a register and we don't want to make it a Runtime field since the overhead [of accessing it via memory in the interpeter loop] would kill us.

> However, if you really think about it, it only lives in a register while the interpreter function is running. For the rest of the time, it is spilled by the C++ compiler onto the stack.
So, precisely when we need it, it is actually stored in memory. The only problem is, we don't know where! Admittedly, that is an annoying problem, but it feels like it should be solvable.

> What if, instead of relying on the compiler to spill the IP register, we manually spill it ourselves, to a known location? It works. Example: https://godbolt.org/z/ftSDnp

This diff implements this approach across the whole interpreter loop: whenever we call out of the loop we capture/publish the IP and restore it again immediately after the external call returns. This means we can now see the IP outside the interpret loop and even change it. This is effectively "for free" as the compiler now skips spilling/restoring the IP behind the scenes.

The immediate benefit of this is knowing the current IP allows us to have more accurate stack-traces during execution. In future this may enabled tricks like changing the IP before returning to the interpreter loop, allowing things outside the interpreter to affect program flow without adding logic to the interpreter loop.

Reviewed By: tmikov

Differential Revision: D20151091

fbshipit-source-id: 3814382639800208d8985a32ede31ba8f7ff7c80
2020-03-31 11:02:41 -07:00
Kevin Gozali 21785eea67 Replace fbsource// with // in xplat/js/ files [4]
Summary:
`fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency.

Changelog: [Internal]

Reviewed By: JoshuaGross, shergin

Differential Revision: D20656696

fbshipit-source-id: 10f02decb1dc969fd3491ac90d97f09e2bda59e7
2020-03-26 01:12:50 -07:00
Kevin Gozali 25f7aea86c Replace fbsource// with // in xplat/js/ files [1]
Summary:
`fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency.

Changelog: [Internal]

Reviewed By: scottrice

Differential Revision: D20495655

fbshipit-source-id: a57b72f694c533e2e16dffe74eccb8fdec1f55f5
2020-03-25 21:55:47 -07:00
Michael Bolin 0b9ea60b4f Back out "Upgrade Prettier from 1.17 to 2.0.2."
Differential Revision: D20639755

fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd
2020-03-24 21:47:35 -07:00
Michael Bolin cf44650b3f Upgrade Prettier from 1.17 to 2.0.2.
Summary:
This gets us on the latest Prettier 2.x:
https://prettier.io/blog/2020/03/21/2.0.0.html

Notably, this adds support for TypeScript 3.8,
which introduces new syntax, such as `import type`.

Reviewed By: zertosh

Differential Revision: D20636268

fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a
2020-03-24 20:24:47 -07:00
Oleg Bogdanov 79c69bea02 hermes | inspector | Don't include posix headers on non-posix systems
Summary:
Changelog: [Internal]

Hermes inspector includes pthreads, arpa and sys headers on all OSes that would break vanilla Windows builds. This diff adds a check for posix-compliance before inclusion

(Note: this ignores all push blocking failures!)

Reviewed By: dulinriley

Differential Revision: D20564449

fbshipit-source-id: 8e264bc3104065dc4315bb291e8560609fe65184
2020-03-24 18:53:43 -07:00
Will Holen f1a9ca04f6 Support CDP returnByValue in Hermes Inspector
Summary:
This adds support for 'returnByValue' in Runtime.evaluate invocations.
If the result of the evaluation can't be serialized to JSON, the results
are undefined.

ChangeLog: [Internal] - Hermes Inspector now supports 'returnByValue' in CDP Runtime.evaluate calls

[Facebook]
This is change was made to support debug completion in VSCode for ReactVR.

Reviewed By: ArchDev

Differential Revision: D19961115

fbshipit-source-id: d20af82b35d6bde88ab74b5c5a4c07415122c142
2020-03-04 16:28:45 -08:00
Emily Janzer bf32023e50 The life-changing magic of clang-tidying up
Summary:
Adding a `.clang-tidy` to a bunch of dirs under `react-native-github/ReactAndroid` and `react-native-github/ReactCommon`.

I don't want to add a single `.clang-tidy` at the root because we'll need more fine-grained control over what checks are enabled in different parts of the codebase; for example, fabric will and TM will probably have more checks enabled than older parts of the codebase that we're not actively modernizing, and the Hermes team probably wants its own config to be consistent with the rest of their codebase.

Starting off each `.clang-tidy` by only enabling clang-diagnostic; this is just to test that it's working. In the future, we'll work with the community to gradually enable more checks.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19705749

fbshipit-source-id: 979cea053b645ac4a9790340033bfcfb49ca0f97
2020-02-04 11:09:30 -08:00
Mike Vitousek 7bc2b91790 Deploy Flow v0.117.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D19596867

fbshipit-source-id: 3fc2ec51672bb453cec0eb6bf3c522f23cf9cd38
2020-01-28 14:36:44 -08:00
Riley Dulin e6f3388541 Change HermesRuntime to jsi::Runtime in RuntimeAdapter
Summary:
Changelog: [Internal]

The inspector API doesn't really need a `HermesRuntime`, all it needs is a `jsi::Runtime` and a `Debugger &`.
Change the return type of `RuntimeAdapter::getRuntime` to be `jsi::Runtime`.
This will allow the inspector to use the tracing runtime instead of the direct hermes runtime.

Reviewed By: willholen

Differential Revision: D18973867

fbshipit-source-id: 6809e52452a35e62be9ca8143aeaba8964c98eaa
2020-01-23 13:16:47 -08:00
Kudo Chien 6e2131b8fa Upgrade Folly to v2020.01.13.00 (#27811)
Summary:
Upgrade Folly to v2020.01.13.00. Fixes https://github.com/facebook/react-native/issues/27640

## Changelog

[Android] [Changed] - Upgrade Folly to v2020.01.13.00
Pull Request resolved: https://github.com/facebook/react-native/pull/27811

Test Plan:
Test by building and running RNTester:
`./gradlew :RNTester:android:app:installJscDebug`
`./gradlew :RNTester:android:app:installHermesDebug`
And the native debug builds:
`NATIVE_BUILD_TYPE=Debug ./gradlew :RNTester:android:app:installJscDebug`
`NATIVE_BUILD_TYPE=Debug ./gradlew :RNTester:android:app:installHermesDebug`

Reviewed By: mdvacca

Differential Revision: D19474027

Pulled By: fkgozali

fbshipit-source-id: 1c680dd80413b63aad66b587213de7499197177c
2020-01-21 12:44:00 -08:00
Pascal Hartig 9ad5e72b77 Migrate to FBJNI (#27729)
Summary:
This is an incomplete effort to migrate from libfb to libfbjni. This is needed to restore the compatibility with Flipper and other FB Android projects that make use of FBJNI. Effectively, the outcome is that `fbjni` no longer has a checked-in copy here, but instead relies on the public artifacts published at github.com/facebookincubator/fbjni that can be deduplicated at build-time.

**A non-exhaustive list of tasks:**

* [X] Gradle builds the SDK and RNTester for Android.
* [X] Buck build for rntester works in OSS.
* [ ] Move from `java-only` release to full `fbjni` release. This requires finding a solution for stripping out `.so` files that the old `Android.mk` insists on including in the final artifacts and will clash with the full distribution.
* [ ] Import this and fix potential internal build issues.
* [ ] Verify that the changes made to the Hermes integration don't have any unintended consequences.

## Changelog

[Android] [Changed] - Migrated from libfb to libfbjni for JNI calls
Pull Request resolved: https://github.com/facebook/react-native/pull/27729

Test Plan:
- CI is already passing again for Gradle and Buck in OSS.
- After applying the following patch, RNTester builds and works with the latest Flipper SDK:

```
 diff --git a/RNTester/android/app/build.gradle b/RNTester/android/app/build.gradle
index b8a6437d7..eac942104 100644
 --- a/RNTester/android/app/build.gradle
+++ b/RNTester/android/app/build.gradle
@@ -170,10 +170,19 @@ dependencies {
     debugImplementation files(hermesPath + "hermes-debug.aar")
     releaseImplementation files(hermesPath + "hermes-release.aar")

-    debugImplementation("com.facebook.flipper:flipper:0.23.4") {
+    debugImplementation("com.facebook.flipper🐬+") {
         exclude group:'com.facebook.yoga'
-        exclude group:'com.facebook.flipper', module: 'fbjni'
-        exclude group:'com.facebook.litho', module: 'litho-annotations'
+        exclude group:'com.facebook.fbjni'
+    }
+
+    debugImplementation("com.facebook.flipper:flipper-network-plugin:+") {
+        exclude group:'com.facebook.yoga'
+        exclude group:'com.facebook.fbjni'
+    }
+
+    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:+") {
+        exclude group:'com.facebook.yoga'
+        exclude group:'com.facebook.fbjni'
     }

     if (useIntlJsc) {
```

Reviewed By: mdvacca

Differential Revision: D19345270

Pulled By: passy

fbshipit-source-id: 33811e7f97f44f2ec5999e1c35339909dc4fd3b1
2020-01-21 02:32:50 -08:00
Riley Dulin 0ee7fb98cc Update the chrome devtools protocol for the inspector
Summary:
Changelog: [Internal] Upgrade Chrome devtools protocol for Hermes

Update to the most recent version of the devtools protocol, r730699.
This just adds a few parameters to the stable API.
They have reasonable defaults that shouldn't break the existing functionality.

Reviewed By: willholen

Differential Revision: D19387559

fbshipit-source-id: 49d9ebf4a1a20f349ea6e46be6d5f36184ba8afb
2020-01-15 16:52:19 -08:00
Riley Dulin 46351cc276 Use the devtools-protocol npm package to generate code
Summary:
Changelog: [Internal]

Before, we were relying on checking out the `devtools-protocol` Github repo at a specific commit and
making special changes to the JSON file.
In order to make it easier to update, use the officially published npm package.

I found the closest package version that was published, but it had two differences:
* `Runtime.getHeapUsage` was either missing (in earlier versions) or experimental (in later versions)
* `isDefault` and `isPageContext` were removed. I'm not sure what these were used for anyway, the comment leads me to believe they're probably not necessary anymore

There were some customizations made previously to annotate `recursive` on some properties. The npm package doesn't set these,
so I wrote some checks to add it back in if it can be detected. This was mostly to handle one special case: `Runtime.StackTrace`.
The workaround seems to be fine for that case.

Reviewed By: willholen

Differential Revision: D19386890

fbshipit-source-id: db0d85f6bc71cba77ee67d85efe2f38376d7cc87
2020-01-15 16:52:18 -08:00
Riley Dulin 4b703e3c1f Remove .flowconfig from hermes/inspector/tools/msggen
Summary:
Changelog: [Internal]

This separate `.flowconfig` file was causing versioning issues.
Delete it so that `msggen` can share the same flowconfig as the rest
of React Native.

Reviewed By: willholen

Differential Revision: D19413710

fbshipit-source-id: 748cb50a3151df1c67ee7176e57e259e48f50be7
2020-01-15 16:52:18 -08:00
Will Holen 58f3673099 yarn upgrade msggen
Summary:
This upgrades the yarn.lock for msggen

Changelog: [Internal]

Reviewed By: avp

Differential Revision: D19199162

fbshipit-source-id: 8064a14032948fa81e3c7e637cfca1e02f5bfcd6
2019-12-20 11:40:40 -08:00
Will Holen 35dd2e0c37 Upgrade more msggen dependencies
Summary:
GitHub still marks some dependencies as vulnerable. Updating them.

Changelog: [Internal]

Reviewed By: avp

Differential Revision: D19183702

fbshipit-source-id: 9c9c815816c4fc591c77d811058234a63aeda727
2019-12-19 14:02:57 -08:00
Will Holen 389a91c9d9 Update msggen dependencies
Summary:
`msggen` has dependencies on some npm packages with vulnerabilities.
This diff updates the dependency list.

Changelog: [Internal]

Reviewed By: avp

Differential Revision: D19107926

fbshipit-source-id: 0526f6fe430c162322ec9ecb84f3d78604cd76bc
2019-12-18 15:06:53 -08:00
Igor Sugak 399cabd1bb move chrome-devtools-protocol from xplat/third-party to third-party
Reviewed By: pixelb

Differential Revision: D16871230

fbshipit-source-id: e97710cf33a4ecee045595f1eb70021f275339e1
2019-12-13 17:30:18 -08:00
Eli White e362470305 Convert easy files to flow strict-local
Summary:
This diff was generated by this script used by WWW
https://our.intern.facebook.com/intern/diffusion/WWW/browse/master/scripts/flow/upgrade_to_flow_strict_local.sh?lines=0

Changelog:
[Internal] Upgrade flow to flow strict-local

Reviewed By: zackargyle, rickhanlonii

Differential Revision: D18833630

fbshipit-source-id: e64d4e9a49a0db5e6bf70a0c489567862b578d7f
2019-12-05 16:06:46 -08:00
Will Holen 33f82c569c Allow enumerating local variables
Summary:
Our current lazy compilation parent scope issue caused us to only have a
single lexical scope, which was taken to be the global scope. This
effectively hid all local variables. Additionally, the variables were
not marked as enumerable, so Chrome didn't show them.

As further improvements, 'this' is now included, and we more correctly
tag parent scopes as closures.

Changelog: [Internal]

Reviewed By: avp

Differential Revision: D18671527

fbshipit-source-id: cbbf9fbd319e433b9f681bd23e4ad7b4bb4a3d74
2019-12-01 05:05:50 -08:00
Will Holen d0ed21531a If getters throw, replace value with a placeholder
Summary:
Currently, if you try to inspect globals in the debugger and they have
properties that throw exceptions, the app redscreens.  In particular,
inspecting any function triggers the bug because of `arguments` and
`caller`.

This diff catches the exception and shows a placeholder instead.

Changelog: [Internal]

Reviewed By: mhorowitz

Differential Revision: D18664765

fbshipit-source-id: 0c662f3d97b21a29c57a1dd724e63d17a3b4e263
2019-11-22 16:13:57 -08:00
George Zahariev 8553e1acc4 Exact-by-default codemod for react-native-github
Summary:
We are rolling out exact-by-default syntax to xplat/js.

I had to manually move around some comments to preserve proper placement.

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D18633611

fbshipit-source-id: 48f7468dcc55b1d00985419d035a61c6820b3abe
2019-11-21 09:42:57 -08:00
Riley Dulin 9f0b80b1cf Fix licenses in the inspector
Summary:
Lint all files in the inspector and apply auto-fixes for licenses.

Changelog: [Internal]

Reviewed By: mhorowitz

Differential Revision: D18210914

fbshipit-source-id: 91c45d4b02a04e99dd32cf0be8771e327fe03660
2019-11-18 19:34:24 -08:00
Will Holen 39704b8937 Implement Debugger.setBreakpoint
Summary:
setBreakpoint differs from the existing setBreakpointByUrl in that you
can specify a scriptId directly. This was not really possible before
now, since scriptIds were mapped via filenames rather than to
RuntimeModules.

When (re)loading files with the same name, this call can be used to set
breakpoints in a specific one, rather than just the latest version.

Changelog: [Internal]

Reviewed By: bestander

Differential Revision: D18362054

fbshipit-source-id: 6ff1e736c79a4e75dc424316675d426ce9902f5f
2019-11-12 16:28:42 -08:00
Will Holen ae615c33d6 Actually send error when pause-on-exception-mode is unknown
Summary:
We were calling `sendErrorToClient` on error, but this function only
returns a closure that we threw away. Change to actually send an error
response.

Changelog: [Internal]

Reviewed By: bestander

Differential Revision: D18362055

fbshipit-source-id: 2ff1750ffd2c32a9291d3ed74fa0aaecd76c64c6
2019-11-12 16:28:41 -08:00
Will Holen 23feaa56cf Make debugger ScriptIDs per RuntimeModule rather than per filename
Summary:
When a filename (potentially with changes) is loaded multiple times, we keep
multiple instances around but fail to alert the attached debugger about this.

By coupling ScriptIDs to RuntimeModules rather than filenames, we can track
multiple instances of the same name instead.

Changelog: [Internal]

Reviewed By: bestander

Differential Revision: D18362052

fbshipit-source-id: 2147af32bc48c5fd2a2b080ea09dfa4133de7cf5
2019-11-12 16:28:41 -08:00
Marc Horowitz 8e750d75ee Switch use of xplat/hermes-inspector to xplat/js/react-native-github/ReactCommon/hermes/inspector
Summary: Changelog: [Internal]

Reviewed By: dulinriley

Differential Revision: D18364013

fbshipit-source-id: 1c077cf4f886ea620a62d8fe83dfd725850bcd31
2019-11-11 18:38:02 -08:00
Marc Horowitz abb4590285 Address folly and flipper version skew
Summary:
There's some incompatibilities which need to be fixed for real,
but this is a temporary fix to make the build work again.

Changelog: [Internal]

Reviewed By: willholen

Differential Revision: D18364011

fbshipit-source-id: c168e6496a504f9b00da0b9d758c50e2c6f314a4
2019-11-11 18:38:01 -08:00
Marc Horowitz e27610819d pull in debugger fixes from internal fork
Summary:
Changelog:
[Android] [Fixed] - Various bug fixes to the hermes inspector/debugger

Reviewed By: cpojer

Differential Revision: D18364014

fbshipit-source-id: d07dc3f4fd076fec3b6a64698ab8af67772a7a55
2019-11-11 18:38:01 -08:00
Marc Horowitz 61cb2686a2 Update hermes-engine to newest version 0.3.0
Summary:
Changelog:

[Android] [Changed] - Update hermes-engine to newest version 0.3.0

Reviewed By: cpojer

Differential Revision: D18364012

fbshipit-source-id: 819f7f7980f4bc965c8875eef70ee0108882f922
2019-11-11 18:38:01 -08:00
Shingo Sato 6c3d966477 Upgrade yargs to 14.2.0 (#2934)
Summary:
`mem` package vulnerability found.

> In nodejs-mem before version 4.0.0 there is a memory leak due to old results not being removed from the cache despite reaching maxAge. Exploitation of this can lead to exhaustion of memory and subsequent denial of service.

ref: https://github.com/sindresorhus/mem/commit/da4e4398cb27b602de3bd55f746efa9b4a31702b

`relay-compiler` depends on that.

```
relay-compiler@6.0.0
  └─┬ yargs@9.0.1
    └─┬ os-locale@2.1.0
      └── mem@1.1.0
```
Pull Request resolved: https://github.com/facebook/relay/pull/2934

Test Plan:
- Tested the Relay compiler briefly on the open source examples project, seems like yargs doesn't error
- `js1 build relay --project facebook`
- `js1 jest`

Reviewed By: alunyov

Differential Revision: D18397131

Pulled By: kassens

fbshipit-source-id: 8b7fc5e237c7b4ce14ff3809cdd59d243e7c4523
2019-11-08 16:06:46 -08:00
Andres Suarez aee88b6843 Tidy up license headers [3/n]
Summary: Changelog: [General] [Fixed] - License header cleanup

Reviewed By: yungsters

Differential Revision: D17952693

fbshipit-source-id: 8fcb8e58a2e04e7a3169f4d525bffc00835768e6
2019-10-16 10:06:34 -07:00
Andres Suarez 3b31e69e28 Tidy up license headers [2/n]
Summary: Changelog: [General] [Fixed] - License header cleanup

Reviewed By: yungsters

Differential Revision: D17952694

fbshipit-source-id: 17c87de7ebb271fa2ac8d00af72a4d1addef8bd0
2019-10-16 10:06:34 -07:00
James Ide df653a9dc2 More robust hermes-engine lookup logic in makefiles (#26820)
Summary:
The Android makefiles had hard-coded paths to hermes-engine, sometimes looking in `node_modules` and other times looking in `..`. This commit implements the Node module resolution algorithm (see common.mk), which handles both of these cases and also looks further up the root if necessary, handling the case when the `hermes-engine` npm package is hoisted.

This commit does three things:

- Defines `find-node-module` and uses it in the makefiles to find `hermes-engine`
- Removes the unused `/path/to/hermes-engine/include` paths since this directory does not exist and should be `/path/to/hermes-engine/android/include` (`android`)
- Moves the definition of `REACT_NATIVE` in the makefiles to the top. It was defined after every `$(CLEAR_VARS)` invocation but was not actually cleared anyway. `$(CLEAR_VARS)` resets only `LOCAL_*` variables in this list: https://android.googlesource.com/platform/build/+/7dc45a8/core/clear_vars.mk

## Changelog

[Internal] [Changed] - Android Makefiles look for hermes-engine using Node's module resolution algorithm
Pull Request resolved: https://github.com/facebook/react-native/pull/26820

Test Plan: Run `./gradlew :ReactAndroid:installArchives`, which requires the hermes-engine paths to be correct in order to find the headers.

Differential Revision: D17923671

Pulled By: cpojer

fbshipit-source-id: 9238b8718a94080db1abbba6375a6a1d484c871d
2019-10-14 19:21:43 -07:00
Kudo Chien 962d9c9c1a Fix compile error for native debug build (#26248)
Summary:
Fix Android gradle build error for native debug build.
`NATIVE_BUILD_TYPE=Debug ./gradlew :ReactAndroid:installArchives`
The root cause is `folly::Future<bool>` not declared.
As we don't include true folly::Future implementation in OSS build but to use a forward declaration,
the fix is pretty much like to original declaration as `folly::Future<folly::Unit>`.

## Changelog

[Android] [Fixed] - Fix compile error for native debug build
This change could be ignored from changelog which is only for internal development.
Pull Request resolved: https://github.com/facebook/react-native/pull/26248

Test Plan: Makes sure `NATIVE_BUILD_TYPE=Debug ./gradlew :ReactAndroid:installArchives` build without errors.

Differential Revision: D17169696

Pulled By: mdvacca

fbshipit-source-id: 42e8b84b7ee0d1bd99d913702df98bc030965f63
2019-09-03 18:27:55 -07:00