Commit Graph

13833 Commits

Author SHA1 Message Date
Alexey Kureev c5ce762697 Replace projectRoots with projectRoot + watchRoots
Summary:
We use projectRoots to limit crawling of jest-haste-map in large codebases. Since this implies multiple projects roots, it makes it very hard (or impossible) to reliably cache dependency resolutions.

If we can replace this with a single project root and a set of watch roots, we can have relative path resolutions for all dependencies which van be cached.

Reviewed By: rafeca

Differential Revision: D8450498

fbshipit-source-id: 830c21e847c3236e42d5414a8587508cb73864bd
2018-06-19 13:47:32 -07:00
Jeff Thomas d7e0fe2c2c AssetsLibrary.framework --> Photos.framework; ReactNative stuff
Summary:
AssetsLibrary.framework --> Photos.framework;  ReactNative

Port RN off of AssetsLibrary where trivial, lazy load AssetsLibrary where remaining.

Reviewed By: fkgozali

Differential Revision: D7999924

fbshipit-source-id: 1d48a2d820984564459ed43680cd3f601399d352
2018-06-19 13:32:16 -07:00
David Vacca c6a52b6db6 Fix setJSResponder for Fabric
Summary:
Before this fix, ReactNative screens that uses the Fabric renderer crashes when an event is dispatched. The root cause of the bug is that React JS executes the setJSResponder method in UIManagerModule, but this method is not implemented yet in Fabric.

This fix will have to be picked into current RC to fix events into the City Guides screen running the Fabric experiment

Reviewed By: fkgozali

Differential Revision: D8515300

