Commit Graph

14635 Commits

Author SHA1 Message Date
Valentin Shergin d517214dd4 Fabric: Fixed missing text on some views with borders
Summary: Apparently, after updating CALayer props we have to request redrowing on top of it manually.

Reviewed By: mdvacca

Differential Revision: D10053340

fbshipit-source-id: f87311399bab809c9e13a3076f526bbe3f7f3fb4
2018-09-26 13:20:33 -07:00
Valentin Shergin 84fbad6215 Fabric: Safer UIManager deallocation and uninstallation
Summary: We have to uninstall UIManager synchronously to avoid a race condition when JS is capable to call already deallocated UIManager.

Reviewed By: mdvacca

Differential Revision: D10033406

fbshipit-source-id: 194d1ae2dd5ab09b036b1c165de289ada8e66014
2018-09-26 10:18:39 -07:00
Valentin Shergin 6af687dec5 Fabric: RCTSurfacePresenter & thread-safety
Summary:
Instead of wrapping all public methods into The controller you requested could not be found. blocks/mutexes, RCTSurfacePresenter utilizes a different thread-safety pattern where all instance variable are granularly thread-safe.
The names of all internal methods were prefixed by '_'.

Reviewed By: mdvacca

Differential Revision: D10033407

fbshipit-source-id: 97fd2879c879dd9ef8d9ece24e25af00f749a871
2018-09-26 10:18:39 -07:00
Valentin Shergin c69313fc52 Fabric: Start/stop Surface calls were moved down to C++ layer
Summary:
There is no need to make JS calls to start or stop React Native apps; Scheduler does it automatically. Yay!

With this change (because we have to change Scheduler API) we are starting slow process migrating away from using term `reactRootTag` when we refer to running a ReactNative app (aka Surface). We will use `surfaceId` instead. We plan to slowly and gracefully retire `reactTag` term entity replacing it with several appropriate entities specific for particular usage, e.g. `viewId` (some id which makes sense for mounting), `surfaceId`, `nodeId` (unique id representing nodes which were cloned from the original one), or `eventTarget`.

Reviewed By: mdvacca

Differential Revision: D9999336

fbshipit-source-id: bbc7303c195b070b8c235c9ca35546d1dc693e98
2018-09-26 10:18:39 -07:00
Valentin Shergin b91f6d1e93 Fabric: Using EventBeatBasedExecutor to ensure threading during installing UIManager
Summary: This is the last step before making JSIUIManagerInstaller a direct dependency of UIManager (and making UIManager installation process completely seamless/platform-agnostic).

Reviewed By: mdvacca

Differential Revision: D9995781

fbshipit-source-id: 6f8c7177495b01ebaac1dbe330f49dce2e2a552c
2018-09-26 10:18:38 -07:00
Valentin Shergin 78746afd92 Fabric: Introducing EventBeatBasedExecutor
Summary:
EventBeatBasedExecutor is an executor derived from EventBeat and using EventBeat to ensure proper threading.
Why do we need yet another executor? Because otherwise, we have to make it platform specific-dependency that each platform-specific implementation has to implement and provide. We already have all that we need in already provided EventBeat, so we can just convert that into simple executor in a platform-agnostic way.

Reviewed By: mdvacca

Differential Revision: D9995783

fbshipit-source-id: f8aa72a9744e50ebecbea9ad0e2546f41f5358f2
2018-09-26 10:18:38 -07:00
Valentin Shergin 08961c1e97 Fabric: Lazy ContextContainer creation in RCTSurfacePresenter
Summary: Besides that it's more simple and straight-forward now, we need that to always instantiate Scheduler with a context full of fresh valid objects derived from the new instance of the bridge.

Reviewed By: mdvacca

Differential Revision: D9995780

fbshipit-source-id: 534a314152d93562b08dd7857962f174b0d06886
2018-09-26 10:18:38 -07:00
Valentin Shergin 7420048b63 Fabric: RCTSurface's start and stop methods
Summary:
The original design of RCTSurface implied that the Surface starts on initialization and stops on deallocation. Recently I realized that this not sufficient API in some cases when the application uses ARC with autorelease pools (that can postpone object deallocations, which is highly undesirable).
And that's simply handy to have those methods sometimes.

