Commit Graph

517 Commits

Author SHA1 Message Date
Andy Street 6d5f9ddfff WebWorkers: Allow native modules to be notified when executors are unregistered
Summary: This will allow them to clean up resources when a web worker goes away.

Reviewed By: mhorowitz, lexs

Differential Revision: D2994721

fb-gh-sync-id: c7ca1afc7290e85038cf692a139f6478dba0ef61
shipit-source-id: c7ca1afc7290e85038cf692a139f6478dba0ef61
2016-03-03 04:10:39 -08:00
Sokovikov 1bab7c5182 vibration module
Summary:I will fix other notes from https://github.com/facebook/react-native/pull/2794 if I get positive feedback.
Closes https://github.com/facebook/react-native/pull/6061

Reviewed By: nicklockwood

Differential Revision: D2982173

Pulled By: dmmiller

fb-gh-sync-id: d1e9407798b0293b090897a10996085b0f0c1b3e
shipit-source-id: d1e9407798b0293b090897a10996085b0f0c1b3e
2016-03-03 04:08:31 -08:00
Dan Caspi d2d00e0fcd Adding GC Timer Sweeping to Android
Reviewed By: mhahnenberg

Differential Revision: D2972822

fb-gh-sync-id: b0ed28c26e3f1141c798d9d107d9e198611f9dce
shipit-source-id: b0ed28c26e3f1141c798d9d107d9e198611f9dce
2016-03-03 04:05:59 -08:00
Michał Gregorczyk 5a6a94b05a sync fbjni
Differential Revision: D2990551

fb-gh-sync-id: 587f2b5cd09295dc1829926c12e38f2880440a5e
shipit-source-id: 587f2b5cd09295dc1829926c12e38f2880440a5e
2016-03-02 07:24:40 -08:00
Michał Gregorczyk 5df3eeb723 Force 16 byte stack alignment on JNI method invocations on x86
Reviewed By: dcolascione

Differential Revision: D2989293

fb-gh-sync-id: 9140ced55ef0b8a73fdc03a6d307af87cd2335ef
shipit-source-id: 9140ced55ef0b8a73fdc03a6d307af87cd2335ef
2016-03-02 07:24:35 -08:00
AbilashK ab12189f87 Enable blurOnSubmit for text input in android
Summary:PR for https://github.com/facebook/react-native/issues/6098, Added tests to UIExplorer based on existing iOS example.

