Commit Graph

8272 Commits

Author SHA1 Message Date
Alexander Blom 1709043a12 Add Network agent
Summary: Adds methods in XMLHttpRequest so that the agent can hook the events needed for the implementation, these are only enabled if the agent is enabled (which means that the inspector is connected), it is also stripped out in non-dev currently.

Reviewed By: davidaurelio

Differential Revision: D4021516

fbshipit-source-id: c0c00d588404012d20b744de74e5ecbe5c002a53
2016-11-02 12:29:15 -07:00
Alexander Blom 6a1783210b Add JS agent support
Summary:
Adds the possibility to define agents in Javascript. Javascript agents are simple classes that extend `InspectorAgent` and pass down the
given `EventSender` to the super constructor. The library will then call methods on the object for each received method call over the protocol.

Reviewed By: davidaurelio

Differential Revision: D4021508

fbshipit-source-id: bbe609e92ea726cbbbec833df81705ebd3346c77
2016-11-02 12:29:15 -07:00
Alexander Blom 27f504e9e3 Add Console agent
Summary: Adds the Console agent which we hook from our console polyfill. It captures the stack and strips the frames of the polyfill.

Reviewed By: davidaurelio

Differential Revision: D4021502

fbshipit-source-id: 49cb700a139270485b7595e85e52d50c9a620db6
2016-11-02 12:29:15 -07:00
Alexander Blom 0ac7bf29af Add Page, Runtime, Debugger agents
Summary: Runtime and Debugger agents are shipped with JSC so we reuse them. Messages are routed to them through the `LegacyDispatcher` which also handles translating their events. The Page agent emits the `Page.getResourceTree` method that the Chrome inspector expects.

Reviewed By: michalgr

Differential Revision: D4021499

fbshipit-source-id: a93d0add01cee732401f8e8db1d43205bfbd4cd4
2016-11-02 12:29:14 -07:00
Alexander Blom 156e5d9837 Add on-device JSC inspector
Summary:
Introduces the inspector library supporting the Chrome Debugging Protocol for JavaScriptCore. Eventually this will mean that it is possible to attach
the Chrome inspector directly to the JSC instance running on the device. This library doesn't define the actual transport but leaves that up to the platform
layer.

The main entry point (and the only exported header) is `Inspector.h`.

This diff only introduces the basics supporting the `Schema` and `Inspector` domains meaning it doesn't have any features yet. These will come in following
diffs.

Reviewed By: michalgr

Differential Revision: D4021490

fbshipit-source-id: 517fd9033051c11ba97d312b16382445ae85d3f3
2016-11-02 12:29:14 -07:00
Sævar Berg 9bfd95c8aa Fixed $PATH guide for Linux users
Summary:
`react-native run-android` will need `adb` in `$PATH` as I explained in issue #10702.
Closes https://github.com/facebook/react-native/pull/10703

Differential Revision: D4118918

fbshipit-source-id: 873e46d044b8cc7acf026aba330ad1dc4ff6f2d3
2016-11-02 12:13:41 -07:00
Ben Bodenmiller dc0a5ec75d ignore all keystore files
Summary:
Ignore all keystore files as we do not want users to accidentally check in their keystore file.
Closes https://github.com/facebook/react-native/pull/10214

Differential Revision: D4118169

Pulled By: bestander

fbshipit-source-id: a81fc99afd1715d52dfdce8c47dfc10808470008
2016-11-02 11:15:10 -07:00
Andy Street f2d3113c1d Fix bug where ScrollView would stop overscrolled by a bit on fling
Summary: This bug was introduced with the bounce-back bug fix. We need to actually set the scroll position to the max scroll position if we've gone over otherwise it can get stuck.

Reviewed By: lexs

Differential Revision: D4118084

fbshipit-source-id: 41a927a40000c526414096c9385f8bd3cbd907f3
2016-11-02 10:58:34 -07:00
Dan Caspi 8287e3e83f Added a way to handle functions that are not supported by the system JSC
Reviewed By: javache

Differential Revision: D4110660

fbshipit-source-id: 27c99cae96b57f70ddc1d310c6d5343d7c3c8892
2016-11-02 09:43:58 -07:00
Pieter De Baets 44025f4931 Stop silently failing for requires on Android
Reviewed By: bestander

Differential Revision: D4117128

fbshipit-source-id: a11996a322d38e884aad2f095342c1ea723b0d89
2016-11-02 08:58:42 -07:00
Andy Street 6a45f05872 Use whether react instance is accepting calls to determine whether instance is active
Summary:
There was previously a race condition where hasActiveCatalystInstance would return true, but calling a JS module call on it would result in a crash. Now, hasActivtyCatalystInstance will only return true once the instance is actually accepting calls.

I'll follow this up with a more risky diff that gets rid of hasActiveCatalystInstance and just queues JS calls until runJSBundle is called.

Reviewed By: javache

Differential Revision: D4117374

fbshipit-source-id: 60941f68b0906a8213571305c564bfe3d053f51b
2016-11-02 07:58:33 -07:00
Héctor Ramos bdbadd1142 Re-style Blog, Add Newsletter Signup Form
Summary:
The goal of this PR is to place greater emphasis on the blog as a destination.

