Commit Graph

10200 Commits

Author SHA1 Message Date
Jean Lauliac 4203c9c837 packager: fix buildBundle() options
Summary: The problem with `bundleOpts` is that it discards Flow typing, so it prevents reinforcing the integration of `Bundler` into `Server`. This changeset removes the `bundleOpts` to solve that issues. Instead, it makes the options explicit so that there is less uncertaintly. I love making options explicit, because they force callsites to take a consicious decision about what is really needed, making them more robust. They also expose oddities that probably needs refatoring, for example having a `resolutionRequest` in the bundle options does not seem correct, it should be an implementation details. Likewise, `onProgress` should probably be exposed differently, as it does not affect the content of the bundle itself.

Reviewed By: davidaurelio

Differential Revision: D4697729

fbshipit-source-id: d543870ba024e7588c10b101fa51429c77cc5ddc
2017-03-14 11:04:51 -07:00
Jean Lauliac 8ac35c8a0e packager: react-packager.js: reinforce the typing at API boundary
Reviewed By: davidaurelio

Differential Revision: D4698256

fbshipit-source-id: 7a42e9b79744f599e92b5d3d91c41cdd0de2ece5
2017-03-14 11:04:51 -07:00
Martin Konicek fbd1b0a665 Temp disable OSS Android e2e test until we debug and fix it
Reviewed By: mkonicek

Differential Revision:
D4705570
Ninja: OSS only

fbshipit-source-id: 9aa401c0e030794accabcdc4861f5bf9950ff4d8
2017-03-14 08:15:07 -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
Héctor Ramos 22e03a09b1 Fix example code
Summary: Closes https://github.com/facebook/react-native/pull/12908

Differential Revision: D4701705

Pulled By: hramos

fbshipit-source-id: 9ac33e57e0df73b4b8a0d1a05a4254e7482e2ef6
2017-03-13 16:35:47 -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
Martin Konicek 103fa3d818 Skip flaky ScrollView tests
Summary: Closes https://github.com/facebook/react-native/pull/12868

Differential Revision: D4699900

Pulled By: hramos

fbshipit-source-id: b531f2359734177df1868b453dd1d882e693caa3
2017-03-13 13:30:31 -07:00
Valentin Shergin 98798a06ae More accurate implementation of `RCTRootView`'s `sizeThatFits:`
Reviewed By: mmmulani

Differential Revision: D4672788

fbshipit-source-id: 780487f2264916349e32785808a93ed6f957e471
2017-03-13 13:30:31 -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
Hector Ramos 67a8d8951d React Conf lanches
Reviewed By: ericvicenti, gfosco

Differential Revision: D4679678

fbshipit-source-id: c1088390a44540e8934666e0ffdd43a3e170de32
2017-03-13 11:01:01 -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
Jean Lauliac ac452c0a17 packager: Server: make buildBundle() async
Summary: Also remove the unnecessary await of the resolver, because `_bundler.bundle()` already does that.

Reviewed By: davidaurelio

Differential Revision: D4689448

fbshipit-source-id: 3b4fd73b1368f8b00c6eb7483e751387d9856ce9
2017-03-13 06:15:36 -07:00
Pieter De Baets 41f3d0cf2d Expose getter for 'flex' property
Summary: Helps mitigate part of https://github.com/facebook/react-native/pull/12245 while we wait for a more comprehensive solution.

Reviewed By: emilsjolander

Differential Revision: D4571776

fbshipit-source-id: 185cd1b0d3af37724136a37471df412c2000dfe4
2017-03-13 06:00:19 -07:00
Jean Lauliac 76f5b9606a packager: Bundler: refactor the maxWorkerCount
Summary: The function giving the worker count was duplicated, let's just pass it down from a central place, the Bundler. Also, I simplified the function to use a simple formula rather than arbitrary ranges (it's still arbitrary, just a tad bit less :D ).

Reviewed By: davidaurelio

Differential Revision: D4689366

fbshipit-source-id: fe5b349396f1a07858f4f80ccaa63c375122fac8
2017-03-13 05:30:12 -07:00
Üstün Ergenoglu 8ba06cbfb1 Fix wrong modal size in fullscreen
Summary:
Display.getCurrentSizeRange() doesn't include the size of the status
bar, so Modal windows on Android have a gap in the bottom that is the
same size as the status bar. This checks the current theme and adds the
size of status bar to the modal window height if necessary.

**Test plan (required)**

Run a React Native app on Android with a theme that doesn't show status bar and launch a modal dialog. See issue #11872 for an example.
Closes https://github.com/facebook/react-native/pull/11928

Differential Revision: D4695847

fbshipit-source-id: 9fafc2b5040e2f58d562c9cc4cd4d6d87b0df2a3
2017-03-11 17:30:03 -08:00
Aaron Chiu 70e4a58d5b measure conversion of Java Map to WritableNativeMap for each NativeModule
Reviewed By: fkgozali

Differential Revision: D4688690

fbshipit-source-id: 871b3f5ab141d7f63ec15b06e44a2c398603d757
2017-03-10 22:00:48 -08:00
Douglas Lowder 02a6621e23 Add systemJSCWrapper.cpp to React-tvOS target
Summary:
**Motivation**: Fix Apple TV build breakage

