Commit Graph

8252 Commits

Author SHA1 Message Date
Pieter De Baets 95cb4ea752 Fix UIView borderWidths not rendering correctly
Reviewed By: majak

Differential Revision: D4111231

fbshipit-source-id: f02c8f2ebda4c3e397d746ed5433afea539c9a88
2016-11-01 11:13:53 -07:00
Ashok Menon 1a75ba3c67 Expose BC version
Reviewed By: javache

Differential Revision: D4110361

fbshipit-source-id: 6cde7d8ca26d30a804f1a99cf9380dcbc0ff5541
2016-11-01 10:28:55 -07:00
Ashok Menon ace32e650c Refactoring JSC Wrapper
Reviewed By: javache

Differential Revision: D4110360

fbshipit-source-id: 5a8bda7cf005dc340ad18a559f8bf0da8d4075d1
2016-11-01 10:28:55 -07:00
Ashok Menon 16290851aa Recognise and run BC bundles
Reviewed By: javache

Differential Revision: D4067425

fbshipit-source-id: fade9adebfa8a59dc49aeadfd01a782f7b686082
2016-11-01 10:28:55 -07:00
Martin Konicek 94711bfb06 Use yarn when available
Summary:
**Motivation**

`react-native init` takes minutes even on a fast network. Yarn makes it much quicker.

When yarn is not installed on the system:

<img width="440" alt="screenshot 2016-10-31 22 21 19" src="https://cloud.githubusercontent.com/assets/346214/19873897/7bad5662-9fb9-11e6-85fb-ad4879949dad.png">

When yarn is installed:

<img width="441" alt="screenshot 2016-10-31 22 02 20" src="https://cloud.githubusercontent.com/assets/346214/19873898/7baf4c56-9fb9-11e6-96b3-007f93d2438a.png">

Also added the option `react-native init AwesomeApp --npm` as a fallback in case yarn is not stable enough for some people (I saw some Github issues that yarn hangs for example; for me it works great though).

**Test plan**
1. Publish to Sinopia: https://github.com/facebook/react-native/tree/master/react-native-cli
2. `react-native init AwesomeApp`

***Tested the following setups***

- New CLI - uses yarn, new react-native - uses yarn
- Old CLI (1.0.0) - doesn't use yarn, new react-native - uses yarn
-
Closes https://github.com/facebook/react-native/pull/10626

Differential Revision: D4110883

Pulled By: bestander

fbshipit-source-id: 8a3427e2bc9158cf5fadd8ddf5b31e4b50ce6453
2016-11-01 09:28:52 -07:00
James Ide 5105c09f56 Fix missing methods in Keyboard module
Summary:
They keyboard module is an instance of `NativeEventEmitter` which is an instance of `EventEmitter`. But the exported module only has a small subset of the APIs. This broke existing codebases which are using the methods not exported currently.

The PR just reassigns the variable before exporting so that the actual module is exported instead of the dummy object used for documentation. It also fixes a layout issue in the documentation.
Closes https://github.com/facebook/react-native/pull/10671

Differential Revision: D4110355

fbshipit-source-id: a6757f3ca8c2494970ba221b10a7e6e9a5f2d64d
2016-11-01 08:58:39 -07:00
David Aurelio 29888b540b buck worker tool: catch errors thrown from commands, and respond with errors.
Reviewed By: cpojer

Differential Revision: D4057884

fbshipit-source-id: acfe0cc57b541a534dd640380c69f591c1fb83c6
2016-11-01 05:58:43 -07:00
James Ide fc11a5fde8 Add support for native animated events on iOS
Summary:
This adds native support for `Animated.event` on iOS.

**Test plan**
Tested in the native animated UIExplorer example that it works properly like on Android.
Closes https://github.com/facebook/react-native/pull/9598

Differential Revision: D4110331

