Summary: ImageManager is used to update the LocalData of Image views, as part of this process we call ImageManager::requestImage in cross platform code. Event if Android doesn't use ImageRequest we need to return an empty non-operation version of this object.
Reviewed By: shergin
Differential Revision: D10429663
fbshipit-source-id: 3621ece72f7291e2e6ab6a84b238ac16b595fc18
Summary: This diff fixes a crash that happens when a component throws an exception that contains a null message
Reviewed By: achen1
Differential Revision: D10429661
fbshipit-source-id: 9faed36906844b51f5a3dc2b3cbc80ede6b93457
Summary: Exports the `ImageLoadEvent` type so that components passing through the `onLoad` callback can be properly typed.
Reviewed By: TheSavior
Differential Revision: D10481050
fbshipit-source-id: f0a48163c6221087b0f9869c033c653316471af9
Summary: UIImplementationProvider was removed as part of D8650376, this was a breaking change that caused problems in OSS. This diff introduces the concept of a deprecated UIImplementationProvider again to allow OSS community to upgrade to latest version of RN.
Reviewed By: achen1
Differential Revision: D10456317
fbshipit-source-id: 6817629524f927dfcb5ebc054dbfd983877b7606
Summary:
Remove BackAndroid, which has had a deprecation warning and only forwarded to BackHandler since March 2018.
Test Plan
---------
React-native init bundle and RNTester bundle works.
Release Notes:
--------------
[ ANDROID ] [ BREAKING ] [ BackAndroid ] - Deprecate BackAndroid since BackHandler should be used in its place.
Pull Request resolved: https://github.com/facebook/react-native/pull/21866
Differential Revision: D10472419
Pulled By: TheSavior
fbshipit-source-id: 3d76e1ce4c74bb783fee7fd8232bb366f2e7ea12
Summary: Removing explicit requires of Map and Set (since those are polyfilled), and fixing resulting flow errors.
Reviewed By: yungsters
Differential Revision: D10350673
fbshipit-source-id: 2fefe8ed1ae1f2cc9e5b7923ad630e73eda9e856
Summary:
React Native needs to be updated to support XCode 10 (GitHub issue: [19573](https://github.com/facebook/react-nåative/issues/19573)). Until we make that change, our CI needs to rely on the legacy build system in XCode 10 to build `RNTester`, as opposed to the new build system made default in XCode 10. This diff uses the `-UseModernBuildSystem=NO` `xcodebuild` flag to enforce that requirement.
**Note:** I did a search within `react-native-github/scripts` for `xcodebuild` and passed in the `-UseModernBuildSystem=NO` flag. I figured that every time we use `xcodebuild`, we should enforce the build system.
� This should hopefully fix the `react-native-oss-ios` test.
Reviewed By: hramos
Differential Revision: D10456139
fbshipit-source-id: 795f32b3ceba6a5a24ab6ccbf4f5160d42746801
Summary: ListView is deprecated and SwipeableListView uses ListView. Thus, it is deprecated as well.
Reviewed By: RSNara
Differential Revision: D10437408
fbshipit-source-id: a08391d5b099e74b6ec179cd940ac404b2e702f4
Summary:
A while back Jest introduced `jest.requireActual` and `jest.requireMock` which are aliases to `require.requireActual` and `require.requireMock`. We believe that users should use official Jest API and are planning to deprecate the latter.
Pull Request resolved: https://github.com/facebook/react-native/pull/21849
Differential Revision: D10448849
Pulled By: TheSavior
fbshipit-source-id: 34fffde97f48c26098c74ee222a56d99071703a6
Summary:
[RN] Relax the requirement that lazy module cannot be initialized on the main thread
I tried to understand the D5364734 that intoduced this, and I am not sure, but belive that asserting here is too strict. If you have a module that you want to lazily initialize, and module does not demand the main queue, it should be just a warning if you run on the main queue, not necessarily an error.
Reviewed By: mmmulani
Differential Revision: D10429880
fbshipit-source-id: 018c211d45b98dd8c552bf0289fe517d05e56d47
Summary:
We don't want people requiring from this file via haste. This file is the main for the react-native yarn workspace requireable via require('react-native').
https://pxl.cl/jnWC
Reviewed By: mostafaeweda, RSNara
Differential Revision: D10444200
fbshipit-source-id: 3832857e3df01def128525f32c9735e928802b59
Summary:
@public
If you call NetInfo.getCurrentConnectivity multiple times in succession, we'll create a bunch of callbacks but lose them in the ether.
With this fix, we'll unschedule them before creating a new one, which should resolve some crashes we're seeing.
Reviewed By: PeteTheHeat
Differential Revision: D10409486
fbshipit-source-id: 6065b09fa626f7f06aed9bf0e278c0a6a6169f58
Summary:
This diff just builds on top of the open source PR:
1. I add a bunch of extra flow typings to the file.
2. I refactor some of the JavaScript code.
Reviewed By: TheSavior
Differential Revision: D10351693
fbshipit-source-id: a6d828518150c11d66a179c5c3fe835cc80a8dfb
Summary:
`extern "C"` disables name mangling, hence input parameter types does not influence the name. That makes it impossible to have several equality operators with `extern "C"` linkage (for different types).
One such operator is defined in Windows SDK, in `guiddef.h`. It in turn is included in `winnt.h` inside `extern "C" { ... }` block. Trying to compile file which both is dependent both on `winnt.h` and `Yoga.h` results in:
```
Yoga.h(50): error C2733: 'operator ==': second C linkage of overloaded function not allowed
guiddef.h(192): note: see declaration of 'operator =='
```
In general it doesn't make much sense to have cpp specific operator to have `extern "C"` linkage, so the change doesn't introduce any controlling flag (mangling on/off).
Note that it's breaking binary compatibility and yoga library should be rebuilt if those operators are used.
Reviewed By: milend
Differential Revision: D10418395
fbshipit-source-id: 2f1cccff26165e638b9a07eece07d94fccfa5e5a
Summary: The only thing extra that we need to do is to include `JavaScriptCore.framework` inside the HelloWorld.xcodeproj file.
Reviewed By: hramos
Differential Revision: D9893035
fbshipit-source-id: 2a29d1fd645eafa2e09109ad14d09f812dfa2601
Summary:
Marc deleted a few files from react-native-github, so I removed them from the RNTester XCode project. I also included the files he created, and created new targets: `jsiexecutor-tvOS`, `jsiexecutor`, `jsi`, `jsi-tvOS`.
**Note:** The tvOS build of RNTester is broken in this diff because of a few `WKWebView` changes I landed earlier. D9844322 includes the fix.
Reviewed By: axe-fb
Differential Revision: D9875409
fbshipit-source-id: 31a9f241a524de91e78dfff0555aec5d1373d789
Summary:
This diff includes a few changes to the `React.podspec` file:
1. Introduce a `jsi` spec for code inside the `ReactCommon/jsi` folder. This depends on the JavaScriptCore framework.
2. Introduce a `jsiexecutor` spec for the code inside the `ReactCommon/jsiexecutor` folder. These files depend on files in `ReactCommon/cxxreact`, `ReactCommon/jsi`, and Folly.
3. Since RCTCxxBridge.mm now depends on `JSIExecutor`, we need to have the `CxxBridge` spec depend on the `jsiexecutor` spec.
Reviewed By: hramos
Differential Revision: D9820323
fbshipit-source-id: 0c96d027eed30ee47b6ee0d2d86cd6b1ad7a5887
Summary:
This diff includes a few changes:
1. Move the headers inside `jsiexecutor` into `jsiexecutor/jsireact`. As far as I'm aware, the Android ndk build system isn't flexible enough to support header namespaces, so we can't just expose the headers inside the `jsiexecutor` directory under the `jsireact` namespace. Therefore, I moved the headers to `jsiexecutor/jsireact`, and added `jsiexecutor` to the header search path. This was the easiest way to simulate `jsireact` namespace.
2. Setup the Android.mk files to get RNTester compiling and running.
3. Introduce a `jscexecutor` module to make `JSCExecutor.java` execute without throwing.
**Note:** Moving the header files inside `jsiexecutor` probably breaks the iOS builds and internal builds. I'll fix those in subsequent diffs on this stack.
Reviewed By: shergin
Differential Revision: D9995429
fbshipit-source-id: 418a4ee91f585842c5e317af2f300227a51e9ba8
Summary:
JSI+JSCRuntime replaces direct use of JSC. This is like the previous
diff, except for iOS.
Reviewed By: RSNara
Differential Revision: D9369108
fbshipit-source-id: 4ed2c0d660ba2a30edf699d95278c72cabcc9203
Summary: JSI doesn't use any of this.
Reviewed By: RSNara
Differential Revision: D10229167
fbshipit-source-id: 9eaa288a1d62bafb3ff0626f9f8430e699fdad4a
Summary:
change RCTCxxBridge to use JSIExecutorFactory+JSCRuntime
instead of JSCExecutorFactory. Also remove JSC usage from RN in other
files. This allows deleting files, too, which is done further down
the stack.
Reviewed By: RSNara
Differential Revision: D9369111
fbshipit-source-id: 67ef3146e3abe5244b6cf3249a0268598f91b277
Summary:
Removing entire files will be the next diff
@public
Reviewed By: fkgozali
Differential Revision: D9328239
fbshipit-source-id: 083847d3b841a3c7bfa751a82e8cc16bd112bace
Summary:
This removes the dependency on JSCExecutor. Everything goes
through JSI now.
Reviewed By: RSNara
Differential Revision: D9328240
fbshipit-source-id: c9c085fec1ebd5d0f4679cd70b89cc263ca33ac4
Summary:
This is similar in function to the old JSCExecutor, but uses the more abstract JSI API to interact with the JSVM.
@public
Reviewed By: axe-fb
Differential Revision: D9328241
fbshipit-source-id: 3212ff4f43d0589a70d7bebc4d463d4433590f1d
Summary:
This diff is an implementation of jsi::Runtime which uses JSC as the virtual machine. All of the JSC-specific details are encapsulated here.
@public
Reviewed By: RSNara
Differential Revision: D9328242
fbshipit-source-id: be3c7bed161916c1cb9a48182600b558f054eadc
Summary: This will help abstract the JS engine from React Native
Reviewed By: hramos
Differential Revision: D9328237
fbshipit-source-id: 7b34f55f28e43d83ba24d22e83e836c92ca737a9
Summary:
This PR introduces a new helper function called `setAndForwardRef`. It is intended to help with moving components that depend on `NativeMethodsMixin` off of `createReactClass`.
It allows for classes that depend on having a ref to a native component to be able to also forward the native component ref to user code.
Usage is like this:
```js
class MyView extends React.Component {
_nativeRef = null;
_setNativeRef = setAndForwardRef({
getForwardedRef: () => this.props.forwardedRef,
setLocalRef: ref => {
this._nativeRef = ref;
},
});
render() {
return <View ref={this._setNativeRef} />;
}
}
const MyViewWithRef = React.forwardRef((props, ref) => (
<MyView {...props} forwardedRef={ref} />
));
module.exports = MyViewWithRef;
```
Pull Request resolved: https://github.com/facebook/react-native/pull/21823
Differential Revision: D10436673
Pulled By: TheSavior
fbshipit-source-id: 32e167bb3ea3234f08d5715168b0e61e4e035a7c
Summary:
Fixes#19069
The --simulator option for the run-ios command now can take an optional
iOS version between parenthesis to further match the desired simulator.
This is useful if you have installed simulators for different iOS
versions and you want to run the app in an especific one. Example:
react-native run-ios --simulator "iPhone 6s (9.3)"
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.
Updated tests for the findMatchingSimulator function to include test cases specifying iOS version, and tested on the command line in my app to make sure it has the expected behavior.
[CLI] [ENHANCEMENT] [{/runIOS/findMatchingSimulator.js}] - run-ios command with the --simulator option now allows specifying the iOS version to run an specific simulator if you have multiple versions of the simulator installed. Example: `react-native run-ios --simulator "iPhone 6s (9.3)"`.
Pull Request resolved: https://github.com/facebook/react-native/pull/19079
Differential Revision: D10432487
Pulled By: hramos
fbshipit-source-id: efa50d798b79d83bfe357ee17967a56c7c003bee
Summary:
With this, we send the correct x position when using center or right aligned text. In order to accomplish this though, we have to pass the text alignment into the Layout object that we create.
Also update RNTester to allow us to try different alignments.
Reviewed By: sahrens
Differential Revision: D10316494
fbshipit-source-id: 11c7d2a59e636528f12211168acb46f16b54a126
Summary:
(cordova-node-)xcode 1.0.0 includes a fix for #13160 plus a few more
fixes. This should increase robustness in Xcode project handling
overall.
Fixes#13160.
-------------------------
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.
If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
_Pull requests that expand test coverage are more likely to get reviewed. Add a test case whenever possible!_
Pull Request resolved: https://github.com/facebook/react-native/pull/21766
Reviewed By: codytwinton
Differential Revision: D10384245
Pulled By: hramos
fbshipit-source-id: 488156be67cfc2d99ca81d7cb82747bab35984a7
Summary:
1. The user inserts a character ('0') at index 0. Because the range matches 0, 0, predictedText is set to that character that was inserted.
2. In textInputDidChange, it discovers a mismatch between the rendered text ('1234') and predicted text ('0')
3. This triggers textInputShouldChangeTextInRange to be called again with the 'new' text that it thinks was just added ('1234')
4. It goes to insert this text, but runs into the maxLength limit, so it gets truncated and then inserted.
(I'm not totally sure why only happens if maxLength is set - I need to look into that.)
One fix for this is to just get rid of the range check, but that'll regress #18374. I decided to just check and see if the rendered text is empty instead of checking the range where text could be inserted, since that seems like it should properly handle both cases.
Reviewed By: shergin
Differential Revision: D10392176
fbshipit-source-id: 84fb3b6cac9b0aa25b3c1a127d43f9cdc5a1c6a8
Summary:
Related to #21581
Remove createReactClass from LayoutEventsTest and refactor a little bit.
Reviewed By: TheSavior
Differential Revision: D10345794
fbshipit-source-id: 40e42f6e9afece5ddf527f91927e75cb1669b696
Summary:
Original PR: https://github.com/facebook/react-native/pull/21340
The original PR fixed a bug with border radius on Android 7.0, but caused a new bug where no `ReactART` components would render if they were nested within a View with border radius set.
Differential Revision: D10409352
fbshipit-source-id: 0b4e36ae9d4c3bc2f4884a43909f8efdeeb41b74
Summary:
The first implementation of EventEmitter's enable/disable feature didn't not provide a way to enable an object after it was disabled.
Apparently, we need this functionality due that fact that all nodes of the same family share same event emitter.
Reviewed By: mdvacca
Differential Revision: D10395849
fbshipit-source-id: 0eba54f0bb7ded35d64afb6559e6e27208c2b577
Summary:
Trivial.
We have to proxy layout directions as well as min and max sizes to RootNode's Props to properly communicate the constrains to Yoga.
Reviewed By: sahrens
Differential Revision: D10387798
fbshipit-source-id: a02ec0a20b3ef28f6230738e5b3a4a2b0b8e0961
Summary: The code fragment `super.accessibilityLabel` always meant "use stored value which came from Props". But after we override the implementation of this getter in the base class, this starts working differently (wrong). This change basically reverts that to original intent.
Reviewed By: sahrens
Differential Revision: D10350597
fbshipit-source-id: 913951eb08c4ede76fc0e9be76b48d86599bcc62
Summary: Empty string in AccessibilityProps basically means same as `nil` in iOS Accessibility API.
Reviewed By: sahrens
Differential Revision: D10350596
fbshipit-source-id: fad9cdc914388c72e1b8261b27f14cbfa9a037db
Summary: An `AttributedString` object generated by a cross-platform layer of React Native must have already resolved text styles to make the actual resulting text identical across platforms. To do so we have to have a unified default.
Reviewed By: sahrens
Differential Revision: D10287725
fbshipit-source-id: e8c62b33496be34146182baccd0009d3624a7fe5