Commit Graph

10388 Commits

Author SHA1 Message Date
Ben Alpert 8f2d73d50b React Native Fiber: Fix errors in children management
Reviewed By: bvaughn

Differential Revision: D4905062

fbshipit-source-id: 43c24e7bcaf06eb4c7385b7022d0f20cf42d6f2f
2017-04-18 18:33:30 -07:00
Van der Auwermeulen Grégoire 23e8fcc68c ListItem JSX tag is not closed when used in SectionList
Summary:
Thanks for submitting a PR! Please read these instructions carefully:

- [ ] Explain the **motivation** for making this change.
- [ ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.

When copy pasting the SectionList, got an error with a non closing JSX tag
What existing problem does the pull request solve?
Closing the JSX tag in 2 files
no test required
A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.

If you have added code that should be tested, add tests.

Sign the [CLA][2], if you haven't already.

Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
Closes https://github.com/facebook/react-native/pull/13525

Differential Revision: D4908495

Pulled By: javache

fbshipit-source-id: f2dc49c9238d1da8906f7daf144429a57ad725a3
2017-04-18 16:45:28 -07:00
Jonathan Kim be5a4609e6 Remove immutable-js
Summary:
Immutable doesn't seem to be used in react-native anymore so I've removed it as a dependency.

Ensure that all tests pass.
Closes https://github.com/facebook/react-native/pull/13471

Differential Revision: D4877659

Pulled By: javache

fbshipit-source-id: f06996d6d0af73e5bd0108cec75370eec66ca038
2017-04-18 16:45:28 -07:00
Marc Horowitz e7fe3b165b Explicitly cast to (bool) where needed on objc with folly::dynamic
Reviewed By: yfeldblum

Differential Revision: D4711054

fbshipit-source-id: 00897ca703f0f3a8cddaf170fef53f9851b631af
2017-04-18 15:36:20 -07:00
Mohamed Habib a5dea8d612 Fixed a typo in open function documentation
Summary:
Thanks for submitting a PR! Please read these instructions carefully:

- [ ] Explain the **motivation** for making this change.
- [ ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.

What existing problem does the pull request solve?

A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.

If you have added code that should be tested, add tests.

Sign the [CLA][2], if you haven't already.

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

Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.
Closes https://github.com/facebook/react-native/pull/13556

Differential Revision: D4908506

Pulled By: javache

fbshipit-source-id: 17f6a57e31e68dc79ac9b5303bf56461663d7edd
2017-04-18 15:36:20 -07:00
Kevin Cooper e443b7379e More verbose error messages for iOS
Summary:
Output the reason for the error when failing to load source code. This was a big help when trying to diagnose https://github.com/facebook/react-native/issues/13299.

~~Unfortunately there still seems to be no way to get the offending line number (because `loadError.userInfo[RCTJSStackTraceKey]` is empty), but this is good enough.~~

Before:

```
[warn][tid:com.facebook.react.JavaScript][RCTBatchedBridge.m:510] Failed to execute source code. Unhandled JS Exception: SyntaxError
```

After:

```
[warn][tid:com.facebook.react.JavaScript][RCTJSCErrorHandling.mm:30] Couldn't get stack trace for http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:81886
[warn][tid:com.facebook.react.JavaScript][RCTBatchedBridge.m:510] Failed to execute source code. Unhandled JS Exception: SyntaxError Unexpected keyword 'var'
```
Closes https://github.com/facebook/react-native/pull/13561

Differential Revision: D4908501

Pulled By: javache

fbshipit-source-id: a316dc70739b917b3cc690309d0ff37a8bb5d412
2017-04-18 14:19:13 -07:00
Sue Ann Ioanis cc4648ba86 Omit units from zero values.
Summary:
It's recommended to remove units for all zero length values because
these units aren't being used and therefore can be safely removed to
save bytes.
Closes https://github.com/facebook/react-native/pull/13518

Differential Revision: D4905286

Pulled By: javache

fbshipit-source-id: 4119eb8034b4b5b864228316c5a450978d4328e9
2017-04-18 14:00:18 -07:00
Himanshu Pathak 5a5fd32acb Update Colors.md, removed duplicate colors
Summary:
removed duplicate colors

Thanks for submitting a PR! Please read these instructions carefully:

- [ ] Explain the **motivation** for making this change.
- [ ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.

What existing problem does the pull request solve?

A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.

If you have added code that should be tested, add tests.

Sign the [CLA][2], if you haven't already.

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

Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests a
Closes https://github.com/facebook/react-native/pull/13555

Differential Revision: D4908510

Pulled By: javache

fbshipit-source-id: 819a3c2788232bc092cccc071f115853e7caddad
2017-04-18 13:41:22 -07:00
Marc Horowitz 5e09242e26 Rename JSCSamplingProfiler to RCTJSCSamplingProfiler
Reviewed By: javache

Differential Revision: D4889427

fbshipit-source-id: 1f74416b858134ec3682b1302021131114763881
2017-04-18 13:22:01 -07:00
David Aurelio 50f0ade13d `getTransformOptions` can only return promises
Summary: Changes the contract for `getTransformOptions` so that it has to return a promises. That allows call sites to get rid of special logic / wrapping.

Reviewed By: jeanlauliac

Differential Revision: D4905959

fbshipit-source-id: c7d434c0766984e25987de1d769594e7c922d691
2017-04-18 11:21:10 -07:00
Gabe Levi f47ed2b5b9 Bump the flow-bin version to ^0.44.2
Summary:
There's something wrong with the Linux binary in Flow v0.44.1. It doesn't work. Flow v0.44.2 fixes, however CircleCI may have cached Flow v0.44.1. Putting this PR up in case it's needed.

yarn install
yarn run flow
Closes https://github.com/facebook/react-native/pull/13549

Differential Revision: D4902838

Pulled By: gabelevi

fbshipit-source-id: 7f5223f7447dc0387955a94a0945915521a508c4
2017-04-18 10:18:58 -07:00
Jean Lauliac c6f5717d2b packager: ResolutionRequest: stronger option typing
Reviewed By: cpojer

Differential Revision: D4906382

fbshipit-source-id: 1696c3e7fe07c84a3a497740dc87a237d9b71d1e
2017-04-18 10:18:58 -07:00
Jean Lauliac 4ab4df07af packager: buck: transform-module: add support for assets
Reviewed By: davidaurelio

Differential Revision: D4868312

fbshipit-source-id: 44d20a5ed73637a9b3f43a99b5c82931f3e15dc6
2017-04-18 09:39:32 -07:00
Jean Lauliac 1c53c9b20f packager: Module: remove dead cacheTransformResults option
Reviewed By: davidaurelio

Differential Revision: D4884343

fbshipit-source-id: ae29757690d9b56d6f166bc86573aca9b1b6b65c
2017-04-18 09:39:32 -07:00
Jean Lauliac a6828f2127 packager: remove Cache
Summary: It seems we don't need that one much anymore, as we have a FS-based cache for files, and removing the last callsites doesn't really change perf, as we have to read these files eventually (plus some of these are read from `HasteMap`, that I believe is already dead code).

Reviewed By: davidaurelio

Differential Revision: D4884220

fbshipit-source-id: 4cf59f16a6f0bdf275abe81e9de2f34816866bae
2017-04-18 09:39:31 -07:00
Ben Roth 09e7dbc9cb Protect against fatal YellowBox error when stack frame has no file
Summary:
Motivation: When viewing a stack trace in YellowBox where one or more of the stack frames has no `file`, JS will encounter the fatal error `null is not an object (evaluating 'file.split')`. This can happen, for example, when running a bundle for which no source maps were generated.
Closes https://github.com/facebook/react-native/pull/13512

Differential Revision: D4896480

Pulled By: javache

fbshipit-source-id: 202c793a47abb83a4700a5778a92b0b5828b01a3
2017-04-18 09:39:31 -07:00
Pieter De Baets 54d8d10a6b Construct ModuleHolder from ReactModuleInfo
Reviewed By: AaaChiuuu

Differential Revision: D4883331

fbshipit-source-id: c901051d0aa5993142104126bbec5d76bd605e0b
2017-04-18 06:48:04 -07:00
Aaron Chiu 035f076594 move calls that need to be on the UI thread out of setupReactContext()
Reviewed By: achen1

Differential Revision: D4890541

fbshipit-source-id: 7fc87d3341a1cefd474481dcc1b7b6d02d92f445
2017-04-18 04:15:34 -07:00
Aaron Chiu b9eeaef243 make ReactInstanceManager safer threading wise
Reviewed By: achen1

Differential Revision: D4883219

fbshipit-source-id: 45671a6d51357fd51ca824a59f7b200c3df66b89
2017-04-18 04:15:34 -07:00
Tony Tan 3e7aa5f14e Fix bug - FlatList component did not render more items when content was filtered
Summary:
**Bug Description**

The FlatList component receives content items via the data prop, and renders an initial number of items on the app's view. When a user scrolls to the end of the list, the component will append and render more available items at the end of the list. There was a bug where when the content was filtered, there were more available items but the component did not append/render them. This is due to the current appending/rendering logic in VirtualizedList, which does not account for data changes as a condition for updating/rendering. VirtualizedList is a dependency of FlatList, so this issue affects FlatList as well.

**Approach to Fixing Bug**

(i) Reproduce bug on iOS view of FlatList.
(ii) For VirtualizedList component:
  # Isolate onEndReached function that appends more data to component UI.
  # Isolate _onContentSizeChange function that is called when list content changes.
  # Write snapshot tests using jest, based off existing test for FlatList.
  # Refactor logic to append more data to list into _maybeCallOnEndReached function.
  # Call _maybeCallOnEndReached in both _onContentSizeChange and _onScroll.
(iii) Run snapshot tests and observe jest output.
(iv) Bring up iOS view of FlatList and check that component now renders more items when content is filtered.

Many thanks to sahrens for guidance in developing this code!

Reviewed By: sahrens

Differential Revision: D4877388

fbshipit-source-id: c10c9eef1912f491450a62b81a9bc41f7f784203
2017-04-17 18:15:37 -07:00
Aaron Chiu ff056d22d9 update the infer-annotation jar for open source to unblock D4883219
Reviewed By: achen1

Differential Revision: D4890251

fbshipit-source-id: 3945c0e85fba15d588aa3b5760c64c5d81c6c516
2017-04-17 15:57:36 -07:00
Andrew Y. Chen 1dc0f7e994 Instrumentation tests for apps that provide a testPayload
Reviewed By: AaaChiuuu

Differential Revision: D4873849

fbshipit-source-id: b5235b952faea2e42fb4292fac4ca409e22ecb56
2017-04-17 15:00:44 -07:00
Aaron Chiu 9c44630866 make mReactChoreographer final in Timing.java
Reviewed By: achen1

Differential Revision: D4883119

fbshipit-source-id: 1adb57f333742fca9c5e1ece6355ee18881c48a4
2017-04-17 13:30:03 -07:00
Gabe Levi 92f900c79d Upgrade to v0.44.0
Reviewed By: zertosh

Differential Revision: D4893660

fbshipit-source-id: ed85f5d4c585164d464a7e009888a28e5af339cd
2017-04-17 09:33:20 -07:00
Emil Sjolander d5601a3e12 Align ios api with android
Reviewed By: kittens

Differential Revision: D4897832

fbshipit-source-id: ff3215b45de389b91825371a987314e4bab5421f
2017-04-17 07:30:18 -07:00
Jakub Šimo 82f3964f2d Change Promise.done to Promise.then
Summary:
- [X] Explain the **motivation** for making this change.
- [X] Provide a **test plan** demonstrating that the code is solid.
- [X] Match the **code formatting** of the rest of the codebase.
- [X] Target the `master` branch, NOT a "stable" branch.

`Promise.done` is non-standard, `Promise.then` is preferred as a standardized method. On Android, polyfill filling in `Promise.done` has been most probably taken out in newer versions of `react-native` and app crashes when it tries to query network state through `NetInfo`.

No tests are required for this change.
Closes https://github.com/facebook/react-native/pull/13489

Differential Revision: D4897566

Pulled By: mkonicek

fbshipit-source-id: 140720d7367cd1d9bf8924ec8a118c1bff4e461d
2017-04-16 15:30:46 -07:00
Alex Kring 665fc86a6e Don't build js bundles for debug simulator build configurations
Summary:
Don't build js bundles for debug simulator build configurations

Motivation:
We have more than one debug build configuration that we run in the simulator, and none of them are exactly named 'Debug'. We want to establish the convention that any simulator build configuration containing the word 'Debug' will not build the react js bundles. We believe this is less intrusive to the developer.
Closes https://github.com/facebook/react-native/pull/13472

Differential Revision: D4890622

Pulled By: javache

fbshipit-source-id: 4c809551f64ad575335416de28887a90b0756de1
2017-04-15 10:17:51 -07:00
Douglas Lowder d34a2c9797 Add missing prop-types dependency to website/package.json
Summary:
**Motivation**

Website generation is broken unless prop-types is added as a dependency.

**Test plan**

This fixes website generation in existing Circle CI tests.
Closes https://github.com/facebook/react-native/pull/13498

Differential Revision: D4888859

Pulled By: bvaughn

fbshipit-source-id: d43afbf3b56c189e723e5628e169947ed5dbacd8
2017-04-14 17:05:01 -07:00
Aaron Chiu 1c440dbcae clean up NativeAnimatedModule
Reviewed By: achen1

Differential Revision: D4883111

fbshipit-source-id: 63873d46db8d2736672a6d102e86dabfbf4f4610
2017-04-14 16:31:23 -07:00
Spencer Ahrens 346fe33077 Make invalid scrolling bugs easier to track down
Reviewed By: jingc, olegbl

Differential Revision: D4887662

fbshipit-source-id: d24590fd79ad1b5f6ada79583dbe870b350ec358
2017-04-14 16:16:40 -07:00
Brian Vaughn f3e56cbbb7 Ran React.PropTypes codemod on fbsource again in case anything was missed
Reviewed By: flarnie

Differential Revision: D4890226

fbshipit-source-id: 36b87bd4395c8cfbe260d2c73f919e62b11439a7
2017-04-14 15:46:04 -07:00
Aaron Chiu b9b03435c4 loosen the ReactChoreographer UI thread assert
Reviewed By: achen1

Differential Revision: D4873553

fbshipit-source-id: 7dbf771e744f6b33e6edb3ad4c227c3a63c3e3e3
2017-04-14 02:45:33 -07:00
Aaron Chiu c9826ba4a9 make mHasDispatchScheduledCount in EventDispatcher atomic
Reviewed By: achen1

Differential Revision: D4882881

fbshipit-source-id: ac9a985287bd4720846ecde97ebb4935963c0d9f
2017-04-14 02:15:46 -07:00
George Xu c29449d573 Revert D4875343: Correct fix for flexing grandchildren
Differential Revision: D4875343

fbshipit-source-id: 2949762bf47e151c8c0ff923d501859b3e0a567a
2017-04-13 18:09:30 -07:00
Spencer Ahrens 3bf7856700 disable removeClippedSubviews by default
Summary:
It's just causing problems (e.g. when combined with transform animations like those used
in some navigators) and hopefully it's not necessary with JS-side windowing. If people need the
perf, they can turn it on themselves.

Should fix https://github.com/facebook/react-native/issues/13316 and related issues.

Reviewed By: achen1

Differential Revision: D4884147

fbshipit-source-id: 95c82448581076c0d0b2c80b1cd80cc294898174
2017-04-13 16:05:52 -07:00
Emil Sjolander 569525d6e4 Revert D4850458: [yoga][PR] Let measure behave more like on the web
Differential Revision: D4850458

fbshipit-source-id: 2ecb6c8627a84b52ade968fd18331a7473369ebe
2017-04-13 15:45:37 -07:00
Brian Vaughn 8b408576b7 Fixed bad ReactPropTypes reference in ViewPagerAndroid
Reviewed By: spicyj

Differential Revision: D4885894

fbshipit-source-id: 2e225354b76bf21dca84c2e723d9b7e27882648d
2017-04-13 15:00:24 -07:00
Emil Sjolander 2030c78355 Remove references to CSSLayoutDEPRECATED
Reviewed By: marco-cova

Differential Revision: D4859822

fbshipit-source-id: 2588c1b3334f28332ae43e6c0bdec65934ca84c4
2017-04-13 12:52:38 -07:00
Jean Lauliac 219328d000 packager: preprocess outdated dependencies
Summary:
Note: if this changeset causes some breakage, consider disabling rather than reverting. To disable, the call to `_preprocessPotentialDependencies` in `ResolutionRequest` can be removed.

It's a bit of an experiment. I couldn't see any particular regression caused by this, but I could see net improvement of the global cache performance, as it unlock much, much stronger batching: indeed, instead of discovering dependencies progressively, we synchronously figure out the list of all potential modules of a bundle, and kick-off cache fetching and/or transformations. So when it comes to fetching from the global cache, it'll do less requests, and each requests will ask for considerably more keys at a time.

Potential problem caused by this changeset: if a module's dependencies completely changed, then the first time we try to build the bundle it'll start transforming modules that we probably don't care at all anymore, spending precious CPU time for nothing. I've been thinking about it and I cannot see such a case happening much often. Even if it happens, it should not cause any bug or corruption, it would just take additional time.

Other potential problem: that this new code doesn't handle some types of edge cases. It's quite hard to figure out what could possibly break in the `ResolutionRequest` code (and I think it would benefit from a larger refactor). We do have a good test coverage for `DependencyGraph` and it seems to work smoothly, so I'm relatively confident we're not breaking edge cases.

Reviewed By: davidaurelio

Differential Revision: D4875467

fbshipit-source-id: 2dfcc755bec638d3d1c47862ec1de5220953e812
2017-04-13 10:31:30 -07:00
Jean Lauliac 33749c2714 packager: ResolutionRequest: correct mistaken callsite
Reviewed By: cpojer

Differential Revision: D4875756

fbshipit-source-id: cdf29e3c1115003596f6a7b4d27988010d56d88d
2017-04-13 10:31:30 -07:00
Emil Sjolander c3dc6a0f0e Revert D4878875: [yoga][PR] Fix sizing of non strech items
Differential Revision: D4878875

fbshipit-source-id: 8927438e7a1969deb617434369af53f71f625638
2017-04-13 10:01:55 -07:00
William Durand 6a1e0516e9 Add Geolocation API Jest mock
Summary:
Hello!

The [Geolocation API](https://facebook.github.io/react-native/docs/geolocation.html) is currently not mocked in Jest, which often leads to an `Invariant Violation: Native module cannot be null` error. This patch adds a basic Jest configuration similar to the existing ones for the other modules.

None unfortunately, but this patch makes my test suite all green 😉

Thanks,
William
Closes https://github.com/facebook/react-native/pull/13442

Differential Revision: D4883830

Pulled By: javache

fbshipit-source-id: c2a976834cca7537bd832a698e8cd25cf877705b
2017-04-13 09:35:22 -07:00
Lukas Wöhrl 62360e8981 Let measure behave more like on the web
Summary:
Nodes with a measure function needs to be measured even so it seems there is no available space. So it behaves more like on the web. Fix facebook/yoga#488
Closes https://github.com/facebook/yoga/pull/499

Differential Revision: D4850458

Pulled By: emilsjolander

fbshipit-source-id: be5e35a670ddcbf3cd426fc3c2a0c9b60a874cdc
2017-04-13 08:49:43 -07:00
Georgiy Kassabli 831ad4adc6 Correct fix for flexing grandchildren
Reviewed By: emilsjolander

Differential Revision: D4875343

fbshipit-source-id: 634e961f9798dff43eae2c6564b28c6629b816e0
2017-04-13 08:49:43 -07:00
Lukas Wöhrl a82de9509f Fix sizing of non strech items
Summary:
Fixes the sizing of items so that under most scenarios it calcultes its height by it's content for non exact measurings. See facebook/yoga#505
Closes https://github.com/facebook/yoga/pull/506

Differential Revision: D4878875

Pulled By: emilsjolander

fbshipit-source-id: ab1174ac7a76dcf20aae7b29a3bc396e11077c4d
2017-04-13 07:57:21 -07:00
ZauberNerd 469acbaa9d fix mock for AsyncLocalStorage
Summary:
The current mock of `AsyncLocalStorage` seems to mock parts of the
`AsyncStorage` API that can't be found on the `AsyncLocalStorage`
object itself and therefore it doesn't work as expected.

What it should do is mock the API of `AsyncLocalStorage` which is a
`NativeModule` so that the `AsyncStorage` module can be used in tests
and it will require the mocked methods.

In order to enable behaviour in unit tests it is possible to replace or
overwrite the mock implementation, see the [jest guide on mocks](https://facebook.github.io/jest/docs/mock-functions.html).
By doing something similar to:
```javascript
import { NativeModules } from 'react-native';
const { AsyncLocalStorage } = NativeModules;
// mock 'multiGet', in order to allow 'AsyncStorage.getItem('myKey')'
AsyncLocalStorage.multiGet.mockImplementationOnce((keys, callback) => {
    callback(null, [['myKey', 'myValue']]);
});
// execute unit tests for code that makes use of 'AsyncStorage'
```
Closes https://github.com/facebook/react-native/pull/13433

Differential Revision: D4883389

Pulled By: javache

fbshipit-source-id: 92a0ee94480b3022acc748e306ee2d4ee7a9869d
2017-04-13 06:32:47 -07:00
Victor Ilyukevich 0d58669c81 Fix typo in documentation: "…controls how rows…"
Summary: Closes https://github.com/facebook/react-native/pull/13482

Differential Revision: D4883387

Pulled By: javache

fbshipit-source-id: fab3ce3136b18079a566e93fb3d388abc27dd41c
2017-04-13 05:52:45 -07:00
Kathy Gray 8e382fd006 Find hasConstant status via preprocessing
Reviewed By: javache

Differential Revision: D4867563

fbshipit-source-id: 66e4505d142fc4776cd727a025005b43d500b167
2017-04-13 05:30:14 -07:00
Vojtech Novak ea89af53cd fix typo
Summary: Closes https://github.com/facebook/react-native/pull/13418

Differential Revision: D4883386

Pulled By: javache

fbshipit-source-id: aa6195d4015ae5eb240b135a3c265be823652b11
2017-04-13 05:00:53 -07:00
Pieter De Baets 8dcef96fd8 Log to console in RCTTestRunner
Reviewed By: fkgozali

Differential Revision: D4875352

fbshipit-source-id: 68f9caf4f350d34b2fd180ff19353c698bfce452
2017-04-13 04:49:51 -07:00