Commit Graph

12153 Commits

Author SHA1 Message Date
Tomislav Tenodi 3c5a55ddc2 Add notes for React Native monthly #5
Summary:
A blog post with notes from the second React Native monthly meeting. I've gathered notes after the meeting in this blog post.

No test plan, submitting just a documentation file.

[DOCS] [ENHANCEMENT] [blog/2017-11-06-react-native-monthly-5.md] - Submitting notes from React Native monthly #5.

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

Differential Revision: D6259640

Pulled By: hramos

fbshipit-source-id: 328ab6018300bef91bdc8561ac8cbd64d3d93129
2017-11-07 08:08:41 -08:00
Jean Lauliac 503b4521a6 metro-bundler: allow different run-before-main-module depending on entry point
Reviewed By: davidaurelio

Differential Revision: D6248242

fbshipit-source-id: 9471820fce926e676170e3024bd48c9d7335c1a7
2017-11-07 07:43:46 -08:00
Omri Gindi a6465d1c17 Backed out changeset 322626be193e
Reviewed By: wutalman

Differential Revision: D6258856

fbshipit-source-id: 392dc91f87148c70817f13858a7fcd368f028b2d
2017-11-07 04:53:40 -08:00
Janic Duplessis 164591218f Add prettier config, format script and reformat files
Summary:
Prettier 1.7.0 has config file + pragma support so this works really well with the current prettier usage. Also added a prettier script to run it (taken mostly from the relay repo) and ran it which caused 1 files to change (probably wasn't updated when upgrading prettier to 1.7.0).

**Test plan**
Made sure flow still checked
Run 'yarn prettier', should format only files with `format` using the config in package.json.
Closes https://github.com/facebook/react-native/pull/16176

Differential Revision: D6256899

Pulled By: shergin

fbshipit-source-id: 646d90c15db8032b7b551da228d26d370babf125
2017-11-06 20:33:56 -08:00
Alex Dvornikov f1258181ee Rename "js-bundles" to "js-segments"
Differential Revision: D6244399

fbshipit-source-id: d1606d126e3b598b19fa8a0955438c8dec76f5d0
2017-11-06 18:25:52 -08:00
William Li 26038f50bb Export YellowBox API
Summary:
Allow end users to access the YellowBox API so that warnings can be properly ignored via the API first introduced in a974c140db. Based on that API, you should be able to do the following:

```
import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['Warning: ...']);
```

However, if you actually try this today, it results in a broken import error.

Verified using an expo instance. First tried without the YellowBox import, observed a failure to import. Then I added the import statement, and observed no warning on my device.

```
import React from 'react';
import { StyleSheet, Text, View, YellowBox } from 'react-native';

YellowBox.ignoreWarnings(['hey']);

export default class App extends React.Component {
  render() {
    console.warn('hey!');
    return (
      <View style={styles.container}>
        <Text>Open up App.js to start working on your app!</Text>
        <Text>Changes you make will automatically reload.</Text>
        <Text>Shake your phone to open the developer menu.</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});
```

[GENERAL] [ENHANCEMENT] [YellowBox] - Export YellowBox API so warnings can be ignored using a non-deprecated API.
Closes https://github.com/facebook/react-native/pull/16709

Differential Revision: D6254819

Pulled By: hramos

fbshipit-source-id: ff92f32e4dedfb01f6902f54fabc62eb64468554
2017-11-06 17:44:37 -08:00
Jessica Cao 2be3ae1ff2 Add ?Fbt to flow type for the title & message props
Differential Revision: D6253195

fbshipit-source-id: eadb185eacdf341393d73357beab22bed1d0169e
2017-11-06 16:24:22 -08:00
Marc Horowitz 515eb0e801 Fix a race condition in the animation module
Summary:
update() is called from the choreographer, so it can be
invoked asynchronously relative to RN.  If it's called while the node
tree is incomplete, this can be called with no parent.  Don't treat an
unparented node as an invariant failure, just skip over it.

Reviewed By: AaaChiuuu

Differential Revision: D6249038

fbshipit-source-id: d22807dff1659bf29a81893ab97d0fe7c19de512
2017-11-06 13:49:46 -08:00
Patrick Kempff 1ee64ccb8a Add tintColor to ActionSheetIOS documentation
Summary:
This pr adds documentation for the tintColor addition of #4590

<!--
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.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

The tintColor was missing from the documentation but works perfectly fine.

Added a tintColor to showActionSheetWithOptions and showShareActionSheetWithOptions in the app i am building right now.

[DOCS][MINOR][ActionSheetIOS] - Added documentation for tintColor in ActionSheet.
Closes https://github.com/facebook/react-native/pull/16679

Differential Revision: D6248070

Pulled By: shergin

fbshipit-source-id: a2276f50b42ff2c5858008f3641c9607f248744a
2017-11-06 10:39:55 -08:00
Dmitry Zakharov fdf04953c0 Make RN Events registered disregarding ViewManager use pattern.
Reviewed By: bvaughn

Differential Revision: D6223864

fbshipit-source-id: 322626be193e5fa840d3e5477e86adaa90f2726d
2017-11-06 06:40:19 -08:00
Bartol Karuza 3f1b021506 Inverted descent/ascent Android prioritisation to match iOS lineHeight behaviour
Summary:
We noticed that on Android the lineHeight behaviour is different from iOS for built in fonts and custom fonts. The problem becomes visible when the lineHeight approaches the fontSize, showing a cut-off on the bottom of the TextView. This issue has been raised before in #10712. There is a mention of a PR with a fix in that issue, which has not been merged yet. This implementation is a less intrusive fix leaving the current lineHeight approach in place and fixing the discrepancy only.

This proposed change prioritises ascent over descent for reduction, making the lineHeight functionality behave identical to iOS.

There is no existing test covering the lineHeight property and its behaviour in the CustomLineHeightSpan. This PR contains new unit tests that covers the various scenario's for the lineHeight calculations.

The original behaviour, before the change can against these unit tests. The case that fails is `shouldReduceAscentThird`, which can be made to succeed on the old code by changing the asserts to:
```
    assertThat(fm.top).isEqualTo(-5);
    assertThat(fm.ascent).isEqualTo(-5);
    assertThat(fm.descent).isEqualTo(-4);
    assertThat(fm.bottom).isEqualTo(-4);
```
The unit test succeeds for the current implementation, which has the values for ascent and descent inverted.

Below screenshots show before, after and iOS:

BEFORE
![screen shot 2017-10-18 at 15 35 41](https://user-images.githubusercontent.com/1605731/31721688-58d7086a-b41a-11e7-8186-9a201e2acb01.png)

AFTER
![screen shot 2017-10-18 at 15 37 02](https://user-images.githubusercontent.com/1605731/31721665-473cf86c-b41a-11e7-94d5-7a70eaf99889.png)

iOS
![screen shot 2017-10-18 at 15 35 22](https://user-images.githubusercontent.com/1605731/31721712-707e30a6-b41a-11e7-9baa-f886a66837e6.png)

[ANDROID] [BUGFIX] [Text] - Fix the lineHeight behaviour on Android to match iOS
Closes https://github.com/facebook/react-native/pull/16448

Differential Revision: D6221854

Pulled By: andreicoman11

fbshipit-source-id: 7292f0f05f212d79678ac9d73e8a46bf93f1a7c6
2017-11-06 05:00:41 -08:00
Jean Lauliac b9f21dc2be react-native: BundleSegments
Reviewed By: davidaurelio

Differential Revision: D6231309

fbshipit-source-id: 565cbadedc5fd8ab25025b5846c098f24fb15a82
2017-11-06 03:46:35 -08:00
Jean Lauliac 73a01be9bc packager-worker-for-buck: transformCommand: add test
Reviewed By: davidaurelio

Differential Revision: D6232002

fbshipit-source-id: 8bdd0dd0dabff4b92b4c2d7b4c3f7a2d90723bee
2017-11-06 03:46:35 -08:00
Wei Yeh e0202e459f Fix a few more Flow warnings
Differential Revision: D6236901

fbshipit-source-id: d98c46cce83ddb45d7f9139d981595eaaeeff933
2017-11-05 12:07:46 -08:00
Robert Paul fd9c3618fc - Adding locale prop to DatePickerIOS
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.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

While building a React Native application, I've come across the use case of wanting to set a specific locale for DatePickers irrespective of the users OS region setting. Since this is a feature available to native DatePicker components, I think it would be helpful to expose this in React Native as well.

Testing can be done by passing a `locale` prop to a DatePickerIOS. Example:

```
<DatePickerIOS
  date={this.state.date}
  mode="date"
  locale="fr_FR"
  onDateChange={date => this.setState({ date: date })}
/>
```

<!--
Help reviewers and the release process by writing your own release notes

**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 ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - 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
-->
[IOS][ENHANCEMENT][DatePickerIOS] - Adding a locale prop.
Closes https://github.com/facebook/react-native/pull/16639

Differential Revision: D6241981

Pulled By: hramos

fbshipit-source-id: 77b1b85c09f3e12d6b3e103b3d1ffd1f12e2cea9
2017-11-04 14:40:24 -07:00
James Ide 38b96cd7bb Define `pod_target_xcconfig` for PrivateDatabase
Summary:
We don't strictly need this since all the other subspecs that use this set up the header search path for ReactCommon anyway but do it just for correctness.
Closes https://github.com/facebook/react-native/pull/16665

Differential Revision: D6241796

Pulled By: hramos

fbshipit-source-id: 19e6363e570d38f06ea970395d68b9cea7fd02ae
2017-11-04 12:56:13 -07:00
Nicolas Feignon 758111a706 Fix launchChrome for chromium on Ubuntu
Summary:
On Ubuntu (and maybe other distros), the executable for the chromium browser is 'chromium-browser' instead of 'chromium'.
This commit calls 'chromium-browser' before calling 'chromium' if it exists.

Start an example app on Android with "react-native init project && react-native run-android". Open DevTools: it opens chromium correctly.

[CLI] [BUGFIX] [local-cli/server/utils/launchChrome.js] - Fix launchChrome for chromium on Ubuntu
Closes https://github.com/facebook/react-native/pull/16658

Differential Revision: D6241686

Pulled By: hramos

fbshipit-source-id: 5cd435c3c42c29f0916679298e62e7a323468e37
2017-11-04 12:02:09 -07:00
alpparkan 9476730cc4 Fixed "putExtra" typo in HeadlessJSAndroid
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.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

Improved documents by fixing a typo

No code was changed

<!--
Help reviewers and the release process by writing your own release notes

**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 ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - 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/16643

Differential Revision: D6241688

Pulled By: hramos

fbshipit-source-id: ffe6f8be369c95bb16fe82719dfc943bb6223191
2017-11-04 11:45:55 -07:00
Jaroslav Khorishchenko acead8e2ba fix(docs): fixing wrong module name in the example of "Integration with Existing Apps" page
Summary:
The current example of `Objective-C/Swift` component will not work cos of wrong module name in the example. If change `MyReactNativeApp` to the `RNHighScores` everything starts working.

[DOCS] [BUGFIX] [IntegrationWithExistingApps.md] - Wrong module name in the example.
Closes https://github.com/facebook/react-native/pull/16675

Differential Revision: D6241675

Pulled By: hramos

fbshipit-source-id: d1ce8764399c4589d99060fba726aae0a379f183
2017-11-04 11:45:55 -07:00
Aditya Kumar 7c95db11d7 Return NSString instead of SEL
Reviewed By: javache

Differential Revision: D6211964

fbshipit-source-id: 4a55d56d0cc4be10460087810f62134676983203
2017-11-03 16:31:31 -07:00
Joshua May 2a24b7b967 Adds PrivateDatabase podspec
Summary:
Resolves #16663.

Walked through the reproduction steps in #16663, but with successful build.

We can also now see the files are included in the `Pods` project:

<img width="236" alt="screen shot 2017-11-03 at 7 43 21 pm" src="https://user-images.githubusercontent.com/33126/32390596-4a06c05c-c0cf-11e7-8616-3ae547f8cca2.png">

(I noticed a subspec called `_ignore_me_subspec_for_linting_` so do we have tests for the podspec?)

[IOS] [BUGFIX] [React.podspec] - Resolves build error about missing symbols for PrivateDatabase.{cpp,h}
Closes https://github.com/facebook/react-native/pull/16664

Differential Revision: D6238178

Pulled By: hramos

fbshipit-source-id: b57007ab8c7c8bd0faf1f2f11269a7a2c28183e5
2017-11-03 16:31:31 -07:00
Yujie Liu 90a00a66e2 bundledSourceURLForBridge always return bundle path
Differential Revision: D6215467

fbshipit-source-id: 49d818cfdb776dd849a809440a1e592e5cb2231a
2017-11-03 14:16:40 -07:00
Miguel Jimenez Esun a75fef48bf Add code for generating remote assets
Reviewed By: davidaurelio

Differential Revision: D6201839

fbshipit-source-id: 78c81eae03c6137ba9bbe33cd7aab8b87020f8d2
2017-11-03 06:15:15 -07:00
Dan Caspi 19de7fcb22 Moving some RAM logic to Instance.
Reviewed By: michalgr

Differential Revision: D6208977

fbshipit-source-id: 28339d07c58f1acc816be02f2707ef75529fa069
2017-11-03 05:32:02 -07:00
Jia Li 59a5dbc0b0 Revert D6210177: react-native: BundleSegments
Differential Revision: D6210177

fbshipit-source-id: 8cb4ee37cd03698e9f3980a9819269086a9d6eab
2017-11-02 12:01:05 -07:00
Avik Chaudhuri a48da14800 @allow-large-files Flow 0.58 upgrade for xplat/js
Reviewed By: yungsters

Differential Revision: D6219339

fbshipit-source-id: f003111500ef5971b9a95f26d43cee6644c16abe
2017-11-02 10:51:14 -07:00
Jean Lauliac 74371bc50d react-native: BundleSegments
Reviewed By: davidaurelio

Differential Revision: D6210177

fbshipit-source-id: c39e4118389a9739e9e70ba34feb5d335a7f2546
2017-11-02 10:01:25 -07:00
Mehdi Mulani e3bb65c62c Remove retain cycle in RCTTextField/RCTTextInput
Reviewed By: shergin

Differential Revision: D6214271

fbshipit-source-id: 4ac7e70f8ead23ac533badaed15d4a939a1965db
2017-11-02 08:51:34 -07:00
Mehdi Mulani b8a5136d22 Fix memory leak in RCTSafeAreaView
Summary:
According to the retain code collector, RCTSafeAreaView is in a cycle:
-> _bridge -> RCTCxxBridge -> _moduleDataByName -> __NSDictionaryM -> RCTModuleData -> _instance -> RCTUIManager -> _viewRegistry -> __NSDictionaryM -> RCTSafeAreaView
This should break the cycle.

Reviewed By: shergin

Differential Revision: D6213668

fbshipit-source-id: efb9c1dd148b72f66fe4485b81c16cd4c2d18b17
2017-11-02 08:51:34 -07:00
Dan Zimmerman 02f7c61cdd Introduce macro that disables poisoning JSC symbols
Reviewed By: dcaspi

Differential Revision: D6184846

fbshipit-source-id: 755653ceebcbded8fbe165375e8e8e50cf0ecccc
2017-11-02 08:16:11 -07:00
Dan Zimmerman c6a30ab949 Match the linkage used for FBJSContextStartGCTimers, configureJSCForIOS
Reviewed By: dcaspi

Differential Revision: D6184848

fbshipit-source-id: cf016caddcccab8de9ffccbe616e579005ae05d0
2017-11-02 08:16:11 -07:00
Miguel Jimenez Esun 3d7cf4f0cf Fix encoding of various files
Reviewed By: jeanlauliac

Differential Revision: D6220214

fbshipit-source-id: dc97d7ec75a0a52cac5fe2acb980b455094ea7a6
2017-11-02 08:00:56 -07:00
Miguel Jimenez Esun 834b9d4e6e Adding @email tags to most of the tests
Reviewed By: rafeca

Differential Revision: D6185623

fbshipit-source-id: 30df83288fe85516d8d5a1617a4fb8fea826ed6f
2017-11-02 06:25:03 -07:00
Chris Lewis cf8dc89ee8 Fix $FlowFixMes from TabBarIOS
Summary:
There are a number of $FlowFixMe statements in TarBarIOS.ios.js as a result of recent Flow upgrades introducing new errors/warnings. I had a stab at removing these statements and introducing what are hopefully sensible types.

Only types were changed so `yarn flow` should be sufficient.

[INTERNAL] [MINOR] [TarBarIOS] - |Fix $FlowFixMes|
Closes https://github.com/facebook/react-native/pull/16365

Differential Revision: D6200713

Pulled By: TheSavior

fbshipit-source-id: ecbd58d5831dd04250e794812ea03d202f777d12
2017-11-01 19:17:11 -07:00
Uts Sikder dd2fc4022e remove unnecessary and error inducing method from Map flow type
Reviewed By: mroch

Differential Revision: D6198877

fbshipit-source-id: 77a058072f439339a92fa07702a0429c4ca3282f
2017-11-01 16:32:19 -07:00
Chandra Patni 86c50a5094 use `> || YGFloatsEqual` instead of `>=` for computing round value to pixel grid
Reviewed By: emilsjolander

Differential Revision: D6202484

fbshipit-source-id: bb80235452208caec388775574cc4f07bfd649c4
2017-11-01 15:47:59 -07:00
Yujie Liu dec81781cd Add bundleSourceURLForBridge in RCTBridgeDelegate
Differential Revision: D6190622

fbshipit-source-id: c45a327be0b0ded6ce10d14b481c0583acca6cca
2017-11-01 09:06:22 -07:00
Alex Dvornikov b5651d945c Add "setJsBundlesDirectory" method to CatalystInstanceImpl
Differential Revision: D6042493

fbshipit-source-id: 950c6d6bdc2e0b62b14c9bcfc86233159a002c67
2017-11-01 06:54:44 -07:00
Georgiy Kassabli 21917ab7bf Fixing the edge case in Yoga with percentage absolute position and infinite constraint
Reviewed By: emilsjolander

Differential Revision: D6199731

fbshipit-source-id: f40ddf00614b2f507848fb35f348a9dfef14b323
2017-11-01 06:20:11 -07:00
Jean Lauliac 7f3090e453 react-native: move out the hardcoded import() transform
Reviewed By: davidaurelio

Differential Revision: D6196869

fbshipit-source-id: 237cd269a2f382851102e3e1ba3208f1460f8c0a
2017-11-01 05:34:40 -07:00
Pritesh Nandgaonkar 0230672275 Reverting the dirty child optimization
Reviewed By: emilsjolander

Differential Revision: D6203290

fbshipit-source-id: 8e42abb70e55f0fac90faaa21ecdbe0fbb76ce6b
2017-10-31 23:15:43 -07:00
Héctor Ramos Ortiz 1dca01b532 Remove ReactNativeVersionCheck __DEV__ gating, print error instead of throwing
Reviewed By: cblappert

Differential Revision: D6192020

fbshipit-source-id: 026f376d6d43ab3de188f94f2a4d5f0cf485733c
2017-10-31 14:28:12 -07:00
Brian Vaughn 870f540336 Updated createAnimatedComponent to account for async rendering
Reviewed By: sahrens

Differential Revision: D6149113

fbshipit-source-id: f28b597c1fe9280ca990fe72efc7b841665de957
2017-10-31 11:29:53 -07:00
Rafael Oleza 01b941927c Update shared/output modules to accept the output from the Delta Bundler
Reviewed By: davidaurelio

Differential Revision: D6186386

fbshipit-source-id: 6160f5a02891dbfb56c6350239703ace91e53690
2017-10-31 10:23:20 -07:00
Adriano Melo ec50aa6d33 Docs: Improve documentation of Slider (add example)
Summary:
It would be great to have examples in the documentation of all components. I have created a PR to add an example for `CheckBox`, and now I am adding an example for the `Slider` component.

The PR changes documentation. No further test is required.

[DOCS][ENHANCEMENT][Slider] - Added example to documentation
Closes https://github.com/facebook/react-native/pull/16588

Differential Revision: D6197329

Pulled By: hramos

fbshipit-source-id: 91d1b20fc2d4bae15f9706ac4c155411d91af290
2017-10-31 09:42:07 -07:00
Liam Sheppard dc207ec40e Docs: Update ImprovingUserExperience.md
Summary:
Made link to a page more consistent with the linking style used throughout this file [e.g `hitSlop` and `TouchableNativeFeedback`], I almost missed the `'(See docs)'` link.

`TouchableNativeFeedback` was pointing to the wrong URL.

N/A

* [DOCS] [BUGFIX] [ImprovingUserExperience.md] - Adjusted link for `KeyboardAvoidingView`
* [DOCS] [BUGFIX] [ImprovingUserExperience.md] - Fix `TouchableNativeFeedback` URL
Closes https://github.com/facebook/react-native/pull/16609

Differential Revision: D6197335

Pulled By: hramos

fbshipit-source-id: 305d9cf7c9e870882fb74f503b800887d450edcf
2017-10-31 09:42:07 -07:00
Jakub Grzmiel 308360ef7f Add __autoreleasing paramters to fix block-capture-autoreleasing warning
Differential Revision: D6196088

fbshipit-source-id: 38a4fd33800113fe78c5e4db27ea0d1354568ce0
2017-10-31 09:17:24 -07:00
Pritesh Nandgaonkar 587225ab45 Used hasDirtyChildren tag for the optimization
Reviewed By: emilsjolander

Differential Revision: D6134754

fbshipit-source-id: bbcfee14058140b946401de756a3f130de0f51cd
2017-10-31 08:21:54 -07:00
Dmitry Zakharov 387a3557ae Remove FlatUI references from fb4a.
Reviewed By: AaaChiuuu

Differential Revision: D6189136

fbshipit-source-id: c92a4d46098ff36ddbf267d150c6fa559a60a1e8
2017-10-31 06:46:06 -07:00
Andreas Amsenius c4f8551fd7 Allow shadowOpacity and shadowRadius in NativeAnimated
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.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

I want to animate `shadowOpacity` style property with Native Animated (`useNativeDriver: true`). This is useful for example in an ios-like navigation transition where the shadow fades in with the view that is sliding in from the side. Code comment for `STYLES_WHITELIST` says:
_In general native animated implementation should support any numeric property that doesn't need to be updated through the shadow view hierarchy (all non-layout properties)._
so I just added `shadowOpacity` (and `shadowRadius` too because why not?).

Before this change, setting `shadowOpacity` (or `shadowRadius`) to an `AnimatedValue` (with `useNativeDriver: true`) would throw the error: `Style property 'shadowOpacity' is not supported by the native animated module`.

After adding `shadowOpacity` (and `shadowRadius`), there is no error. The animation looks correct so it seems to be working. I also tried setting a ridiculously large `shadowRadius` and could see that working too.

Please advice on any further testing I should do.

[IOS] [ENHANCEMENT] [NativeAnimated] - Allow `shadowRadius` and `shadowOpacity` as NativeAnimated style properties.
Closes https://github.com/facebook/react-native/pull/16603

Differential Revision: D6195364

Pulled By: hramos

fbshipit-source-id: a55630df43df3c8f9db9921dab0bfbf925b6a09f
2017-10-31 06:06:20 -07:00