Commit Graph

9295 Commits

Author SHA1 Message Date
Gabe Levi e2ce98b7c6 Fix the suppress comment regex for react_native
Reviewed By: davidaurelio

Differential Revision: D4435640

fbshipit-source-id: c680aee6931979859f04c0dca47037ba6f6cba73
2017-01-19 10:28:28 -08:00
Jakub Zika 35bcf1bacc Move AppCompat resource target used by React Native
Reviewed By: alsutton

Differential Revision: D4416749

fbshipit-source-id: 965a1245e7c2ffb20b34492c0cb399d3c6884dc6
2017-01-19 08:43:55 -08:00
Andres Suarez d4e8b19e71 Enable emoji in flow
Reviewed By: gabelevi

Differential Revision: D4428957

fbshipit-source-id: 487dbbb2512ff9dbd42e37fb81e14dfb8bea301b
2017-01-19 07:43:31 -08:00
Gabe Levi 6ffdd1678e Fix all the flow errors
Reviewed By: bestander

Differential Revision: D4435405

fbshipit-source-id: 888c94e7984d3ca926a4b08b1e3dafe9a2474491
2017-01-19 04:43:38 -08:00
Satyajit Sahoo 72be2d35cc Add selectionColor prop for Text on Android
Summary:
**Motivation**

Customizing the selection color allows to use brand colors in the app. The PR implements a `selectionColor` prop for `Text` component similar to `TextInput`.

**Test plan (required)**

Run UIExplorer example with the changes and verify everything works fine.