**Test plan**: This fixes Travis test that builds tvOS targets.
Closes https://github.com/facebook/react-native/pull/12869

Differential Revision: D4692883

fbshipit-source-id: 3babfe4ab6d80143e15410bff7cae41ada3bf09f
2017-03-10 16:30:33 -08:00
Yann Pringault 68695bdb26 Fix indent for .babelrc in HelloWorld template
Summary:
Minor code formatting.
Each time I run `react-native init` I must reindent this file.
Closes https://github.com/facebook/react-native/pull/12850

Differential Revision: D4691374

fbshipit-source-id: dc02b021e2f320f1046e4e6d024ba675a4213de8
2017-03-10 13:45:58 -08: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
Martin Konicek a8bd4621af Try to fix tvOS and podspec builds
Summary: Closes https://github.com/facebook/react-native/pull/12866

Differential Revision: D4691348

Pulled By: ericvicenti

fbshipit-source-id: df7d611aa4ed3fed6158d2210a0403c90875b7c3
2017-03-10 13:17:18 -08:00
Hector Ramos 30bf039d90 Documentation updates
Summary:
Tackling a handful of docs issues:

- #12780
- #11227
- #2819
Closes https://github.com/facebook/react-native/pull/12867

Differential Revision: D4691083

Pulled By: hramos

fbshipit-source-id: 9115315f2d6132e975901c9a0b784e9d41eeb49e
2017-03-10 13:05:02 -08:00
Jean Lauliac 014eef3c74 packager: verify validity of TTY before using it
Reviewed By: mkonicek

Differential Revision: D4689779

fbshipit-source-id: 9bc2c1447bd64ec392adef772b1189a782f83545
2017-03-10 10:50:10 -08:00
Alexey Lang 434ca242ec Use CLOCK_MONOTONIC instead of CLOCK_MONOTONIC_RAW in performanceNow
Reviewed By: AaaChiuuu

Differential Revision: D4688909

fbshipit-source-id: 30d02ea6af4cce47bcd4fe41bc1f048dccbb3b2b
2017-03-10 10:17:52 -08:00
Theo Yaung acb9fa8f66 Refactor dependencies
Reviewed By: mkonicek

Differential Revision: D4689351

fbshipit-source-id: 35e6939379dcb6723e7749883ad9613459f9787b
2017-03-10 09:15:50 -08:00
Jean Lauliac 3e1542b485 packager: Resolver: remove opt defaults, simplify load()
Summary: Not having default everywhere (keeping them at the top level instead) makes for a code that is easier to understand, and more robust as different pieces of code cannot default to different values. This changeset also unifies the option types (ex. `platform`).

Reviewed By: cpojer

Differential Revision: D4688882

fbshipit-source-id: b5f407601386336f937a0ac1f68c666acc89dfd8
2017-03-10 08:33:56 -08:00
Felix Oghina d9ae27ba89 Clear Fresco memory cache in onHostDestroy
Summary: `onHostDestroy` is when the app is backgrounded and all Activities are destroyed. At this point it's safe to clear Fresco's memory cache.

Reviewed By: AaaChiuuu

Differential Revision: D4674950

fbshipit-source-id: f6db658ad56e3ad843cd2acfa31e2df1c40d3279
2017-03-10 06:45:36 -08:00
Lukas Wöhrl 75e783d913 Align resolve function names to have similiar namings
Summary:
We have some resolve functions with ```YG**Resolve``` and others named ```YGResolve**```. This changes both to be named like the later one, as I think this is the grammatically better readable one.
Closes https://github.com/facebook/yoga/pull/471

Differential Revision: D4688997

Pulled By: emilsjolander

fbshipit-source-id: 38b5f84d4d39ed3effedf08188085b9efd96b4ce
2017-03-10 06:21:48 -08:00
Martin Konicek f0394ce38b Revert D4588356: Refactor dependencies
Differential Revision: D4588356

fbshipit-source-id: 88cd348ed10cbf51e8ea4cde7503f6e0f9e6c572
2017-03-10 05:45:28 -08:00
Martin Konicek 5c24a9110a Update Boost dependency to 1.63 on iOS
Summary:
We use this version internally.
Closes https://github.com/facebook/react-native/pull/12838

Differential Revision: D4688982

Pulled By: mkonicek

fbshipit-source-id: d8a6f8168b9e71ff4f53a8c18d55dc5a759a9183
2017-03-10 05:45:28 -08:00
Martin Konicek 193afff926 Update Boost dependency on Android to 1.63
Summary:
We use this version internally.
Closes https://github.com/facebook/react-native/pull/12837

Differential Revision: D4688986

Pulled By: mkonicek

fbshipit-source-id: 93d9dedb51a56d6104aae443e939455c44397e88
2017-03-10 05:45:28 -08:00
Jean Lauliac 0c46953ad0 packager: node-haste: async load()
Reviewed By: cpojer

Differential Revision: D4673384

fbshipit-source-id: 816529f8947079b4003c8e91443e221184fd589d
2017-03-10 04:13:06 -08:00
Jean Lauliac 1030aabbc4 packager: Resolver: make the Resolver construction a Promise
Reviewed By: cpojer