fbshipit-source-id: 40fe2f77987470abed8164f848680a911efa4bd2
2018-06-19 10:48:18 -07:00
Pavlos Vinieratos 5f9a2117bf Remove some methods that have `NS_UNAVAILABLE` set (#19790)
Summary:
These lines were causing erros with the e2e tests on ios.
There are some methods that are not going to be called, and some definitions that are not correct.

needed for #19574.

we will run the e2e tests.

[INTERNAL] [MINOR] [Tests] - Fix some definitions.
Closes https://github.com/facebook/react-native/pull/19790

Differential Revision: D8509228

Pulled By: hramos

fbshipit-source-id: 78650e347db52305a587e3461ac56877e3c79062
2018-06-19 02:18:01 -07:00
Hoa Dinh e11cdc917c Fixed RCTAssert nullability
Summary:
```
Apps/Instagram/AppLibraries/IGReactKit/IGReactKit/IGReactRouteHelpers.m:54:5: error: implicit conversion from nullable pointer 'NSString * _Nullable' to non-nullable pointer type 'NSString * _Nonnull' [-Werror,-Wnullable-to-nonnull-conversion]
    RCTAssert(!(title != nil && logoAsTitle), @"Screen navigationOptions cannot have both title and logoAsTitle.");
    ^
Apps/Instagram/AppLibraries/IGReactKit/IGReactKit/IGReactRouteHelpers.m:54:5: error: implicit conversion from nullable pointer 'NSString * _Nullable' to non-nullable pointer type 'NSString * _Nonnull' [-Werror,-Wnullable-to-nonnull-conversion]
/data/sandcastle/boxes/trunk-hg-fbobjc-fbsource/xplat/js/react-native-github/React/Base/RCTAssert.h:28:14: note: expanded from macro 'RCTAssert'
        file:@(__FILE__) lineNumber:__LINE__ description:__VA_ARGS__]; \

```

Reviewed By: zats

Differential Revision: D8509133

fbshipit-source-id: ae7027efc18716193c86fbeeec74d41d1879797f
2018-06-18 23:46:15 -07:00
Valentin Shergin 9a59428468 Fabric: Fixed `Identity Transform` matrix literal
Summary:
@public
As Janic janicduplessis mentioned on GH the literal should be slightly different.
8df7d51600 (r29390543)

And here is prooflink: https://developer.apple.com/documentation/quartzcore/calayer/identity_transform?language=objc

Thanks Janic!

Created from Diffusion's 'Open in Editor' feature.

Reviewed By: fkgozali

Differential Revision: D8508559

fbshipit-source-id: 7427be36e041bf500bee1e06d2293f7b5ea8cf21
2018-06-18 23:02:41 -07:00
Eli White 843a433e87 Update react-native init's flowconfig
Summary:
Fixes https://github.com/facebook/react-native/issues/19766

On a clean project flow was complaining about `Cannot resolve module X` because of the removal of `providesModule`. This resolves the errors.

Reviewed By: rubennorte

Differential Revision: D8500303

fbshipit-source-id: 4e129ee4382f8ff36ab126e9f6c6530254cd382e
2018-06-18 16:02:34 -07:00
Héctor Ramos aaddbee29e Revert D8489006: [react-native][PR] Update Xcode projects
Differential Revision:
D8489006

Original commit changeset: 2922b2e76aca

fbshipit-source-id: 84ba633b7e9a33b32e0a1347ebe6ca8bb1b02441
2018-06-18 12:18:02 -07:00
Pavlos Vinieratos 59b5743187 Update Xcode projects (#19574)
Summary:
A few people have been complaining, including me, that when we compile a react native project, there are a lot of warnings from xcode, suggesting to update the project build settings to the new recommendations.

I took the liberty to actually update the xcode projects, so we can finally have these gone, as well as replace some deprecated methods with the new suggested ones.

I made two react native projects, one with the regular react native and the other one using this branch.
Left is before, right is after:
![screen shot 2018-06-05 at 15 44 34](https://user-images.githubusercontent.com/100233/40979899-6aba12da-68d7-11e8-8630-6c3009b6dc24.png)

[IOS] [MINOR] [Xcode] - updated the Xcode projects with the latest suggestions from Xcode 9.3, and replaced a few deprecated methods of iOS with their new replacements.
Closes https://github.com/facebook/react-native/pull/19574

Differential Revision: D8489006

Pulled By: hramos

fbshipit-source-id: 2922b2e76aca6883c4f5d04e9c511b9fc1029583
2018-06-18 11:17:18 -07:00
Dmitry Zakharov 2f53573d4f Fix Modules concurrent access
Reviewed By: fkgozali

Differential Revision: D8379392

fbshipit-source-id: 72495950ea5fcf37f5b1cc3413666879dfc81e5c
2018-06-18 07:47:26 -07:00
Michał Mokijewski a130239257 Make run-ios command play nicely with multiple Xcode versions (#19781)
Summary:
I started using Xcode 10 beta and spotted that even though react-native cli is using cli tools from Xcode 10 for building it tries to open simulator from Xcode 9.4. Turned out that path to simulator app is hardcoded and doesn’t care about active developer directory.

1. You have to have more than one Xcode version (ie. 9.4 and 10 beta).
2. Change active developer directory to Xcode beta (`xcode-select -s /Applications/Xcode-beta.app/Contents/Developer`).
3. Without fix `react-native run-ios` will open simulator from Xcode 9.4, with fix it'll open simulator from active developer directory.

[CLI][IOS] [BUGFIX] [./local-cli] - use simulator from active developer directory
Closes https://github.com/facebook/react-native/pull/19781

Differential Revision: D8475915

Pulled By: TheSavior

fbshipit-source-id: d607f1f9eb9e565d4a017c21de50b5e569d171f9
2018-06-17 23:01:49 -07:00
Valentin Shergin 310a2850c5 Fabric: Universal `fromDynamic` for `std::vector<...>`
Summary:
Now, if `fromDynamic` is defined for some type, `fromDynamic` for `std::vector` of this type is also will be defined.
We need this for parsing `ImageSources` (a vector of `ImageSource`) type.

Reviewed By: fkgozali

Differential Revision: D8473508

fbshipit-source-id: d8dc8e3a3273f35b76c7132c553130762f768394
2018-06-17 21:46:22 -07:00
Valentin Shergin d92601be05 Fabric: Improved parsing EdgeInsets and CornerInsets styles
Summary: In case if it's just a number, it is treated as unified insets now.

Reviewed By: mdvacca

Differential Revision: D8473510

fbshipit-source-id: 1034377bc3e4abe55778c2f182360345419f00d5
2018-06-17 21:46:22 -07:00
Valentin Shergin c1e0ea9d38 Fabric: Fixed erratum in "borderRadius" prop name
Summary: Trivial.

Reviewed By: mdvacca

Differential Revision: D8473506

fbshipit-source-id: ce2888edc1052f39a042904c02b3ac347feedbba
2018-06-17 21:46:22 -07:00
Valentin Shergin dca2067b71 Fabric: Fixed error in parsing translateX/translateY prop
Summary: Quite trivial.

Reviewed By: mdvacca

Differential Revision: D8473513

fbshipit-source-id: 5d20244cbaae5ea69c79379e9894adb05cef2eb5
2018-06-17 21:46:22 -07:00
Valentin Shergin 3b20a16703 Fabric: Fixed error in parsing `position` style
Summary: This style/prop is called `position` (not `positionType`) in RN/JS API.

Reviewed By: mdvacca

Differential Revision: D8473509

fbshipit-source-id: f381189e05e6b618f3c74f1bc4610e737981b388
2018-06-17 21:46:22 -07:00
Valentin Shergin e23a91e67b `Invalid JS responder` error was promoted to warning
Summary:
Given async nature of RN, it is quite possible situation, hence it should not be a redbox.
And in Fabric it happends all the time which makes debugging painful.

Reviewed By: mdvacca

Differential Revision: D8473511

fbshipit-source-id: cfe7a1d3d105fde3b23db4c4c07b99864215c94c
2018-06-17 21:46:22 -07:00
David Vacca e15a761084 Add noop support for setJSResponder / clearJSReponder API methods
Reviewed By: fkgozali

Differential Revision: D8458980

fbshipit-source-id: 2411fb8106288f65cabdef12917d0f5086d1723a
2018-06-17 11:53:34 -07:00
David Vacca 936de607b1 Add support to receive null payload in events
Reviewed By: shergin

Differential Revision: D8439118

fbshipit-source-id: a45da18765d58f6e32d34e2e57f3a6a64daccf71
2018-06-17 11:53:34 -07:00
David Vacca a7e8e72c51 Moving more logs from Log -> Flog
Reviewed By: fkgozali

Differential Revision: D8433247

fbshipit-source-id: e666fbf2abb81697ba6fb508c149af8a1a2035f1
2018-06-17 11:53:33 -07:00
Héctor Ramos 15f84420f0 Enable CocoaPods tests, add parallelism (#19764)
Summary:
Enable CocoaPods test, iOS e2e.
Use parallelism to run several tests simultaneously within the same machine.

Circle CI
Closes https://github.com/facebook/react-native/pull/19764

Differential Revision: D8471955

Pulled By: hramos

fbshipit-source-id: c484fd6c66fb2d0d2305ced29e34cb305f73fb55
2018-06-16 15:55:49 -07:00
Dulmandakh 9e4a4323b1 limit ndk jobs for RNTester on CI (#19755)
Summary:
Limit number of NDK jobs of ReactAndroid on CI using $BUILD_THREADS environment variable. Otherwise, it was spawning 32 jobs while building RNTester, which caused in OOM or unexpected failure.

CI: https://circleci.com/gh/dulmandakh/react-native/387

Android CI is green again 😍
Closes https://github.com/facebook/react-native/pull/19755

Differential Revision: D8466069

Pulled By: hramos

fbshipit-source-id: fd507d12c8e93f718e047719daa68aa25c37bfb2
2018-06-16 01:31:32 -07:00
Sho Ikeda 045688bc28 Fix Stable release date of 0.58.0 (#19751)
Summary:
See https://github.com/facebook/react-native/pull/19715#discussion_r195620169 for the details.

hramos
Closes https://github.com/facebook/react-native/pull/19751

Differential Revision: D8466070

Pulled By: hramos

fbshipit-source-id: 569e84119ac927e393889ad2c2f38d2b982aa6e8
2018-06-16 01:31:32 -07:00
Tim Yung c749d951ad React sync for revisions c0fe8d6...ae14317
Summary:
This sync includes the following changes:
- **[ae14317d6](https://github.com/facebook/react/commit/ae14317d6)**: Inline fbjs/lib/emptyFunction (#13054) //<Dan Abramov>//
- **[72434a768](https://github.com/facebook/react/commit/72434a768)**: Remove or inline some fbjs dependencies (#13046) //<Dan Abramov>//
- **[64c54edea](https://github.com/facebook/react/commit/64c54edea)**: Adding movementX and movementY to synthenticMouseEvent fixes #6723 (#9018) //<Jason Williams>//
- **[9bd4d1fae](https://github.com/facebook/react/commit/9bd4d1fae)**: Synchronously restart when an error is thrown during async rendering (#13041) //<Andrew Clark>//
- **[9bda7b28f](https://github.com/facebook/react/commit/9bda7b28f)**: Suspended high pri work forces lower priority work to expire early  (#12965) //<Andrew Clark>//
- **[2e7577907](https://github.com/facebook/react/commit/2e7577907)**: Fix incorrect data in compositionend event with Korean IME on IE11 (#10217) (#12563) //<Crux>//
- **[bc963f353](https://github.com/facebook/react/commit/bc963f353)**: setJSResponder in Fabric renderer (#13031) //<Sebastian Markbåge>//
- **[051637da6](https://github.com/facebook/react/commit/051637da6)**: Extract Fabric event handlers from canonical props (#13024) //<Sebastian Markbåge>//
- **[2a8085980](https://github.com/facebook/react/commit/2a8085980)**: Remove rAF fork (#12980) //<Flarnie Marchan>//
- **[e0c78344e](https://github.com/facebook/react/commit/e0c78344e)**: Retry on error if there's lower priority pending work (#12957) //<Andrew Clark>//
- **[9725065eb](https://github.com/facebook/react/commit/9725065eb)**: Update bundle sizes for 16.4.1 release //<Dan Abramov>//
- **[0b87b2790](https://github.com/facebook/react/commit/0b87b2790)**: Updating package versions for release 16.4.1 //<Dan Abramov>//
- **[036ae3c6e](https://github.com/facebook/react/commit/036ae3c6e)**: Use native event dispatching instead of Simulate or SimulateNative (#13023) //<Philipp Spieß>//
- **[945fc1bfc](https://github.com/facebook/react/commit/945fc1bfc)**: Call gDSFP with the right state in react-test-render (#13030) //<Rafał Ruciński>//
- **[392530104](https://github.com/facebook/react/commit/392530104)**: Remove feature flag around 'getDerivedStateFromProps' bug fix (#13022) //<Flarnie Marchan>//
- **[1594409fa](https://github.com/facebook/react/commit/1594409fa)**: Scheduler depends on common packages (#13020) //<Dan Abramov>//
- **[d5c11193e](https://github.com/facebook/react/commit/d5c11193e)**: Added production profiling bundle type (#12886) //<Brian Vaughn>//
- **[ec60457bc](https://github.com/facebook/react/commit/ec60457bc)**: Popping context is O(1) in SSR (#13019) //<Dan Abramov>//
- **[30bc8ef79](https://github.com/facebook/react/commit/30bc8ef79)**: Allow multiple root children in test renderer traversal API (#13017) //<Dan Abramov>//
- **[d480782c4](https://github.com/facebook/react/commit/d480782c4)**: Don’t error when returning an empty Fragment (#12966) //<Philipp Spieß>//
- **[4ac6f133a](https://github.com/facebook/react/commit/4ac6f133a)**: Fallback to event.srcElement for IE9 (#12976) //<Nathan Hunzaker>//
- **[23be4102d](https://github.com/facebook/react/commit/23be4102d)**: Fixed an issue with nested contexts unwinding when server rendering. Issue #12984 (#12985) //<Eric Soderberg>//
- **[d0d428064](https://github.com/facebook/react/commit/d0d428064)**: Remove old reference to inst._wrapperState (#12987) //<Nathan Hunzaker>//
- **[c78957eac](https://github.com/facebook/react/commit/c78957eac)**: Fix an SVG focusing crash in IE11 (#12996) //<Jifa Jiang>//
- **[bfb12ebb5](https://github.com/facebook/react/commit/bfb12ebb5)**: delete a couple of redundant lines in performWorkOnRoot() in ReactFiberScheduler.js (#13003) //<Nathan Quarles>//
- **[394b17eed](https://github.com/facebook/react/commit/394b17eed)**: Update custom renderer docs //<Dan Abramov>//
- **[188c4252a](https://github.com/facebook/react/commit/188c4252a)**: Fix react-dom ReferenceError requestAnimationFrame in non-browser env (#13000) (#13001) //<Ivan Babak>//
- **[9cf3733a9](https://github.com/facebook/react/commit/9cf3733a9)**: update comment in computeAsyncExpiration() to reflect code (#12994) //<Nathan Quarles>//
- **[c5a733e1e](https://github.com/facebook/react/commit/c5a733e1e)**: Fix links of docs on the comment (#12795) //<Ende93>//
- **[36546b513](https://github.com/facebook/react/commit/36546b513)**: Set the correct initial value on input range (#12939) //<Maxime Nory>//
- **[15767a8f8](https://github.com/facebook/react/commit/15767a8f8)**: [scheduler] 5/n Error handling in scheduler (#12920) //<Flarnie Marchan>//
- **[3118ed9d6](https://github.com/facebook/react/commit/3118ed9d6)**: Expose unstable_interactiveUpdates on ReactDOM (#12943) //<Andrew Clark>//
- **[524a74331](https://github.com/facebook/react/commit/524a74331)**: Fix for Flow issues in SimpleCacheProvider (#12942) //<Flarnie Marchan>//
- **[ae57b125c](https://github.com/facebook/react/commit/ae57b125c)**: [simple-cache-provider] Use LRU cache eviction (#12851) //<Andrew Clark>//
- **[e0a03c1b4](https://github.com/facebook/react/commit/e0a03c1b4)**: Extend input type check in selection capabilities (#12062) (#12135) //<Spyros Ioakeimidis>//
- **[79a740c6e](https://github.com/facebook/react/commit/79a740c6e)**: Rename variables to remove references to 'global' global (#12931) //<Flarnie Marchan>//
- **[ff724d3c2](https://github.com/facebook/react/commit/ff724d3c2)**: [scheduler] 4/n Allow splitting out `schedule` in fb-www, prepare to fix polyfill issue internally (#12900) //<Flarnie Marchan>//
- **[83f76e4db](https://github.com/facebook/react/commit/83f76e4db)**: ForwardRefs supports propTypes (#12911) //<Brian Vaughn>//
- **[8aeea5afa](https://github.com/facebook/react/commit/8aeea5afa)**: Do not assign node.value on input creation if no change will occur (#12925) //<Nathan Hunzaker>//
- **[aa85b0fd5](https://github.com/facebook/react/commit/aa85b0fd5)**: Upgrade to Jest 23 (#12894) //<Simen Bekkhus>//
- **[61777a78f](https://github.com/facebook/react/commit/61777a78f)**: [scheduler] 3/n Use a linked list instead of map and queue for callback storage (#12893) //<Flarnie Marchan>//
- **[e7bd3d59a](https://github.com/facebook/react/commit/e7bd3d59a)**: No longer expose ReactNativeComponentTree (#12904) //<Sebastian Markbåge>//
- **[f35d989be](https://github.com/facebook/react/commit/f35d989be)**: TestRenderer warns if flushThrough is passed the wrong params (#12909) //<Brian Vaughn>//
- **[557870067](https://github.com/facebook/react/commit/557870067)**: Record "actual" times for all Fibers within a Profiler tree (alt) (#12910) //<Brian Vaughn>//
- **[76e07071a](https://github.com/facebook/react/commit/76e07071a)**: [scheduler] 2/n Adding 'schedule' fixture (#12884) //<Flarnie Marchan>//
- **[345e0a71a](https://github.com/facebook/react/commit/345e0a71a)**: Improve tests for 'schedule' module (#12880) //<Flarnie Marchan>//
- **[8765d6089](https://github.com/facebook/react/commit/8765d6089)**: Update bundle sizes for 16.4.0 release //<Andrew Clark>//
- **[d427a563d](https://github.com/facebook/react/commit/d427a563d)**: Updating package versions for release 16.4.0 //<Andrew Clark>//
- **[53852a887](https://github.com/facebook/react/commit/53852a887)**: add functional components warning about legacy context api (#12892) //<Chang Yan>//
- **[fe747a51c](https://github.com/facebook/react/commit/fe747a51c)**: Add React.Timeout to getComponentName (#12890) //<Toru Kobayashi>//
- **[c601f7a64](https://github.com/facebook/react/commit/c601f7a64)**: add siblings Timeout components test case (#12862) //<Chang Yan>//
- **[735035837](https://github.com/facebook/react/commit/735035837)**: add legacy context API warning in strict mode (#12849) //<Chang Yan>//
- **[e88579184](https://github.com/facebook/react/commit/e88579184)**: Fix a regression that caused us to listen to extra events at the top (#12878) //<Dan Abramov>//
- **[7c0aca289](https://github.com/facebook/react/commit/7c0aca289)**: Rollup freeze: false (#12879) //<Brian Vaughn>//
- **[33289b530](https://github.com/facebook/react/commit/33289b530)**: Tests and fixes for 'timing out' behavior (#12858) //<Flarnie Marchan>//
- **[ad27845cc](https://github.com/facebook/react/commit/ad27845cc)**: Fix double-firing submit events (#12877) //<Sophie Alpert>//
- **[dd5fad296](https://github.com/facebook/react/commit/dd5fad296)**: Update Flow to 0.70 (#12875) //<Dan Abramov>//
- **[13003654e](https://github.com/facebook/react/commit/13003654e)**: Pass "start time" and "commit time" to Profiler callback (#12852) //<Brian Vaughn>//
- **[dc3b144f4](https://github.com/facebook/react/commit/dc3b144f4)**: Treat Rollup "warnings" as errors (#12868) //<Dan Abramov>//
- **[d7b9b4921](https://github.com/facebook/react/commit/d7b9b4921)**: Fix react native example links in README of 'react-reconciler' (#12871) //<Kevin (Kun) "Kassimo" Qian>//
- **[9bed4a6ae](https://github.com/facebook/react/commit/9bed4a6ae)**: https in reactProdInvariant text (#12869) //<Sophie Alpert>//
- **[47b003a82](https://github.com/facebook/react/commit/47b003a82)**: Resolve host configs at build time (#12792) //<Dan Abramov>//

Release Notes:
[GENERAL] [FEATURE] [React] - React sync for revisions c0fe8d6...ae14317

Reviewed By: bvaughn

Differential Revision: D8458731

fbshipit-source-id: afefaa50685d43e70c8ea85c70d2e29dee311cbb
2018-06-16 00:46:24 -07:00
Tim Yung 23f959aab8 FBJS: Upgrade to 0.8.17
Reviewed By: hramos

Differential Revision: D8458729

fbshipit-source-id: 1e92098b2651751f1b7ba3c8da1316fe4c0ca808
2018-06-16 00:46:23 -07:00
Kirill Nikolaev 52f431b4bb Eliminate circular dependency between MessageQueue and JSTimers modules. (#19526)
Summary:
This makes JSTimers actively register a callback for callImmediates.

Besides being generally tricky, circular dependency prevent compiling React Native code with bundlers that rely on concatenating module sources rather that evaluating code at the time of requiring, like Google Closure Compiler.

Sadly, Google Closure Compiler setup that prompted this change is complicated and brittle. And there are no good public tools to find circular dependencies among Haste-style modules (with unqualified require paths).

So some advice on a good test plan would be useful. Does Facebook have any tools to find circular dependencies with Haste-style requires?

FWIW, a check that worked for me was to replace all import paths in React Native from Haste style to normal relative paths (which I needed anyway) and then run [`madge`](https://www.npmjs.com/package/madge) on the code base:

```
$ ~/node_modules/.bin/madge --circular react-native/Libraries
Processed 390 files (7.4s) (81 warnings)

✖ Found 2 circular dependencies!

1) BatchedBridge/NativeModules.js > BatchedBridge/BatchedBridge.js > BatchedBridge/MessageQueue.js > Core/Timers/JSTimers.js
2) StyleSheet/flattenStyle.js > StyleSheet/StyleSheet.js
```

(The second cycle is already eliminated in a8e3c7f578).

[GENERAL] [MINOR] [MessageQueue] - MessageQueue implementation doesn't have a circular dependency on JSTimers.
Closes https://github.com/facebook/react-native/pull/19526

Reviewed By: hramos

Differential Revision: D8458755

Pulled By: yungsters

fbshipit-source-id: e753139b920ba1ad1a6db10f974c03ca195340c7
2018-06-15 17:06:29 -07:00
Dulmandakh 18e9ea2112 Suppress lint errors in Dialog module. remove abortOnError=false (#19740)
Summary:
Suppress lint errors in Dialog module. remove abortOnError=false.

This might hide future problems, so removing it
``` gradle
lintOptions {
  abortOnError false
}
```

Builds locally just fine. But CI is failing for unknown reasons. https://circleci.com/gh/dulmandakh/react-native/265

RNTester will built without errors
Closes https://github.com/facebook/react-native/pull/19740

Differential Revision: D8450600

Pulled By: hramos

fbshipit-source-id: faf508a0c546af18a05ee224628f88b02a38ab9f
2018-06-15 14:28:39 -07:00
Dulmandakh 77a02c0d83 deprecate ReactFragmentActivity (#19741)
Summary:
Android Support Library page says https://developer.android.com/topic/libraries/support-library/
> Caution: Starting with Support Library release 26.0.0 (July 2017), the minimum supported API level across most support libraries has increased to Android 4.0 (API level 14) for most library packages. For more information, see Version Support and Package Names in this document.

_android.support.v4.app.FragmentActivity_ is used to support **Fragment**s on Android API versions below 11. Now, we support only API version 14 and above, it's ok to remove _ReactFragmentActivity_ that extends _FragmentActivity_.

Once ReactFragmentActivity removed, we can remove some codes that use _android.support.v4_ to work support _ReactFragmentActivity_ on **unsupported** Android versions.

CI is failing for unknown reasons: https://circleci.com/gh/dulmandakh/react-native/278
> Received 'killed' signal

Everything will build and work just fine, except showing _ ReactFragmentActivity_ as deprecated
Closes https://github.com/facebook/react-native/pull/19741

Differential Revision: D8454968

Pulled By: hramos

fbshipit-source-id: e5f901438ef764163af013fe854904a28c73070a
2018-06-15 13:02:11 -07:00
Kevin Gozali 0a530f5d16 iOS: fix up nullability annotation for UIAppDelegate method signature
Reviewed By: TheSavior

Differential Revision: D8454576

fbshipit-source-id: 879b695b1b014a92453bf85f23cc1a0e64f015a3
2018-06-15 12:31:43 -07:00
Héctor Ramos 3f29d2c440 Skip metro bump commits (#19680)
Summary:
New metro releases are published to npm when a "Bump metro" commit is synced to GitHub and picked up by facebook/metro's Circle CI.
The same commit is picked up by facebook/react-native's Circle CI, but it will fail the checkout job because yarn will not find the new package on npm.
This is expected because the package will only be published to npm after Circle CI is done running on facebook/metro.

We can safely skip `yarn install` on these commits, and rely on the restored yarn cache instead.
Closes https://github.com/facebook/react-native/pull/19680

Differential Revision: D8450638

Pulled By: hramos

fbshipit-source-id: 436c229d09bfb4f9f92236c5aeec4a60d8317922
2018-06-15 11:47:40 -07:00
Valentin Shergin dc0ebf7cb0 Fabric: Implementation of <View transform={...}/> property
Summary: After moving all matrix math to C++, the actual client native code is quite trivial.

Reviewed By: fkgozali

Differential Revision: D8344059

fbshipit-source-id: 6910c6af5de64d5f901e82075d30edbde177af40
2018-06-15 11:47:40 -07:00
Valentin Shergin 55f8cfe693 Fabric: Implementation of shadow related props of <View> component
Summary: Quite trivial.

Reviewed By: fkgozali

Differential Revision: D8344060

fbshipit-source-id: 1e44a2ad78e98699dd0ae7ca2816f8c8349bf6d6
2018-06-15 11:47:40 -07:00
Valentin Shergin 5bb538ab5c Fabric: Color conversions function in RCTConversions
Summary:
This is quite interesting.
In Fabric, on C++ layer we store `color` values as `SharedColor` objects which (on iOS) are `shared_ptr`s with custom deallocater (which calls CoreFramework's `CFRelease` function). All this means that we cannot directly transfer ovenership of this managed pointer to ARC (honestly, I am not 100% sure about that, but at least this "shared ownershipt between ARC and non-ARC worlds" concept is as dangerous as any "relying on implementation details" approach). To to so, we have to create a copy and transfer ownership of the copy to ARC (which we do in 1RCTCGColorRefFromSharedColor`).

Reviewed By: fkgozali

Differential Revision: D8344061

fbshipit-source-id: 8b6764e1539b1982b41f502bbd3307c7b6900fd9
2018-06-15 11:47:40 -07:00
Valentin Shergin 8df7d51600 Fabric: Transform type and <View transform/> prop
Summary: The matrix magic and parsing approach are mixins between current iOS and Android implementation.

Reviewed By: fkgozali

Differential Revision: D8344054

fbshipit-source-id: 524b48c5ab61959ce740373534d0d435eb37b647
2018-06-15 11:47:39 -07:00
Valentin Shergin 3c8c01791f Fabric: Implementation of bunch of trivial <View> props
Summary: Pretty straightforward.

Reviewed By: fkgozali

Differential Revision: D8344063

fbshipit-source-id: e6d35353cb3f3e374d2f2b723a612eda2d19c8b7
2018-06-15 11:47:39 -07:00
Valentin Shergin 8bdc1ff10b Fabric: Implementatiton of <View hitSlop={}/> on the native side
Summary: The implementation was basically ported from existing one.

Reviewed By: fkgozali

Differential Revision: D8344057

fbshipit-source-id: c0ec3b7b986080eab62532244da73859b445fcbb
2018-06-15 11:47:39 -07:00
Valentin Shergin cde30eb6b7 Fabric: Basic implementation of <View nativeId={...}>
Summary:
Trivial.
`nativeId` is meant to be used by subclasses of external inspector-like tools, so it does not have any real functionality.

Reviewed By: fkgozali

Differential Revision: D8344064

fbshipit-source-id: d86ef378cda1f7f0e9a7b4ffc09f51004ae530d2
2018-06-15 11:47:39 -07:00
Valentin Shergin da55ef1367 Fabric: Definition of the rest <View> props on C++ side
Summary:
Just definition; we don't have an implementation on the native view layer yet.
And we don't have `transform` prop yet (because it's quite complex).

Reviewed By: fkgozali

Differential Revision: D8344058

fbshipit-source-id: 3b7b41480be8295cbc90b95ebe8562e52c6f81d7
2018-06-15 11:47:39 -07:00
Valentin Shergin f65e4e0174 Fabric: Implemetation of <Switch> component
Summary:
This is pretty straightforward implementation uses native `UISwitch`.
Suddenly we need Switch to test a bunch of other things.

Reviewed By: fkgozali

Differential Revision: D8344055

fbshipit-source-id: cfc51b8bc11198eb9d4d5e4745b96fb3a7f14de1
2018-06-15 11:47:39 -07:00
Valentin Shergin 8fa2d847b6 Fabric: `-[RCTViewComponentView setContentView:]`:
Summary:
This is just the convenient way to embed native views inside custom View components.
See coming <Switch> implementation as an example.

Reviewed By: fkgozali

Differential Revision: D8344056

fbshipit-source-id: 7f5f8cfeeffa7676bc7b562aa07f006cb9006575
2018-06-15 11:47:39 -07:00
Valentin Shergin e311fbb797 Fabric: CornerInsets: Graphical primitive for rect-corner-specific values
Summary: CornerInsets is something like EdgeInsets but about corners instead of edges.

Reviewed By: fkgozali

Differential Revision: D8344062

fbshipit-source-id: 9bf7a8696fba96e3124cb15e8e84093c1f4f8747
2018-06-15 11:47:39 -07:00
Kevin Gozali cb19621dfe Implementation of JS reload without crashing
Summary:
On JS reload the FabricUIManager and EventDispatcher didn't get release due to a retain cycle. This breaks the cycle.

In addition, force release the Scheduler on reload so that the stale classes get cleaned up properly, avoiding crashes. Also the surface now remounts the content correctly

Reviewed By: shergin

Differential Revision: D8414916

fbshipit-source-id: 4b14031f29b3bc9987d7aa765dc0d930a7de2b1e
2018-06-15 11:02:17 -07:00
Kevin Gozali 2ca4770011 fabric: send events via JS thread
Summary: Calling the event emitters on the main thread seems to be problematic, so let's dispatch it via the JS thread. This requires some changes to make "eventTarget" single-use because otherwise the binding would need to synchronize the actual JS call with the act of releasing the target.

Reviewed By: shergin

Differential Revision: D8375291

fbshipit-source-id: bd2b42731176ae209f4a19c232309c163fb1c01b
2018-06-15 11:02:17 -07:00
Jay Phelps 0883e52c74 remove deprecated behavior of touchableHandleActivePressIn/Out called for focus/blur (#19718)
Summary:
Follow up to #18470, which has not yet landed in a release so we may want to hold off merging this until it has so that people receive the deprecation warning.

***

This PR removes the previously deprecated behavior of touchableHandleActivePressIn/Out (as well as onPressIn/Out being called on TV platforms for focus/blur. Instead, users should utilize the new `onFocus` and `onBlur` for these events.

This was because on TV platforms onPressIn/Out was overloaded to trigger for not only presses but these focus events as well. The normal behavior of true presses will still defer to touchableHandleActivePressIn/Out (which defers to onPressIn/Out).

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[TV] [BREAKING] [Touchable] - On TV platforms `onPressIn` and `onPressOut` on Touchables will now only be triggered for press events, not for focus/blur. Instead, you can use `onFocus` and `onBlur`.

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->

Cc/ matthargett
Closes https://github.com/facebook/react-native/pull/19718

Differential Revision: D8450514

Pulled By: hramos

fbshipit-source-id: 818e85a338a451834b54d8965602699fc9b24e87
2018-06-15 10:46:47 -07:00
Eoin Norris a7a2ef1bb6 Possible fix for 18890 (#19687)
Summary:
Potential fixes for 18890. The issue was that when the setAttributedText method in RCTBaseTextInputView.m is called it does two main things:

Check that the attributed text that it receives is equal to the existing attributed text in the underlying backed up view ( backedTextInputView)
If not set the attributed text of the backed up view to the value passed into the method. This kills the dictation as it is effectively the equivalent of typing in the backed up text view.
    self.backedTextInputView.attributedText = attributedText;
is the problem. It kills the dictation. It may have other effects as well.

In all cases I have seen the underlying text of the attributed string that is passed in the same as the text in the backedTextInputView, what was said to the dictation; however the attributes are different, which causes the isEqualToAttributedString: check to fail and thus the update happens, and the keyboard is killed.

Fix is to test for the underlying string equality not the attributed string equality when the input mode is dictation.

By necessity this had to be an integration test on an existing application. To test I enabled the keyboard and started the dictation. It worked with this fixes and not without. Will upload videos later.

This might break attributes on dictation, as it is happening. However anything set on the existing underlying text view should hold.

[IOS] [BUG] [Textinput] fixed an issue where the keyboard dictation ended abruptly.
Closes https://github.com/facebook/react-native/pull/19687

Differential Revision: D8450590

Pulled By: hramos

fbshipit-source-id: f97084131f98e9e0ed1f32111afc0f9f510f3b3b
2018-06-15 10:37:42 -07:00
Vojtech Novak 4e1abdd74d fix permission requests on pre-M android (#19734)
Summary:
On pre-M devices, `PermissionsAndroid.request` currently returns a boolean, whereas on newer, it returns GRANTED, DENIED or other constants defined in `PermissionsModule.java`

given the example form the [docs](https://facebook.github.io/react-native/docs/permissionsandroid.html) which I guess many people use, this will lead to code that does not work before M (it will tell you that permissions are not given even if they are in the manifest).

I believe the author of [this](51efaab120) forgot to change the resolved value in this one place but changed it in other places, eg [here](51efaab120 (diff-2a74096453bc8faa5d4a1599ad0ab33fL99)).

The docs are written correctly:

> On devices before SDK version 23, the permissions are automatically granted if they appear in the manifest, so check and request should always be true.

but the code is not right because we'd need to check for `if (granted === PermissionsAndroid.RESULTS.GRANTED || granted === true) {`

Also, the behavior is done correctly in [requestMultiplePermissions](26684cf3ad/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.java (L148)) so returning a boolean is an inconsistency.

I tested this locally. The code is the same as on line [148](26684cf3ad/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.java (L148)) where it is done correctly.

[ANDROID] [BUGFIX] [PermissionAndroid] - return GRANTED / DENIED instead of true / false on pre-M android

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/19734

Differential Revision: D8450402

Pulled By: hramos

fbshipit-source-id: 46b0b7f83f81d817d60234f155d43de7f57248c7
2018-06-15 10:37:42 -07:00
gengjiawen 86d8c7a9b3 Bugfix/ci lint proguard (#19724)
Summary:
* avoid lint to interrupt ci
* add proguard rules
pass all ci
none
 [GENERAL] [ENHANCEMENT] [CI] - Fix lint and proguard
Closes https://github.com/facebook/react-native/pull/19724

Differential Revision: D8446721

Pulled By: hramos

fbshipit-source-id: b21c5418210b27dda6a7194995a25df39af0c92a
2018-06-15 08:01:51 -07:00
Héctor Ramos 5fd5e6b230 Revert "Bump soloader to 0.5.0 (#19676)" (#19739)
Summary:
This reverts commit e3c5524bc6.
Closes https://github.com/facebook/react-native/pull/19739

Differential Revision: D8446714

Pulled By: hramos

fbshipit-source-id: 1b0e78fe57e9864faafcc766364bd76a1ba5bd03
2018-06-15 07:47:43 -07:00
Peter van der Zee b8402852a2 Bump Metro dep in RN preset to 39.1, preset to 5.0.2
Reviewed By: rubennorte

Differential Revision: D8445528

fbshipit-source-id: e8937509bb1384a2d62e880c860306d8c86dab92
2018-06-15 07:22:09 -07:00
Vojtech Novak 1723b6cd9c Checkbox to inherit from AppCompatCheckBox (#18318)
Summary:
The checkbox components inherits from `android.widget.CheckBox`. `AppCompatCheckBox` offers better appearance and support for advanced features (eg. tinting) on older APIs.

~~However, the build fails for some reason; If somebody could shed some light on this, I'd appreciate it.~~ Thanks for the comment, I was being blind and somehow ignored the BUCK file.

I have created a simple app with a checkbox.

Screenshot from android 4.1 (current master):

<img src="https://user-images.githubusercontent.com/1566403/37357997-2d34bdb8-26ea-11e8-8c77-709a4f96c6bf.png" width="300" />

Screenshot after applying the change, also android 4.1:

<img src="https://user-images.githubusercontent.com/1566403/37358016-3c28fb86-26ea-11e8-8dca-3a92e41450c9.png" width="300" />

https://github.com/facebook/react-native/pull/18300 (this PR is needed to support tinting on older android api levels)

[ANDROID]  [ENHANCEMENT]  [Checkbox] - Checkbox inherits from AppCompatCheckBox
Closes https://github.com/facebook/react-native/pull/18318

Differential Revision: D7268393

Pulled By: hramos

fbshipit-source-id: 01cb2819f4d56c4e0f94cdd1fb5e1a90667a398a
2018-06-15 00:30:49 -07:00