Граф коммитов

56 Коммитов

Автор SHA1 Сообщение Дата
Chiara Mooney 33dbb6c40c Fix Make Unused Not Compiler Specific (#34357)
Summary:
Use of `__attribute__` and `__unused` is compiler specific. Opt for standard `[[maybe_unused]]` instead.

## Changelog

[General] [Fixed] - Remove compiler-specific syntax.

Pull Request resolved: https://github.com/facebook/react-native/pull/34357

Test Plan: Built on react-native-windows.

Reviewed By: cipolleschi

Differential Revision: D38498481

Pulled By: javache

fbshipit-source-id: af43206788f54dda3b747b6417e20096c7d520e8
2022-08-08 03:50:58 -07:00
Pieter De Baets 71e89213aa Make ReactCommon and tests compile for CXX platform
Summary:
If you don't list `Cxx` as a supported platform, we will use Android builds, even when using `buck run` for local execution.

Changelog: [Internal]

Reviewed By: derolf

Differential Revision: D37600464

fbshipit-source-id: 6ba8566cde4180524351c9d8c647ce1d4ac5279d
2022-07-05 05:56:35 -07:00
Andres Suarez 8bd3edec88 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Ramanpreet Nara db3625a3b0 Refactor: Move RuntimeExecutor into Instance.cpp
Summary:
RuntimeExecutor is currently declared inside NativeToJsBridge. It doesn't need to be: Instance.cpp can use NativeToJsBridge::runOnExecutorQueue to schedule work on the JS Thread. So, this diff moves RuntimeExecutor out of NativeToJsBridge into Instance.cpp. Now, both the JS CallInvoker and the RuntimeExecutor are declared in the same file.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D27975840

fbshipit-source-id: aa06f479fa24bb7a15bfd21712df5414a183266c
2021-04-23 18:16:03 -07:00
Luna Wei 568d2206f7 Add non-fatal error handling
Summary:
## Changelog:

[Internal][Added] - Additional option to report non-fatal JS error

Reviewed By: ejanzer

Differential Revision: D22054406

fbshipit-source-id: 25e2a8d45f086173b09ee095331f94364cae4c1a
2020-06-18 16:58:21 -07:00
Emily Janzer 92630856c6 Move error handling with JSI into a separate helper function (#29090)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/29090

Moving the logic for calling into JS to handle errors into ErrorUtils, where it can be reused outside of the bridge.

Reviewed By: RSNara

Differential Revision: D21939254

fbshipit-source-id: 0d8f3bd2503720be7619ed8dc8b2389f544049f3
2020-06-10 10:31:46 -07:00
Emily Janzer a50fa552a7 Fix CircleCI by adding dependency on JSI to cxxreact (#29087)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/29087

D21908523 added an implicit dependency on `jsi.h` to use functions like `asObject`, etc. For some reason this doesn't break the build with BUCK (??) but it does with cocoapods. Adding the dep to the cxxreact podspec and regenerating offline mirrors to unbreak CircleCI. Also adding the BUCK dep and include statement for good measure.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21924592

fbshipit-source-id: 295c0670c6499e1195ba3c3a3320c6aee13bc025
2020-06-07 17:55:16 -07:00
Emily Janzer 965635f073 Add JS error handling logic to bridge's RuntimeExecutor
Summary:
Call into our existing JS error handling logic from C++ using JSI in the RuntimeExecutor used by the bridge.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D21908523

fbshipit-source-id: ae41196443781b9f2673dcb7bbcb5b5aa8aa2528
2020-06-06 13:31:15 -07:00
Ramanpreet Nara 4830085f40 Guard all NativeModulePerfLogger calls with a null check
Summary:
## Motivation
We got this crash T67304907, which shows a `EXC_BAD_ACCESS / KERN_INVALID_ADDRESS` when calling this line:
```
  NativeModulePerfLogger::getInstance().asyncMethodCallBatchPreprocessStart();
```
There are no arguments in that call, so I figured the only error could be when we try to invoke `getInstance()` or `asyncMethodCallBatchPreprocessStart()`.

This diff:
1. Removes the `NativeModulePerfLogger::getInstance()` bit. Now NativeModulePerfLogger is used via regular static C functions. So, there's no way that simply invoking one of the logging functions crashes the application: there's no vtable lookup.
2. Inside each logging function, when perf-logging is disabled, the global perflogger should be `nullptr`. This diff makes it so that in that case, we won't execute any code in the control group of the perf-logging experiment.

## Changes
**How do we enable NativeModule perf-logging?**
- Previously:
   - `NativeModulePerfLogger::setInstance(std::make_shared<FBReactNativeModulePerfLogger>(...))`
   - `TurboModulePerfLogger::setInstance(std::make_shared<FBReactNativeModulePerfLogger>(...))`.
- Now:
   - `BridgeNativeModulePerfLogger::enableLogging(std::make_unique<FBReactNativeModulePerfLogger>(...))`
   - `TurboModulePerfLogger::enableLogging(std::make_unique<FBReactNativeModulePerfLogger>(...))`

**How do we do NativeModule perf-logging now?**
- Previously:
   -  `NativeModulePerfLogger::getInstance().command(...args)`
   -  `TurboModulePerfLogger::getInstance().command(...args)`.
- Now:
   - `BridgeNativeModulePerfLogger::command(...args)`
   - `TurboModulePerfLogger::command(...args)`.

The benefit of this approach is that each method in `BridgeNativeModulePerfLogger` is guarded with an if check. Example:

```
void moduleCreateConstructStart(const char *moduleName, int32_t id) {
  NativeModulePerfLogger *logger = g_perfLogger.get();
  if (logger != nullptr) {
    logger->moduleCreateConstructStart(moduleName, id);
  }
}
```

Therefore, we don't actually execute any code when perf-logging is disabled.

Changelog:
[Internal]

Reviewed By: fkgozali

Differential Revision: D21669888

fbshipit-source-id: 80c73754c430ce787404b563878bad146295e01f
2020-05-20 20:19:30 -07:00
Ramanpreet Nara eb2a561ecb Rename <ReactCommon/NativeModulePerfLogger.h> to <reactperflogger/NativeModulePerfLogger.h>
Summary:
## Motivation
This rename will fix the following CircleCI build failures:
- [test_ios_unit_frameworks](https://circleci.com/gh/facebook/react-native/150473?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link)
- [test_ios_detox_frameworks](https://circleci.com/gh/facebook/react-native/150474?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link)

## Investigation
We have 4 podspec targets that map to the same header namespace (i.e: `header_dir`) `ReactCommon`:
- **New:** `React-perflogger`: Directory is `ReactCommon/preflogger`, and contains `NativeModulePerfLogger.{h,cpp}`.
- `React-runtimeexecutor`: Directory is `ReactCommon/runtimeexecutor`, and contains only `RuntimeExecutor.h`
- `React-callinvoker`: Directory is `ReactCommon/callinvoker`, and contains only `CallInvoker.h`
- `ReactCommon/turbomodule/core`: Directory is `ReactCommon/turbomodule`, and contains C++ files, as well has header files.

**The problem:**
We couldn't import headers from `React-perflogger` in `ReactCommon/turbomodule/core` files.

**The cause:**
I'm not entirely sure why, but I was able to discern the following two rules by playing around with the podspecs:
1. If your podspec target has a cpp file, it'll generate a framework when `USE_FRAMEWORKS=1`.
2. Two different frameworks cannot map to the same `module_name` or `header_dir`. (Why? No clue. But something breaks silently when this is the case).

So, this is what happened when I landed `React-perflogger` (D21443610):
1. The TurboModules code generates the `ReactCommon` framework that uses the `ReactCommon` header namespace.
2. `React-runtimeexecutor` and `React-callinvoker` also used the `ReactCommon` header namespace. However, neither generate a framework because of Rule 1.
3. When I comitted `React-perflogger`, I introduced a second framework that competed with the `ReactCommon` framework (i.e: TurboModules code) for the `ReactCommon` header namespace. Rule 2 violation.

## Thoughts on renaming
- `<perflogger/NativeModulePerfLogger.h>` is too generic, and the `perflogger` namepsace is used internally within FB.
- `<react/perflogger/NativeModulePerfLogger.h>` matches our fabric header format, but I'm pretty sure that slashes aren't allowed in `header_dir`: I tested this and it didn't work. IIRC, only alphanumeric and underscore are valid characters for `header_dir` or `module_name`. So, I opted to just use `reactperflogger`.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D21598852

fbshipit-source-id: 60da5d0f7758eaf13907a080b7d8756688f40723
2020-05-15 15:25:23 -07:00
Keegan Mendonca 2b0208b399 Revert D21585006: Rename <ReactCommon/NativeModulePerfLogger.h> to <reactperflogger/NativeModulePerfLogger.h>
Differential Revision:
D21585006

Original commit changeset: e3339273af5d

fbshipit-source-id: cb4ff227edcc16842c7539bf71c912cd4ec478e0
2020-05-14 21:48:44 -07:00
Ramanpreet Nara 9f3c7af400 Rename <ReactCommon/NativeModulePerfLogger.h> to <reactperflogger/NativeModulePerfLogger.h>
Summary:
## Motivation
This rename will fix the following CircleCI build failures:
- [test_ios_unit_frameworks](https://circleci.com/gh/facebook/react-native/150473?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link)
- [test_ios_detox_frameworks](https://circleci.com/gh/facebook/react-native/150474?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link)

## Investigation
We have 4 podspec targets that map to the same header namespace (i.e: `header_dir`) `ReactCommon`:
- **New:** `React-perflogger`: Directory is `ReactCommon/preflogger`, and contains `NativeModulePerfLogger.{h,cpp}`.
- `React-runtimeexecutor`: Directory is `ReactCommon/runtimeexecutor`, and contains only `RuntimeExecutor.h`
- `React-callinvoker`: Directory is `ReactCommon/callinvoker`, and contains only `CallInvoker.h`
- `ReactCommon/turbomodule/core`: Directory is `ReactCommon/turbomodule`, and contains C++ files, as well has header files.

**The problem:**
We couldn't import headers from `React-perflogger` in `ReactCommon/turbomodule/core` files.

**The cause:**
I'm not entirely sure why, but I was able to discern the following two rules by playing around with the podspecs:
1. If your podspec target has a cpp file, it'll generate a framework when `USE_FRAMEWORKS=1`.
2. Two different frameworks cannot map to the same `module_name` or `header_dir`. (Why? No clue. But something breaks silently when this is the case).

So, this is what happened when I landed `React-perflogger` (D21443610):
1. The TurboModules code generates the `ReactCommon` framework that uses the `ReactCommon` header namespace.
2. `React-runtimeexecutor` and `React-callinvoker` also used the `ReactCommon` header namespace. However, neither generate a framework because of Rule 1.
3. When I comitted `React-perflogger`, I introduced a second framework that competed with the `ReactCommon` framework (i.e: TurboModules code) for the `ReactCommon` header namespace. Rule 2 violation.

## Thoughts on renaming
- `<perflogger/NativeModulePerfLogger.h>` is too generic, and the `perflogger` namepsace is used internally within FB.
- `<react/perflogger/NativeModulePerfLogger.h>` matches our fabric header format, but I'm pretty sure that slashes aren't allowed in `header_dir`: I tested this and it didn't work. IIRC, only alphanumeric and underscore are valid characters for `header_dir` or `module_name`. So, I opted to just use `reactperflogger`.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D21585006

fbshipit-source-id: e3339273af5dfd65a1454d87213d1221de6a4651
2020-05-14 20:54:57 -07:00
Ramanpreet Nara bf0e516086 Instrument async method call batch preprocessing
Summary:
NativeModule async method calls are queued up on the JS side, and flushed to C++ on every Native -> JS call. Before we execute the batch of async NativeModule method calls, we convert it (a JS object) from a `jsi::Value` to a `folly::dynamic` object in `JSIExecutor::callNativeModules`. Then, in `JsToNativeBridge::callNativeModules`, we convert this `folly::dynamic` object into an `std::vector<MethodCall>`, before finally looping over these `MethodCall`s and invoking each NativeModule async method call.

The markers I'm adding in this diff measure this `jsi::Value -> folly::dynamic -> std::vector<MethodCall>` pre-processing.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D21435455

fbshipit-source-id: 4c5a9e2b73c1a2a49d7a8f224a0d30afe3a0c79c
2020-05-13 20:28:17 -07:00
Emily Janzer a4a47b9a1e Expose RuntimeExecutor on CatalystInstance (#28851)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/28851

This diff creates a RuntimeExecutor that uses the bridge and exposes it on CatalystInstanceImpl.

Changelog: [Internal]

Reviewed By: mdvacca, RSNara

Differential Revision: D21051949

fbshipit-source-id: b3977fc14fa19089f33e297d29cedba0d067526d
2020-05-08 16:13:42 -07:00
Ramanpreet Nara de56649430 Add CallInvoker::invokeSync
Summary:
We'll be using a native CallInvoker to dispatch sync and async method calls to ObjC NativeModules. This native CallInvoker will hold a reference to the ObjC NativeModule's method queue.

**Why is the native CallInvoker required for ObjC NativeModules?**
In the case where the ObjC NativeModule neither provides nor requests a method queue, we must create a method queue for it. When we go to invoke a method from JS, for these NativeModules specifically, there is no way to access this method queue. A native CallInvoker is a convenient abstraction that holds on to that method queue. For async calls, we'll just call `CallInvoker::invokeAsync`, and for sync calls, we'll just call `CallInvoker::invokeSync`.

**Why do we need sync call support for native `CallInvoker`?**
In ObjC, sync NativeModule method calls block the JS thread, then execute synchronously on the NativeModule's method queue, and then unblock the JS thread. This is what'll be implemented by `CallInvoker::invokeSync`.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D20829955

fbshipit-source-id: efb9d5408a1ade81069a943c865f232d4d10acfe
2020-04-03 09:47:42 -07:00
Ramanpreet Nara eb4e2baaa9 Rename Instance::getNativeCallinvoker to Instance::getDecoratedNativeCallInvoker
Summary:
Now, instead of accepting a `std::function` that schedules work, and returning a `CallInvoker`, `Instance::getDecoratedNativeCallInvoker`  will accept a `CallInvoker` that schedules work, and return a decorated `CallInvoker`.

I think this change will help with readability. It also clarifies that the bridge is adding additional behaviour to the native `CallInvoker`.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D20826885

fbshipit-source-id: a2c5681d10a4544ee3d2a0d1f1cbd386ef06d0e6
2020-04-03 09:47:41 -07:00
maciej simka 6f627f684b Split loadApplicationScript into initializeRuntime and loadBundle (#27844)
Summary:
This is the first of three PRs related to enabling multi-bundle support in React Native. More details, motivation and reasoning behind it can be found in RFC [here](https://github.com/react-native-community/discussions-and-proposals/issues/152).

Logic responsible for installing globals was pulled out from `loadApplicationScript` to `initializeRuntime` since it should be ran only once, what was left was renamed to `loadBundle`.

It's based on dratwas work from [here](https://github.com/callstack/react-native/tree/feat/multibundle/split-load-application), but applied to current `master` to avoid rebasing 3-months old branch and issues that come with that.

## Changelog

[Internal] [Changed] - split `loadApplicationScript` into `initializeRuntime` and `loadBundle` to enable multi-bundle support in the future
Pull Request resolved: https://github.com/facebook/react-native/pull/27844

Test Plan: Initialized new RN app with CLI, set RN to build from source and verified the still app builds and runs OK using code from this branch.

Reviewed By: rickhanlonii

Differential Revision: D19888605

Pulled By: ejanzer

fbshipit-source-id: 24ace48ffe8978796591fe7c6cf53a61b127cce6
2020-04-01 17:52:39 -07:00
Ramanpreet Nara 9b94a541d8 Get CallInvokers from the bridge
Summary:
## Context
For now, assume TurboModules doesn't exist.

**What happens when we call an async NativeModule method?**
Everytime JS calls an async NativeModule method, we don't immediately execute it. The legacy infra pushes the call into some queue managed by `MessageQueue.js`. This queue is "flushed" or "emptied" by the following events:
- **Flushed:** A C++ -> JS call. NativeModule async methods can called with an `onSuccess` and/or `onFail` callback(s). Calling `NativeToJsBridge::invokeCallback` to invoke one of these callbacks is one way for ObjC++/C++/Java to call into JS. Another way is via JSModule method calls, which are initiated by `NativeToJsBridge::callFunction`.
- **Flushed:** When `JSIExecutor::flush` is called. Since TurboModules don't exist, this only happens when we call `JSIExecutor::loadApplicationScript`.
- **Emptied:** When more than 5 ms have passed, and the queue hasn't been flushed/emptied, on the next async NativeModule method call, we add to the queue. Afterwards, we empty it, and invoke all the NativeModule method calls.

**So, what's the difference between flushed and emptied?**
> Note: These are two terms I just made up, but the distinction is important.

If the queue was "flushed", and it contained at least one NativeModule method call, `JsToNativeBridge` dispatches the `onBatchComplete` event. On Android, the UIManager module is the only module that listens to this event. This `onBatchComplete` event doesn't fire if the queue was "emptied".

**Why does any of this matter?**
1. TurboModules exist.
2. We need the TurboModules infra to have `JsToNativeBridge` dispatch `onBatchComplete`, which depends on:
   - **Problem 1:** The queue being flushed on calls into JS from Java/C++/ObjC++.
   - **Problem 2:** There being queued up NativeModule async method calls when the queue is flushed.

In D14656466, fkgozali fixed Problem 1 by making every C++/Java/Obj -> JS call from TurboModules also execute `JSIExecutor::flush()`. This means that, with TurboModules, we flush the NativeModule async method call queue as often as we do without TurboModules. So far, so good. However, we still have one big problem: As we convert more NativeModules to TurboModules, the average size of the queue of NativeModule method calls will become smaller and smaller, because more NativeModule method calls will be TurboModule method calls. This queue will more often be empty than not. Therefore, we'll end up dispatching the `onBatchComplete` event less often with TurboModules enabled. So, somehow, when we're about to flush the NativeModule method call queue, we need `JsToNativeBridge` to understand that we've executed TurboModule method calls in the batch. These calls would have normally been queued, which would have led the queue size to be non-zero. So if, during a batch, some TurboModule async method calls were executed, `JsToNativeBridge` should dispatch `onBatchComplete`.

**So, what does this diff do?**
1. Make `Instance` responsible for creating the JS `CallInvoker`.
2. Make `NativeToJsBridge` responsible for creating the native `CallInvoker`. `Instance` calls into `NativeToJsBridge` to get  the native `CallInvoker`.
3. Hook up `CatalystInstanceImpl`, the Android bridge, with the new JS `CallInvoker`, and the new native `CallInvoker`. This fixes `onBatchComplete` on Android. iOS work is pending.

Changelog:
[Android][Fixed] - Ensure `onBatchComplete` is dispatched correctly with TurboModules

Reviewed By: mdvacca

Differential Revision: D20717931

fbshipit-source-id: bc3ccbd6c135b7f084edbc6ddb4d1e3c0c7e0875
2020-04-01 11:39:18 -07:00
Joe Loser ba18ee9b87 Replace folly::make_unique with std::make_unique (#26730)
Summary:
There is a mixed usage of `folly::make_unique` and `std::make_unique`. Soon, `folly::make_unique` may be removed (see [this PR](https://github.com/facebook/folly/pull/1150)). Since `react-native` only supports C++14-compilers and later, switch to always using `std::make_unique`.

## Changelog

[Internal] [Removed] - Replace folly::make_unique with std::make_unique
Pull Request resolved: https://github.com/facebook/react-native/pull/26730

Test Plan:
Running the existing test suite. No change in behavior is expected.

Joshua Gross: buck install -r fb4a, make sure MP Home and forced teardown works okay on android

Reviewed By: shergin

Differential Revision: D18062400

Pulled By: JoshuaGross

fbshipit-source-id: 978ca794c7e972db872a8dcc57c31bdec7451481
2019-10-22 12:21:41 -07:00
Andres Suarez 722feeb02b Tidy up license headers [1/n]
Summary: Changelog: [General] [Fixed] - License header cleanup

Reviewed By: yungsters

Differential Revision: D17952695

fbshipit-source-id: 81aa607612ba1357ef7814ef20371335151afe7e
2019-10-16 10:06:33 -07:00
Min ho Kim 84f5ebe4f9 Fix typos (#25770)
Summary:
Fix typos mostly in comments and some string literals.

## Changelog

[General] [Fixed] - Fix typos
Pull Request resolved: https://github.com/facebook/react-native/pull/25770

Differential Revision: D16437857

Pulled By: cpojer

fbshipit-source-id: ffeb4d6b175e341381352091134f7c97d78c679f
2019-07-23 03:23:11 -07:00
Marc Horowitz 0735873fbc Make isInspectable safe to call from any thread
Summary: The bridge was not properly isolating isInspectable onto the JS thread.

Reviewed By: fkgozali

Differential Revision: D14991970

fbshipit-source-id: 92a06c90bade8f92bfa81fa3b7dfb23b17db6117
2019-04-17 21:23:19 -07:00
zhongwuzw 81860c59c3 Remove compiler warning (#23588)
Summary:
Fixed compiler warning, after this, seems we have no warning for framework in debug mode.
<img width="1280" alt="image" src="https://user-images.githubusercontent.com/5061845/53224564-2d14e980-36b0-11e9-85f4-46304513b18d.png">

[iOS] [Fixed] - Remove compiler warning
Pull Request resolved: https://github.com/facebook/react-native/pull/23588

Differential Revision: D14181748

Pulled By: cpojer

fbshipit-source-id: 8b633e7cdb7b3b8029f4145a1155e540ac516191
2019-02-22 01:40:09 -08:00
Matt Hargett 36916ee99d Fix portability issues to Linux, FreeBSD, and older libc++
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/21764

Differential Revision: D13902907

Pulled By: hramos

fbshipit-source-id: 640cde865b1bcc5ca43c17d00574b8e2f78ceaf4
2019-01-31 17:45:20 -08:00
zhongwuzw d55558e138 Fix isBatchActive of RCTCxxBridge (#22785)
Summary:
Seems we lost handler of `isBatchActive` from [RCTBatchedBridge a86171a](a86171a482/React/Base/RCTBatchedBridge.m) to [RCTCxxBridge 5bc7e39](b774820dc2 (diff-a2a67635fffd7b690d14dc17ae563a71)).

Changelog:
----------

[iOS] [fixed] - Fix isBatchActive of RCTCxxBridge
Pull Request resolved: https://github.com/facebook/react-native/pull/22785

Reviewed By: mhorowitz

Differential Revision: D13731897

Pulled By: cpojer

fbshipit-source-id: 8d6b85bcea8fe8997a93b4e1ac8b8007422ca20e
2019-01-21 00:28:48 -08:00
empyrical 0c0540965a CxxReact: Silence 'unused lambda capture' warnings in open-source (#22240)
Summary:
This pull request silences build warnings like this in open-source:

```
{snip}/ReactCommon/cxxreact/CxxNativeModule.cpp:134:85: warning: lambda capture 'callId' is not used [-Wunused-lambda-capture]
  messageQueueThread_->runOnQueue([method, params=std::move(params), first, second, callId] () {
```

These are variables used by "fbsystrace", which is not open-sourced.

An  unused statement has been added to the affected files in the `#else` for the `#ifdef WITH_FBSYSTRACE` conditionals
Pull Request resolved: https://github.com/facebook/react-native/pull/22240

Differential Revision: D13031358

Pulled By: shergin

fbshipit-source-id: 8ccfc226b65e32abda6abb573f77a6589bd19dcd
2018-11-16 10:37:16 -08:00
Héctor Ramos 1151c096da Update copyright headers to yearless format
Summary: This change drops the year from the copyright headers and the LICENSE file.

Reviewed By: yungsters

Differential Revision: D9727774

fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
2018-09-11 15:33:07 -07:00
Kevin Gozali 201ba8c69d Catch JS bundle load failure and prevent calls to JS after that
Summary: There are cases where JS bundle fails to be evaluated, which throws an exception already, but then there were pending calls into JS which would fail in a weird way. This prevents those calls (because it's mostly meaningless at that point). For now, those extra calls will still throw an exception, but with a specific message so that it doesn't confuse people.

Reviewed By: yungsters

Differential Revision: D8961622

fbshipit-source-id: 3f67fb63fdfa9fc5b249de0096e893b07956776a
2018-07-24 19:48:32 -07:00
Héctor Ramos da7873563b Migrate Android sources to MIT license header
Reviewed By: fkgozali

Differential Revision: D8065619

fbshipit-source-id: 719c303b40c96950bab8e5dde9a75f449b2956c6
2018-05-31 15:37:30 -07:00
Marc Horowitz 042449f24a simplify handleMemoryPressure conditionalization, delete some dead code
Reviewed By: javache

Differential Revision: D7803912

fbshipit-source-id: 0bab4be07fc006a208caa75f94b5716c99b5d265
2018-05-09 22:12:03 -07:00
Ben Nham 15cd98b782 add isInspectable property
Reviewed By: Hypuk

Differential Revision: D6578736

fbshipit-source-id: a4229c3766125ff55cff50a49893b2385f9c8a6a
2017-12-18 13:32:36 -08:00
Alex Dvornikov cff0d8e0e5 Register split segment paths with RAMBundleRegistry
Differential Revision: D6284466

fbshipit-source-id: c80cf929af38f92f06cca5b366c58785ae992d83
2017-11-09 12:23:46 -08:00
Alex Dvornikov 7d115730dc Configure JSExector with BundleRegistry instead of JSModulesUnbundle
Differential Revision: D5890458

fbshipit-source-id: 968be95786ffbf53aa98928d4d3e3bd52a84b3dc
2017-09-22 09:58:46 -07:00
Jia Li 0aa12939fd Revert D5850968: Configure JSExector with BundleRegistry instead of JSModulesUnbundle.
Differential Revision: D5850968

fbshipit-source-id: f4c9dc8d5f14cdd32195463e8786242e708770e9
2017-09-21 21:22:39 -07:00
Alex Dvornikov 79821917fa Configure JSExector with BundleRegistry instead of JSModulesUnbundle.
Differential Revision: D5850968

fbshipit-source-id: e5e7ad92c2347c2641551fcf820f061ffde5fed6
2017-09-21 08:51:00 -07:00
Pieter De Baets ed3c018ee4 Remove legacy JSC profiler
Reviewed By: bnham

Differential Revision: D5433406

fbshipit-source-id: 8cbea8b9b46a0d9f29c57a5bcf605e6bb61ed8a7
2017-07-20 04:21:16 -07:00
Pieter De Baets 83faa4b608 Simplify Catalyst handleMemoryPressure
Reviewed By: cwdick

Differential Revision: D5200555

fbshipit-source-id: 86f12acca33ece265d3482ba52de9afcc83173cd
2017-06-26 06:01:14 -07:00
Pieter De Baets e2628f93b5 Rename Executor to JSExecutor
Summary:
* Cleanup some header files so we use more forward declarations
* Rename Executor to JSExecutor.h
* Move some typedefs to more appropriate locations

Reviewed By: mhorowitz

Differential Revision: D5301913

fbshipit-source-id: e75154797eb3f531d2f42a5e95409f4062b85f91
2017-06-23 17:01:25 -07:00
Pieter De Baets 6221053179 Improve systrace markers
Reviewed By: mhorowitz

Differential Revision: D4860135

fbshipit-source-id: ce963010883e6b9cc8e34f7ff01b4018cd195eba
2017-05-12 18:07:49 -07:00
Pieter De Baets 34bc6bd2ae Drop support for webworkers
Reviewed By: AaaChiuuu

Differential Revision: D4916449

fbshipit-source-id: a447233d3b7cfee98db2ce00f1c0505d513e2429
2017-04-25 05:37:54 -07:00
Pieter De Baets d7b37c4050 Remove JsToNativeBridge's nativeQueue
Reviewed By: mhorowitz

Differential Revision: D4589737

fbshipit-source-id: 3b2730417d99c4f98cfaad386bc50328f2551592
2017-03-17 07:08:14 -07:00
Andy Street c8d922b467 BREAKING: Only call batchDidComplete when there were actually native calls dispatched
Summary: This is breaking because it affects the contract for onBatchComplete, but modules really shouldn't (and probably aren't) depending on it being called without any actual native module method calls having happened.

Reviewed By: javache

Differential Revision: D4715656

fbshipit-source-id: 53ddd4a26c9949de86f5111d214b3e5002ca2e94
2017-03-16 07:45:38 -07:00
Marc Horowitz e622d51e20 Support ModuleHolder-based lazy init of C++ modules with C++ bridge on android
Reviewed By: AaaChiuuu

Differential Revision: D4614479

fbshipit-source-id: 109ac34b8688f0113675e4a4479d1ddcc6169ed4
2017-03-14 15:35:01 -07:00
Marc Horowitz 7e4b8ff000 Support passing native modules to JSContext
Reviewed By: amnn

Differential Revision: D4561036

fbshipit-source-id: b096a222103e895b14cba1ec5b2bb6e72dd72c37
2017-03-14 15:35:01 -07:00
Ashok Menon 14dc219810 Deleting Optimized Bundle!
Reviewed By: javache

Differential Revision: D4566164

fbshipit-source-id: 1fbd3dd04f24399e93e3c6ec58956e6e18f1683f
2017-02-16 13:30:55 -08:00
Pieter De Baets d7d89172c2 Expose ModuleRegistry on ExecutorDelegate
Differential Revision: D3944588

fbshipit-source-id: f8450a6735e1f6283c3bfe9d2ce883327172621c
2016-10-03 05:13:38 -07:00
Marc Horowitz 6071e8ca2c Support sync loading of the initial bundle/source
Reviewed By: javache

Differential Revision: D3897521

fbshipit-source-id: a4f234c7003a5f4be952d315eb62f382836e24dc
2016-09-26 16:14:11 -07:00
Marc Horowitz 971cda8794 Move thread jump for js loading into NativeToJSBridge, out of platform code
Reviewed By: javache

Differential Revision: D3906009

fbshipit-source-id: b9782a6c209e3c1626899dac7fd50233cdef87f3
2016-09-26 16:14:10 -07:00
Pieter De Baets 145109fc6d Remove additional JSON encoding for native->JS communication
Reviewed By: mhorowitz

Differential Revision: D3857323

fbshipit-source-id: 4386cc107b8a1425ecb7297b0f659f6c47f01a78
2016-09-19 04:44:12 -07:00
Michał Gregorczyk 3c0f428f05 Fix optimized bundle stuff.
Reviewed By: davidaurelio, tadeuzagallo

Differential Revision: D3563710

fbshipit-source-id: 2b0a982d388ee5f44b806f8e561ef49a3fd8c8ca
2016-07-14 15:28:46 -07:00