Reviewed By: mdvacca

Differential Revision: D9982356

fbshipit-source-id: baa3bd24804d3708606ebd00b8795f2d5c9d4de9
2018-09-26 10:18:38 -07:00
Valentin Shergin b7584122a1 -[RCTSurfaceHostingView createSurfaceWithBridge:...] promoted to class method
Summary: We call this method in a constructor before the actual object is beeing constructed, so it's incorrect; it should be class method.

Reviewed By: mdvacca

Differential Revision: D9931315

fbshipit-source-id: 304ba8e2354f3f408cfa2bf1729266525a08f951
2018-09-26 10:18:38 -07:00
Valentin Shergin bce94dc8c3 Fabric: Polishing RCTSurfacePresenter
Summary:
Now RCTSurfacePresenter is uniquely responsible for:
* Starting and stopping JS apps;
* Restarting JS apps during hot-reload;
* Recreating Scheduler during hot-reload.

Reviewed By: mdvacca

Differential Revision: D9931318

fbshipit-source-id: a6a3fb58814222f71cc6cb2caad620ed6319089d
2018-09-26 10:18:38 -07:00
Valentin Shergin 24ffd8f6fb Fabric: Polishing RCTFabricSurface
Summary: All integration with Bridge was removed from RCTFabricSurface, now it's Surface's responsibility to start and stop JS app and register the ShadowTree in the Scheduler.

Reviewed By: mdvacca

Differential Revision: D9931317

fbshipit-source-id: 55a682f0afb1c542a904e1a8570029e4690967cc
2018-09-26 10:18:38 -07:00
Valentin Shergin 4a8613f40f Fabric: UIManager's API for installing and uninstalling itself
Summary: UIManager now can install and uninstall itself calling a functions that are provided as constructor arguments.

Reviewed By: mdvacca

Differential Revision: D9931329

fbshipit-source-id: b8d2d9925b0e2db0fed44bdf2e185d198fabd5ee
2018-09-26 10:18:38 -07:00
Valentin Shergin bcdf81918b Fabric: Enumerator for RCTSurfaceRegistry
Summary: Now we have a way to enumerate surfaces stored in RCTSurfaceRegistry.

Reviewed By: mdvacca

Differential Revision: D9931316

