Commit Graph

2955 Commits

Author SHA1 Message Date
Brian Vaughn 6620b1ff7d Added ReactNative feature-flag switch between Stack and Fiber builds
Reviewed By: sebmarkbage

Differential Revision: D4606164

fbshipit-source-id: 5f25dbc52298d359e11e52341ff3570c797a6ea9
2017-03-16 19:30:29 -07:00
Sebastian Markbage 17cb70efdd Apply numeric text event bubbling fix for Android
Reviewed By: bvaughn

Differential Revision: D4726029

fbshipit-source-id: 94c8025bb59cc0970b6cc8ce7f3caf6e867bf72b
2017-03-16 18:16:02 -07:00
Spencer Ahrens b1a63f0088 Fix minimumViewTime
Reviewed By: blairvanderhoof

Differential Revision: D4723575

fbshipit-source-id: a120eef4079a808bd3dead08df93989e1db3d96a
2017-03-16 16:45:54 -07:00
Mehdi Mulani 55f48eb9f6 Move RCTLinkingManager to the main thread
Reviewed By: shergin

Differential Revision: D4709352

fbshipit-source-id: 3fc86504b12fe64dd94dd7330073d1a4a4f272e2
2017-03-16 16:02:38 -07:00
Spencer Ahrens 7e4c93d65a Fix doubled ItemSeparators
Summary: Forgot to update these after rename...

Reviewed By: yungsters

Differential Revision: D4723788

fbshipit-source-id: 8cf7e8de57a23d9ee0a424aa9c0d62ab1cfbbb12
2017-03-16 16:02:36 -07:00
Andy Street 3637bce479 Warn when timers longer than 1 min are set pending AlarmManager support
Summary:
These are bad since the app might not be foregrounded anymore and it also keeps the timing module awake. We could fix the latter but the former would require someone adding AlarmManager support.

Open to better/more helpful ideas for the warning message but there's not a ton we can tell them to do right now.

Reviewed By: achen1

Differential Revision: D4716273

fbshipit-source-id: c5d3a3ce8af53253b240477f2bde38094a138a02
2017-03-16 15:19:02 -07:00
mlanter 9d3292069d Add support for animating nested styles
Summary:
This adds the ability to nest animated styles and is a follow up to #11030 .

**Test plan (required)**
Verify a component with a shadowOffset animation animates.

Example:
```
<Animated.View
  style={{
    shadowOffset: {
      width: 0,
      height: this._pressAnim.interpolate({
        inputRange: [0, 1],
        outputRange: [20, 5],
      }),
    },
  }},
/>

```

