Summary: public
Add simpler example and remove clutter used to test rendering.
Reviewed By: nicklockwood
Differential Revision: D2605648
fb-gh-sync-id: 84900c290c7af9439f5ce726dd84565bb006ff37
Summary: public
Do not set a default backgroundColor of white when top-level RCTShadowText has
backgroundColor == nil.
Reviewed By: nicklockwood
Differential Revision: D2605636
fb-gh-sync-id: f2076d302e7ed574f7804080ccc80db1c9b9401c
Summary: public
Added opacity property to RCTShadowText, and use it to adjust the alpha
color component of nested text nodes when collapsing the RCTShadowText tree
into an NSAttributedString. The opacity is propagated down the tree,
multiplying the aggregate with the current node's opacity at each step. Also,
foreground and background colors are propagated down the tree so that in case
a node has an opacity style but no colors, the ancestor's colors can be used
when adjusting the alpha components.
Reviewed By: nicklockwood
Differential Revision: D2600402
fb-gh-sync-id: 2adb7b598b0a73c984bb2edaab545c02ab911c6b
Summary: public
Original github title: Exported a callback for native webview delegate method shouldStartLoadWithRequest
We have a requirement in our app, to open in mobile Safari, any http:// and https:// links displayed in a web view. Our web view is not full screen and is loaded with an HTML string from the backend. Displaying external content in that web view is outside of the scope of our app, so we open them in mobile Safari.
I've forked the WebView component and added a callback property, shouldStartLoadWithRequest, and modified the RCTWebView implementation of `webView:shouldStartLoadWithRequest:navigationType:`
to check if the shouldStartLoadWithRequest property is set.
If the property is set, `webView:shouldStartLoadWithRequest:navigationType:` passes the URL & navigationType to the callback. The callback is then able to ignore the request, redirect it, open a full screen web view to display the URL content, or even deep link to another app with LinkingIOS.openURL().
Original author: PJ Cabrera <pj.cabrera@gmail.com>
Closes https://github.com/facebook/react-native/pull/3643
Reviewed By: nicklockwood
Differential Revision: D2600371
fb-gh-sync-id: 14dfdb3df442d899d9f2af831bbc8d695faefa33
Summary: RubyMine's command line launcher `mine` supports the same syntax as `mate` for jumping to line numbers. This patch adds it to the list.
Closes https://github.com/facebook/react-native/pull/3883
Reviewed By: svcscm
Differential Revision: D2615422
Pulled By: pcottle
fb-gh-sync-id: 79a70f524f852ba8eb4803e6abc6970abbf02b61
Summary: Hi,
While implementing my own `RCTURLRequestHandler` I came across retain cycles in `RCTNetworkTask` when used with `RCTFileRequestHandler` and `RCTDataRequestHandler`.
The `NSBlockOperation` used in `RCTFileRequestHandler` and `RCTDataRequestHandler` could never be dealloc'ed because of a retain cycle.
And then the second issue was that those blocks were also strongly capturing the passed delegate which in this case is the `RCTNetworkTask` itself and then since the task was storing the block as a `requestToken`, the task could never be dealloc'ed as well.
Here are my proposed fixes. Let me know what you think.
Closes https://github.com/facebook/react-native/pull/3884
Reviewed By: svcscm
Differential Revision: D2615353
Pulled By: nicklockwood
fb-gh-sync-id: a73cbecffbebea75aaeb23d39f04a0d87602926f
Summary: 1. Add a new api `top` which returns the root navigator of a nested navigator.
2. Remove the param `context` from the method `addListener` because it's not used and not necessary.
public
Reviewed By: fkgozali
Differential Revision: D2613852
fb-gh-sync-id: 0d5544422ff0be7875824989a4fbefbef9aac986
Summary: Currently, the components get registered by `UIExplorerApp.ios.js` as a side effect of requiring `UIExplorerList.ios.js`. This removes the side effect and makes the registration explicit so that it works well with inline requires.
public
Reviewed By: jingc
Differential Revision: D2613174
fb-gh-sync-id: 799dd8b11985708b05fc4c03f367487b47f46bc6
Summary: This check to see if `require` exists was bad as it throws an error for an
undefined reference in case it doesn't exist.
Closes https://github.com/facebook/react-native/pull/3845
Reviewed By: svcscm
Differential Revision: D2613368
Pulled By: martinbigio
fb-gh-sync-id: 7b1d0f38e4af9bce81356a613d6105f2c00c7ed7
Summary: public
Added lightweight genarics annotations to make the code more readable and help the compiler catch bugs.
Fixed some type bugs and improved bridge validation in a few places.
Reviewed By: javache
Differential Revision: D2600189
fb-gh-sync-id: f81e22f2cdc107bf8d0b15deec6d5b83aacc5b56
Summary: This prevents the 'distanceFromEnd' from being negative when 'offset' is zero, for example.
Closes https://github.com/facebook/react-native/pull/3074
Reviewed By: svcscm
Differential Revision: D2610771
Pulled By: sahrens
fb-gh-sync-id: f878f1c1b865063294013c3bb96b90831877d372
Summary: public
The Dev Menu is for some reason eventually calling twice the callbacks, guard
against it while we don't fix it.
Reviewed By: nicklockwood
Differential Revision: D2600470
fb-gh-sync-id: 50c622d2ab64ce50d51572dbfcc076c2765ce582
Summary: A lot of people try to use a device as the very first thing when trying
out React Native. I've observed this at the developer workshop in Prague
and on Twitter.
However, developing on pre-API 21 devices is quite involved:
https://facebook.github.io/react-native/docs/running-on-device-android.html
I'm thinking we could recommend installing Android together with Android
studio. Android studio installs HAXM for you (hardware acceleration, without
this Google emulators are useless) and also creates and starts emulators.
So it would be quite a smooth experience similar to pressing 'Run' in Xcode.
We'd just need to integrate with Gradle so that installing the app also starts
the packager. I think that's something we should do in any case.
Probably an even better option is to build a React Native-specific tool that
lets you do everything you need: opens the Android SDK Manager, creates and
starts emulators, detects whether you have Genymotion and opens it, upgrades
node and npm etc.
public
Reviewed By: vjeux
Differential Revision: D2604774
fb-gh-sync-id: c7ffb701b4e5209815faf652926937c22943be95
Summary: public
The UIManager had a lock around the enqueued ui blocks, but now all the operations
should happen on the shadow thread, so I added assertions to it and removed the
locks.
Reviewed By: nicklockwood
Differential Revision: D2605760
fb-gh-sync-id: e1bc649f759502e7e9fd059932e0cba38dba05bf
Summary: public
At some point the profile call was changed to only pass `@"invoke callback"`
rather than the module name, which makes most entries pretty much useless.
Change it back to be the module name.
Reviewed By: javache
Differential Revision: D2602222
fb-gh-sync-id: c4e8e3f559f66725620293cc575baf5ede48df31
Summary: Inspired by: https://twitter.com/geirmanc/status/660275638637477889
There are many reasons why the Gradle build could fail and the best
thing to do is to read the error message.
We can provide some hints in the most common cases though.
public
Reviewed By: vjeux
Differential Revision: D2604747
fb-gh-sync-id: 1aa83abb9ec823c03814dcc31d630a8f1914cf5c
Summary: public
Add explicitly cast to the trampoline prototype to silence warnings.
Reviewed By: javache
Differential Revision: D2605779
fb-gh-sync-id: e208b69236c1b87bb1374ee493840ea5f47b371c
Summary: public
Native iOS has a good error message, but it's in native which makes
things a little harder to track down (can't use Chrome debugger as easily).
Android has no special handling, so a cryptic "Trying to add unknown view tag..."
redbox would come up.
This puts the error handling in JS so it's shared on all platforms and can be
debugged more easily in Chrome.
Reviewed By: vjeux
Differential Revision: D2606064
fb-gh-sync-id: 5295a44a028c7be79d60dbaf0b5d59fd0a56fdde
Summary: releasing the viewControllers referred by _navigationController.viewControllers, which is also releasing the related views
Closes https://github.com/facebook/react-native/pull/3808
Reviewed By: svcscm
Differential Revision: D2604735
Pulled By: javache
fb-gh-sync-id: f202d155f04169f3f0f0ef26365b37b8525b6687
Summary: public
White space between the end of the first part of the method selector and the first colon was being included in the JS method name.
(See: https://github.com/facebook/react-native/issues/3804)
Reviewed By: javache
Differential Revision: D2605713
fb-gh-sync-id: b4402c9ede5eb31dd38021c902f046a4e0557814
Summary: public
Expose a more precise timer, millisecond precision is enough to measure small operations.
Reviewed By: javache
Differential Revision: D2604218
fb-gh-sync-id: ba50c891b5690575548fe04ba1ae7d015bc31d90
Summary: public
We moved to using `new` instead of `alloc] init` but there was still some calls
left.
Reviewed By: javache
Differential Revision: D2604679
fb-gh-sync-id: ff7300ecbedb55dd5e93873592598810c9b87808