Граф коммитов

252 Коммитов

Автор SHA1 Сообщение Дата
Mike Armstrong 7f710f9050 Add fbsystrace markers using the legacyprofiler
Reviewed By: astreet

Differential Revision: D2728033

fb-gh-sync-id: 264d40930b8fec0262cbea36529bd8b11efcc58e
2015-12-10 04:39:31 -08:00
Dave Miller 5775d9e1d0 Update touch/measure/hotspot to all use same coordinate space
Reviewed By: astreet

Differential Revision: D2731165

fb-gh-sync-id: 729943233af66f139907cac2002fed4038b3fa6a
2015-12-10 03:01:37 -08:00
Felipe Martim 96553cf553 Add rotateX and rotateY transforms to Android Views .
Summary:
Setting rotateX and rotateY for Android Views.
Closes https://github.com/facebook/react-native/pull/4413

Reviewed By: svcscm

Differential Revision: D2741328

Pulled By: mkonicek

fb-gh-sync-id: 931027c006bc571ef374a7b82cc7074b8a34bc8d
2015-12-09 16:09:30 -08:00
Siddu Duddikunta 64a78ed74b Fix bug in Android elevation implementation
Summary:
If border radius is not set or is zero, then elevation will not
work properly. This bug seems to have been introduced when the
style in facebook/react-native#4180 was modified slightly to
produce commit b65f1f2234.
Closes https://github.com/facebook/react-native/pull/4555

Reviewed By: svcscm

Differential Revision: D2741203

Pulled By: mkonicek

fb-gh-sync-id: f4ee9ccdfc64374d58824a6e988409ac2b7532a4
2015-12-09 15:52:29 -08:00
Martin Konicek 2aa3e0dd1a Use the new Android Clipboard module
Summary:
public

- Open source the unit test for `ClipboardModule`, start using the `ReactTestHelper` in two unit tests
- Fixes a few references to "pasteboard" in strings

Reviewed By: bestander

Differential Revision: D2739614

fb-gh-sync-id: e076940a3ae5c22314e181a37fe2c3f77a18cf85
2015-12-09 15:21:30 -08:00
Denis Koroskin c0c8e7cfdf Add support for `double` type in ReactPropGroup
Reviewed By: astreet

Differential Revision: D2735362

fb-gh-sync-id: a8eab400248fc4c8ad5d43e6a34cfd350dfb1d26
2015-12-09 12:39:38 -08:00
Martin Konicek e8659b3602 Remove all BUCK files 2015-12-09 20:25:19 +00:00
tantan 90c7ad112f add Clipboard component for ios and android
Summary:
add Clipboard component for ios and android
 ```javascript
    import Clipboard from 'react-native'

    Clipboard.get((content)=>{
          console.log('here is content in clipboard:%s',content)
    });
    var content = 'here is a string';
    Clipboard.set(content);
```
Closes https://github.com/facebook/react-native/pull/4384

Reviewed By: svcscm

Differential Revision: D2738881

Pulled By: mkonicek

fb-gh-sync-id: a06df32d1eb2824cc9ca3de9d45e4e67fd2edbc9
2015-12-09 10:04:21 -08:00
Sebastian Markbage 8d397b4cbc Decouple Module System from Native Calls
Summary:
The JavaScript ecosystem doesn't have the notion of a built-in native module loader. Even Node is decoupled from its module loader. The module loader system is just JS that runs on top of the global `process` object which has all the built-in goodies.

Additionally there is no such thing as a global require. That is something unique to our providesModule system. In other module systems such as node, every require is contextual. Even registered npm names are localized by version.

The only global namespace that is accessible to the host environment is the global object. Normally module systems attaches itself onto the hooks provided by the host environment on the global object.

Currently, we have two forms of dispatch that reaches directly into the module system. executeJSCall which reaches directly into require. Everything now calls through the BatchedBridge module (except one RCTLog edge case that I will fix). I propose that the executors calls directly onto `BatchedBridge` through an instance on the global so that everything is guaranteed to go through it. It becomes the main communication hub.

I also propose that we drop the dynamic requires inside of MessageQueue/BatchBridge and instead have the modules register themselves with the bridge.

executeJSCall was originally modeled after the XHP equivalent. The XHP equivalent was designed that way because the act of doing the call was the thing that defined a dependency on the module from the page. However, that is not how React Native works.