Before:
![blur_true](https://cloud.githubusercontent.com/assets/11550281/13401854/cd66117a-df33-11e5-875d-e1f132e2fc82.gif)

After:
![blur_false](https://cloud.githubusercontent.com/assets/11550281/13401874/de1dd1ce-df33-11e5-8210-e6bee80240fb.gif)
Closes https://github.com/facebook/react-native/pull/6215

Differential Revision: D3000042

Pulled By: mkonicek

fb-gh-sync-id: 7f01270580b198498505d92e38a456c0b3a01488
shipit-source-id: 7f01270580b198498505d92e38a456c0b3a01488
2016-03-02 07:07:32 -08:00
Konstantin Raev f827f7b79a instrumentation tests are executed with BUCK
Summary:Added ability to run instrumentation tests with BUCK.

This change uses BUCK to build and run instrumentation tests facebook style.
The gains are that we can execute the same tests internally at FB and in OSS.
Also running tests not via graddle:connect command is 1.5 minutes faster.

I'll keep keep an eye on stability Gradle and BUCK builds for a while.
Closes https://github.com/facebook/react-native/pull/6176

Differential Revision: D2999878

Pulled By: bestander

fb-gh-sync-id: d715ba231769e57100685a1256f2e530c589921c
shipit-source-id: d715ba231769e57100685a1256f2e530c589921c
2016-03-02 06:55:35 -08:00
Konstantin Raev 00178b7b36 Added prebuilt folder with BUCK files to support BUCK run of ReactAndroid in OSS
This is a manualt sync of a folder from fbsource that was previously in ignored list
2016-03-02 11:09:31 +00:00
Andy Street bd95b22844 WebWorkers: Add ExecutorToken to route native module calls to/from workers
Summary:To support native modules in web workers, native modules need to have an notion of the JS executor/thread that called into them in order to respond via Callback or JS module call to the right executor on the right thread.

ExecutorToken is an object that only serves as a token that can be used to identify an executor/message queue thread in the bridge. It doesn't expose any methods. Native modules Callback objects automatically have this ExecutionContext attached -- JSModule calls for modules that support workers will need to supply an appropriate ExecutorToken when retrieving the JSModule implementation from the ReactContext.

Reviewed By: mhorowitz

Differential Revision: D2965458

fb-gh-sync-id: 6e354d4df8536d40b12d02bd055f6d06b4ca595d
shipit-source-id: 6e354d4df8536d40b12d02bd055f6d06b4ca595d
2016-03-01 07:57:35 -08:00
Andy Street 58f86b2d91 Don't execute things that may throw in Bridge/JSCExecutor dtors
Summary:In testing, I've found that there's no good way to return stack traces to the server for exceptions that happen in dtor's. If the dtor is not marked nothrow(false), the exceptions are uncatchable (and bubble up as a std::abort without exception info) and if annotated properly, the program instead crashes trying to resume the stack, again a std::abort without exception info.

Instead, I created a separate destroy method that can be called (and protected via fbjni) to make the dtor's no longer execute code that may throw. Note that we don't really expect the code that was previously in ~JSCExecutor() to throw, but it was in production and we had absolutely no info to help debug it.

Reviewed By: mhorowitz

Differential Revision: D2989999

fb-gh-sync-id: 4cf9de5e0592fe6830a9903375363a78e1339a94
shipit-source-id: 4cf9de5e0592fe6830a9903375363a78e1339a94
2016-03-01 04:26:35 -08:00
Ahmed El-Helw 9be1216c7f Minor code improvements for RCTTextInput
Summary: Expose hasUnseenUpdates in ReactShadowNode. Various text input cleanup and fixes.

Differential Revision: D2975870

fb-gh-sync-id: 26c4c0d36e82aaa025b4760603cc48c47ebf46a3
shipit-source-id: 26c4c0d36e82aaa025b4760603cc48c47ebf46a3
2016-02-29 16:43:32 -08:00
Chris Hopman e55cefc476 Add log message to bridge init
Reviewed By: mhorowitz

Differential Revision: D2983352

fb-gh-sync-id: d87fcb7d7728115ae45cdb6f061fa094da7dfba8
shipit-source-id: d87fcb7d7728115ae45cdb6f061fa094da7dfba8
2016-02-29 12:49:01 -08:00
Andy Street f99579adaa Try/catch exceptions in JSCExecutor for debugging crash
Reviewed By: lexs

Differential Revision: D2982534

fb-gh-sync-id: 4eda4116cd60e2e46771ecddefc1d27eee761762
shipit-source-id: 4eda4116cd60e2e46771ecddefc1d27eee761762
2016-02-26 10:58:29 -08:00
Andy Street f420f811c5 Revert D2982150: Revert D2926896 WebWorkers: Move web worker impl to JSCExecutor
Reviewed By: lexs

Differential Revision: D2982364

fb-gh-sync-id: 25f099377acca75298768072d38d77dcb9c1bff3
shipit-source-id: 25f099377acca75298768072d38d77dcb9c1bff3
2016-02-26 08:43:36 -08:00
Dave Miller 9edfd945d1 Fix minor code nit from D2977441
Reviewed By: andreicoman11

Differential Revision: D2982182

fb-gh-sync-id: dba3c6ea0dfbd375e3c27d3ad2ba3481d05e06e8
shipit-source-id: dba3c6ea0dfbd375e3c27d3ad2ba3481d05e06e8
2016-02-26 06:46:35 -08:00
Felix Oghina 9baef48498 decouple textview from fresco
Reviewed By: andreicoman11

Differential Revision: D2960626

fb-gh-sync-id: c03aa7f16cdea795cefe39da2c5d660ae6278a37
shipit-source-id: c03aa7f16cdea795cefe39da2c5d660ae6278a37
2016-02-26 06:16:49 -08:00
Andy Street c32e5fd84f Revert D2926896 WebWorkers: Move web worker impl to JSCExecutor
Reviewed By: lexs

Differential Revision: D2982150

fb-gh-sync-id: c75d05988df50b9788608e7c1bf00c4952ccfce1
shipit-source-id: c75d05988df50b9788608e7c1bf00c4952ccfce1
2016-02-26 05:56:36 -08:00
Andrei Coman d032cc967d Pass jsc config to JSC
Reviewed By: astreet

Differential Revision: D2965497

fb-gh-sync-id: 1aef5a1f2d7ccb8de8ca403e51ebcf247bd6b034
shipit-source-id: 1aef5a1f2d7ccb8de8ca403e51ebcf247bd6b034
2016-02-26 03:24:36 -08:00
Dave Miller 542432fc3e Launch a new task if openURL is called with a url in a different package
Summary: Change the default handling of openURL to attach the NEW_TASK flag if the package we will be launching is different than the currently running package.

Reviewed By: foghina

Differential Revision: D2977441

fb-gh-sync-id: 01d1ac1d791345f815bfc9e8358bce6420c08c1b
shipit-source-id: 01d1ac1d791345f815bfc9e8358bce6420c08c1b
2016-02-26 03:12:32 -08:00
Matthew Denner b860897cd5 Restore canvas once group has been drawn
Summary:The implementation of ARTGroupShadowNode saved the canvas and then drew the child nodes but did not reset the canvas afterwards, unlike the behaviour of the other ART shadow nodes.  Because of this the matrix operations were compounded for sibling nodes in the surface.

As an example the following code should draw a green circle in the bottom right corner of the surface and a red circle in the top left, which it does on iOS; on Android you'll find that the red circle is drawn in the bottom right corner instead.

```
'use strict';
import React, {
  AppRegistry,
  Component,
  StyleSheet,
  View,
} from 'react-native';

const { Surface, Group, Shape } = React.ART;

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#808080',
  },
  surface: {
    backgroundColor: '#ffffff'
  },
});

class ARTGroupBug extends Component {
  render() {
    return (
      <View style={styles.container}>
        <
Closes https://github.com/facebook/react-native/pull/5619

Differential Revision: D2981865

Pulled By: spicyj

fb-gh-sync-id: 95ca701354fe728ed6ee78f8c02d1e1eb70c181e
shipit-source-id: 95ca701354fe728ed6ee78f8c02d1e1eb70c181e
2016-02-26 00:42:33 -08:00
AbilashK 8b88cae747 Fix android's image tintColor prop when used with alpha
Summary:Fixes https://github.com/facebook/react-native/issues/6075
UIExplorer example has been tested with 4 levels of opacity(100,75,50,25)

![selection_029](https://cloud.githubusercontent.com/assets/11550281/13228124/31c85dcc-d9c0-11e5-90e3-3938e155d5a2.png)
Closes https://github.com/facebook/react-native/pull/6090

Differential Revision: D2979913

Pulled By: mkonicek

fb-gh-sync-id: ff30dec853935a059979096d9b1da9088d146249
shipit-source-id: ff30dec853935a059979096d9b1da9088d146249
2016-02-25 17:16:02 -08:00
Konstantin Raev 5112a63953 Added ability to run Movies app with BUCK
Reviewed By: mkonicek

Differential Revision: D2874873

fb-gh-sync-id: 9feface8d9a18742e68206dbafb804de25f53ed8
shipit-source-id: 9feface8d9a18742e68206dbafb804de25f53ed8
2016-02-25 17:15:58 -08:00
Martin Konicek 9d3d9dfbce Make fbsource and GitHub consistent 2016-02-25 17:13:25 -08:00
Ahmed El-Helw 652c1c11e4 Fix incorrect MeasureSpec in ReactTextInputShadowNode
Summary:WRAP_CONTENT is not a valid size for MeasureSpec. While 0 is
a valid value size to pass to makeMeasureSpec, it's slightly cheaper to just
pass in 0 instead since makeMeasureSpec(0, UNSPECIFIED) is 0 anyway.

Differential Revision: D2968322

fb-gh-sync-id: 2ca0e27b12c1a8263800d96fec32127a4b967497
shipit-source-id: 2ca0e27b12c1a8263800d96fec32127a4b967497
2016-02-25 16:27:32 -08:00
Alexander Blom b8e7fe4959 Copy exif data when resizing images in ImageEditingManager
Summary:Previously images that have exif orientation data would be cropped and the exif data
would be lost leading to us displaying pictures rotated in error.

Reviewed By: foghina

Differential Revision: D2971596

fb-gh-sync-id: 40f92e27089455259a7d8b83c92d0cf36367e5df
shipit-source-id: 40f92e27089455259a7d8b83c92d0cf36367e5df
2016-02-25 07:46:39 -08:00
Ahmed El-Helw 6b80f11652 Add switch for enabling nodes screenshot tests
Summary: Allow customizing the UIImplementation passed in to loadApp.

Differential Revision: D2975785

fb-gh-sync-id: 2ce081fb488b78c0c91fcebe6a37dac4f587a467
shipit-source-id: 2ce081fb488b78c0c91fcebe6a37dac4f587a467
2016-02-24 21:13:35 -08:00
Michał Gregorczyk 9836b297ad Align stack on all JSC API calls
Reviewed By: astreet

Differential Revision: D2971504

fb-gh-sync-id: 4f2cb5924c135aa39853e6746b0a35e30f3e93a4
shipit-source-id: 4f2cb5924c135aa39853e6746b0a35e30f3e93a4
2016-02-24 13:00:41 -08:00
Andrei Coman 36400807ab Remove unused variable
Reviewed By: bestander

Differential Revision: D2971225

fb-gh-sync-id: 827d4403d436ec74043e2dde02e19513f7bf811f
shipit-source-id: 827d4403d436ec74043e2dde02e19513f7bf811f
2016-02-24 10:49:33 -08:00
Jason Sendros f538032888 Sync CSSLayout: Make 'stretch' aligned children fill cross-axis in containers of undefined size in the cross-axis
Reviewed By: lucasr

Differential Revision: D2971032

fb-gh-sync-id: 90ec286ca2070d666571fd3d0db4037bc9d3cda7
shipit-source-id: 90ec286ca2070d666571fd3d0db4037bc9d3cda7
2016-02-24 08:57:37 -08:00
Andrei Coman 936b5e794b Backed out changeset fe59b7f7c7da
Reviewed By: javache

Differential Revision: D2971309

fb-gh-sync-id: 0104f5499d32e0a4e4bd24128c58a9ee4aa7ca4e
shipit-source-id: 0104f5499d32e0a4e4bd24128c58a9ee4aa7ca4e
2016-02-24 08:39:35 -08:00
Andreas Drivenes ec173b1a17 Add drawerLockMode prop to DrawerLayoutAndroid
Summary:Closes #5270.
Closes https://github.com/facebook/react-native/pull/5534

Differential Revision: D2970771

fb-gh-sync-id: 36a814032283df7d4c469964f803b8d20d1b0c93
shipit-source-id: 36a814032283df7d4c469964f803b8d20d1b0c93
2016-02-24 03:25:30 -08:00
Chris Hopman 11843fd10e Initialize glog in react native.
Reviewed By: mhorowitz

Differential Revision: D2967180

fb-gh-sync-id: fe59b7f7c7dab8b5e7f3a449e72b467e1c2c2c67
shipit-source-id: fe59b7f7c7dab8b5e7f3a449e72b467e1c2c2c67
2016-02-24 02:18:28 -08:00
Konstantin Raev a759131ca1 another patch hoping to fix chronos 2016-02-24 10:17:56 +00:00
Konstantin Raev 96ecfade11 manual file sync for oss sync bot 2016-02-24 10:13:35 +00:00
Konstantin Raev ecfd4f854b patch commit that was not synced from fbsource
This one was not synced correctly https://phabricator.fb.com/rFAaebd840baa045b25f7c6641a0657b3cb1a01ba78
2016-02-24 10:01:37 +00:00
Andy Street 7176c5291e Dispatch JS calls to JS thread from c++ bridge
Summary: Instead of dispatching calls to the JS thread in Java, do it in the C++ bridge. This moves us closer to the cxx bridge and will allow us to dispatch to the correct web worker in C++ instead of in Java

Reviewed By: mhorowitz

Differential Revision: D2954115

fb-gh-sync-id: 7e7d4eff2c72601b8b4416f1ccd8d2985aebd755
shipit-source-id: 7e7d4eff2c72601b8b4416f1ccd8d2985aebd755
2016-02-23 10:59:00 -08:00
Mark Hahnenberg c17428e9d2 Schedule memory pressure handlers onto JS queue thread
Reviewed By: lexs

Differential Revision: D2940927

fb-gh-sync-id: 2556925194a753a33f039dc841a4001d7ede2bce
shipit-source-id: 2556925194a753a33f039dc841a4001d7ede2bce
2016-02-22 07:46:28 -08:00
Andy Street 5534f8b7c7 Fix instacrash on login in rnfeed
Summary:build-break

Proguard was renaming MessageQueueThread interface methods that we reference from c++.

Differential Revision: D2960332

fb-gh-sync-id: 572dcd8a64e774f65c5abfb8cdf891efcb2bd591
shipit-source-id: 572dcd8a64e774f65c5abfb8cdf891efcb2bd591
2016-02-22 06:03:33 -08:00
Konstantin Raev 26a7335d4d Backed out changeset 837af947846b
Reviewed By: astreet

Differential Revision: D2960159

fb-gh-sync-id: ec8df9c2f7213879470482b77346b3872c26413d
shipit-source-id: ec8df9c2f7213879470482b77346b3872c26413d
2016-02-22 03:58:30 -08:00
Andrei Coman b5d26679c4 Use nanoTime instead of currentTimeMillis for events
Reviewed By: foghina

Differential Revision: D2953917

fb-gh-sync-id: effd09849a5504c9eb7c684a510e616fdcfcdf6e
shipit-source-id: effd09849a5504c9eb7c684a510e616fdcfcdf6e
2016-02-22 03:26:32 -08:00
Janic Duplessis cf3bd9f9a1 Fix hidden StatusBar reappearing after exiting app on Android
Summary:I changed the technique used to hide the status bar and now it works properly. Also changed the way flags are set on the decorView to make sure it doesn't cause issues with other flags already set and fix deprecated Promise.reject

**Test plan**
Test using the UIExplorer StatusBar example, change the `hidden` prop value and go in and out of the app making sure the status bar has the right visibility.

Fixes #5991
Closes https://github.com/facebook/react-native/pull/6051

Differential Revision: D2960060

Pulled By: nicklockwood

fb-gh-sync-id: ee1c541896f5771d27cfd3ff18537edb6c017284
shipit-source-id: ee1c541896f5771d27cfd3ff18537edb6c017284
2016-02-22 01:50:29 -08:00
Chris Hopman 9294c6f5d4 Initialize glog in react native.
Reviewed By: astreet

Differential Revision: D2931172

fb-gh-sync-id: 837af947846ba862f7e82110771a680f6991342f
shipit-source-id: 837af947846ba862f7e82110771a680f6991342f
2016-02-19 16:25:27 -08:00
Konstantin Raev 54a423e466 fixed master branch
Summary:shame to astreet and glory circle ci
Closes https://github.com/facebook/react-native/pull/6038

Differential Revision: D2954377

fb-gh-sync-id: cda4f1e4d46c5a477756131a4c65a9430cd3cd95
shipit-source-id: cda4f1e4d46c5a477756131a4c65a9430cd3cd95
2016-02-19 15:13:51 -08:00
Andy Street 2b251638a6 WebWorkers: Allow web worker owner to inject globals into worker, supply modified __fbBatchedBridgeConfig
Summary: Now that web workers are just JSCExecutors, we can move forward with adding native module support. The means we need to supply the worker with a correct __fbBatchedBridgeConfig global so it can appropriately set up its JS MessageQueue. Unfortunately, native modules can't support multiple JS execution contexts out-of-the-box, so we need to whitelist those modules that actually can be referenced from a webworker. In order to do that, we add the supportsWebWorkers call in NativeModule and the SupportsWebWorkers annotation for JS modules. These add metadata to __fbBatchedBridgeConfig which allows us to create a new config with only those modules that support web workers.

Reviewed By: lexs

Differential Revision: D2927091

fb-gh-sync-id: 9b47331253b277940b552e7d899198b5f0a3ed8c
shipit-source-id: 9b47331253b277940b552e7d899198b5f0a3ed8c
2016-02-19 08:22:37 -08:00
Andy Street febb1fbe13 WebWorkers: Move web worker impl to JSCExecutor
Summary: Part of the plan to make web workers able to call native modules. We will reuse the infrastructure already present in JSCExecutor to allow web workers to call native modules via the Bridge.

Reviewed By: mhorowitz

Differential Revision: D2926896

fb-gh-sync-id: 259b766c46f79bbb5df9d1c648237b81fc1cc1f9
shipit-source-id: 259b766c46f79bbb5df9d1c648237b81fc1cc1f9
2016-02-19 08:22:31 -08:00
AbilashK 4b97137eee Enable scalesPageToFit on Android
Summary:PR for https://github.com/facebook/react-native/issues/5958. The viewport meta tags if present, are overridden from the page and it is rendered according to the screen size. An example has been added in the Web View section of UIExplorer demo app.
Closes https://github.com/facebook/react-native/pull/6013

Differential Revision: D2953940

Pulled By: nicklockwood

fb-gh-sync-id: 012769f3a2a3f7dc942b60de02a9d1b80a27236e
shipit-source-id: 012769f3a2a3f7dc942b60de02a9d1b80a27236e
2016-02-19 06:28:34 -08:00
Felix Oghina 19a1c4c229 use a static react instance holder
Reviewed By: astreet

Differential Revision: D2937867

fb-gh-sync-id: cdda79929fa5993b6ef159aa73922909017c2ded
shipit-source-id: cdda79929fa5993b6ef159aa73922909017c2ded
2016-02-19 05:07:34 -08:00
Konstantin Raev 0107d1a67b manual sync for D2949054 2016-02-19 11:43:54 +00:00
Huang Yu a6a4389bf4 add the ability to create triangles using css tricks
Summary:- modify ReactViewBackgroundDrawable.java to make each border a trapezoid
 - disable anti-alias to eliminate white spaces between borders
 - add examples to BorderExample.js (see last one)
Closes https://github.com/facebook/react-native/pull/5911

Differential Revision: D2953734

Pulled By: dmmiller

fb-gh-sync-id: dd103d80dec53ad35c9539ab1ceb93ef857feeb9
shipit-source-id: dd103d80dec53ad35c9539ab1ceb93ef857feeb9
2016-02-19 02:59:30 -08:00
Al Sutton 8956915ab1 Move appcompat-orig alongside fork
Reviewed By: bestander

Differential Revision: D2949054

fb-gh-sync-id: d1efc1814d82fdd3c93d08bae469ec815e51c028
shipit-source-id: d1efc1814d82fdd3c93d08bae469ec815e51c028
2016-02-18 09:04:38 -08:00