![example](https://cloud.githubusercontent.com/assets/19673711/23878825/e29f6ae4-0806-11e7-8650-9cff1f591204.gif)
Closes https://github.com/facebook/react-native/pull/12909

Differential Revision: D4723933

fbshipit-source-id: 751d7ceb4f9bb22283fb14a5e597730ffd1d9ff6
2017-03-16 14:45:53 -07:00
Bin Yue c53404a688 Fix TextInput 'defaultValue' propTypes to 'string'
Summary:
Because `TextInput` only render the `defaultValue` of `string`, when using other types of values, it will render empty('') without any Warnings.
Closes https://github.com/facebook/react-native/pull/11478

Differential Revision: D4340132

Pulled By: lacker

fbshipit-source-id: aedb96d49277836000c0adc53007c97db6363253
2017-03-15 18:08:22 -07:00
Mike Adams 7f4054df76 Update FlatList.js
Summary:
Only a small amendment, but took me a little bit to figure out why this wasn't working.
Closes https://github.com/facebook/react-native/pull/12706

Differential Revision: D4656700

fbshipit-source-id: d6038581aa70e96a2be775a7a9786e8c7e64f762
2017-03-15 17:00:46 -07:00
Daniel Woelfel 5f8e46b8b4 prevent undefined is not an Object exception
Reviewed By: sebmarkbage

Differential Revision: D4707119

fbshipit-source-id: 403d7c26a1910d0ed1b980f305aa2b6326f371a2
2017-03-14 13:16:11 -07:00
Edwin 8a7eb170dd Adds Animated.loop to Animated API
Summary:
* Any animation can be looped on the javascript thread
* Only basic animations supported natively at this stage, loops run
using the native driver cannot contain animations of type sequence,
parallel, stagger, or loop

Motivation: We need a spinner in our app that is displayed and animated while the javascript thread is tied up with other tasks. This means it needs to be offloaded from the javascript thread, so that it will continue to run while those tasks are churning away.

I originally submitted PR #9513, which has served our needs, but brentvatne pointed out a better way to do it. Had hoped his suggestion would be implemented by janicduplessis or another fb employee, but after 5 months I thought I'd give it another push.

I've put together an implementation that basically matches the suggested API. Let me know what you think, and whether others can pick it up from here and get it in to core.

Personal Motivation: I am leaving my current organisation on Feb 10th, so am trying to clean thing
Closes https://github.com/facebook/react-native/pull/11973

Differential Revision: D4704381

fbshipit-source-id: 42a2cdf5d53a7c0d08f86a58485f7f38739e6cd9
2017-03-14 00:00:08 -07:00
Valentin Shergin fa30f41403 Better TextInput: RCTTextView and RCTTextField was marked as Yoga leaf nodes
Reviewed By: mmmulani

Differential Revision: D4639060

fbshipit-source-id: d4580303a61a7f86cf8bb6ec016fd9834340ffe0
2017-03-13 13:46:26 -07:00
amilcar-andrade 2976aa12bc Fixes spelling mistake inside TouchableNativeFeedback.android.js
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**

Explain the **motivation** for making this change. What existing problem does the pull request solve?

Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

**Test plan (required)**

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

Make sure tests pass on both Travis and Circle CI.

**Code formatting**

Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).

For more info, see
Closes https://github.com/facebook/react-native/pull/12901

Differential Revision: D4699296

Pulled By: hramos

fbshipit-source-id: 514ae27c47c8ae22e1aadb99a787daa6fdc3b6a4
2017-03-13 12:31:41 -07:00
Spencer Ahrens 3ce31c24da Rename *Component props to match SectionList
Reviewed By: yungsters

Differential Revision: D4697335

fbshipit-source-id: 742b7a1729ba7a08fe3d9707bcf6c51026779739
2017-03-13 09:45:45 -07:00
Spencer Ahrens 82ff298c00 Update ListView sticky header docs
Summary:
Sticky headers work on android now, but are only enabled by default on ios, so reflect that in the docs.

cc janicduplessis
Closes https://github.com/facebook/react-native/pull/12860

Differential Revision: D4691071

fbshipit-source-id: 0e28f948dc587561b6f20c3615cdf65dfebd9b73
2017-03-10 13:32:45 -08:00
Spencer Ahrens f28f5d34d0 Sticky headers are no longer ios-only
Summary:
Should have removed this in 77b8c09727

cc janicduplessis
Closes https://github.com/facebook/react-native/pull/12859

Differential Revision: D4691047

fbshipit-source-id: 5633c99d42bf1ed788783669571852285303cdb5
2017-03-10 13:32:45 -08:00
Spencer Ahrens 5177a55314 native animated scroll event support
Reviewed By: yungsters

Differential Revision: D4648383

fbshipit-source-id: fdb8e2deaa06b2d2f9002cee2c0b827dbd7a5570
2017-03-09 22:15:53 -08:00
Fred Liu 28ed5eddf2 Revert D4494386: [react-native][PR] BREAKING - Remove LayoutAnimation experimental flag on Android
Differential Revision: D4494386

fbshipit-source-id: 1ba6fc60467d1c3347c90e52a3251e6591a99e25
2017-03-09 20:16:37 -08:00
cailenmusselman dd5ac841d2 YellowBox" Only provide elevation style prop when running on Android
Summary:
For unknown reasons, setting elevation: Number.MAX_VALUE causes remote debugging to hang on iOS (some sort of overflow maybe). Setting it to Number.MAX_SAFE_INTEGER fixes the iOS issue, but since elevation is an android-only style property we might as well remove it altogether for iOS.