The JS side is driving the dependencies by virtue of requiring new modules and frameworks and the existence of dependencies is driven by the JS side, so this design doesn't make as much sense.

The main driver for this is to be able to introduce a new module system like Prepack's module system. However, it also unlocks the possibility to do dead module elimination even in our current module system. It is currently not possible because we don't know which module might be called from native.

Since the module system now becomes decoupled we could publish all our providesModule modules as npm/CommonJS modules using a rewrite script. That's what React Core does.

That way people could use any CommonJS bundler such as Webpack, Closure Compiler, Rollup or some new innovation to create a JS bundle.

This diff expands the executeJSCalls to the BatchedBridge's three individual pieces to make them first class instead of being dynamic. This removes one layer of abstraction. Hopefully we can also remove more of the things that register themselves with the BatchedBridge (various EventEmitters) and instead have everything go through the public protocol. ReactMethod/RCT_EXPORT_METHOD.

public

Reviewed By: vjeux

Differential Revision: D2717535

fb-gh-sync-id: 70114f05483124f5ac5c4570422bb91a60a727f6
2015-12-08 16:03:37 -08:00
Mike Armstrong e7a4b20d75 exceptions generated from incorrect arg usage on JSC trace and LegacyProfile functions
Reviewed By: astreet

Differential Revision: D2729015

fb-gh-sync-id: a3f56554ff6e77170e07aaf93934f93522b3a81b
2015-12-08 06:14:34 -08:00
Andrei Coman 5aef380609 Refactor NetInfo
Reviewed By: foghina

Differential Revision: D2718059

fb-gh-sync-id: 5c4e946991be27c5ae2bcc3eec32b5bc596545bd
2015-12-08 04:56:26 -08:00
Mike Armstrong dcebe8cd37 Use ascii characters to construct JSStringRef
Reviewed By: astreet

Differential Revision: D2700781

fb-gh-sync-id: be790600ea3d4c0238553efe69a0979c177ddb2d
2015-12-08 01:39:28 -08:00
Mike Armstrong 0f98dedefe More markers for view operations
Reviewed By: astreet

Differential Revision: D2679126

fb-gh-sync-id: 882e815a7551d23b4594fdc2dd257b4f1cdbbab7
2015-12-07 15:25:27 -08:00
Alexander Blom 510d50fc17 Trigger GC and drop compiled code on low memory
Reviewed By: astreet

Differential Revision: D2658693

fb-gh-sync-id: 8cba49b67ac45a2dbf8b4c9c404d6fb9c97693f6
2015-12-07 08:46:25 -08:00
Mike Armstrong 69ce5ab5b8 JSC bindings for flow events
Reviewed By: astreet

Differential Revision: D2717887

fb-gh-sync-id: 40d03ac140669b8ebeb096917f2aba32fe260a1a
2015-12-07 03:51:29 -08:00
Olivier Notteghem a38ce5c570 match RN attachment images Feed experience with Native with spinner/fade in
Reviewed By: astreet

Differential Revision: D2722917

fb-gh-sync-id: a09b9a1a4b9a19b94471d8e93ec5bde53af7da06
2015-12-06 15:48:34 -08:00
Dave Miller fa884ee5e6 Fix Y-coord on touches
Summary:
public

D2670028 updated the x/y positions of touch events to be relative to the window, but measure still uses the location on the screen. Therefore, in Touchable.js, we were seeing taps get inproperly invalidated because they were erroneously considered outside of the touch rect. This diff moves back to the old version of pageX/Y on touch events that's compatible with the current version of measure.

Reviewed By: nicklockwood

Differential Revision: D2724917

fb-gh-sync-id: 978ae26fcaa23c47a4f619e2b7ff2d078388ae95
2015-12-04 20:54:39 -08:00
Dave Miller 4661e59d1a For clippedSubViews, pass down the opportunity for children views to update their clipping if they intersect at all
Reviewed By: astreet

Differential Revision: D2717903

fb-gh-sync-id: 8852a6d3ac3a329c4cad663e7f9f7093f9b6ae16
2015-12-04 04:16:28 -08:00
Andy Street ecdc3429cd Fork v4 support library NestedScrollView to fix fling bug
Reviewed By: oli, lexs

Differential Revision: D2707733