fbshipit-source-id: 6b886c4b52cebddf15fef0239190fb2730d682cc
2018-09-26 10:18:38 -07:00
Janic Duplessis 458d56c0a1 Remove global babelHelpers and regenerator (#21283)
Summary:
Follow up to 8932a9caa8

Babel helpers and regenerator runtime will be imported automatically from `babel/runtime`. We still need to add the global regeneratorRuntime for jest tests since we disable babel-runtime currently.
Pull Request resolved: https://github.com/facebook/react-native/pull/21283

Reviewed By: mjesun

Differential Revision: D10010963

Pulled By: rafeca

fbshipit-source-id: da5e23dd901f8f8940d46816b4fc9290d0e28c76
2018-09-26 10:03:05 -07:00
Héctor Ramos 544adcaf4f Test Xcode 10 (#21324)
Summary:
This also fixes an issue with tagged commit Circle CI jobs, and avoids running the `publish_npm_package` on every commit. The new config ignores commits on *all branches*, but should still catch git tags.
Pull Request resolved: https://github.com/facebook/react-native/pull/21324

Differential Revision: D10041629

Pulled By: hramos

fbshipit-source-id: 9b3295b5fcd614c67a8838ffd49c6a5d6ae7fd86
2018-09-25 20:39:55 -07:00
empyrical 2da60a8f45 Prettify remaining unprettified files (#21327)
Summary:
This PR is the result of running `yarn prettify` on the codebase - which caught a few files that were not prettified. This will make instructing people to run prettify a bit less complicated, since unrelated files will not show up in diffs.
Pull Request resolved: https://github.com/facebook/react-native/pull/21327

Differential Revision: D10046057

Pulled By: TheSavior

fbshipit-source-id: 2c771a3c758c72816c707e32ee2f4587e466f277
2018-09-25 19:50:08 -07:00
empyrical ae1817fdb9 RNTester: Remove all but one instance of PropTypes (#21321)
Summary:
Part of: https://github.com/react-native-community/discussions-and-proposals/issues/29

This PR removes all but one instance of PropTypes in `RNTester`. The last remaining conversion is `CameraRollView`, which I will do in a separate PR.
Pull Request resolved: https://github.com/facebook/react-native/pull/21321

Differential Revision: D10041809

Pulled By: TheSavior

fbshipit-source-id: c03b1ce5ad640ae59ae6240a3b6c13581345b5a3
2018-09-25 17:17:37 -07:00
David Aurelio 6bcc1dfcc8 Set up Yoga experiment
Reviewed By: priteshrnandgaonkar

Differential Revision: D9943869

fbshipit-source-id: 6b6550f453ab4e0ab8305401b299f2d0ed415f72
2018-09-25 15:48:03 -07:00
David Aurelio 27a3bdb886 Adapt methods for fast calls
Summary:
Changes all possible native JNI methods to critical methods.

For now, this only changes Android up and including v7. In order to be prepared for the `CriticalNative` annotation in Android v8, the following restrictions apply:

- Qualifying methods must be static (this is also enforced for Dalvik / Android v4)
- Method implementations can only consume primitive JNI types (`boolean`, jchar`, etc.)

Reviewed By: priteshrnandgaonkar

Differential Revision: D9943868

fbshipit-source-id: 728817eb37822b717fd3daf94cd9f02b42c17db6
2018-09-25 15:48:03 -07:00
David Aurelio ee6c1ecef0 Make native method binding configurable
Summary:
Moves binding of native methods into a separate native method that can be parameterized.

This will be used to experiment with JNI-related technology.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9943870

fbshipit-source-id: 661f15537d5bbf7a3eef7717e3d99fed2de23904
2018-09-25 15:48:03 -07:00
Matias Colotto 201f2f189f ReactScrollView should account for `overflow: scroll`
Summary:
Support for `overflow: visible` was recently added to Android ScrollView.
However, it didn't account for `overflow: scroll` and changed the behavior, causing content to render
when before it would be clipped.

Reviewed By: achen1

Differential Revision: D10036807

fbshipit-source-id: e44a79b18eecbc7d64621f7cf5d800a00a121b13
2018-09-25 15:04:01 -07:00
Ramanpreet Nara 1323acd0bb Fix RNTester build failure in CI (#21304)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/21304

If you cd into `~/fbsource/xplat/js/react-native-github` and run:

```
xcodebuild -project RNTester/RNTester.xcodeproj -scheme RNTester -configuration Release -sdk iphonesimulator -derivedDataPath RNTester/build -quiet
```

The command fails with the following error:
```
➜  react-native-github xcodebuild -project RNTester/RNTester.xcodeproj -scheme RNTester -configuration Release -sdk iphonesimulator -derivedDataPath RNTester/build -quiet
=== BUILD TARGET RNTester OF PROJECT RNTester WITH CONFIGURATION Release ===
+ DEST=/Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app
+ [[ Release = *Debug* ]]
+ [[ -n '' ]]
+ case "$CONFIGURATION" in
+ DEV=false
+++ dirname /Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/../scripts/react-native-xcode.sh
++ cd /Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/../scripts/..
++ pwd
+ REACT_NATIVE_DIR=/Users/ramanpreet/fbsource/xplat/js/react-native-github
+ cd /Users/ramanpreet/fbsource/xplat/js/react-native-github/../..
+ '[' -z '' ']'
+ export NVM_DIR=/Users/ramanpreet/.nvm
+ NVM_DIR=/Users/ramanpreet/.nvm
+ [[ -s index.ios.js ]]
+ ENTRY_FILE=RNTester/js/RNTesterApp.ios.js
+ [[ -s /Users/ramanpreet/.nvm/nvm.sh ]]
++ command -v brew
+ [[ -x /usr/local/bin/brew ]]
++ brew --prefix nvm
+ [[ -s /usr/local/Cellar/nvm/0.33.11/nvm.sh ]]
+ [[ -x /Users/ramanpreet/.nodenv/bin/nodenv ]]
++ command -v brew
+ [[ -x /usr/local/bin/brew ]]
++ brew --prefix nodenv
+ [[ -x /usr/local/Cellar/nodenv/1.1.2/bin/nodenv ]]
+ '[' -z node ']'
+ '[' -z '' ']'
+ export CLI_PATH=/Users/ramanpreet/fbsource/xplat/js/react-native-github/local-cli/cli.js
+ CLI_PATH=/Users/ramanpreet/fbsource/xplat/js/react-native-github/local-cli/cli.js
+ '[' -z '' ']'
+ BUNDLE_COMMAND=bundle
+ [[ -z '' ]]
+ CONFIG_ARG=
+ type node
+ BUNDLE_FILE=/Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app/main.jsbundle
+ node /Users/ramanpreet/fbsource/xplat/js/react-native-github/local-cli/cli.js bundle --entry-file RNTester/js/RNTesterApp.ios.js --platform ios --dev false --reset-cache --bundle-output /Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app/main.jsbundle --assets-dest /Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app
warning: the transform cache was reset.
Loading dependency graph, done.

Unable to resolve module `babel/runtime/helpers/classCallCheck` from `/Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/js/RNTesterApp.ios.js`: Module `babel/runtime/helpers/classCallCheck` does not exist in the Haste module map

This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  1. Clear watchman watches: `watchman watch-del-all`.
  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.

Error: Unable to resolve module `babel/runtime/helpers/classCallCheck` from `/Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/js/RNTesterApp.ios.js`: Module `babel/runtime/helpers/classCallCheck` does not exist in the Haste module map

This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  1. Clear watchman watches: `watchman watch-del-all`.
  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.
    at ModuleResolver.resolveDependency (/Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:209:1301)
    at ResolutionRequest.resolveDependency (/Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:83:16)
    at DependencyGraph.resolveDependency (/Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/node-haste/DependencyGraph.js:238:485)
    at Object.resolve (/Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/lib/transformHelpers.js:180:25)
    at dependencies.map.result (/Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/DeltaBundler/traverseDependencies.js:311:29)
    at Array.map (<anonymous>)
    at resolveDependencies (/Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/DeltaBundler/traverseDependencies.js:307:16)
    at /Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/DeltaBundler/traverseDependencies.js:164:33
    at Generator.next (<anonymous>)
    at step (/Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/DeltaBundler/traverseDependencies.js:266:307)

+ [[ false != true ]]
+ [[ ! -f /Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app/main.jsbundle ]]
+ echo 'error: File /Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app/main.jsbundle does not exist. This must be a bug with'
error: File /Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app/main.jsbundle does not exist. This must be a bug with
+ echo 'React Native, please report it here: https://github.com/facebook/react-native/issues'
React Native, please report it here: https://github.com/facebook/react-native/issues
+ exit 2
** BUILD FAILED **
```

Basically, we're missing the `babel/runtime/helpers/classCallCheck` function. Installing `babel/runtime` fixed the issue.

Reviewed By: mjesun

Differential Revision: D10021475

fbshipit-source-id: 3709bedb2fdaf552fa8c620c3515a5bc68deb771
2018-09-25 13:32:54 -07:00
Andrew Chen (Eng) 59aada873e Remove overflow hidden killswitch
Summary: There hasn't been any reports of overflow issues since the last issue was fixed in v183 (July 30th). Let's remove this flag

Reviewed By: yungsters

Differential Revision: D10020006

fbshipit-source-id: 593c7d2c2bef5f0bd60d5de1941cd58f7fd6ccc7
2018-09-25 11:52:19 -07:00
empyrical 0a04bb7030 TabBarIOS: Remove PropTypes (#21315)
Summary:
Part of: https://github.com/react-native-community/discussions-and-proposals/issues/29

This PR removes the prop types from the TabBarIOS files, and cleans up their flow types.
Pull Request resolved: https://github.com/facebook/react-native/pull/21315

Reviewed By: TheSavior

Differential Revision: D10031191

Pulled By: rsnara

fbshipit-source-id: 50dc26b858ea5b065a3934080af7e6b0e36c7f46
2018-09-25 11:02:10 -07:00
David Vacca b41ce43c07 Move folder and packages from 'fabricxx' to 'fabric'
Summary: This diff renames fabricxx into fabric

Reviewed By: achen1

Differential Revision: D10013410

fbshipit-source-id: 75d73ace6957d706d39bb87118140bb642bed747
2018-09-25 02:30:04 -07:00
David Vacca a5f1d79adf Move fabric dependecies out of OSS instrumentation tests (#21306)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/21306

This diff moves fabric dependencies out of OSS instrumentation tests (js/react-native-github/ReactAndroid/src/androidTest/java/com/facebook/react/testing/BUCK), this will un-break build of OSS project in CI.

Reviewed By: rsnara

Differential Revision: D10020517

fbshipit-source-id: e2cf23afeeecf4cfb41345742f59c16af6b108d0
2018-09-25 02:30:04 -07:00
Alican Çubukçuoğlu 783cb8e4a6 Export ImageURISource type (#21305)
Summary:
Exporting ImageURISource because we needed to use it in a custom Image component. This should be a case for other people too since handling of `number` ImageSources and `ImageURISource` ImageSources are way different.

Release Notes:
--------------

[GENERAL] [ENHANCEMENT] [Image] - Export "ImageURISource" Flow type
Pull Request resolved: https://github.com/facebook/react-native/pull/21305

Differential Revision: D10024160

Pulled By: rsnara

fbshipit-source-id: f074148345285217014b6ba6735cfdf3508563b5
2018-09-24 20:48:20 -07:00
empyrical 6b892141cc Remove PropTypes from Modal.js (#21279)
Summary:
This PR converts the Prop Types in `Modal` to Flow Types, and fills out the callback types a bit more.

Context Types are left in for now.
Pull Request resolved: https://github.com/facebook/react-native/pull/21279

Reviewed By: yungsters

Differential Revision: D10006795

Pulled By: TheSavior

fbshipit-source-id: ac885f2e5f068b0991009a9b1cbb3886e34941af
2018-09-24 15:20:58 -07:00
Martin Arista 9d03c69615 Update links & Add Code of Conduct (#21296)
Summary:
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/21296

Differential Revision: D10016120

Pulled By: hramos

fbshipit-source-id: 45c92241c5e09f8a8ba1c9cfff4c24f291845117
2018-09-24 13:53:48 -07:00
empyrical cd1d3ceffe StatusBar: Remove PropTypes (#21293)
Summary:
Part of: https://github.com/react-native-community/discussions-and-proposals/issues/29

This PR removes the remaining PropTypes from `StatusBar` and moves its flowtypes to its own definition.
Pull Request resolved: https://github.com/facebook/react-native/pull/21293

Differential Revision: D10012963

Pulled By: TheSavior

fbshipit-source-id: 7fb4e416eb49e7860809a3e2aaf157590908687d
2018-09-24 13:23:54 -07:00
Valentin Shergin 031037f491 Fabric: Cleaning up Shadow Tree on surface unregistering
Summary: As it mentioned in the comment, we have to commit an empty tree as part of cleaning up Surface.

Reviewed By: mdvacca

Differential Revision: D9931320

fbshipit-source-id: 04e780bafdb917adeb89f2edef2dc0348b2a4d4a
2018-09-24 13:03:12 -07:00
Valentin Shergin 55e168980f Fabric: ContextContainer initialization was moved to RCTSurfacePresenter
Summary:
Several reasons:

* We are fulfilling a promise that RCTScheduler is just a very thin interop proxy between C++ and Objective-C;
* We have to pass all parameters down to Scheduler anyway, so instead of creating all of them separately and then passing one-by-one, we consolidate them into Context created where we have all those values.

In the future, we probably will move it to some dedicated place.

Reviewed By: mdvacca

Differential Revision: D9884892

fbshipit-source-id: f1d5744e4044bc4bdfe53ec9a97ee61dcf0c60c2
2018-09-24 13:03:11 -07:00
Valentin Shergin 60a4faa578 Fabric: Proper includes in ContextContainer
Summary: Trivial. Suddenly, compiler is unhappy without all proper headers.

Reviewed By: mdvacca

Differential Revision: D9884891

fbshipit-source-id: 7a5b175923f06bdb87bff8c9aad9f4ee40febbe9
2018-09-24 13:03:09 -07:00
gengjiawen 0a2825f8b3 add x86_64 arm64-v8a support. Fixes #2814 (#18754)
Summary:
add arm64 support, related issue : https://github.com/facebook/react-native/issues/2814.
If we are okay with binary aar android-jsc, then the pr can be directly merged. Otherwise merge facebook/android-jsc#30 first and do a new release.

RNTester all variant works. You can also test the apk from here: https://github.com/gengjiawen/react-native/releases/tag/v0.56beta.

https://github.com/facebook/android-jsc/pull/30.

 [ANDROID] [ENHANCEMENT] [ABI] - add x86_64 arm64-v8a support.

Differential Revision: D9491481

Pulled By: hramos

fbshipit-source-id: d6ec6992768eb0c0866a0317273e09fae5b8935e
2018-09-24 11:32:56 -07:00
David Vacca ef863c0679 Remove unused parameters in ReactInstanceManager methods
Summary: Just a small diff to remove some unused parameters in some methods of the ReactInstnaceManager class

Reviewed By: achen1

Differential Revision: D10011168

fbshipit-source-id: 2247ecd01bfc63c27837c6abad4bff1b4e590ac0
2018-09-24 11:17:59 -07:00
empyrical 93717e3f17 SnapshotViewIOS: Remove PropTypes (#21294)
Summary:
Part of: https://github.com/react-native-community/discussions-and-proposals/issues/29

This PR removes all PropTypes from `SnapshotViewIOS`, and fills out the flow types for its event callbacks.
Pull Request resolved: https://github.com/facebook/react-native/pull/21294

Differential Revision: D10011659

Pulled By: TheSavior

fbshipit-source-id: 28bfa0ab58c0655f9b905d3cb6530b57166c67f9
2018-09-24 11:02:21 -07:00
Oleg Lokhvitsky e0170a9445 Android ScrollView fix for pagingEnabled
Summary:
The snapToOffsets changes improved the flinging algorithm for snapToInterval/snapToOffsets but actually broke it for pagingEnabled because it's meant to only scroll one page at a time.

First, I just brough back the old algorithm, but noticed that it has a bunch of issues (e.g. #20155). So, I tried to improve the algorithm to make sure it uses the proper target offset prediction using the same physics model that Android uses for it's normal scrolling but still be limited to one page scrolls.

This resolves #21116.

Reviewed By: shergin

Differential Revision: D9945017

fbshipit-source-id: be7d4dfd1140f4c4d32bad93a03812dc80286069
2018-09-24 10:22:23 -07:00
Rafael Oleza 28dedfb6d6 Cleanup the transformer flow types
Summary:
Since the options that are passed to the `babelTransformer` are not exactly the same ones as the `transformer` receives, we need to have a specific object for them.

This allows us to make the transformer options object strict (since unfortunately the `babeltransformer` options object comes from many places and needs a bit of work to be able to be strict...

Reviewed By: mjesun

Differential Revision: D9309173

fbshipit-source-id: 0a92381968f17e5eb6c4740c1ca89580fa7ee4d3
2018-09-24 10:22:23 -07:00
Rafael Oleza 2e0d5c87e9 Remove absolute path parameter from transformers
Summary:
Up until now, transformers in Metro received the absolute path of a file, the relative path of a file and the projectRoot.

This diff gets rid of the absolute path sent to the worker, since by having the projectRoot and the relative path, the absolute path can be easily calculated.

This has been done to avoid having absolute paths as transform options, since we need to have custom logic to filter them out from the cache key generation, which is dangerous.

Reviewed By: mjesun

Differential Revision: D9195147

fbshipit-source-id: e95c5c29272eec7f1a48af7cede4c6d6b4a8ffb7
2018-09-24 10:22:23 -07:00
Oleg Lokhvitsky 4af4da9089 Android ScrollView support for `overflow: visible`
Summary:
ScrollView always clipping children on Android even when `overflow: visible` was specified.
This change just omits the clipping during draw if `overflow: visible` is passed in.
The default is not changed (from hidden to visible) in case there is a performance impact.
Android now matches iOS in behavior. This helps with issue #21116 and resolves #14416.

Reviewed By: shergin

Differential Revision: D9952096

fbshipit-source-id: 367afe33ee7ff0fdc5aa1074d239883aa289888a
2018-09-24 10:22:23 -07:00
Rafael Oleza e741ff8aa1 Bump metro@0.46.0
Summary: monkey_publish

Reviewed By: jeanlauliac

Differential Revision: D10009619

fbshipit-source-id: cde0a979e44940140c61494b35ac495c822d6f30
2018-09-24 08:20:30 -07:00
Jean Lauliac 9c242c8a2f react-native-github: set path mock to posix by default
Summary:
@public

Otherwise tests using `path` but not `fs` have an empty mock, as it happens on https://github.com/facebook/metro/issues/235#issuecomment-423722747

Reviewed By: mjesun

Differential Revision: D10008513

fbshipit-source-id: 673e2ca79c8105a68818985dc08fe7ccd5d13881
2018-09-24 06:32:24 -07:00
Kevin Leung 65e4e674fc Android subpixel text (#19043)
Summary:
<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

Fixes inconsistency in custom font rendering in android. See explanation below.

<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->

I tested the following on my physical device (Sony Z5C) and on Android emulator on Mac.
The test app contains various fonts in the AvenirNext family, which are added to the app as `.ttf` format.

Note that the character "thickness" is inconsistent. Some characters looks thicker than other. See the screenshots below as an example:
- Looks thicker: right half of the `g` and `&` as in "Region & Language" (list-view screen)
- Looks thicker: `w` as in `Change Password` (list-view screen)
- Looks vertically compressed: `a` and `e` as in "Message" in the bottom bar (list-view screen)
- Looks thicker: `A`, `N`, `V`, `v` (paragraph screen)
- Looks thinner: `i` (paragraph screen), it leaves extra space on its right hand side

![screenshot_20180427-151129](https://user-images.githubusercontent.com/1103788/39350754-ae9fafe2-4a31-11e8-8835-97280783bb95.png)
![screenshot_20180427-151419](https://user-images.githubusercontent.com/1103788/39350755-aecc9bba-4a31-11e8-8128-2d230f003dfa.png)

Every characters has consistent "weight" and looks nice:

![screenshot_20180427-150835](https://user-images.githubusercontent.com/1103788/39350753-ae698728-4a31-11e8-8a55-4e161c559b95.png)
![screenshot_20180427-151639](https://user-images.githubusercontent.com/1103788/39350756-aef95d44-4a31-11e8-820b-1a7dee77fabe.png)

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

None

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

[ANDROID] [ENHANCEMENT] [CustomStyleSpan] - Enable subpixel text rendering

<!--
  **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
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/19043

Differential Revision: D10008155

Pulled By: hramos

fbshipit-source-id: 7fe9bb0f9be80380947ff80eac522e3cfd6b22cf
2018-09-24 02:03:31 -07:00
Krzysztof Ciombor 4d71b1525d Fix event handlers for DPad arrows on Android TV (#21143)
Summary:
<!--
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.
-->

Fixes #20924
DPad arrow events were missing from `KEY_EVENTS_ACTIONS` which meant that they were not broadcasted by `TVEventHandler`.
Pull Request resolved: https://github.com/facebook/react-native/pull/21143

Differential Revision: D10007851

Pulled By: mdvacca

fbshipit-source-id: 9a03cad249a4a1917975d1de10b6112e69d32a72
2018-09-24 00:47:07 -07:00
empyrical 421667ccae Picker: Remove PropTypes (#21281)
Summary:
Part of: https://github.com/react-native-community/discussions-and-proposals/issues/29

This pull request removes all PropTypes from the various files for `Picker` and cleans up their flow types.
Pull Request resolved: https://github.com/facebook/react-native/pull/21281

Differential Revision: D10007224

Pulled By: TheSavior

fbshipit-source-id: 5b8b7918cc918dd77e7ab27c9e3921ffbeb4ff73
2018-09-23 22:50:40 -07:00
empyrical afb7fc2aab Button: Remove PropTypes (#21280)
Summary:
Part of: https://github.com/react-native-community/discussions-and-proposals/issues/29

This PR removes the `prop-types` from the `Button` component, and cleans up its flow type definitions.
Pull Request resolved: https://github.com/facebook/react-native/pull/21280

Differential Revision: D10007108

Pulled By: TheSavior

fbshipit-source-id: 6206f7e8aab5b56abc5e8e0790a1020494eb2bf0
2018-09-23 19:32:46 -07:00
Janic Duplessis 53bb283fb3 Fix flow type for maxFontSizeMultiplier on TextInput (#21271)
Summary:
This flow type is wrong, probably just a copy paste mistake.
Pull Request resolved: https://github.com/facebook/react-native/pull/21271

Differential Revision: D10006741

Pulled By: TheSavior

fbshipit-source-id: eba0116ec39ba00f000d9bf789ae9214990355a1
2018-09-23 16:11:24 -07:00
Héctor Ramos b0946006e7 Deploy to npm on tagged commits only (#21250)
Summary:
This PR applies some fixes I made to the 0.57-stable branch to ensure we only run on commits tagged as "v0.57.1", as an example. This also ensures we only deploy after all tests pass.
Pull Request resolved: https://github.com/facebook/react-native/pull/21250

Differential Revision: D10003666

Pulled By: hramos

fbshipit-source-id: 22d5e674ca925dce53d0ddf0e12c64dc82ec7aa1
2018-09-22 09:16:58 -07:00
Ram N c31f79fe47 Remove class loads for CoreModulesPackage
Summary: CoreModulePackages was following the old way of adding Native Modules to the Array list. This diff changes it to use names instead of class.

Reviewed By: achen1

Differential Revision: D9996803

fbshipit-source-id: a6c3daf2193a2559db0908f9e26e339e03e4f8c7
2018-09-21 21:17:57 -07:00
Janic Duplessis 36033bd0ed Use babel runtime instead of relying on global babelHelpers and regenerator (#198)
Summary:
**Summary**

The RN transformer currently relies on the enviroment providing babelHelpers and regeneratorRuntime as globals by using 'babel-external-helpers'. This wasn't really a problem before since helpers were stable and we could maintain our copy easily but it seems like there are more now with babel 7 and it makes sense to include only those used by the app.

This is exactly what babel/transform-runtime does. It will alias all helpers and calls to regeneratorRuntime to files in the babel/runtime package.

This will solve issues like this https://github.com/facebook/react-native/issues/20150 caused by missing babelHelpers. This solution also avoids bloating babelHelpers to fix OSS issues like the one linked before.

**Test plan**

- Updated tests so they all pass.
- Tested that it actually works by applying the changes locally in an RN app.
- Added a test for async functions, to make sure regenerator is aliased properly and doesn't depend on the global.
- Made sure require-test.js still fails if the require implementation contains babel helpers (by adding an empty class in the file).
Pull Request resolved: https://github.com/facebook/metro/pull/198

Reviewed By: mjesun

Differential Revision: D8833903

Pulled By: rafeca

fbshipit-source-id: 7081f769f288ab358ba89ae8ee72a513bb12e225
2018-09-21 16:17:40 -07:00