See: https://github.com/facebook/react-native/issues/12223
Closes https://github.com/facebook/react-native/pull/12744

Differential Revision: D4684524

Pulled By: mkonicek

fbshipit-source-id: 7fb4f6da1c5c0cb437beff0e75122523e7233b72
2017-03-09 15:30:29 -08:00
Janic Duplessis 921b9ac53d Native Animated - Support multiple events attached to the same prop
Summary:
Re-applying the diff that was reverted in D4659669 / b87f4abf78 because of some crashes with fixes from D4659708 merged in.

 ---

Fixes a bug that happens when trying to use ScrollView with sticky headers and native `Animated.event` with `onScroll`. Made a few changes to the ListViewPaging UIExplorer example to repro https://gist.github.com/janicduplessis/17e2fcd99c6ea49ced2954d881011b09.

What happens is we need to be able to add multiple events to the same prop + viewTag pair. To do that I simple changed the data structure to `Map<prop+viewTag, List<AnimatedEventDriver>>` and try to optimize for the case where there is only one item in the list since it will be the case 99% of the time.

**Test plan**
Tested by reproducing the bug with the above gist and made sure it was fixed after applying this diff.
Closes https://github.com/facebook/react-native/pull/12697

Reviewed By: fkgozali

Differential Revision: D4661105

Pulled By: sahrens

fbshipit-source-id: c719dc85f45c1a142ef5b9ebfe0a82ae8ec66497
2017-03-09 15:30:28 -08:00
Mike Lambert bfb2766c63 Allow Promise to display error strings and not just error objects.
Summary: Closes https://github.com/facebook/react-native/pull/9989

Reviewed By: bestander

Differential Revision: D4147256

Pulled By: hramos

fbshipit-source-id: 62d49b592391bad434062e3c0d9c8287842664a8
2017-03-09 14:30:57 -08:00
Jakob Kerkhove a592e5bfa0 Typo documentation ScrollView
Summary:
Typo documentation ScrollView: 'as as alternative' => 'as an alternative'
Closes https://github.com/facebook/react-native/pull/12826

Differential Revision: D4681930

Pulled By: mkonicek

fbshipit-source-id: a10574c659c949359da0be9e6e82f597e9a3eb73
2017-03-09 09:32:02 -08:00
Douglas Lowder f5585b3d75 ScrollView should not use RefreshControl on tvOS
Summary:
**Motivation**: On tvOS, Flatview and other components that use ScrollView with a RefreshControl will break without this change.

**Test plan**: Manual testing on tvOS simulator.
Closes https://github.com/facebook/react-native/pull/12751

Differential Revision: D4669503

fbshipit-source-id: 320036571788dc0102ec2611492d0fc97bceb53b
2017-03-09 04:45:28 -08:00
Mohammed 0150bc76eb Updating the documentation for getSize()
Summary:
Clearly state that the `getSize()` does not work for static image resources because it is assumed the developer knows their static image resource size (the reason I got from a comment on a github issue by a react native contributor).

This missing documentation cost me about 30 minutes to figure out why it didn't work for my static image resource and so I decided to update the documentation 💃
Closes https://github.com/facebook/react-native/pull/11645

Differential Revision: D4533463

Pulled By: lacker

fbshipit-source-id: 70e175ea30a5540c8a9f2a0c040585c711d82ac3
2017-03-08 06:45:22 -08:00
Janic Duplessis abc483a653 BREAKING - Remove LayoutAnimation experimental flag on Android
Summary:
I don't remember exactly where we talked about this but LayoutAnimation on Android is pretty stable now so there's no reason to keep it behind an experimental flag anymore. The only part that is not really stable is delete animations, so what I did is remove the default delete animation that we provide in presets.

**Test plan**
Tested that layout animations work properly without any config.
Closes https://github.com/facebook/react-native/pull/12141

Differential Revision: D4494386

Pulled By: mkonicek

fbshipit-source-id: 5dd025584e35f9bff25dc299cc9ca5c5bf5f17a3
2017-03-08 06:45:22 -08:00
Prabakar Marimuthu 36eb69ecd0 Added option to set mixed content mode in android webview
Summary:
PR for option to set mixed content mode in Webview(Android) for issue #8460
Closes https://github.com/facebook/react-native/pull/12314

