Commit Graph

4031 Commits

Author SHA1 Message Date
Nick Lockwood 01a0facf33 Fixed onFocus/onBlur events for multiline TextInput
Summary: public

onFocus and onBlur were not firing for multiline TextInputs.

Reviewed By: tadeuzagallo

Differential Revision: D2699846

fb-gh-sync-id: 7e64309bc631a42a99f989f615fef927dc50217c
2015-11-27 07:47:28 -08:00
Nick Lockwood 60db876f66 Wrapped UIManager native module for better abstraction
Summary: public

RCTUIManager is a public module with several useful methods, however, unlike most such modules, it does not have a JS wrapper that would allow it to be required directly.

Besides making it more cumbersome to use, this also makes it impossible to modify the UIManager API, or smooth over differences between platforms in the JS layer without breaking all of the call sites.

This diff adds a simple JS wrapper file for the UIManager module to make it easier to work with.

Reviewed By: tadeuzagallo

Differential Revision: D2700348

fb-gh-sync-id: dd9030eface100b1baf756da11bae355dc0f266f
2015-11-27 07:00:32 -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
Mike Armstrong af753a8a4d Add NativeProfiling module that uses RN nativeProfiler or console.profile
Reviewed By: jspahrsummers

Differential Revision: D2696072

fb-gh-sync-id: 6a2b9793424cf9a82b9472e6d468cbd81dd6780a
2015-11-27 04:44:25 -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
Martin Kralik be285c43d1 use didSetProps instead of updateLayout
Summary: There is no point in using `updateLayout` when we have `didSetProps`.
The only a bit risky part is calling `dirtyLayout` in `setFrame:forView:` instead of `updateLayout`,
but since setting frame shouldn't really change border/margin/padding it should be ok.

Depends on D2699512.

public

Reviewed By: nicklockwood

Differential Revision: D2700012

fb-gh-sync-id: a7c33b3b4e3ddc195bebebb8b03934131af016fb
2015-11-27 04:03:48 -08:00
Martin Kralik f86691a449 added `didSetProps` for views and shadow views
Summary: Views and shadow views might want to configure themself once all of their props were set.
So far there was no way to do it without writing some synchronization code.

This diff adds a `didSetProps` call on both uiviews and shadow views, passing names of all props that were set for convenience.

public

Reviewed By: nicklockwood

Differential Revision: D2699512

fb-gh-sync-id: 65f76e7bcbf5751d5b550261a953c463ed2f4e8a
2015-11-27 04:03:42 -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
Mike Armstrong e1533fdff6 Move BridgeProfile call to give better systrace info
Reviewed By: tadeuzagallo, sahrens

Differential Revision: D2697510

fb-gh-sync-id: 00ec4d5835331b78c554c904dd29661dad9f6f97
2015-11-27 01:19:25 -08:00
David Aurelio 9c322df7b8 Don’t do manual connection counting
Reviewed By: tadeuzagallo

Differential Revision: D2696017

fb-gh-sync-id: 039abf9b7ed1570590e96e7077bb48a5493e8471
2015-11-26 11:04:28 -08:00
Martin Konicek c4636beaeb Merge pull request #4375 from mkonicek-tester/master
Alpha-sort modules in Known Issues
2015-11-26 18:12:09 +00:00
mkonicek-tester 8ebe136f61 Alpha-sort modules 2015-11-26 18:07:58 +00:00
mkonicek-tester ab68d8e8d1 Alpha-sort modules in Known Issues 2015-11-26 18:07:17 +00:00
Martin Konicek 5a002a2987 Merge pull request #4374 from mkonicek-tester/master
Update KnownIssues.md
2015-11-26 18:02:59 +00:00
mkonicek-tester fd6ec34cdc Update KnownIssues.md 2015-11-26 18:01:53 +00:00
Martin Konicek 0f89696f76 Update KnownIssues.md 2015-11-26 17:39:15 +00:00
Tim Park 8911b72d9e Add Polyline support to MapView
Summary: Per issue #1925, add support for Polyline to MapView.

Briefly, if you have a MapView declared as:

    <MapView
      annotations={this.state.annotations}
      overlays={this.state.overlays}
      style={styles.map}
      region={this.state.region}
      ref="mapView"
    />

then setting

    this.state.overlays = [{
      coordinates: [
        { latitude: 35.5, longitude: -5.5 },
        { latitude: 35.6, longitude: -5.6 },
        ...
      ],
      strokeColor: 'rgba(255, 0, 0, 0.5)',
      lineWidth: 3,
    }];