The dark Hero from the landing page is now present in the blog as well, and the content is front and center.

The sidebar has been removed. It is not necessary to show a list of recent blog posts in the sidebar when the blog landing page shows the same number of posts along with short excerpts.

The prev/next links have swapped positions, and will now display "Older posts" and "Newer posts".

The excerpts have been stripped of formatting and they are now consistent across the blog landing page and the OpenGraph metatags. Fixes #10597.

A signup form for the new React Native newsletter has been added to the footer.

Newsletter signup form in footer:

![screencapture-localhost-8079-react-native-1477944030909](https://cloud.githubusercontent.com/assets/165856/19869614/4bb035aa-9f6a-11e6-9b8e-e0333417f423.png)

Blog landing page:

![screencapture-localhost-8079-r
Closes https://github.com/facebook/react-native/pull/10660

Differential Revision: D4117034

Pulled By: bestander

fbshipit-source-id: 215f966008fdf5c8870ed28d92384034a0d23c39
2016-11-02 05:43:43 -07:00
Andres Suarez 680df8900b Update babel and co.
Summary:
This update is necessary in order to update to [Flow 0.34.0](https://github.com/facebook/flow/releases/tag/v0.34.0) - which has new syntax to annotate [variance](https://flowtype.org/blog/2016/10/04/Property-Variance.html). The new syntax is available starting in [babel 6.18.0](https://github.com/babel/babel/releases/tag/v6.18.0) and [babylon 6.13.0](https://github.com/babel/babylon/releases/tag/v6.13.0) - both must be used in conjunction.

Transitive dependencies were also updated, otherwise `node_modules` wouldn't dedupe enough (increasing from ~225MB to 300+MB).

This diff copies D4051237.

Reviewed By: yungsters

Differential Revision: D4113693

fbshipit-source-id: 0b834683a9930822f5f77099858c6e5484c09e7c
2016-11-02 05:43:43 -07:00
Kevin Gozali 3237ade34f fallback to JS Animation if native animated is not present
Summary: This should be a temporary migration path until we enable native animated everywhere, instead of crashing the app if the module is missing. This would present a yellow box with an instruction to add RCTAnimation module to the app

Reviewed By: yungsters

Differential Revision: D4112938

fbshipit-source-id: 56db7801063e9de16a3ff251bf1f0e4f6e3ea7c0
2016-11-01 23:58:49 -07:00
Pieter De Baets 4082a54649 Don't mask exceptions generated from loadModule
Reviewed By: davidaurelio

Differential Revision: D4112447

fbshipit-source-id: e9b3a5cefb166fe00c04b6126c9878e71f1413ec
2016-11-01 16:13:33 -07:00
Kevin Gozali 8bb707b686 Use native animations in TouchableBounce and TouchableOpacity
Summary:
this brings back the previous commit that had to be reverted due to internal breakages.

original commit: 1bb323e256

Reviewed By: AaaChiuuu

Differential Revision: D4109811

fbshipit-source-id: b50de145eaf6851138429635bc0302518d656b75
2016-11-01 15:58:41 -07:00
crismali d685620f31 Prevent escaped 'a' tag html from appearing in 'Integration With Exis…
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?

- Prevents unclickable, escaped HTML from appearing in the docs.

[Before](https://facebook.github.io/react-native/docs/integration-with-existing-apps.html#our-sample-app):
![screen shot 2016-11-01 at 2 45 14 pm](https://cloud.githubusercontent.com/assets/3209502/19904789/263a4080-a042-11e6-8d9e-f88d3f8e5a77.png)

After:
![screen shot 2016-11-01 at 2 45 29 pm](https://cloud.githubusercontent.com/assets/3209502/19904813/39a5dcf6-a042-11e6-9dfb-766af44a246c.png)
Closes https://github.com/facebook/react-native/pull/10685

Differential Revision: D4113084

Pulled By: hramos

fbshipit-source-id: 210cc97d8f53ee0ec7a26640d99c4dfedf7145b5
2016-11-01 15:13:39 -07:00
Martin Konicek 85b8c6ba23 Bump to 1.2.0
Summary:
Turns out I published 1.1.0 previously by accident and unpublished /ducks
Closes https://github.com/facebook/react-native/pull/10684

Differential Revision: D4111999

Pulled By: bestander

fbshipit-source-id: a85c8db6e7f48c9e96a649f017d82cbef44c73ae
2016-11-01 12:50:30 -07:00
Alexander Blom a0c550d5c0 Allow creating JS functions from std::function
Reviewed By: mhorowitz

Differential Revision: D4043376

fbshipit-source-id: 65b4f025835dbae34e764015743c2616d9eb9379
2016-11-01 11:44:10 -07:00
Alexander Blom ddb8cb7cf0 Move JSCHelpers.h and Value.h into separate package
Reviewed By: javache

Differential Revision: D3950748

fbshipit-source-id: 6315ea07f3217b485aeb4374b5f6e36333957848
2016-11-01 11:44:10 -07:00
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