fb-gh-sync-id: c9b375a6aa1010d60d21ca7500e862a6ff91a49b
2015-12-03 11:15:51 -08:00
Mike Armstrong 5ad7dd3cac pre add new systrace TRACE_TAG_REACT_VIEW
Reviewed By: foghina

Differential Revision: D2717692

fb-gh-sync-id: 572b9286bd5be9f15ba3295e29770c4d33ee7590
2015-12-03 06:17:27 -08:00
Sameer Rahmani c8eed6a361 RTL support added for ToolbarAndroid via "rtl" property
Summary: Closes https://github.com/facebook/react-native/pull/4378

Reviewed By: svcscm

Differential Revision: D2715052

Pulled By: mkonicek

fb-gh-sync-id: e24f5db230cd7329911797794e5ef150f6195c4a
2015-12-03 05:18:26 -08:00
David Aurelio a68c731aca Android: Accept Throwables in Promise.reject()
Summary:
public

Fixes #4309

This adds the possibility to reject `Promise` instances with `Throwable`s in java, instead of strings.
For now, it only reads the message, but we can add more features on top of this, e.g. forwarding the error stack.

Reviewed By: andreicoman11

Differential Revision: D2708192

fb-gh-sync-id: ca5ff584eca29370a9f9b780fa9825b17863a7e9
2015-12-03 04:52:26 -08:00
Konstantin Raev 0779dd1e87 Open source the Android NetInfo module
Reviewed By: mkonicek

Differential Revision: D2703432

fb-gh-sync-id: 4a85844f1734ec433df543c89f0fdd56fe5db13c
2015-12-02 11:52:22 -08:00
Felix Oghina c06efc0831 remove activities from module constructors
Summary:
Refactor modules that take activities (or activities that implement some interface) as constructor args to not do that. Expose `getCurrentActivity()` in `ReactContext` and use that wherever the activity is needed.

public

Reviewed By: astreet

Differential Revision: D2680462

fb-gh-sync-id: f263b3fe5b422b7aab9fdadd051cef4e82797b0a
2015-12-02 10:05:28 -08:00
Alon Schwarz f69ac1eaef Revert D2679408 (Only send layout update operation to nativehierarchymanager when layout actually changes)
Reviewed By: andreicoman11

Differential Revision: D2712224

fb-gh-sync-id: e6aebe6fcf54e9f36cac092cab801bb97a65dbfd
2015-12-02 06:46:28 -08:00
Alexander Blom 30a5eb51f8 Generate module definition on demand
Reviewed By: astreet

Differential Revision: D2707977

fb-gh-sync-id: fb2baa464a23df82e8b48a91a84c98370517d311
2015-12-02 06:25:28 -08:00
Olivier Notteghem 098fcb3a27 LayoutAnimation support for Android RN
Reviewed By: dernienl

Differential Revision: D2710141

fb-gh-sync-id: 28d6af84441b7c2dbc423b73eb05e71f62f7cdea
2015-12-01 19:06:32 -08:00
Denis Koroskin b828ae4200 Initial FlatUIImplemenatation
Summary: public This patch adds an alternative UIImplementation based on an idea of creating UI hierarchy off-the-main-thread (everything but Views), flattening ReactShadowNode hierarchy and displaying it within a single View when possible. While NativeViewHierarchyOptimizer allows removing layout-only RCTViews, this allows removing RCTView, RCTText and RCTImage.

This is an initial bare-bones implementation that doesn't really draw anything, only lays out the shadow nodes. Followup diffs will add missing features.

Reviewed By: astreet

Differential Revision: D2564309

fb-gh-sync-id: 2dda4c8cfc2bac3eb39c5c15e97bd23a57550a1d
2015-12-01 13:11:27 -08:00
Daniel Hugenroth b0e39d26ae implemented tracing async flow events (s, t and f)
Reviewed By: jkeljo

Differential Revision: D2699625

fb-gh-sync-id: 1d1b41fac157650e98a49307b701b6da63589c4b
2015-12-01 10:36:27 -08:00
Aaron Chiu b6f662d6b6 init Timing.java in a paused state
Summary: It hasn't been resumed yet when first constructed.

public

Reviewed By: astreet

Differential Revision: D2705635

fb-gh-sync-id: fa90a89524d56fd5e349ebad2820b42deba7f26f
2015-12-01 10:06:27 -08:00
Satish Sampath 765801dfc2 Improve JSC GC implementation on android
Reviewed By: astreet