Differential Revision: D4681614

fbshipit-source-id: 5da558280edf300f67042e72c65b272e49351871
2017-03-10 04:13:06 -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
Theo Yaung b47000a051 Refactor dependencies
Reviewed By: javache

Differential Revision: D4588356

fbshipit-source-id: ac13bbef8252ce87cdccc2f2d32890e94ff022fb
2017-03-09 16:22:58 -08:00
Héctor Ramos ac92d3e81e Remove showcase submission callout
Summary:
Related to e5ebdd8458
Closes https://github.com/facebook/react-native/pull/12840

Differential Revision: D4684864

Pulled By: hramos

fbshipit-source-id: f4aa7ea95523b09497edbfa0574e30eb1074f83b
2017-03-09 16:06:28 -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
Oleg Lokhvitsky d2796ea4ed Fix cookies not being sent with <Image> network requests
Reviewed By: pvulgaris

Differential Revision: D4669967

fbshipit-source-id: d26da8d3a60f71cf3751eb1c73974b0e57e59bed
2017-03-09 14:03:00 -08:00
Janic Duplessis 231bf7c68b Show bundle loading progress on Android
Summary:
This implements a loading banner like on iOS that shows the progress of the packager.

![](https://media.giphy.com/media/l4FGoepExkpOeXtTO/giphy.gif)

**Test plan**
- Tested that it displays similar messages as it does on iOS and also that is show the right message when waiting for the remote debugger.
- Tested that errors are still shown properly.
- Tested that it works with packagers that don't support multipart response (add && false in https://github.com/facebook/react-native/blob/master/packager/src/Server/MultipartResponse.js#L81).
- Run new unit tests.
- Tested that backgrounding / foregrounding the app hides / show the banner properly.
Closes https://github.com/facebook/react-native/pull/12674

Differential Revision: D4673638

Pulled By: mkonicek

fbshipit-source-id: b2a1163de3d0792cf481d7111231a065f80a9594
2017-03-09 10:45:35 -08:00
Martin Konicek e5ebdd8458 Showcase is now fully managed by OSS team at fb, update comment
Reviewed By: mkonicek

Differential Revision:
D4682340
Ninja: OSS only

fbshipit-source-id: ddeed5d267fd4999e16061c7b847fe163337e283
2017-03-09 10:03:33 -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
iboxgithub b79a24637a Update Troubleshooting.md
Summary:
Following ericvicenti request on https://github.com/facebook/react-native/issues/10188#issuecomment-282448021
Hope it helps

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
Closes https://github.com/facebook/react-native/pull/12578

Differential Revision: D4682076

Pulled By: mkonicek

fbshipit-source-id: 2fab5355a066eb3d8333e50f07ab3a258cbc002b
2017-03-09 09:32:02 -08:00
sunnylqm 0429b6bf8f Update 2016-12-05-easier-upgrades.md
Summary:
> The logic behind react-native-git-upgrade described above is going to power the standard react-native upgrade starting with React Native version 0.40.0.
This means that if you are upgrading from version 0.40.0 or higher, you will be able to simply run react-native upgrade in your project without having to install anything globally.

I hadn't seen any logic related to this description in either practice nor [the source code](https://github.com/facebook/react-native/blob/master/local-cli/upgrade/upgrade.js) . Did I misunderstand anything or the plan has been changed since this blog post? ncuillery
Closes https://github.com/facebook/react-native/pull/12758

Differential Revision: D4681959

Pulled By: mkonicek

fbshipit-source-id: 782d243bd92e51cbfcf83995fdcbb569fcb7bbc1
2017-03-09 09:00:39 -08:00
Dan Abramov a94d14c47c Make a section on keyboard shortcuts more prominent
Summary:
The note is currently in "Reloading JavaScript". However I was struggling with the first step ("Accessing the In-App Developer Menu") so didn't read down to that section.

I think it makes sense to make this the very first thing the reader sees when visiting the page.
Closes https://github.com/facebook/react-native/pull/12828

Differential Revision: D4681842

Pulled By: hramos

fbshipit-source-id: 1afbec7f62a2ec97febdd05987e7fc1541d3ee28
2017-03-09 08:15:45 -08:00
Lukas Wöhrl 9c6da277bc Move pointscalefactor to config
Summary:
This adds some improvements to the new ```YGConfig```, it tackles #452 and moves the scalefactor into the config.
Closes https://github.com/facebook/yoga/pull/457

Differential Revision: D4675088

Pulled By: emilsjolander

fbshipit-source-id: 99b2c734d6c5139fe1dc8bdeb014bb038f0e337d
2017-03-09 07:25:54 -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
Lukas Wöhrl 751addcb73 Take margin into account on max dimension
Summary:
We need to take the margin into account if we clip on max dimension. Fixes #466.
Closes https://github.com/facebook/yoga/pull/467

Differential Revision: D4681342

Pulled By: emilsjolander

fbshipit-source-id: 56311df9864a284d553c31f1c6db382f337f1fad
2017-03-09 04:00:32 -08:00