will draw a red line between the points in locations with a width of 3 and equally blended with the background.
Closes https://github.com/facebook/react-native/pull/4153

Reviewed By: svcscm

Differential Revision: D2697347

Pulled By: nicklockwood

fb-gh-sync-id: a436e4ed8d4e43f2872b39b4694fad7c02de8fe5
2015-11-26 08:54:16 -08:00
Andy Street a636ddd9f0 Backout D2677289 [react_native] View recycling in JS
Summary: public

We're seeing related crashes. The diff has no tests, the perf tests weren't conclusive, and the person who'd be supporting it no longer is available to work on it. We can try this again later in a less rushed manner with proper perf testing.

Reviewed By: davidaurelio

Differential Revision: D2696615

fb-gh-sync-id: 3b6814ac12af19516146d5c42d2add8321b10db5
2015-11-26 08:41:27 -08:00
Pieter De Baets bb11e05c33 Default empty view to RCTView with position: absolute
Reviewed By: spicyj, davidaurelio

Differential Revision: D2693494

fb-gh-sync-id: fc00b995d7d4fdaaedf4c3e5382354f0a1f4ac23
2015-11-26 08:12:28 -08:00
Konstantin Raev c0f60d2018 Moved React Native Android unit tests to open source
Reviewed By: mkonicek

Differential Revision: D2685799

fb-gh-sync-id: 56f061df58641c8cb13fc16bad5f87039f0c49fb
2015-11-26 08:05:15 -08:00
Tadeu Zagallo a7e2059c15 Fix class pair register on reload
Summary: public

It was possible after reload to detach from the new instance, removing the markers.

Reviewed By: jspahrsummers

Differential Revision: D2696208

fb-gh-sync-id: ad8f5d449f51c7c74a20ae7c0cafc4fc786ea390
2015-11-26 07:27:27 -08:00
David Aurelio 977a40ed04 Don’t error for known files that are reported as “added” by watchman
Reviewed By: tadeuzagallo

Differential Revision: D2696636

fb-gh-sync-id: 89f90aba2a22d9c3e93632df4c4bc01791525833
2015-11-26 07:06:24 -08:00
Nick Lockwood 4b6b71664e Fix buck error
Reviewed By: idevelop

Differential Revision: D2699529

fb-gh-sync-id: d71a5abf04b767a58dd6f054a88a8bf0c561aa8d
2015-11-26 05:42:25 -08:00
Pieter De Baets bf0934a531 Delete RCTRootView's deprecated 'initialProperties' property
Reviewed By: majak

Differential Revision: D2597411

fb-gh-sync-id: 547837cac8e22e7fe78db6213741634b87bcf571
2015-11-26 05:10:28 -08:00
Tadeu Zagallo ea96a7edb8 Avoid dispatch_async on RCTProfile when not profiling
Summary: public

Fixes #3953

Bail out soon when the profiler is not running + move string formating into the macro so that it happens in a background queue.

Reviewed By: jspahrsummers

Differential Revision: D2696167

fb-gh-sync-id: a1b91ee4459078ab9a4c0be62bd23362ec05e208
2015-11-26 04:11:28 -08:00
SungHyun Park 9365414559 added TRACE_TAG_REACT_APPS constants
Summary: added required constants
Closes https://github.com/facebook/react-native/pull/4366

Reviewed By: svcscm

Differential Revision: D2699433

Pulled By: astreet

fb-gh-sync-id: 33c69b248f682e1b31bb2ef79cb0253ddd8d8817
2015-11-26 03:35:32 -08:00
Nick Lockwood 5b5b55027b Added support for custom color and image for map annotations
Summary: public

This diff extends RCTMap annotations with an `image` and `tintColor` property, which can be used to render completely custom pin graphics.

The tintColor applies to both regular pins and custom pin images, allowing you to provide varied pin colors without needing multiple graphic assets.

Reviewed By: fredliu

Differential Revision: D2685581

fb-gh-sync-id: c7cf0af5c90fd8d1e9b3fec4b89206440b47ba8f
2015-11-26 03:07:28 -08:00
James Ide 63ef826d44 Merge pull request #4368 from FormationsFactory/showcase-add-blog-link-formations-factory-company-name-search-app
[Showcase] Add blog post link to Formations Factory Company name search app
2015-11-26 02:45:16 -08:00
Julius Jurgelenas e379536c11 Showcase: add blog post link to Formations Factory Company name search app 2015-11-26 12:43:39 +02:00
James Ide 8167c9e313 Merge pull request #4363 from spicyj/nav-abc
Fix ABC order of docs nav
2015-11-26 00:19:24 -08:00
Denis Koroskin 76e033ead9 Extract shadow hierarchy logic from UIManagerModule into UIImplementation
Summary: public This diff extracts all shadow hierarchy-specific logic from UIManagerModule into a UIImplementation class. This will later allow using in alternative UIImplementations in future.