Differential Revision: D4663084

Pulled By: lacker

fbshipit-source-id: 0e40ea463739166311ddcb7887ff6d0289369637
2017-03-08 06:45:22 -08:00
Adam Comella 454ab8fc23 BREAKING: iOS: Support withCredentials flag in XHRs
Summary:
Corresponding Android PR: #12276

Respect the withCredentials XMLHttpRequest flag for sending cookies with requests. This can reduce payload sizes where large cookies are set for domains.

This should fix #5347.

This is a breaking change because it alters the default behavior of XHR. Prior to this change, XHR would send cookies by default. After this change, by default, XHR does not send cookies which is consistent with the default behavior of XHR on web for cross-site requests. Developers can restore the previous behavior by passing `true` for XHR's `withCredentials` argument.

**Test plan (required)**

Verified in a test app that XHR works properly when specifying `withCredentials` as `true`, `false`, and `undefined`. Also, my team uses this change in our app.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/12275

Differential Revision: D4673644

Pulled By: mkonicek

fbshipit-source-id: 2fd8f536d02fb39d872eb849584c5c4f7e7698c5
2017-03-08 06:15:15 -08:00
Adam Comella 36f09dc252 Add onabort to XHR classes
Summary:
04d870b added support for onabort in XHRs. The other on* events are declared on XMLHttpRequest and XMLHttpRequestEventTarget. This adds onabort there as well.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/12277

Differential Revision: D4673648

Pulled By: mkonicek

fbshipit-source-id: 0c5255da77537103c5ad91d9b2826d064140708d
2017-03-08 05:59:41 -08:00
Martin Konicek 48f30eca7e Move iOS Maps out of the GitHub repo to internal fb codebase
Summary:
MapView has been deprecated in open source for a while: http://facebook.github.io/react-native/docs/mapview.html
We still want to use it internally. Moving it away from the GitHub folder.

Reviewed By: mmmulani

Differential Revision: D4646199

fbshipit-source-id: f469971e448dbca12afe141b43fa8a2518c7d467
2017-03-08 05:01:36 -08:00
Martin Konicek adf650debc Use different function syntax that the JS parser used to build the website can understand
Summary:
For some reason the parser doesn't support that syntax. It fails with:

```
Cannot parse file ../Libraries/Animated/src/AnimatedImplementation.js Error: parseSource returned falsy
    at parseAPIInferred (/home/ubuntu/react-native/website/server/extractDocs.js:343:13)
```

Reviewed By: sahrens

Differential Revision: D4669961

fbshipit-source-id: 3536c94b8f385f5810c47544c4a72c8c785bf0e5
2017-03-08 04:47:05 -08:00
Eric Vicenti a8474c25fd Fix license headers
Reviewed By: hramos

Differential Revision: D4670890

fbshipit-source-id: e8429aa88a1d4f3cc80034dd087739410c0761f2
2017-03-08 00:52:17 -08:00
Kevin Gozali 1a8d216458 added RCTLog.logToConsole() to force log regardless of debugger connection
Summary: This adds an alternative logging method that can be called from native side. `logIfNoLoggingHook()` will pass the message to console only if there's Chrome debugger attached. This new method sends the message to console regardless to notify the developers better.

Reviewed By: yungsters

Differential Revision: D4669663

fbshipit-source-id: 3940816dadd08d450f066b7223f6d26a38a70921
2017-03-07 19:45:49 -08:00
Spencer Ahrens 5257c35d05 Add new `forkEvent`/`unforkEvent` API
Reviewed By: vjeux

Differential Revision: D4648427