Differential Revision: D2657643

fb-gh-sync-id: a049ee745de9a066a4a2da2762ec6a2f1517c78b
2015-12-01 08:50:32 -08:00
Dave Miller 7377fdcc70 Fix XY coords to be XY instead of YX
Summary: public

This fixes the ordering of methods in touch handling to take their arguments as X,Y instead of Y,X.

This is really just internal cleanup of native touch handling.

Reviewed By: andreicoman11

Differential Revision: D2703003

fb-gh-sync-id: d169436d21fd11c1a9cb251e7e0b57b2094699e4
2015-12-01 05:35:34 -08:00
Denis Koroskin baa97b2e9f Make ViewManagerRegistry class public
Summary: public I need to construct this class outside of the uimanager package, and this requires the class (and its constructor) to be public.

Reviewed By: astreet

Differential Revision: D2554847

fb-gh-sync-id: a73c3236b91a1ed7074521e19b72e1994804cced
2015-11-30 19:13:25 -08:00
Denis Koroskin 00046bc832 Allow extending NativeViewHierarchyManager
Summary: public This diff makes a few small changes to NativeViewHierarchyManager to allow extending it:
a) makes the class public so it can be constructed from outside of the package
b) adds resolveView and resolveViewManager to access mTagsToViews and mTagsToViewManagers
c) changes addRootView signature to make root view a ViewGroup instead of SizeMonitoringFrameLayout

The reason behind change c) is that in FlatUIImplementation I want to use a root view that does not extend SizeMonitoringFrameLayout. NativeViewHierarchyManager doesn't really use any of the root view properties, so it could be even a View, but ViewGroup seems more fitting.

This diff should contain no functional changes or other side-effects.

Reviewed By: astreet

Differential Revision: D2554841

fb-gh-sync-id: cce748707cf7485d456e4a057dae1db87aa17160
2015-11-30 18:59:26 -08:00
Denis Koroskin fe28118a48 When creating a View using NativeViewHierarchyManager, pass ThemedReactContext instead of root view tag
Summary: public NativeViewHierarchyManager.createView() takes int rootViewTag which is only used to resolve ThemedReactContext, but we already have it resolved before we enqueueCreateView, so we can just pass it directly. This makes mRootViewsContext tag -> to ThemedReactContext mapping unnecessary in NativeViewHierarchyManager. Makes the class simpler.

Reviewed By: kmagiera, astreet

Differential Revision: D2460280

fb-gh-sync-id: 68c503f4fb37ca0b1dcb2abc9e0c33a5225d1f6a
2015-11-30 18:21:40 -08:00
Denis Koroskin c4c74215fa Allow extending UIViewOperationQueue
Summary: public I need to extend NativeViewHierarchyManager to support a richer set of operations on Views, and those operations needs to be ran in UI thread.
Existing UIViewOperationQueue doesn't know about those operations, so I need to extend it too to allow them. This patch is making the class constructor protected to allow subclassing it from another package. Should not have any functional changes.

Reviewed By: astreet

Differential Revision: D2554826

fb-gh-sync-id: ad2d44a61beb216d940e20cd1489d3b5da1b398b
2015-11-30 17:43:27 -08:00
Denis Koroskin dd5bb96e44 Provide getters for CallerContext and DraweeControllerBuilder in ReactViewManager
Summary: public Right now there is no centralized place to initialize CallerContext for Fresco. It should probably go through FrescoModule, but currently it's going through ReactImageManager, and thus unavailable to FlatUIImplementation, that doesn't use ReactImageManager. So this diff provides public getters for CallerContext (and DraweeControllerBuilder) in ReactViewManager. This is hacky and generally should not be needed, but without it groups don't have correct CallerContext set.

Reviewed By: kmagiera, astreet

Differential Revision: D2569372

fb-gh-sync-id: 2622e69c64bfebfc575deb330ee77e0139efb7ec
2015-11-30 13:58:29 -08:00
Dave Miller c929e15523 Update touch handling to properly handle transformed Views
Summary: public

Our view handling for determining if a touch was in a view was not transform aware.  This updates it to be
transform aware (by borrowing the code from ViewGroup).

Now, touches will be correctly translated to the view if the view is transformed.  They will also have the correct
local touch point.

