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

283 Коммитов

Автор SHA1 Сообщение Дата
Andrei Coman 41875eec47 Add cold start events dashboard ctscan test
Reviewed By: AaaChiuuu

Differential Revision: D2765609

fb-gh-sync-id: 1ac6b76dfad2cd01e52908c31e5391897aa2d99f
2015-12-21 10:24:37 -08:00
Konstantin Raev a99c5160ee Android Instrumentations tests are ready to be run in github/CI open source environment
Reviewed By: mkonicek

Differential Revision: D2769217

fb-gh-sync-id: 7469af816241d8b642753cca21f6542b971e9572
2015-12-21 09:39:57 -08:00
Jan Kassens 4769bdc013 disable debugging of web views
Reviewed By: andreicoman11

Differential Revision: D2773171

fb-gh-sync-id: 41b1313c2ec3d3a22cf56ee15e452b978adf5a78
2015-12-18 10:52:44 -08:00
Martin Konicek b436943a27 Pass the correct URL to Android WebView events
Summary:
`WebView.getUrl()` doesn't return the correct value in WebView callbacks
(e.g. `onPageFinished`).
For example, when navigating to a URL, we report that loading finished,
but still with the old URL. This diff fixes that.

public

Reviewed By: andreicoman11

Differential Revision: D2769597

fb-gh-sync-id: f14bdd405290469ac0a20d0fb89aa2a27d33e758
2015-12-18 03:41:31 -08:00
Martin Konicek a3d16c0178 Fix gitignore
build/ is too generic, ignores valid paths.

Test plan:
- Built Android UI explorer, ReactAndroid, iOS UIExplorer, iOS React
- Git still ignores build output files correctly
2015-12-18 11:35:30 +00:00
Denis Koroskin 56fd138fd3 Dispatch OnLayoutEvent when node gets re-laid out
Reviewed By: ahmedre

Differential Revision: D2768625

fb-gh-sync-id: 4a9862e4c7ada218565fcd87cae25414a0bd5181
2015-12-17 18:46:27 -08:00
Denis Koroskin 18d2177989 Implement @ReactProp nativeBackgroundAndroid in RCTView
Reviewed By: ahmedre

Differential Revision: D2768671

fb-gh-sync-id: cb3ae29f1cecfaec103708cbc82cf4b57dc80d1a
2015-12-17 15:05:45 -08:00
Denis Koroskin ad74dabb68 Turn FlatViewManager into ViewGroupManager
Reviewed By: ahmedre

Differential Revision: D2768667

fb-gh-sync-id: 39298e4033aab5ca8230516f98da252790811f14
2015-12-17 13:31:31 -08:00
Jing Chen 022eac9bd8 Revert D2739392 to fix events dash loading on android
Reviewed By: andreicoman11

Differential Revision: D2770201

fb-gh-sync-id: 6391936f41ba18606637c801645c3177ed1da9ea
2015-12-17 12:54:37 -08:00
Martin Konicek 8cd7730080 Open source Android WebView
Summary:
Keep `WebView.android.js` and `WebView.ios.js`, there are
some small differences. Use the same example on both platforms.

public

Reviewed By: bestander

Differential Revision: D2769446

fb-gh-sync-id: be3d0afcbfd6ddcbaa49f70555063b3081ba03cb
2015-12-17 12:47:39 -08:00
Martin Konicek 3a3af8a385 Open souce the Android Dialog module
Summary:
public

The `DialogModule` requires `android.support.v4.app.FragmentManager` which means
every app that wants to use Dialogs would need to have its Activity extend the legacy
`android.support.v4.app.FragmentActivity`.

This diff makes the `DialogModule` work with both the Support `FragmentManager`
(for AdsManager & potentially other fb apps) and the `android.app.FragmentManager`
(for new apps with no legacy dependencies).

Also wrap the native module in the same `Alert` API that we have on iOS and provide
a cross-platform example. In my opinion the iOS Alert API is quite nice and easy to use.

We still keep `AlertIOS` around because of its `prompt` function which is iOS-specific
and also for backwards compatibility.

Reviewed By: foghina