Reviewed By: astreet

Differential Revision: D2457849

fb-gh-sync-id: 532128ce1d67b525cdf03794a5a29d7e9ed0ab90
2015-11-25 22:15:37 -08:00
Denis Koroskin aeda31428d When addRootView() is called in a background thread, execute it as a generic UIOperation command in UIViewOperationQueue
Summary: public There is really no reason NativeViewHierarchyManager.addRootView() should be performed synchroniously when called from background thread, as long as it is executed before every other command in UIViewOperationQueue, and we can ensure that by putting add view command at the front of the queue. When that happpens, the queue should always be empty anyway, but it's best to be safe.

This eliminates an unnecessary blocking call and should overall make the code simpler and safer (Semaphores can timeout).

Reviewed By: astreet

Differential Revision: D2462680

fb-gh-sync-id: 784ac6573a455019b93628c70992f3830b9d6f1f
2015-11-25 22:15:32 -08:00
Denis Koroskin 16350ae09b Remove AnimationRegistry from UIManageModule
Summary: public UIManageModule creates AnimationRegistry but never uses it, this diff moves it to NativeViewHierarchyManager who owns it. UIViewOperationQueue depends on AnimationRegistry to perform some of the enqueued operations, so it accessed it through a getting in NativeViewHierarchyManager. This will also make sure NativeViewHierarchyManager. and UIViewOperationQueue operate on the same AnimationManager (previously, that wasn't really enforced). This is needed so I can move away UIViewOperationQueue creation off the UIManagerModule. This diff should have no functional changes whatsoever.

Reviewed By: astreet

Differential Revision: D2462605

fb-gh-sync-id: 1e3cd64908f51126362f2b5fb39b1efa6521854e
2015-11-25 22:15:26 -08:00
Ben Alpert fab8e38759 Fix ABC order of docs nav 2015-11-25 21:26:32 -08:00
Sebastian Markbage 0e11379dbb Extract the Require polyfill from the default list of polyfills
Summary: Extracts the module system from the list of dependencies and adds it back to the bundling process.

Unbundling and Prepack has their own module systems. jest does as well. This is not normally part of the resolver, nor polyfills.

In fact, I think we'll eventually start treating polyfills as normal modules just like core-js.

The prelude is the weird part right now but I think that we'll eventually move the DEV flag to be module level instead of global and we can just get rid of this prelude.

public

Reviewed By: davidaurelio

Differential Revision: D2693701

fb-gh-sync-id: a59ccda0fa15fcfcda52897e8290805eed1b92b3
2015-11-25 18:46:28 -08:00
Brent Vatne ae09a10c95 Add onLoadX support on Android
Summary: ~~This is a WIP, just finished the first bit and wanted to get some feedback to see if this approach seems appropriate, as I haven't done a lot of Android development.~~

Looks ready for review now.
Closes https://github.com/facebook/react-native/pull/3791

Reviewed By: svcscm

Differential Revision: D2672262

Pulled By: mkonicek

fb-gh-sync-id: 1e8f1cc6658fb719a68f7da455f30a7c9b1db730
2015-11-25 18:30:31 -08:00
Kyle Corbitt b65f1f2234 Use elevation to implement shadows on Android
Summary: This PR includes a working interface to Android's `elevation` property implemented as an RN style. Elevation is the only (easy) [platform-supported way to create shadows](http://developer.android.com/training/material/shadows-clipping.html). For it to work note that you must be running on Android 5.0+, and add `elevation` to a view with a `backgroundColor` set. These are platform limitations.

This PR is not intended to be merged in its current state, but rather to inform the discussion from #2768. At a minimum, before merging we would need to add the elevation style to the docs and rebase this to master (**EDIT** I have now rebased on master because from v0.14.2 too many commits were being pulled in -- haven't tested it since the rebase though). Additionally, it might be good to add tests, although I couldn't find any for the Android code. I'm happy to get that done if this feature gets signed off by the React Native team.

Finally, as I argued in #2768 I think that `elevation` is a useful abstraction ov
Closes https://github.com/facebook/react-native/pull/4180

Reviewed By: svcscm

Differential Revision: D2684746

Pulled By: mkonicek

fb-gh-sync-id: 825f3ccd20c4b0eea9d11b5f0e3a6b018b7e4378
2015-11-25 18:28:29 -08:00
Brent Vatne c11d861807 [Docs] Update style of paragraphs within showcase 2015-11-25 14:15:47 -08:00
Brent Vatne 0d2eb748f7 [Docs] Re-imagining the showcase 😇 2015-11-25 14:10:03 -08:00
Brent Vatne a00bd33295 Merge pull request #4256 from rreusser/note-on-known-issue-for-3198
[Docs] Additional note for Android borderRadius clipping #3198
2015-11-25 12:47:13 -08:00
Chester Wood e966cd1041 Set navigator.product to ReactNative
Summary: Fix for [Issue 1331](https://github.com/facebook/react-native/issues/1331). Sets navigator.product to ReactNative and navigator.productSub to the version string in package.json.

Note that the code requires package.json, which works fine in the RN packager, but webpack users will probably a need to configure a json loader in their config file.

Tested using UIExplorer and console.log printout of the product variables in xcode and Chrome debugger.
Closes https://github.com/facebook/react-native/pull/4083

Reviewed By: svcscm

Differential Revision: D2696881

Pulled By: vjeux

fb-gh-sync-id: 511446432dcd0ec658100715129c77153e743423
2015-11-25 12:45:28 -08:00
Milen Dzhumerov a663d4d8d5 Use for-loop instead of forEach() in a hot path
Summary: public

Replaces the usage of forEach() with a for loop on a hot code path

Reviewed By: tadeuzagallo

Differential Revision: D2690727

fb-gh-sync-id: b7cbcda5cf80a0e31753f49c01e145abb789f3e5
2015-11-25 07:24:31 -08:00
Andy Street ca016e4eb3 Add perf markers for cold start
Summary: public

Adds useful systrace perf markers for cold start analysis

Reviewed By: mikearmstrong001

Differential Revision: D2695629

fb-gh-sync-id: d964f28a1f3e10a13c441a17b0300c980d4914e8
2015-11-25 05:58:31 -08:00
Martin Konicek 388d8c8f9b Update breaking-changes.md 2015-11-25 13:41:40 +00:00
Milen Dzhumerov 638fd11c5c Revert 3770f061c832 for further investigation
Reviewed By: idevelop

Differential Revision: D2695659

fb-gh-sync-id: b1ba529c648681faef5d4f07273722764722fbe1
2015-11-25 05:24:28 -08:00
Nick Lockwood 060664fd3d Refactored module access to allow for lazy loading
Summary: public

The `bridge.modules` dictionary provides access to all native modules, but this API requires that every module is initialized in advance so that any module can be accessed.

This diff introduces a better API that will allow modules to be initialized lazily as they are needed, and deprecates `bridge.modules` (modules that use it will still work, but should be rewritten to use `bridge.moduleClasses` or `-[bridge moduleForName/Class:` instead.

The rules are now as follows:

* Any module that overrides `init` or `setBridge:` will be initialized on the main thread when the bridge is created
* Any module that implements `constantsToExport:` will be initialized later when the config is exported (the module itself will be initialized on a background queue, but  `constantsToExport:` will still be called on the main thread.
* All other modules will be initialized lazily when a method is first called on them.

These rules may seem slightly arcane, but they have the advantage of not violating any assumptions that may have been made by existing code - any module written under the original assumption that it would be initialized synchronously on the main thread when the bridge is created should still function exactly the same, but modules that avoid overriding `init` or `setBridge:` will now be loaded lazily.

I've rewritten most of the standard modules to take advantage of this new lazy loading, with the following results:

Out of the 65 modules included in UIExplorer:

* 16 are initialized on the main thread when the bridge is created
* A further 8 are initialized when the config is exported to JS
* The remaining 41 will be initialized lazily on-demand

Reviewed By: jspahrsummers

Differential Revision: D2677695

fb-gh-sync-id: 507ae7e9fd6b563e89292c7371767c978e928f33
2015-11-25 04:49:45 -08:00
Pieter De Baets bba71f146d Defer rendering events popover until required
Reviewed By: davidaurelio

Differential Revision: D2690835

fb-gh-sync-id: 1d17c20b308e364c49f868d8861c6ad93957bffe
2015-11-25 04:15:27 -08:00