This fixes https://github.com/facebook/react-native/issues/3557

Reviewed By: andreicoman11

Differential Revision: D2696063

fb-gh-sync-id: 291f6b9884c610c29f8f8b9992c98d59863ab481
2015-11-30 06:12:24 -08:00
mkonicek pr tester c9dd4015f1 Better error handling in Android Geolocation module (PR 2)
Summary: Just a testing PR for the shipit bot (please don't close :))
Closes https://github.com/facebook/react-native/pull/4355

Reviewed By: svcscm

Differential Revision: D2702784

Pulled By: mkonicek

fb-gh-sync-id: 867c65dcea486750ca65a8437b37a0f658538111
2015-11-30 04:27:28 -08:00
Denis Koroskin 3dca8cf9fd Add UIImplementationProvider and allow overriding it in AbstractReactActivity
Summary: public UIImplementationProvider allows plugging in an alternative UIImplementation. A follow up diff adds a toggle under FB Dev Settings and uses this class to control an implementation. This allows us experimenting with other ways of generating UI hierarchy from JavaScript components.

Reviewed By: astreet

Differential Revision: D2554774

fb-gh-sync-id: 6574a893020e3519bd2ab00b9620a6dbdfaed595
2015-11-29 23:27:30 -08:00
Der-Nien Lee e8e7a2db57 @build-break revert of D2217731
Differential Revision: D2702368

fb-gh-sync-id: 64f53168610c5bf5f3dc22cd7e4dd6b4bb620b4c
2015-11-29 17:41:28 -08:00
olivier notteghem 593a45e319 LayoutAnimation support for Android RN
Reviewed By: astreet

Differential Revision: D2217731

fb-gh-sync-id: d990af4b630995f95433690d5dcf510382dc34d2
2015-11-29 16:33:26 -08:00
Alexander Blom 4890424562 Allow to pass in `ImagePipelineConfig` to `FrescoModule`
Summary: This allows an app to configure much more options in Fresco. public

Reviewed By: astreet

Differential Revision: D2700598

fb-gh-sync-id: e1ffff18bff270e14ef82c14f7bfeef984605738
2015-11-29 04:49:28 -08:00
Denis Koroskin fd0d987768 ShadowNodeHierarchyManager should be supplied externally to UIManagerModule
Summary: public UIManagerModule should not be creating UIImplementation. Instead, UIImplementation instance should be supplied to it to allow plugging in different implementations. No functional changes.

Reviewed By: astreet

Differential Revision: D2464632

fb-gh-sync-id: e7372977c93ceb7ef5e8658e5ee7e8e87f52d851
2015-11-28 11:59:28 -08:00
Felix Oghină 9e30c3b218 add native module overriding
Differential Revision: D2700638

fb-gh-sync-id: a88ffaf864be848e1bba22e443d301e4623f04ec
2015-11-27 06:31:12 -08:00
Oleksandr Stashuk af1475fc4c revert of D2699721
Reviewed By: lexs

Differential Revision: D2700660

fb-gh-sync-id: c59fc46e03146af9a1a6ce836070924d6bcfaba6
2015-11-27 04:28:28 -08:00
Konstantin Raev 01983c2f0a Ability to run unit tests in react-android-github via gradle
Reviewed By: mkonicek

Differential Revision: D2699804

fb-gh-sync-id: 7b31287407bacf2e8e3de6ee1c723a11bb2a0f27
2015-11-27 04:20:19 -08:00
Alexander Blom 2c0679bed1 Reuse DraweeControllerBuilder instead of allocating one for every image
Reviewed By: astreet

Differential Revision: D2699801

fb-gh-sync-id: 883e788f0a5c7231bf26f1ba4149115a15487366
2015-11-27 03:03:33 -08:00
Alexander Blom 699a75b01f Clear Fresco caches when going low on memory
Reviewed By: astreet

Differential Revision: D2699721

fb-gh-sync-id: 2d4685885ee254546496b0517633e5fe2de840d6
2015-11-27 03:03:28 -08:00
Mike Armstrong e1adea86c6 add timestamps to determine string convert time
Reviewed By: astreet

Differential Revision: D2684174

fb-gh-sync-id: feed759025e131fd913c6188f783d6920ad1839c
2015-11-27 02:53:26 -08:00