Differential Revision: D2647000

fb-gh-sync-id: e2280451890bff58bd9c933ab53cd99055403858
2015-12-17 11:11:13 -08:00
Mike Armstrong 1be5777265 define out the memory heap jsc functions
Reviewed By: mkonicek

Differential Revision: D2764964

fb-gh-sync-id: 26eff3e29762287f3527de84b146cee90eccd580
2015-12-16 10:45:52 -08:00
Denis Koroskin 42a1620b1e Remove referenced to dropped views
Reviewed By: ahmedre

Differential Revision: D2757310

fb-gh-sync-id: 2ac97476823879d60dac63920f5e7f086872888a
2015-12-16 10:06:31 -08:00
Dave Miller fcf0431d25 Add support for more Scroll Events to Android
Summary:
public
This adds support for
onScrollBeginDrag/End
onMomentumScrolBegin/End

Reviewed By: astreet

Differential Revision: D2739035

fb-gh-sync-id: 2a49d1df54e5f5cd82008bdb0ffde0881ba39aff
2015-12-16 00:48:28 -08:00
Denis Koroskin 1fabd86048 Add support for custom AndroidViews
Reviewed By: ahmedre

Differential Revision: D2751716

fb-gh-sync-id: 3007cc1eb0303bb2e9eab84836b486e1c2e21021
2015-12-15 20:08:34 -08:00
Felix Oghina 3d4889b5cf return packager URL instead of proxy URL when debugging
Summary:
JS relies on the URL returned by SourceCodeModule to load packager assets. Because we currently return localhost when debugging (because that's the URL Chrome uses), assets don't load when debugging. This makes it so SourceCodeModule still returns the package URL relative to the emulator / device even when debugging.

public

Reviewed By: astreet

Differential Revision: D2759710

fb-gh-sync-id: bab6a88ef044b8b4d971381e3b23c59fa9aa2ed0
2015-12-15 12:17:28 -08:00
Mike Armstrong 7f92aea371 JSC Heap snapshot and capture
Reviewed By: astreet

Differential Revision: D2699681

fb-gh-sync-id: 81617187abec6d9bc1ffe3da02513c6875d0b93b
2015-12-15 10:53:31 -08:00
Alexander Blom 12bec39da1 Fix cxxbridge usage of SettableFuture
Reviewed By: mhorowitz

Differential Revision: D2759591

fb-gh-sync-id: 920b4a5c934c1bd9d196ccbeec0799a54001b85d
2015-12-15 10:43:36 -08:00
Dave Miller e6d498b99b Fix case where measure is called with a view that is now off screen (and removed from clipping)
Reviewed By: astreet

Differential Revision: D2760119

fb-gh-sync-id: cf2723ddc94de64bba961e9390ce54f39ca4651f
2015-12-15 10:43:29 -08:00
Felix Oghina 7871abf907 crash gracefully on fatal js errors
Reviewed By: AaaChiuuu

Differential Revision: D2739392

fb-gh-sync-id: bcc1171c076a4f6425184e7b9ffed204f5ce6f0e
2015-12-15 08:20:32 -08:00
Satyajit Sahoo eb188c8d98 Add deep linking support to IntentAndroid
Summary:
Add a method to handle URLs registered to the app,

```js
IntentAndroid.getInitialURL(url => {
    if (url) {
        // do stuff
    }
});
```

Refer - http://developer.android.com/training/app-indexing/deep-linking.html#adding-filters

The API cannot be same as the iOS API (i.e. as a constant), as the activity is not availble at the time of module initialization. Moreover, multiple activties can share the same bridge instance, and the activity itself is not a constant. Hence the initialURL can change.
Closes https://github.com/facebook/react-native/pull/4320

Reviewed By: svcscm

Differential Revision: D2759667

Pulled By: foghina

fb-gh-sync-id: b725231ae1401fa5565d444eee5a30d303e263ae
2015-12-15 06:27:27 -08:00
David Aurelio cf94a9ea95 Avoid copying the JS bundle unnecessarily
Summary:
public
When forwarding the unbundle code to the bridge, we’re passing the code by value.
This changes the affected method to take it by reference.

Reviewed By: astreet

Differential Revision: D2759569

fb-gh-sync-id: 508d4f4d56bcbdd5a7df5610cf9040121f8878ef
2015-12-15 05:47:31 -08:00
Martin Kralik c46936a00d updated css-layout and fixed callsites
Reviewed By: foghina

Differential Revision: D2757965

fb-gh-sync-id: 061ff38ae59783edb36ff66516866e4a22fd6e25
2015-12-15 04:49:29 -08:00
Andrei Coman dbc35b69fa Make it possible to set DB size
Reviewed By: oli

Differential Revision: D2749219

fb-gh-sync-id: 2165ed8a89c48687ad82cd1facf2b875d31ca997
2015-12-14 12:10:32 -08:00
Krzysztof Magiera 2f56c0c90a Upgrade gradle to 2.9
Summary:
public

New version of gradle has a better support for zipTree copy task. Since we have a few of those including one for boost library which used to take very long, after upgrading we no longer need 6a656a1.

Also seems like many improvements made to gradle since 2.2 made it perform better on incremental builds (around 10% improvement on my laptop).

Command used to upgrade gradle version:

    gradle wrapper --gradle-version 2.9

Some of the plugins require updating as well since the previous versions were incompatible with gradle 2.9.

Closes https://github.com/facebook/react-native/pull/4462

Reviewed By: mkonicek

Differential Revision: D2754786

Pulled By: mkonicek

fb-gh-sync-id: 92c07d29aec6d5b4b2c55205b42b135c4d9479a9
2015-12-14 06:37:34 -08:00
Alexander Blom 01e291751a Use callOnQueue() instead of latch
Reviewed By: astreet

Differential Revision: D2717989

fb-gh-sync-id: 9770e773015838301f6e9520a1ca7a283f647de7
2015-12-12 14:33:17 -08:00
Alexander Blom 8de172e92d Refactor so that mBridge can not be null and can be final
Reviewed By: astreet

Differential Revision: D2717983

fb-gh-sync-id: 969499eb062d54e0271f910c06c4539e2cb20030
2015-12-12 14:33:12 -08:00
Qiao Liang c60b581327 fix POST/PUT/PATCH has no body redbox, when xhr is used without body
Summary:
… by passing a empty body
fix #3371
referring to https://github.com/square/okhttp/pull/1559/files
Closes https://github.com/facebook/react-native/pull/4518

Reviewed By: svcscm

Differential Revision: D2753086

Pulled By: lexs

fb-gh-sync-id: 5c486b127b194b29cd0f8a2cb9a1ef19449109e3
2015-12-12 09:11:30 -08:00
Martin Konicek f168fc335e Don't insta-crash when network permission is missing
Summary:
public

Rename the `ConnectivityModule` to `NetInfoModule` (there's
no need to name things differently in two places). Add exception
handling to the module in case the network permission is missing.

When the permission is missing, throw an actionable error from
all calls to `NetInfo`: http://imgur.com/zVIMxOV

Without this change, the app immediately crashes on startup:
`getCurrentConnectionType` is called from `Activity.onResume`.

Reviewed By: andreicoman11, bestander

Differential Revision: D2749230

fb-gh-sync-id: 1b752d21a8f28ffeaf60a3322cb76f869dc70a14
2015-12-11 10:29:23 -08:00
Mike Armstrong 1a94698658 expose systemclock time to JS
Reviewed By: tadeuzagallo

Differential Revision: D2748749

fb-gh-sync-id: 4d1dbae61f69a07b7106cb57caff03cadfb85776
2015-12-11 07:32:30 -08:00
Tadeu Zagallo 3549ff049c Rename BridgeProfiling to Systrace for consistency
Summary:
public

Rename the `BridgeProfiling` JS module to `Systrace`, since it's actually just
an API to Systrace markers.

This should make it clearer as we add more perf tooling.

Reviewed By: jspahrsummers

Differential Revision: D2734001

fb-gh-sync-id: 642848fa7340c545067f2a7cf5cef8af1c8a69a2
2015-12-11 03:53:19 -08:00
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