fbshipit-source-id: 9bbbd81f49a9363ac271b3906d73f937f0d1f500
2017-03-06 21:51:40 -08:00
Douglas Lowder b7e9374c64 Move BackAndroid -> BackHandler, add Apple TV support for back nav
Summary:
Enable back navigation on Apple TV (with the remote's menu button) in code making use of BackAndroid.  The module is renamed to BackHandler.  BackAndroid is still exported to ReactNative for now, until external projects switch to using the new name for the module.  The navigation in https://github.com/react-community/react-navigation makes use of this module.

**Test plan**: Manual testing with an example app (https://github.com/dlowder-salesforce/react-nav-example).
Closes https://github.com/facebook/react-native/pull/12571

Differential Revision: D4665152

Pulled By: ericvicenti

fbshipit-source-id: 925400ce216379267e014457be6f5eedbe4453ec
2017-03-06 21:51:40 -08:00
Spencer Ahrens 9325496d46 Simplify scroll interaction stuff
Reviewed By: angelahess

Differential Revision: D4662787

fbshipit-source-id: 6e28f8cacd08601254e70f30ab98ee27bd08cc5a
2017-03-06 21:51:40 -08:00
Spencer Ahrens 28b43aa05c Fix crash with empty section headers
Summary: It's ok for them to be empty, so we should check!

Reviewed By: yungsters

Differential Revision: D4664411

fbshipit-source-id: c66e98458708eee59757fa665b3a05972f1c1b70
2017-03-06 21:31:05 -08:00
Spencer Ahrens 7005f54ab5 Fix unmount crash when using sticky headers
Reviewed By: bvaughn

Differential Revision: D4659436

fbshipit-source-id: c04394681a4f07599f16bae195313e6617419404
2017-03-06 21:16:00 -08:00
Spencer Ahrens 293bb36c0e warn about PureComponent in docs
Reviewed By: hramos

Differential Revision: D4663872

fbshipit-source-id: cb2bd2a2d588a9419da7517304d0612e259151e3
2017-03-06 19:31:08 -08:00
Valentin Shergin 4040e89ac5 `<TextView>.onContentSizeChange` now fires on ANY content changing circumstances
Reviewed By: blairvanderhoof

Differential Revision: D4625916

fbshipit-source-id: 80191a07edaf404a70a7571ada2d849619407bda
2017-03-06 16:35:08 -08:00
Valentin Shergin 4e437c1232 Export Alert's type ButtonsArray for external use
Reviewed By: mmmulani

Differential Revision: D4623764

fbshipit-source-id: 9c4edc98e15603bdae180ec4b6c27b677bba1d53
2017-03-06 12:44:47 -08:00
Jiajie Zhu b87f4abf78 revert D4656347 to fix crashes
Reviewed By: jingc

Differential Revision: D4659669

fbshipit-source-id: 2c95c212a19cc8b67ce4ec62963c8374aecb3ef6
2017-03-06 11:15:45 -08:00
Emily Janzer 5e20b7bcfb Add TabBarIOS.Item on Android
Summary: TabBarIOS has a dummy module on Android, but it doesn't export TabBarIOSItem so if you try to use TabBarIOS.Item you'll get a redbox.

Reviewed By: frantic

Differential Revision: D4653962

fbshipit-source-id: 36ca2527d8eac2d28d35c3ac69ced5bf50b2e682
2017-03-06 10:10:11 -08:00
Vedad Sose f126540519 Fix linking manager library name in documentation
Summary:
I had an issue while using

```#import "RCTLinkingManager.h"```

![image](https://cloud.githubusercontent.com/assets/1089932/22933908/523cf910-f2cd-11e6-9c20-b3c298d5b7cc.png)

But when replaced with

```#import <React/RCTLinkingManager.h>```

the build succeeds.

Looks fine on the website:

![image](https://cloud.githubusercontent.com/assets/1089932/22934563/b1ff337a-f2cf-11e6-9109-b133aef1d69c.png)
Closes https://github.com/facebook/react-native/pull/12383

Differential Revision: D4658153

Pulled By: ericvicenti

fbshipit-source-id: e48368c08cb27bf68ea2f1294129669896350f34
2017-03-06 00:45:25 -08:00
Janic Duplessis 5353d39172 Remove unused native iOS sticky headers implementation
Summary:
Remove the native iOS sticky headers implementation that has been replaced by the js Animated one. Also remove a line in JS that made sure we passed null to native so it did not use the native implementation.

**Test plan**
Made sure there were no more mentions of sticky / header in native ScrollView related code.
Tested that sticky headers still work :o
Closes https://github.com/facebook/react-native/pull/12696

Differential Revision: D4657391

Pulled By: ericvicenti

fbshipit-source-id: 16324a45ca4ce5cd143293c61394a0fa7ad0c4a1
2017-03-05 14:21:40 -08:00
Janic Duplessis c708234f66 Native Animated - Support multiple events attached to the same prop
Summary:
Fixes a bug that happens when trying to use ScrollView with sticky headers and native `Animated.event` with `onScroll`. Made a few changes to the ListViewPaging UIExplorer example to repro https://gist.github.com/janicduplessis/17e2fcd99c6ea49ced2954d881011b09.

What happens is we need to be able to add multiple events to the same prop + viewTag pair. To do that I simple changed the data structure to `Map<prop+viewTag, List<AnimatedEventDriver>>` and try to optimize for the case where there is only one item in the list since it will be the case 99% of the time.

**Test plan**
Tested by reproducing the bug with the above gist and made sure it was fixed after applying this diff.
Closes https://github.com/facebook/react-native/pull/12697

Differential Revision: D4656347

Pulled By: sahrens

fbshipit-source-id: b5c36ba796f478e56028c7a95bc0f86bc54cb2ce
2017-03-05 10:16:57 -08:00
Jeff Morrison 59257d6976 fbobjc
Reviewed By: gabelevi

Differential Revision: D4652687

fbshipit-source-id: 6069c8bc24f0b88da3537ada877cdb7d1d4eccfd
2017-03-04 19:30:34 -08:00
David Adams e3ef69548c VirtualizedList - trigger this.props.onContentSizeChange
Summary:
Have tested this and works fine
```
<SectionList
    onLayout={this.onLayout}
    ref={thisRef => this.listView = thisRef}
    ListFooterComponent={this.renderFooter}
    renderItem={this._renderRow}
    onScroll={this._onScroll}
    onContentSizeChange={this.contentSizeChanged}
    renderSectionHeader={this._renderSectionHeader}
    sections={this.props.data}
/>
Closes https://github.com/facebook/react-native/pull/12708

Differential Revision: D4656338

Pulled By: sahrens

fbshipit-source-id: a2b585aa80247ff0dc2261b740003a6e77cb7a97
2017-03-04 19:15:19 -08:00
Spencer Ahrens 500dd2cff3 Fix bug with sticky headers that listen to onLayout
Summary:
Wrapping them in ScrollViewStickyHeader broken the onLayout and would always give y = 0
because it is now relative to the wrapper.

This uses some not-so-great react magic, but fixes the bugs with no aparent side-effects.

Note we also need to kill the StaticRenderer wrapper that ListView introduces. I think this was
probably a premature optimization anyway since there are usually not many headers and they are
usually pretty cheap to render. If people care, they can use `shouldComponentUpdate` with the
rendered components.

Reviewed By: yungsters

Differential Revision: D4654622

fbshipit-source-id: 1ea557ef64327d1f4df53b22fedd678da1549288
2017-03-03 20:15:38 -08:00
Spencer Ahrens 94a333a2ea Fix crash with js-based sticky headers
Summary:
We're seeing ` inputRange must be monotonically increasing -1,0,0,-33,-32 ` which happens when we
have zero height headers, wherever those come from...maybe rendering null?

The math was also off and didn't handle variable height headers correctly, and it was confusing
because it was `setNextHeaderY` with the header y _minus it's height_, which only works
if the prev height was also the same height.

Reviewed By: furdei

Differential Revision: D4649404

fbshipit-source-id: c2c2d438fa0d0b979c2cbdfa5752eaf86c14768b
2017-03-03 20:01:13 -08:00
Spencer Ahrens f6aad8b995 Default sticky headers enabled on ios only.
Summary:
They aren't normal for android, so don't make that the default.

some more context: https://github.com/facebook/react-native/pull/11315#issuecomment-283816468

Reviewed By: furdei

Differential Revision: D4648714

fbshipit-source-id: 3232a6914e3db82c2b300409663ce63412d892a6
2017-03-03 15:29:48 -08:00