![image](https://cloud.githubusercontent.com/assets/1174278/22023258/70197d84-dceb-11e6-8662-2879d78d14d4.png)

cc brentvatne
Closes https://github.com/facebook/react-native/pull/11947

Differential Revision: D4430265

fbshipit-source-id: 462f16548d93ab03aadb27d6f12acf90842627ab
2017-01-18 12:58:44 -08:00
Mehdi Mulani 81c33b542d Switch out DISABLE_YELLOW_BOX for IS_TESTING
Summary: Switch to using IS_TESTING on the Platform module. While IS_TESTING has to be explicitly set in the test harness, this makes it more usable and stops people from relying on brittle variables in the (larger) environment.

Reviewed By: fkgozali

Differential Revision: D4423661

fbshipit-source-id: 27a80867778b9374bcba67b69f9c93d32c0a74b0
2017-01-18 12:28:42 -08:00
Gabe Levi a4bfac907e Deploy v0.38.0
Reviewed By: jeffmo

Differential Revision: D4428858

fbshipit-source-id: 10dc69349a2b563e1fa444a8b0612e3b2d4ccd1c
2017-01-18 11:13:30 -08:00
Andy Street 963e6e9d36 Improve error messages when nesting View in Text
Summary: Since we don't support this, we should throw early. Also tries to improve the error message when adding a node that doesn't have a YogaNode to a node that can't measure itself.

Reviewed By: andreicoman11

Differential Revision: D4421542

fbshipit-source-id: e0be8cdd763091145e5e6af2db91515f4d236b37
2017-01-18 09:28:26 -08:00
Ashok Menon 76c4faee5e CatalystInstanceImpl.setSourceURL
Reviewed By: javache

Differential Revision: D4422416

fbshipit-source-id: bc49485ac64064909f32375b6b8360a0a505975b
2017-01-18 08:58:41 -08:00
Lukas Piatkowski bbd5750bb4 Sampling Profiler to return urls that open file in nuclide
Reviewed By: cwdick

Differential Revision: D4422768

fbshipit-source-id: 2e8c4af6e6fae4256fe886b79f5ea6c87986d581
2017-01-18 04:28:38 -08:00
Justin Myers 2e8683b150 Add link to Convoy Android app to showcase
Summary:
Adding a link to the Convoy Driver Android app to the showcase
Closes https://github.com/facebook/react-native/pull/11830

Differential Revision: D4427024

Pulled By: hramos

fbshipit-source-id: 641ed9c4dce3b69d141a9328f41ce04ea1cd049c
2017-01-17 18:28:31 -08:00
Sokovikov 8159b2cd2a return stacktrace button in yellow box
Summary:
**motivation**

return button which shows stacktrace in yellow box.

**Test plan (required)**

<img src="https://cloud.githubusercontent.com/assets/1488195/21954896/fd3b0078-da77-11e6-8eeb-e6fe16ad9939.png" width="300"/>
Closes https://github.com/facebook/react-native/pull/11908

Differential Revision: D4424824

Pulled By: mmmulani

fbshipit-source-id: db4b33423fd839216286adb40a65417949c0073a
2017-01-17 17:43:28 -08:00
Peter Salanki 52d8851fc8 Cache policy control for image source
Summary:
In the context of an app an image exists in three resolutions on the server: `thumb` (30px) `feed` (300px) `full` (900px). When looking at an individual item a user can come either from the feed, via a permalink or from other parts of the app. This allows a situation where the `feed` image might or might not already be loaded somewhere in the app. In the detail view I want to render `thumb` with a blur (to quickly display something), then the `feed` image if it exists to have something decent to display until `full` loads. However it is quite a waste to load the `feed` image if it isn't already in cache, and will slow down the time until `full` is loaded. It is possible to track the navigation from feed->detail and that the `feed` image has actually completed loading by the feed component however as component hierarchies grow this turns into quite a lot of prop passing and bad separation of concerns.

NSURLRequests accepts a [Cache Policy](https://developer.apple.com/reference/fo
Closes https://github.com/facebook/react-native/pull/10844

Differential Revision: D4425959

Pulled By: lacker

fbshipit-source-id: 679835439c761a2fc894f56eb6d744c036cf0b49
2017-01-17 17:13:31 -08:00
Max Sherman a6844bdf75 Break infinite loop that happens only in debug environments
Reviewed By: javache

Differential Revision: D4411870

fbshipit-source-id: 6b141e42206734368ed50f37c8e7df8e8fd006c0
2017-01-17 16:58:46 -08:00
Lukas Woehrl e93ccfd57a Fix wraping calculation if min-size constraint exists
Summary:
Fixes #261
Closes https://github.com/facebook/css-layout/pull/262

Reviewed By: splhack

Differential Revision: D4245200

Pulled By: emilsjolander

fbshipit-source-id: 77d802d71010ed426511d6a01e6de1e7c9194179
2017-01-16 16:13:34 -08:00
Neil Sarkar 302d42da7f Remove deprecated method 'RCTExecuteOnMainThread'
Summary:
**Motivation**

This finishes the job of #11817, removing the previously deprecated method. See https://github.com/facebook/react-native/issues/11736 for more context.

**Test plan**

There were no tests for this method, and I searched the whole project to make sure we weren't relying on it anywhere.
Closes https://github.com/facebook/react-native/pull/11854

Differential Revision: D4421671

Pulled By: javache

fbshipit-source-id: 67e0db8d3c594ad3ccd6ccdae08f8ce49ddb8a34
2017-01-16 15:13:36 -08:00
Douglas Lowder a531efe26e Add an integration test for WebSocket
Summary:
**Motivation**

See if we can safely run a WebSocket test in Travis CI
Closes https://github.com/facebook/react-native/pull/11433

Differential Revision: D4342024

Pulled By: ericvicenti

fbshipit-source-id: 137fb0c39ed7ea3726e2778d5c0bdac4cef6ab89
2017-01-16 13:28:43 -08:00
rh389 e0c3d56d3a Fix template release build: Add -ObjC and -lc++ to tests target
Summary:
Fixes https://github.com/facebook/react-native/issues/11861 - the release config is currently broken for projects created by `react-native init` in `master`, 0.40 and 0.39.

I'm still investigating when and how this got broken but this seems to be a clean fix. I've added `-ObjC` as well to match the main target but I'm not sure yet whether that's necessary.

To test:
```
react-native init fooproject --version react-native@rh389/react-native#missinglinkerflags
```
Open in XCode, Edit scheme (⌘<), Change `Build Configuration` to `Release`, build.

Update: The `-lc++` flag became necessary when 33deaad196 landed because of the libstdc++ dependencies of `RCTLog`. Still not sure about `-ObjC`. javache ?
Closes https://github.com/facebook/react-native/pull/11889

Differential Revision: D4421685

Pulled By: javache

fbshipit-source-id: 954edaef773f8cef7b7ad671fa4d1f2bfc2f20f2
2017-01-16 13:13:31 -08:00
Emil Sjolander 8d2a034f9c BREAKING - Fix sizing of container with child overflowing parent
Reviewed By: mmmulani

Differential Revision: D4182141

fbshipit-source-id: c73fd15d2577ab846fc8a202d529d0e6e1207b75
2017-01-16 11:13:29 -08:00
Martin Konicek 893941e116 Re-enable Android e2e test
Summary:
Tests were temporarily disabled in https://github.com/facebook/react-native/pull/11894

This should fix them and has landed: https://github.com/facebook/react-native/pull/11896

**Test Plan**

CircleCI tests on this PR. If they pass, merge this.
Closes https://github.com/facebook/react-native/pull/11918

Differential Revision: D4421029

Pulled By: bestander

fbshipit-source-id: 80761a3bfe59ee73deeea4dc174d7e5233b54461
2017-01-16 05:28:26 -08:00
Maël Nison ae4fa4b012 Add YGLayoutGetMargin
Summary:
Fix #326. I'll open another PR once this one gets accepted to add support for `YGLayoutGetBorder` 👌
Closes https://github.com/facebook/yoga/pull/335

Reviewed By: gkassabli

Differential Revision: D4409399

Pulled By: emilsjolander

fbshipit-source-id: 8153f6701cab60b55a485f6d2e0b9f7767481090
2017-01-15 15:28:34 -08:00
Philipp von Weitershausen 3c806652cf Consolidate XHR UIExplorer examples
Summary:
The XHRExample file had been forked between iOS and Android for various reasons that are no longer valid, making maintenance unnecessarily difficult. New features demos had in fact been added in separate files to avoid further duplication. This change continues on that same trajectory and splits the entire example file into multiple files. This makes them much easier to handle. We also get rid of the iOS/Android fork.

**Test plan:** Run UIExplorer app, specifically the XHR examples, on both iOS and Android.
Closes https://github.com/facebook/react-native/pull/11901

Differential Revision: D4419882

Pulled By: ericvicenti

fbshipit-source-id: ec12836dfa8e1b9259b92a7510914857a8db58d5
2017-01-14 18:58:26 -08:00
Seph Soliman 6d2ae35bca Added AnimatedValueXY.removeAllListeners
Summary:
> Explain the **motivation** for making this change. What existing problem does the pull request solve?

`AnimatedValueX` has `removeAllListeners()` which is a convenient way to do cleanup when components unmount, but `AnimatedValueXY` was missing a similar method which doesn't really make sense. This change makes the two classes more similar, less confusing and more convenient.
Closes https://github.com/facebook/react-native/pull/11783

Differential Revision: D4397188

fbshipit-source-id: d10a0c9c7e0a83af015ec04f6facf965d95ea984
2017-01-14 14:43:27 -08:00
Philipp von Weitershausen 237ee2ddf6 Fix Android startup exception
Summary:
This is an attempt to fix the following startup exception that I get when running any of the example apps:

> Unrecognized type: interface com.facebook.react.bridge.Dynamic for method: com.facebook.react.uimanager.LayoutShadowNode#setFlexBasis

I really have no idea what I'm doing here, just trying to get UIExplorer to compile and run so I can test my upcoming PRs. ~~Unfortunately, this doesn't actually make the apps run, but at least it does get rid of the startup exception!~~ Edit: it works now.

**Test plan:** Run Movies and UIExplorer example app
Closes https://github.com/facebook/react-native/pull/11896

Differential Revision: D4418927

Pulled By: mkonicek

fbshipit-source-id: 34788b790b6bfc46ff39a0d9ca1698a5c20662e1
2017-01-13 20:28:30 -08:00
Spencer Ahrens c7e3819cf4 Propagate prop type flow through StyleContext.createContainer
Reviewed By: blairvanderhoof

Differential Revision: D4394074

fbshipit-source-id: f9c7f71ba921d345e3313a3a2be16a7f85a2e0af
2017-01-13 19:28:28 -08:00
janus_wel bc432ae324 fix typo RTC to RCT
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?

Descriptions about class names are incorrect.
Closes https://github.com/facebook/react-native/pull/11898

Differential Revision: D4418957

fbshipit-source-id: fc7d0b61149ed9f850a436a35ad98f179b5e3e19
2017-01-13 18:58:23 -08:00
Valentin Shergin 930010ec91 RCTTouchHandler doesn't delay any touches anymore
Reviewed By: mmmulani

Differential Revision: D4418211

fbshipit-source-id: 07fdd81d975c6b65477e599e2dcb604b64556e9e
2017-01-13 17:43:35 -08:00
ericnakagawa 8045a7084a Temporarily disabling e2e tests. Tests will reconvene after solution for CI-14683
Summary:
https://circleci.com/gh/facebook/react-native/14683

We are disabling end to end tests over weekend to allow additional time to some new additions introduced in #3f49e743bea730907066677c7cbfbb1260677d11 #b15c042a21359a727f2c5d79721994473be83620.
Closes https://github.com/facebook/react-native/pull/11894

Differential Revision: D4418208

fbshipit-source-id: 890d987110d959e06612899263bf6ea798c49845
2017-01-13 17:28:28 -08:00
Martin Konicek 521e9c6ee5 Add a missing include in a BUCK file
Summary: The include was missing in 87c6bcb65d (D4405355)

Reviewed By: ericnakagawa

Differential Revision: D4417874

fbshipit-source-id: 164a44e08c9da0931b49c90d01eb4396225e27d1
2017-01-13 16:43:33 -08:00
Rob Hogan 9e1e52f312 Mark __unused completion block args
Summary:
Catching a couple more build warnings introduced by b50f55026a since https://github.com/facebook/react-native/pull/11797.

Edit: and one more introduced by c68a708621

Tested the build with UIExplorer.
Closes https://github.com/facebook/react-native/pull/11865

Differential Revision: D4415630

fbshipit-source-id: 1384d56770eea8665ede8bd9abe06cf34cd14b33
2017-01-13 12:43:31 -08:00
Mehdi Mulani 49d7c00500 Disable yellow box warnings based on environment variable
Summary:
This adds a hook to let you disable yellow box warnings. It's useful for native engineers who don't want to mess with JS but also for CI/testing, where the app operates mostly as a blackbox.

Depends on D4395091

Reviewed By: achen1

Differential Revision: D4395552

fbshipit-source-id: 4c3a9676caa975c537d1a4711d60aab2f404db15
2017-01-13 12:28:31 -08:00
Mehdi Mulani 91b7499cf6 Expose environment and arguments to JS
Summary:
Right now from JS there's no way to see the environment variables or arguments that the application was started with.
The main use case for this is to help enable/disable features when being run in a testing environment (as environment variables are the easiest way to communicate).

javache is it okay to reference these constants from JS at startup time? I am planning to disable yellow boxes via an environment variable.

achen1 how easy is it expose these two things for Android as well?

Reviewed By: achen1

Differential Revision: D4395091

fbshipit-source-id: fc318e6a60b8829f7eb4491ea8f3258f68f59c8c
2017-01-13 12:28:31 -08:00
David Aurelio 09072b9d77 Fix loading minified bundle over HTTP
Summary: Sets `generateSourceMaps` to true when requesting a bundle in non-dev mode or minified.

Reviewed By: bestander, cpojer

Differential Revision: D4415492

fbshipit-source-id: 9b4dcbd577a535dab143bb7a067210fbd831bf1a
2017-01-13 10:43:27 -08:00
David Aurelio 9a4e4e8ee8 Fix packager breakages on node4
Summary:
This fixes issues that only surface when running with node4 / npm2.
Closes https://github.com/facebook/react-native/pull/11888

Differential Revision: D4415021

Pulled By: bestander

fbshipit-source-id: 8672cd892c9dae41cc7b5b7b3227eb24dd780d22
2017-01-13 09:28:41 -08:00
Ashok Menon 87c6bcb65d Adding Soft Error Logging to FallbackJSBundleLoader
Reviewed By: michalgr

Differential Revision: D4405355

fbshipit-source-id: 7730a1afd74ace7fdad91b22f9254e83d16d1050
2017-01-13 03:58:47 -08:00
Ashok Menon c3892fa871 Introducing `FallbackJSBundleLoader`
Reviewed By: michalgr

Differential Revision: D4386951

fbshipit-source-id: b1375deee9b3268d414e1b03fa79df50ac4d36cb
2017-01-13 03:58:47 -08:00
Ashok Menon 89d72c99be BREAKING - (Re)moving `JSBundleLoader.getSourceUrl()`
Summary:
== What ==

Changing the `JSBundleLoader` API, to remove `String getSourceUrl()`, instead `JSBundleLoader.loadScript` now returns the source URL it loaded.

This change has a knock-on effect: We can no longer populate `SourceCodeModule` when we construct it, because at that time, we do not know the source URL.

In order to solve this I have made the following changes:

 -  Added `CatalystInstance.getSourceURL()`, to return the source URL from the instance after the JS Bundle has been loaded, or `null` otherwise.
 -  Removed `ReactInstanceManager.getSourceUrl()`, because its only purpose was to populate `SourceCodeModule`.
 -  Also removed `ReactInstanceManager.getJSBundleFile()` because it was only being used in a test confirming that the `ReactInstanceManager` knew its bundle file as soon as it was constructed, which is no longer necessarily true.
 -  Initialise `SourceCodeModule` with the `ReactContext` instance it belongs to.
 -  Override `NativeModule.initialize()` in `SourceCodeModule` to fetch the source URL. When the `SourceCodeModule` is constructed, the context does not have a properly initialised `CatalystInstance`, but by the time we call initialise on it, the `ReactContext` has a `CatalystInstance` and that in turn has a source URL.

== Why ==

The reason for this change is that it allows us to add implementations of `JSBundleLoader`, that cannot determine their source URL until after having performed a load successfully. In particular I plan to introduce `FallbackJSBundleLoader` which will try to load from multiple sources in sequence stopping after the first successful load. As load failures could happen for a variety of reasons, we can't know what the true source URL is without performing the load.

Reviewed By: javache

Differential Revision: D4398956

fbshipit-source-id: 51ff4e289c8723e9d242f23267181c775a6abe6f
2017-01-13 03:58:47 -08:00
Pieter De Baets 8e4f33e669 Dismiss redbox upon pressing reload
Reviewed By: shergin

Differential Revision: D4405376

fbshipit-source-id: 63d624457c6afde3dbe71a66c57b410cf71cbbd3
2017-01-13 03:58:47 -08:00
Pieter De Baets a94418fdd3 Show redbox when no bundle is present
Reviewed By: shergin

Differential Revision: D4405409

fbshipit-source-id: 847fc559121dcde844f1ee3c6d02206e9e27803b
2017-01-13 03:43:35 -08:00
Andrew Imm 09a83f976e Allow project-specific config for RN CLI using providesModuleNodeModules
Reviewed By: davidaurelio

Differential Revision: D4409046

fbshipit-source-id: 5af0d08542935a784f4737653ccac49fd7517aff
2017-01-12 21:13:36 -08:00
Kevin Lee 09801aac30 fix direction of VerticalSwipeJump gestures
Summary:
When something comes in from the right, we swipe from left to
right to move back. That means, when something comes in from the bottom,
we should swipe from top to bottom to get rid of it. This diff makes that
behavior occur - right now it's somewhat nonsensical as both jumpBack
and jumpForward are mapped to the same gesture.

thanks to #11192 for making gestures work on VerticalUpSwipeJumps

Reviewed By: ericvicenti, shergin

Differential Revision: D4412129

fbshipit-source-id: 6a3b202b0a90ca459b4ef106ba5bf48d0b1aec9e
2017-01-12 17:43:42 -08:00
Ashok Menon 154e183344 Fixing RN Debugger
Reviewed By: cwdick, javache

Differential Revision: D4409257

fbshipit-source-id: 062c798d1a1c9ad90884599ed262412c1dd51359
2017-01-12 16:28:36 -08:00
Mike Grabowski 545072b02d Fully support new import system on iOS
Summary:
A bit late to the party, but upgraded, tests replaced, all green.

Also updated `pbxproj` so that we are testing against React 0.40 init result, not against something old.

To cherry-pick and land once ships.
Closes https://github.com/facebook/react-native/pull/11868

Differential Revision: D4411362

fbshipit-source-id: c485fd76114979d34a7e288bb70e1ecb9b3baf76
2017-01-12 14:58:28 -08:00
David Aurelio 0849f84df2 create better debuggable source maps
Summary:
Introduces a new mechanism to build source maps that allows us to use real mapping segments instead of just mapping line-by-line.

This mechanism is only used when building development bundles to improve the debugging experience in Chrome.

The new mechanism takes advantage of a new feature in babel-generator that exposes raw mapping objects. These raw mapping objects are converted to arrays with 2, 4, or 5 for the most compact representation possible.
We no longer generate a source map for the bundle that maps each line to itself in conjunction with configuring babel generator to retain lines.

Instead, we create a source map with a large mappings object produced from the mappings of each individual file in conjunction with a “carry over” – the number of preceding lines in the bundle.

The implementation makes a couple of assumptions that hold true for babel transform results, e.g. mappings being in the order of the generated code, and that a block of mappings always belongs to the same source file. In addition, the implementation avoids allocation of objects and strings at all costs. All calculations are purely numeric, and base64 vlq produces numeric ascii character codes. These are written to a preallocated buffer objects, which is turned to a string only at the end of the building process. This implementation is ~5x faster than using the source-map library.

In addition to providing development source maps that work better, we can now also produce individual high-quality source maps for production builds and combine them to an “index source map”. This approach is unfeasable for development source maps, because index source map consistently crash Chrome.

Better production source maps are useful to get precise information about source location and symbol names when symbolicating stack traces from crashes in production.

Reviewed By: jeanlauliac

Differential Revision: D4382290

fbshipit-source-id: 365a176fa142729d0a4cef43edeb81084361e54d
2017-01-12 14:28:41 -08:00
Mike Grabowski 4969f26252 Improve `unlink` on rnpm
Summary:
We don't need to look for `thisDependency` as we already have it. Small improvement as I am working on other fixes.
Closes https://github.com/facebook/react-native/pull/11867

Differential Revision: D4411177

fbshipit-source-id: 1413eb5457cb4d7916ead90f438ffe158f644cad
2017-01-12 13:58:34 -08:00
Janic Duplessis 6b1bc4ad74 Fix babel only regexp on windows
Summary:
cli / packager was broken on Windows after 28f1c67ced.

Babel `only` regexp option requires paths to use forward slashes only but `__dirname` will use backslashes on windows. This simply adds a replace to normalize to forward slashes.

cc jeanlauliac cpojer
Closes https://github.com/facebook/react-native/pull/11850

Reviewed By: cpojer

Differential Revision: D4409143

Pulled By: jeanlauliac

fbshipit-source-id: a705236630959f762e53100299ab073ec9a29ee1
2017-01-12 12:43:39 -08:00
Valentin Shergin c68a708621 New way to handle simultaneously active gesture recognizers in RCTTouchHandler
Reviewed By: majak

Differential Revision: D4385209

fbshipit-source-id: 22746dd93e378a4d9e5feca66bc84c357afb6f36
2017-01-12 12:13:28 -08:00
Dan Hassin dbe555ba78 Include props in new ListView and ScrollView mocks
Summary:
Hi,

The (as of yet unreleased) commit 5537055bf8 added some ListView and ScrollView mocks, but they leave out the original properties passed into them, which broke some of my tests (e.g. by excluding some properties like `testID`, for example, from the render tree) and I assume might break others' as well.

This PR makes it so the ListView mock directly returns the scroll component (instead of wrapping it in a View), and has ListViewMock and ScrollViewMock pass their given properties through.
Closes https://github.com/facebook/react-native/pull/11847

Differential Revision: D4408497

Pulled By: sahrens

fbshipit-source-id: 7ec01c35d6b8efeb97761cddffdb4075d09c7d70
2017-01-12 10:58:29 -08:00
Jean Lauliac d12d0b4c53 packager: do not try to fetch uncached files
Reviewed By: davidaurelio

Differential Revision: D4403623

fbshipit-source-id: 8319e6bac365fe5fcebefd4f338faf145f662ecb
2017-01-12 10:43:32 -08:00
David Aurelio e1c0e04833 add `no-const-assign` rule
Summary: Adds the `no-const-assign` rule to our `.eslintrc`, because sometime people assign to `const`.

Reviewed By: bestander, jeanlauliac

Differential Revision: D4409485

fbshipit-source-id: c74ad9649ec665e3f2ba2da7843f4e261303c9e7
2017-01-12 10:28:33 -08:00