fbshipit-source-id: 15748d23d0f475f2bcd1040ca3dca33e2620f058
2016-11-01 03:58:53 -07:00
James Ide 0fe1c7a9ff Fix symbolication failure caused by attempt to modify frozen frame
Summary:
This change makes so that processing stack trace before sending it to packager (see 7dbc805)
doesn't modify original frames but creates a copies instead.

This is required because after some changes that also have been landed in 0.35, frames that arrive to
'symbolicateStackTrace' are already frozen, so changing 'file' property of the original frame causes
symbolication to fail.
Closes https://github.com/facebook/react-native/pull/10655

Differential Revision: D4110273

fbshipit-source-id: 0302694b520d83a79c3cb67903038b3f494315f2
2016-11-01 02:58:41 -07:00
Janic Duplessis cdd2d791c9 Support static values in NativeAnimated transforms on iOS
Summary:
Support static values (non-animated) in transform config like Android already does.

**Test plan**
Tested in UIExplorer native animated example by adding a transform with a static value and comparing with JS.
Closes https://github.com/facebook/react-native/pull/10664

Differential Revision: D4109515

fbshipit-source-id: 2d7de17d51d6df835c569fd45d2de8fc170bf928
2016-10-31 21:13:41 -07:00
Janic Duplessis 2b49eddcfd Fix initial value of native Animated.Value
Summary:
Native Animated.Value uses the value it was created with when sending the config to native but this causes issue when the value has changed before calling `__makeNative` this happens with the `progress` value for `NavigationExperimental`. It gets initialized with value 1, then uses `setValue` to change it to 0 before starting the animation and this is when `__makeNative` is called. This simply uses the current value instead of the value passed to the constructor. Also pass offset so native implementations that support it can use it (iOS).

**Test plan**
Tested that the first transition that uses the `progress` animated value is not broken in an app that uses `NavigationExperimental` when using `useNativeDriver` for animations.
Closes https://github.com/facebook/react-native/pull/10656

Differential Revision: D4107624

fbshipit-source-id: 921cf4a3422cf91923bc315fd7a15c508becddae
2016-10-31 20:43:44 -07:00
Ben Nham c089761f9b Use JSCExecutor to manage loading js script in JSContext
Reviewed By: jaegs

Differential Revision: D4021624

fbshipit-source-id: 8e46052ad246e842a88715d55059a233196a4a6b
2016-10-31 15:13:49 -07:00
Janic Duplessis 34c7e7610c Fix setAnimatedNodeValue in Native Animated on iOS
Summary:
`setAnimatedNodeValue` currently does not update views if there is no animation currently running. This simply updates the view immediately instead of relying on the animation loop. Extracted it out in a function to be able to use it for native `Animated.event` too.

**Test plan**
Tested this in an app using native driven animations with `NavigationCardStackPanResponder` that makes use of `setValue` to update `Animated.Values` during the back gesture.
Closes https://github.com/facebook/react-native/pull/10643

Differential Revision: D4106346

fbshipit-source-id: 7c639e03ded87058354340f1179f8b75be423e84
2016-10-31 14:28:42 -07:00
Leo Natan 3ac3749ac3 Fix for Unicode decoding issue when using incremental networking.
Summary:
This is **a critical issue**.

The issue arises when incremental networking is enabled from JS by setting `onprogress` or `onload` on an `XMLHttpRequest` object.

The results:

![example1](https://cloud.githubusercontent.com/assets/2270433/18829964/5a54ff30-83e7-11e6-9806-97857dce0430.png)

![example2](https://cloud.githubusercontent.com/assets/2270433/18829966/5bf40a66-83e7-11e6-84e6-9e4d76ba4f8b.png)

Unicode characters get corrupted seemingly in random. The issue is from the way Unicode character parsing is handled in `RCTNetworking.mm`. When incremental networking is enabled, each chunk of data is decoded and passed to JS:

```objective-c
incrementalDataBlock = ^(NSData *data, int64_t progress, int64_t total) {
NSString *responseString = [RCTNetworking decodeTextData:data fromResponse:task.response];
if (!responseString) {
  RCTLogWarn(@"Received data was not a string, or was not a recognised encoding.");
  return;
}
NSArray<id> *responseJSON = @[task.requestID, responseString, @(prog
Closes https://github.com/facebook/react-native/pull/10110

Reviewed By: yungsters

Differential Revision: D4101533

Pulled By: fkgozali

fbshipit-source-id: 2674eaf0dd4568889070c6cde5cdf12edc5be521
2016-10-31 13:13:38 -07:00
Cristian Carlesso 6d3e074dd4 Adding Jest preset so that people can configure Jest using react-native as preset
Reviewed By: cpojer

Differential Revision: D4081817

fbshipit-source-id: 43cf2ec467ea69651705162b6a58e0b3f1ad1dbf
2016-10-31 12:58:35 -07:00
Dustin Shahidehpour bb84c37dce Prevent crash when accessing child count, but child list is NULL.
Reviewed By: emilsjolander

Differential Revision: D4104093

fbshipit-source-id: cd7b09818759aa76415b97e241f1a6746a2bc50c
2016-10-31 12:44:09 -07:00
Jean Lauliac 66406cc6f9 extract-dependencies.js: fix out-of-date comment
Summary: We actually use the AST, not regexes. Fix comment.

Reviewed By: davidaurelio

Differential Revision: D4104797

fbshipit-source-id: e37d168bd541d9d222667d0d168aa6b6099c1275
2016-10-31 11:43:37 -07:00
Tim Yung 8b653cde56 RN: Show Warning for Background Remote Debuggers
Summary:
Some recent change to Chrome causes the remote debugger to be throttled unexpectedly if it is in a background tab. Although this does not fix the problem, it raises the issue and suggests a workaround.

I also cleaned up some littering of the global namespace in the debugger web worker.

Reviewed By: jingc

Differential Revision: D4104515

fbshipit-source-id: 56e46c0e759bec4c42d3baedd4d2d46cdea2e4a0
2016-10-31 11:29:57 -07:00
Tim Yung 448e66b3fa RN: Cleanup Debugger HTML
Summary: Minor cleanup to `debugger.html`.

Reviewed By: fkgozali

Differential Revision: D4104499

fbshipit-source-id: f484711b4a855a1fd703d3a457b96ad45e0250e2
2016-10-31 11:29:57 -07:00
Emil Sjolander df7d61bbbb Some small simplifications for function return values
Reviewed By: gkassabli

Differential Revision: D4101772

fbshipit-source-id: 626df10c0fc76278c330c86be4dc82fdda5f5156
2016-10-31 11:13:39 -07:00
Emil Sjolander d0f8e7f35c void* -> CSSNodeRef in CSSNodeList
Reviewed By: gkassabli

Differential Revision: D4101773

fbshipit-source-id: 8a5c9066da796967bd02ce6b1fc74ff40e15dfe1
2016-10-31 11:13:39 -07:00
Howard Yeh d4b8ae7a8a Android shouldn't dispatch onLayout if frame didn't change
Summary:
Fixes [#7202 Android Redundant onLayout event](https://github.com/facebook/react-native/issues/7202)
Closes https://github.com/facebook/react-native/pull/7250

Differential Revision: D4104066

Pulled By: mkonicek

fbshipit-source-id: 383efdb4b4881aa7d7e508d61c9c01165bcf7bb6
2016-10-31 10:58:49 -07:00
Cristian Carlesso 9833e1bd34 Fixes typo
Reviewed By: bestander

Differential Revision: D4103918

fbshipit-source-id: 1176f97cf489180490e497be7deca331ed26e730
2016-10-31 09:28:36 -07:00
Pieter De Baets 7063ff466a Modules export constants if any superclass exports them (2nd try)
Reviewed By: fkgozali

Differential Revision: D4098128

fbshipit-source-id: 73d7f068373b3a9dd5af1881b4cca4e54856cec6
2016-10-31 04:58:50 -07:00
Jean Lauliac bd867c1105 Module.js: add @flow
Reviewed By: cpojer

Differential Revision: D4095611

fbshipit-source-id: d87509153eab3d8dbcd65b8c6c6ffb3e5746685f
2016-10-31 04:28:29 -07:00
Dan Purdy 954df6d13e Update image docs with missing iOS style warning
Summary:
As discussed in #10570 to document that corner specific border radius styles are unsupported with the iOS image component.

Closes #10570

Have signed the CLA and ensured the website section affected still works
Screenshot included as suggested in the contribution guidelines.

![rn-doc-update](https://cloud.githubusercontent.com/assets/1386054/19838492/4eb91d7c-9ec8-11e6-98cf-c085ef4af5c2.png)
Closes https://github.com/facebook/react-native/pull/10632

Differential Revision: D4102593

fbshipit-source-id: ffc901ec4e7e50f5a189fb2d98d79eaa33a95e37
2016-10-30 11:28:28 -07:00
Adam Miskiewicz 426e66cfe6 Reverted commit D4099819
Summary:
Now that native animations for opacity and springs have landed in both iOS and Android, we can enable native animations both for TouchableBounce and TouchableOpacity.
Closes https://github.com/facebook/react-native/pull/10583

Differential Revision: D4099819

Pulled By: jingc

fbshipit-source-id: de70f8732b84d4caf0e4adfb2ad0e95b3de5da0f
2016-10-29 13:59:02 -07:00
Pooya Parsa cd97128ba3 os.tmpDir() is deprecated
Summary:
According to [5e5ec2cd1e](https://github.com/nodejs/node/commit/5e5ec2cd1e) os.tmpDir() is now deprecated in node.js 7 and `os.tmpdir()` is preferred :)

Current status:
Bundler shows annoying warning every time it runs :)
Closes https://github.com/facebook/react-native/pull/10620

Differential Revision: D4101498

fbshipit-source-id: 0de8cc30f684f1f22191c64fa2c7ce73c5abf9ea
2016-10-29 13:59:01 -07:00
Sadika Sumanapala 93ed185c3d Use HTTPS in the OG image on the website
Summary:
Use https instead of http
Closes https://github.com/facebook/react-native/pull/10619

Differential Revision: D4100991

fbshipit-source-id: 200f3df3b02db36182fc176f2d654ba780d121e3
2016-10-29 01:28:36 -07:00
Michał Gregorczyk afe1619eb8 Do not block RN start path with fsync calls
Reviewed By: bnham

Differential Revision: D4097184

fbshipit-source-id: b3a7aeac7f4196a510efe650194eebdc797b5ec9
2016-10-28 19:43:34 -07:00
Christine Abernathy 9d86a1295e Fix Xcode build error on non-standard setup
Summary:
This change is related to https://github.com/facebook/react-native/issues/9677 that can happen when trying to get an Xcode release build, which in turn calls  `react-native-xcode.sh` and if one has a non-standard file setup, ex:

```
ios/
 |_ (iOS related code)
js/
 |
 |_ index.ios.js
     node_modules
     package.json
     (other React Native JS code)
```

The error output in this case is:

```
+ DEST=/Users/caabernathy/Library/Developer/Xcode/DerivedData/Mixer-ffglwypovddbciahtlducaeuqxqa/Build/Products/Release-iphonesimulator/Mixer.app
+ [[ Release = \D\e\b\u\g ]]
+ BUNDLE_FILE=/Users/caabernathy/Library/Developer/Xcode/DerivedData/Mixer-ffglwypovddbciahtlducaeuqxqa/Build/Products/Release-iphonesimulator/Mixer.app/main.jsbundle
+ node /Users/caabernathy/Facebook/OpenSource/Apps/RWMixer/Sample/Build/Mixer-Challenge/js/node_modules/react-native/local-cli/cli.js bundle --entry-file index.ios.js --platform ios --dev false --reset-cache --bundle-output /Users/caabernathy/Library/Developer/X
Closes https://github.com/facebook/react-native/pull/10262

Differential Revision: D4100083

Pulled By: lacker

fbshipit-source-id: 476f38990d09d5c26c22df77630b1a71b42959e2
2016-10-28 18:44:36 -07:00
Adam Miskiewicz 1bb323e256 Use native animations in TouchableBounce and TouchableOpacity
Summary:
Now that native animations for opacity and springs have landed in both iOS and Android, we can enable native animations both for TouchableBounce and TouchableOpacity.
Closes https://github.com/facebook/react-native/pull/10583

Differential Revision: D4099819

Pulled By: lacker

fbshipit-source-id: 247d7bff9a778e520af764f571caf6286b4a5749
2016-10-28 17:58:41 -07:00
Fabian Köster 55ebb89916 Enable TLS 1.1 and TLS 1.2 on Android 4.1-4.4
Summary:
This is a proposed patch for issue #7192.

Android 4.1-4.4 has support for TLS 1.1 and 1.2 but it is disabled by default. Because of the known security issues and more and more servers switching to TLS 1.2 only, it would be nice for react-native to enable this support.

I demonstrated a demo application which showcases the problem and can be used to test this patch. All sources and documentation for it can be found here:

https://github.com/bringnow/react-native-tls-test

Credits to Alex Gotev (gotev) for the nice implementation.
Closes https://github.com/facebook/react-native/pull/9840

Differential Revision: D4099446

Pulled By: lacker

fbshipit-source-id: 94db320dce6d27f98169e63f834562360c00eef7
2016-10-28 17:14:00 -07:00
Héctor Ramos 9cb370dd5b Generate Atom feed for the React Native blog.
Summary:
An Atom feed is now generated as part of the build script. This is done statically and not as a React view because React is not the right tool for generating XML documents.

Some additional metadata is stored in `metadata-blog.js` and duplicated to `metadata-blog.json` in the `server/` directory to aid in the generation of the feed. Let me know if there's a better way to import this data using the existing Haste module that wouldn't require writing an additional JSON file.

The feed will be available at https://facebook.github.io/react-native/blog.xml

A sample output of the Atom feed is included at the bottom. It is a [valid Atom 1.0 feed](https://validator.w3.org/feed/check.cgi), with some additional recommendations that can be ignored for now.

> Congratulations!
>
> [Valid Atom 1.0] This is a valid Atom 1.0 feed.
> Recommendations
>
> This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
> line 2, col
Closes https://github.com/facebook/react-native/pull/10611

Differential Revision: D4097381

Pulled By: mkonicek

fbshipit-source-id: 8d2e18923358d1903b2715b00c48680b0c4dff68
2016-10-28 13:28:37 -07:00
Mehdi Mulani a96b4ab5a0 Warn when height/width is set in style without correct flex
Reviewed By: emilsjolander, yungsters

Differential Revision: D4095399

fbshipit-source-id: 6246e47a39ebbc60835bc1ce5e9fb78c6630a851
2016-10-28 12:13:37 -07:00
Cristian Carlesso 45275e30b9 Fixes Components with prefixes in mock
Reviewed By: bestander

Differential Revision: D4096027

fbshipit-source-id: 342677a27c6d03dc7d2d6eb53970a504fb62d63b
2016-10-28 10:58:39 -07:00
Ovidiu Viorel Iepure 4cff039d78 Circle CI releases now work with Java 8
Reviewed By: bestander

Differential Revision: D4095313

fbshipit-source-id: 1806db054bbca86f6394af077baeccac4e7efbe1
2016-10-28 07:58:52 -07:00
Mehdi Mulani 103257b793 Fix ModalExample flex issue with Button
Reviewed By: majak

Differential Revision: D4091827

fbshipit-source-id: be8e611d6b514fc7c7c5b6242b7b032942b1109c
2016-10-28 05:43:35 -07:00
Kevin Gozali cea7c6edf2 Reverted commit D4081915
Reviewed By: fkgozali

Differential Revision: D4081915

fbshipit-source-id: 7fa750becc12b40861f30d86411388180fec2d59
2016-10-27 17:28:40 -07:00
Emily Janzer 3580de541d fix notification task timeout crashing
Reviewed By: hedgerwang

Differential Revision: D4088570

fbshipit-source-id: e2a217564d9325815e396daafbef2b7f06e84b33
2016-10-27 17:28:40 -07:00
Pieter De Baets 285786ad30 Correctly generate viewConfig for shadow properties
Reviewed By: fkgozali

Differential Revision: D4090109

fbshipit-source-id: 6aa24ae95ddcbdabdc5d1da8ab817960bde960a4
2016-10-27 12:43:52 -07:00
Emil Sjolander 844cafd883 Set layout outputs on java object from C
Reviewed By: lexs

Differential Revision: D4077968

fbshipit-source-id: bce86ba610cd5ae36cfb45d78b2609c63a14cfa3
2016-10-27 10:58:42 -07:00
Emil Sjolander 8e69a9f695 BREAKING - Make first parameter of measure and print functions CSSNodeRef instead of just context
Reviewed By: javache

Differential Revision: D4081544

fbshipit-source-id: d49679025cea027cf7b8482898de0a01fe0f9d40
2016-10-27 10:58:42 -07:00
Emil Sjolander 553f4371e0 BREAKING - Change measure() api to remove need for MeasureOutput allocation
Reviewed By: splhack

Differential Revision: D4081037

fbshipit-source-id: 28adbcdd160cbd3f59a0fdd4b9f1200ae18678f1
2016-10-27 10:58:42 -07:00
Gant Laborde bafc6ddbd1 remove busywork of upgrade docs, move to symbols
Summary:
We constantly get PRs that are busywork.

_e.g._ https://github.com/facebook/react-native/pull/10555#issuecomment-256301537

This PR hopefully makes a clear doc that won't get PRs.
Closes https://github.com/facebook/react-native/pull/10595

Differential Revision: D4089166

Pulled By: JoelMarcey

fbshipit-source-id: cf5af53ecc868a7a3e6c2e14edcb6f271fdd6190
2016-10-27 10:29:12 -07:00
Mehdi Mulani 97153d68cf Guard against bad values set in RCTCustomScrollView
Summary:
UIScrollView's internal logic with scroll indicator dies when bad values (e.g. NaN/Infinity) are set on the position/size.
We already guard UIManager with these checks but the RCTScrollView's underlying scrollview (RCTCustomScrollView) can get these set from other places, and we're seeing crashes in this area.

Reviewed By: javache

Differential Revision: D4088601

fbshipit-source-id: b1185cc7c65ba0266787441169264c94338fc55c
2016-10-27 09:28:32 -07:00
Pieter De Baets aa4428cd13 Remove customDirectEventTypes
Summary: This method has been deprecated for a while and there are no internal use-cases left (customBubblingEventTypes is still used by RCTViewManager though).

Reviewed By: fkgozali

Differential Revision: D4083327

fbshipit-source-id: 261e0dce3b41714d13b46d146f87fc415eb9e817
2016-10-27 06:58:52 -07:00
Pieter De Baets 19ab84ffb7 Cleanup and simplify view config generation
Reviewed By: fkgozali

Differential Revision: D4083308

fbshipit-source-id: 42ca797a8faede68bd031e84cf1c33a3e3ade37f
2016-10-27 06:58:52 -07:00
Pieter De Baets af3f656d97 Modules export constants if any superclass exports them
Reviewed By: fkgozali

Differential Revision: D4081915

fbshipit-source-id: 3a99033cd156c1393f7c8bbbb45f43772eb3a8df
2016-10-27 04:29:01 -07:00
Pieter De Baets 8bc30af6c8 Fix some warnings in React.xcodeproj
Reviewed By: majak

Differential Revision: D4081860

fbshipit-source-id: 4b503df3c4e8b6e06b04613919a4a3405bf01171
2016-10-27 04:29:01 -07:00