Commit Graph

6463 Commits

Author SHA1 Message Date
Yann Pringault ed47efe4a1 Add Array.prototype.includes polyfill
Summary:
Add `Array.prototype.includes` polyfill.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes

I had all my `includes` running well on iOS 9 but when switching to Android `includes` threw an error.
[The compatibility table](http://kangax.github.io/compat-table/esnext/#test-Array.prototype.includes_Array.prototype.includes) shows that is not supported on Android yet as well as iOS 6-8.
With Chrome debugging it's working on both environment.
Closes https://github.com/facebook/react-native/pull/7756

Reviewed By: davidaurelio

Differential Revision: D3346873

Pulled By: vjeux

fbshipit-source-id: 2e17d29992873fbe4448b962df0423e516455b4b
2016-05-25 11:58:24 -07:00
Hedger Wang 8097fcf4e7 Fix NavigationTransitioner.
Summary:
- Address the issues reported at 7db7f78dc7 (commitcomment-17575647)
- Fix the logic that reduces the scenes.
- Fix the logic that computes the active scene for `renderOverlay`.

Reviewed By: ericvicenti

Differential Revision: D3344716

fbshipit-source-id: 3fce517ff1de212f412a77936012695bd2dcfc3c
2016-05-25 11:28:21 -07:00
Olivier Notteghem 80741a170a Prevent race condition leading to deadlock when destroying activity w/ catalyst instance.
Reviewed By: astreet

Differential Revision: D3345567

fbshipit-source-id: 8ac550456c99549a6c4bc2d2cdb19334f9e85c71
2016-05-25 11:13:19 -07:00
Pieter De Baets 4b0f0881eb Make RCTTiming module lazy
Reviewed By: nicklockwood

Differential Revision: D3346796

fbshipit-source-id: e7fa02f47bfca44272857864472c3f8ef59f56e5
2016-05-25 10:43:27 -07:00
Anoop Chaurasiya 1586a32fa7 add support to provide fallback-sourceURL: in case primary-sourceURL fails to load
Reviewed By: javache

Differential Revision: D3339692

fbshipit-source-id: 93fa1821bf4abca878832d4f75c6b9968d8d0460
2016-05-25 10:28:27 -07:00
yuyaohshimo 298dc7c152 Add "Coiney Madoguchi" to showcase
Summary:
"Coiney Madoguchi" is a registration app for Coiney (http://coiney.com/).
Closes https://github.com/facebook/react-native/pull/7299

Differential Revision: D3245067

Pulled By: mkonicek

fbshipit-source-id: 207a975593625d910b0c06e794fa95ed7b8d2789
2016-05-25 08:28:23 -07:00
Francois Dumas 84f82e5cdd use RN version from node_modules instead of jcenter
Summary:
the current `build.gradle` configuration make all third-party plugins to pull react native from jcenter instead of using version from `node_modules`.

For example, a newly generated project with RN 0.25 using https://github.com/ProjectSeptemberInc/gl-react-native leads to the following gradle output:

```
Download https://jcenter.bintray.com/com/facebook/stetho/stetho-okhttp/1.2.0/stetho-okhttp-1.2.0.pom
Download https://jcenter.bintray.com/com/facebook/stetho/stetho/1.2.0/stetho-1.2.0.pom
Download https://jcenter.bintray.com/com/facebook/stetho/stetho/1.2.0/stetho-1.2.0.jar
Download https://jcenter.bintray.com/com/facebook/stetho/stetho-okhttp/1.2.0/stetho-okhttp-1.2.0.jar
Download https://jcenter.bintray.com/com/facebook/react/react-native/0.20.1/react-native-0.20.1.aar
```
Closes https://github.com/facebook/react-native/pull/7470

Differential Revision: D3346526

Pulled By: mkonicek

fbshipit-source-id: 0f1d051f4340f35403931727982900a9fc7abad5
2016-05-25 07:58:23 -07:00
Nick Lockwood b49633e020 Fixed image test flakiness by tying decoded image cache to module lifecycle
Summary: The decoded image cache was previously static, meaning that cached images could persist beyond the lifetime of the module. This resulted in some flakiness in the RCTImageLoaderTests due to the loader returning cached image instanced from previous tests instead of the correct instance.

Reviewed By: bestander

Differential Revision: D3346329

fbshipit-source-id: 375af8894cef1c5b6303c6cdfd7eb57ebcfe3251
2016-05-25 06:58:23 -07:00
Nick Lockwood 57e9df4af2 Fixed multiline textinput onChange event
Summary: Broken in d9737571c4

Reviewed By: tadeuzagallo

Differential Revision: D3346276

fbshipit-source-id: 0cd67edb38b9f80b0976616059f9c2454cb34448
2016-05-25 06:13:25 -07:00
Philipp von Weitershausen 1e4d9d4897 Expose Systrace from the 'react-native' package
Summary:
This allows React Native apps to instrument their own code via Systrace.measureMethod() and the like.

**Test Plan:** Used require('react-native').Systrace in my own app successfully to instrument my own code.
Closes https://github.com/facebook/react-native/pull/7734

Differential Revision: D3346222

Pulled By: javache

fbshipit-source-id: 08ffc781a1187db89c6e9a0714d644dbc485724c
2016-05-25 05:28:22 -07:00
Nick Lockwood b71db11554 Update RCTNetworking, RCTNetInfo and RCTLocationManager to use new events system
Summary: Updated networking and geolocation to use the new events system.

Reviewed By: bestander

Differential Revision: D3346129

fbshipit-source-id: 957716e54d7af8c4a6783f684098e92e92f19654
2016-05-25 04:28:36 -07:00
Raincal 62f53ffaa7 remove paddingTop in AnimatedGratuitousApp
Summary:
Please see the screenshot below.
![qq20160525-0](https://cloud.githubusercontent.com/assets/6279478/15526182/74170a9e-2262-11e6-8f99-5e121ed7b9c1.png)
Closes https://github.com/facebook/react-native/pull/7733

Differential Revision: D3345791

fbshipit-source-id: 4e5885197a42b760a800970156fcdebadf227575
2016-05-25 00:13:31 -07:00
Chris Hopman a8acf8a5ce Move cxx module support into oss
Reviewed By: mhorowitz

Differential Revision: D3319751

fbshipit-source-id: 87f91a541cfbbe45bd8561d94f269ba976a9f702
2016-05-24 19:28:59 -07:00
MIYOKAWA, Nobuyoshi 04d86d819e Update XHR information for Android.
Summary:
Currently XHR also supports Android platform, so document should include this information.
Closes https://github.com/facebook/react-native/pull/7729

Differential Revision: D3345168

fbshipit-source-id: 8dee7d573a47aede5dc5be97640fc711747df65c
2016-05-24 19:28:59 -07:00
Basil Hosmer ac5636dd59 explicit type args in react-native-github
Reviewed By: vjeux

Differential Revision: D3342856

fbshipit-source-id: ba5a4d5529fc9d1d1efe98cc175d718c5f044a5b
2016-05-24 18:28:26 -07:00
Ahmed El-Helw caa2baee9d Fix leak in Nodes due to removeClippedSubviews
Reviewed By: astreet

Differential Revision: D3337513

fbshipit-source-id: b7b798f024488cd19cdcf93aee7f99eed512dd6a
2016-05-24 14:58:23 -07:00
Spencer Ahrens 0a027167de Fix WLV bug when data shrinks
Differential Revision: D3341453

fbshipit-source-id: 008cb65db6da74f2525ae8e667b702bc48f9f9ad
2016-05-24 13:28:20 -07:00
Andrei Coman 1926fdf156 Inline images package name fix
Summary: Renaming package name from textfrescosupport to text.frescosupport

Reviewed By: dmmiller

Differential Revision: D3340363

fbshipit-source-id: 6c73d9e05751ccba299489fbc13447dc85a9c0df
2016-05-24 12:43:30 -07:00
Konstantin Raev 2de0323182 Reverted commit D3339945
Summary: Updated networking and geolocation to use the new events system.

Reviewed By: javache

Differential Revision: D3339945

fbshipit-source-id: 01d307cf8a0aea3a404c87c6205132c42290abb1
2016-05-24 12:43:30 -07:00
Ben Alpert 8876eaaea0 Set up Systrace during initialization
Summary: When we're profiling, we want to load Systrace immediately and profile all the startup and initial render code. The code here used to load Systrace during startup only if `__DEV__` but would always start profiling once Systrace was otherwise required. That seems pretty hard to reason about, so I'm switching to always requiring Systrace during the startup path and enabling profiling if appropriate. In actual production that'll always be false, of course.

Reviewed By: javache

Differential Revision: D3338216

fbshipit-source-id: f173e82f34e110d83e7ff04f11af9b302a54b859
2016-05-24 12:13:24 -07:00
Alex Kotliarskyi 11449359e5 Add index page for packager
Summary:
When packager is running, visiting localhost:8081 produces ugly 404 "GET / not found"
This diff adds a simple index.html page that has a title and link to documentation.

It's a super tiny detail, but I hope it makes things a little nicer. Improvements are welcome.

Maybe we could include an offline copy of React Native's docs website?

Reviewed By: vjeux

Differential Revision: D3341242

fbshipit-source-id: c8cd4b647e69eb520ea8bc978bea070551225912
2016-05-24 11:58:23 -07:00
Rahul Jiresal 0e8c3ff463 Add a removeListener method to DeviceEventEmitter for Framework consi…
Summary:
The Framework is inconsistent in how listeners are removed in certain classes. This issue has been discussed in https://github.com/facebook/react-native/issues/6493.

For example,

**DeviceEventEmitter**

```javascript
/* Current */
this.keyboardHideObserver = DeviceEventEmitter.addListener('keyboardWillHide', this.keyboardWillHide);
this.keyboardHideObserver.remove();

/* Expected (maybe in addition to the current API) */
DeviceEventEmitter.addListener('keyboardWillHide', this.keyboardWillHide);
DeviceEventEmitter.removeListener('keyboardWillHide', this.keyboardWillHide);
```
**AppStateIOS**

```javascript
AppStateIOS.addEventListener('change', this.handleAppStateChange);
AppStateIOS.removeEventListener('change', this.handleAppStateChange);
```

The API should be consistent, and preferably should allow both ways of removing the listeners.

Currently, developers who tried to use the second way of removing the listeners get an error for function not found. Due to the lack of documenta
Closes https://github.com/facebook/react-native/pull/6884

Differential Revision: D3341235

Pulled By: nicklockwood

fbshipit-source-id: 87431e8b667f46ad002d4a6e3ca07cbc1e6b4007
2016-05-24 11:45:51 -07:00
Neo 986f67ac4f Add NeoReader to showcase
Summary:
detail about NeoReader
https://github.com/nihgwu/NeoReader/
Closes https://github.com/facebook/react-native/pull/7716

Differential Revision: D3341121

fbshipit-source-id: 91bea4e906c68b9a687be4edfb17a0e3ea815d64
2016-05-24 11:28:21 -07:00
Nick Lockwood 3f08fe4b7f Update RCTNetworking, RCTNetInfo and RCTLocationManager to use new events system
Summary: Updated networking and geolocation to use the new events system.

Reviewed By: javache

Differential Revision: D3339945

fbshipit-source-id: f1332fb2aab8560e4783739e223c1f31d583cfcf
2016-05-24 10:29:00 -07:00
Ben Nham 71bf8a3e48 Only clear image contents on memory warning
Summary:
Some apps are complaining about flashing images when performing navigation transitions. An example issue would be:

1. Load a master list view with many images
2. Click on an image to go to a detail view
3. Go back to the master list view

At step (3), users see a number of images flash from a placeholder image back to the final image because `-[RCTImageView didMoveToWindow]` calls `clearImage` when the image view exits the view hierarchy between (1) and (2) and calls `reloadImage` (which sets the image property asynchronously) when the image view re-enters the view hiearchy between (2) and (3).

This diff fixes the issue by being less aggressive about clearing image contents. It only clears image contents when the app receives a memory warning or the app goes into the background.

For comparison, CKNetworkImageComponent in ComponentKit doesn't have this purging behavior at all.

Reviewed By: javache

Differential Revision: D3325009

fbshipit-source-id: efca10099cdfdb49afbb3f550854d4b8a40511d0
2016-05-24 08:43:23 -07:00
taelimoh 7113367000 Changed module name from 'ReactNative
Summary:
Platform is in React-Native not React.
Closes https://github.com/facebook/react-native/pull/7718

Differential Revision: D3340334

fbshipit-source-id: 3816f8966bc5b675097182aaf3304d465fbebb95
2016-05-24 08:13:22 -07:00
David Aurelio 3d8725dfdb Respect original enumerability/writability when polyfilling globals
Summary:
Reuses the original property descriptor when overwriting / polyfilling globals to ensure enumerability and writability are the same
Closes https://github.com/facebook/react-native/pull/7704

Differential Revision: D3338119

Pulled By: davidaurelio

fbshipit-source-id: ab456324a3346cd3ec8b2c3e3a2378408c92087c
2016-05-24 06:58:17 -07:00
David Aurelio 6629ae9fdf adapt instantiation of node-haste/DependencyGraph to new version
Reviewed By: bestander

Differential Revision: D3339969

fbshipit-source-id: 2b81f8019223b060f3e3afb940cc58360ed024e5
2016-05-24 05:13:27 -07:00
Martin Kralik 2c8abebccc improved description for RCTTouchEvent
Summary: This will make error messages more helpful.

Reviewed By: javache

Differential Revision: D3292400

fbshipit-source-id: d1e0bb24593058b75422824c0d351ede1320029e
2016-05-24 05:13:27 -07:00
Janic Duplessis a71a9efe96 Remove deprecated PullToRefreshViewAndroid and onRefreshStart / endRefreshing
Summary:
Removes the deprecated APIs that were replaced by `RefreshControl`. Those API have been deprecated for a while already so I think it's fine to remove them at this point. Also ported the `SwipeRefreshLayoutTestModule` test to use `RefreshControl` instead of `PullToRefreshViewAndroid`.

**Test plan (required)**

Made sure no references are left in the codebase to `PullToRefreshViewAndroid`, `onRefreshStart` and `endRefreshing`.
Tested that `ScrollView` examples in UIExplorer still work properly.
Check that the `SwipeRefreshLayoutTestModule` passes on CI.
Closes https://github.com/facebook/react-native/pull/7447

Reviewed By: mkonicek

Differential Revision: D3292391

Pulled By: bestander

fbshipit-source-id: 27eb2443861e04a9f7319586ce2ada381b714d47
2016-05-24 03:28:25 -07:00
Nick Lockwood 18d6d85320 Fixed UIExplorer
Summary: CI_USE_PACKAGER flag was set only for testing, not running.

Reviewed By: nathanajah

Differential Revision: D3334982

fbshipit-source-id: 3f98e697bd144a4ac6d8d7cfabf546bb55de1695
2016-05-24 02:58:23 -07:00
Urban Cvek ddc374fac8 Add renderAsOriginal to selectedIcon
Summary:
Hey,
I've created a PR a few weeks ago #7264. It got merged in and then I received some emails and got mentioned in a few issues that it doesn't use renderAsOriginal prop on selectedIcon. Instead the app would use tint color.

The problem can be seen here #7467.

I've now added a method in TabBarItem that sets selectedIcon to renderAsOriginal if the prop is set.
I added a "relay" icon to UIExplorer TabBarIOS example so you can see the item is now rendered in color as the image supplied.

Oh and also should this PR be made from master. Had to work on this issue from 0.27 because the master was broken for me.
Closes https://github.com/facebook/react-native/pull/7709

Differential Revision: D3339795

fbshipit-source-id: d8d4699bb617ecae8996a6627f3774c6473c19e0
2016-05-24 01:58:23 -07:00
James Ide 1343248bbe Set statics on the NavigationCard container
Summary:
NavigationCard is wrapped in a container, which breaks statics so apply the statics to the wrapped class instead.
Closes https://github.com/facebook/react-native/pull/7483

Differential Revision: D3336226

Pulled By: ericvicenti

fbshipit-source-id: ae28e7be7a6227700c2c11081c5605f3667d1494
2016-05-23 20:43:28 -07:00
Konstantin Raev f60cabf34b website generation
Summary:
TestPlan:
- cd website
- node ./server/generate.js
Closes https://github.com/facebook/react-native/pull/7706

Differential Revision: D3335839

fbshipit-source-id: bd4a65d23ce242a5aa1d6a545dafa6be565e43c5
2016-05-23 12:28:38 -07:00
Anoop Chaurasiya be38ae1169 provide verbose error-message on bundle-load-failure
Reviewed By: fkgozali

Differential Revision: D3329107

fbshipit-source-id: 33c02ff066ec9ad415a5cc4639347ebdef67c604
2016-05-23 11:13:24 -07:00
Hedger Wang 0b72eba869 Fix UI Explorer in Android.
Summary:
The refactor work (renamed `navigationState.children` to `navigationState.routes`) from D3333735
broken UI Explorer in Android. Fix it.

Reviewed By: ericvicenti

Differential Revision: D3334014

fbshipit-source-id: 345fbb5eabc792a49c6f2f82ce8c03679bc75940
2016-05-23 10:58:26 -07:00
Eric Rozell 68af89dcbf Update node-haste dependency to 2.12.0
Summary:
Update to node-haste 2.12.0 to support pass through configuration of supported platforms.
Closes https://github.com/facebook/react-native/pull/7660

Differential Revision: D3335034

Pulled By: mkonicek

fbshipit-source-id: d238b90a90d51654301d61251ceb26d183fef57a
2016-05-23 10:28:34 -07:00
Fred Liu ca71143ff4 Faster animation
Summary: Reduce auto-swipe animation duration to 200 ms to increase swipe speed.

Reviewed By: zjj010104

Differential Revision: D3333942

fbshipit-source-id: a9e0b15926ef854adcd9e1d2c1e67fd080139d84
2016-05-23 10:28:34 -07:00
Emil Sjolander 1767a0a828 Correctly implement measure callback with measure modes
Reviewed By: astreet

Differential Revision: D3330139

fbshipit-source-id: 2ea6e4b463817e9ccc5f2d9395736f68f8d972e4
2016-05-23 10:28:34 -07:00
Marc Horowitz f7c4ed8926 Fix chrome debugging on android
Summary:
Java loadApplicationScript changed, but the C++ code in the
debug ProxyExecutor which called it did not.  This fixes the fbjni
method lookup.

fixes #7659

Reviewed By: AaaChiuuu

Differential Revision: D3331472

fbshipit-source-id: 33312dccc3c7687f51742e42f9e0397f9c925e76
2016-05-23 09:43:23 -07:00
Alexander Blom 81e4b4202a Don't block waiting for UI thread to be ready
Reviewed By: astreet

Differential Revision: D3323227

fbshipit-source-id: bc8a815f9dca43c8c1adebc7b2554f931f135f33
2016-05-23 09:28:21 -07:00
Nick Lockwood d9737571c4 Updated AppState module to use new emitter system
Summary: AppState now subclasses NativeEventEmitter instead of using global RCTDeviceEventEmitter.

Reviewed By: javache

Differential Revision: D3310488

fbshipit-source-id: f0116599223f4411307385c0dab683659d8d63b6
2016-05-23 09:13:37 -07:00
Nick Lockwood c87b737ca1 Fixed tests
Reviewed By: bestander

Differential Revision: D3334669

fbshipit-source-id: ba0ae2ec5ea06c27d40ceed3ca8bf7a9da27dda9
2016-05-23 08:28:28 -07:00
David Aurelio 4c76e5476c remove premature optimizations
Reviewed By: javache

Differential Revision: D3325805

fbshipit-source-id: cdf8f4f3744d70fd37e8fa35c44ca8110ea4395a
2016-05-23 07:28:25 -07:00
Konstantin Raev 5d06402b4a Made npm deployment to be independent of git tags cache
Summary:
Fixes npm deployment script as in https://circleci.com/gh/facebook/react-native/6745.

Example situation:
- admin is ready to release 0.26.0
- admin adds tag v0.26.0 and pushes to origin
- Circle CI build fails because of code error
- admin cherry-picks a fix and tags v0.26.0 again and pushes to origin
- Circle does not update local tag v0.26.0 because it already has it cached, compiles the code but fails to deploy to npm because v0.26.0 is not on branch HEAD from Circle point of view

The previous version of the script was checking the tags on current commit as well but it used the local branch tags.
This change fetches tags from `origin` fresh and allows us to redeploy the same version multiple times.
Closes https://github.com/facebook/react-native/pull/7619

Differential Revision: D3334469

fbshipit-source-id: b423fc19516dc4f5f7f2605224e62b8a378c8a7d
2016-05-23 06:58:28 -07:00
Shiran Ginige a3f50ec8a0 Fixing the issue on packager (failing with siblings error)
Summary:
The packager was failing with below error after a fresh clone

npm ERR! peerinvalid The package react@15.1.0 does not satisfy its siblings' peerDependencies requirements!

Changed the dependancy for **^react@15.1.0-alpha.1** to **^react@15.1.0** and it was fixed.
Closes https://github.com/facebook/react-native/pull/7692

Differential Revision: D3334425

fbshipit-source-id: ee86fc2e3c6f19b2430658d91d0a88c50bcf11de
2016-05-23 06:13:20 -07:00
Janic Duplessis bb5aede6e3 Fix RefreshControl race condition
Summary:
Improved version of #7317.

`setRefreshing` and `setProgressViewOffset` needs to be called after the view has been layed out. Instead of using `post` to do that we update the `refreshing` and `progressViewOffset` values in the first call to `onLayout`.

I also noticed that `progressViewOffset` default value wasn't exactly the same as when not calling `setProgressViewOffset` at all. Tweaked the values to match android defaults.

**Test plan (required)**
Make sure the integration test passes,
In UIExplorer: test RefreshControl with `refreshing = true` initially, test `progressViewOffset`.
Closes https://github.com/facebook/react-native/pull/7683

Differential Revision: D3334426

fbshipit-source-id: ddd63a5e9a6afe2b8b7fe6a25e875a40f4e888c6
2016-05-23 05:43:25 -07:00
James Ide 69bf0bd8c1 Run CircleCI tests on the latest version of Node
Summary:
Travis CI runs Node 4 (LTS), so make CircleCI run Node `<latest>` which is Node 6.
Closes https://github.com/facebook/react-native/pull/7542

Differential Revision: D3334397

fbshipit-source-id: 15a758011626fca4efdc4c1b36891a4d73c52e94
2016-05-23 05:13:29 -07:00
Pieter De Baets 4880309e72 Prevent Systrace from including React in the preloaded modules section
Reviewed By: tadeuzagallo

Differential Revision: D3304923

fbshipit-source-id: 25dea5b57002578ccb3e38e8946c6b73db008ed0
2016-05-23 04:58:24 -07:00
MIYOKAWA, Nobuyoshi 8f9a3aa0e2 Add .iml to ignore target.
Summary:
Sorry for trivial one, but I feel no need to share '.iml' in a project, so it should be ignored.
Closes https://github.com/facebook/react-native/pull/7689

Differential Revision: D3334367

fbshipit-source-id: 2a68aa93084a51d0b3d24427c71bc7c12e41ed78
2016-05-23 04:58:24 -07:00