Summary:
@public
This is the first of a few diffs that change the way the executors are handled
by the bridge.
For they are just promoted to modules, so they are automatically loaded by the bridge.
Test Plan:
Tested on UIExplorer, Catalyst and MAdMan.
Tested all the 3 executors, everything looks fine.
Summary:
@public
`[Bridge] Add support for JS async functions to RCT_EXPORT_METHOD` was imported but broke some internal code, reverting the `MessageQueue` that caused the issues and add a test, since the method is not used yet.
Test Plan: Run the test o/
Summary:
Adds support for JS async methods and helps guide people writing native modules w.r.t. the callbacks. With this diff, on the native side you write:
```objc
RCT_EXPORT_METHOD(getValueAsync:(NSString *)key
resolver:(RCTPromiseResolver)resolve
rejecter:(RCTPromiseRejecter)reject)
{
NSError *error = nil;
id value = [_nativeDataStore valueForKey:key error:&error];
// "resolve" and "reject" are automatically defined blocks that take
// any object (nil is OK) and an NSError, respectively
if (!error) {
resolve(value);
} else {
reject(error);
}
}
```
On the JS side, you can write:
```js
var {DemoDataStore} = require('react-native').NativeModules;
DemoDataStore.getValueAsync('sample-key').then((value) => {
console.log('Got:', value);
}, (error) => {
console.error(error);
// "error" is an Error object whose message is the NSError's description.
// The NSError's code and domain are also set, and the native trace i
Closes https://github.com/facebook/react-native/pull/1232
Github Author: James Ide <ide@jameside.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
@public
This is a refactor of @philikon's original diff that decouples the dependencies between the Network and Image modules, and replaces RCTDataQueryExecutor with a more useful abstraction.
I've introduced the RCTURLRequestHandler protocol, which is a new type of bridge module used for loading data using an NSURLRequest. RCTURLRequestHandlers can be registered using RCT_EXPORT_MODULE() and are then available at runtime for use by the RCTDataManager, which will automatically select the appropriate handler for a given request based on the handler's self-reported capabilities.
The currently implemented handlers are:
- RCTHTTPRequestHandler - the standard open source HTTP request handler that uses NSURLSession
- RKHTTPRequestHandler - the internal FB HTTP request handler that uses FBNetworking
- RCTImageRequestHandler - a handler for loading local images from the iOS asset-library
Depends on D2108193
Test Plan:
- Internal apps still work
- OSS port still compiles, Movies app and a sample Parse app still work
- uploading image to Parse using the above code snippet works
- tested `FormData` with string and image parameters using http://www.posttestserver.com/
Summary:
The logic for this is incorrect when the `state.transitionToIndex === 0`, and will return false and not capture the touch.
@public
Test Plan: Try to repro bugs on device and simulator
Summary:
@public
Previously, our XMLHttpRequest implementation would only update the readyState when the download was fully completed. This diff adds support for receiving incremental data updates as the download happens, which can be monitored by adding the onreadystatechange event handler.
As a performance optimization, incremental data updates are only sent if the onreadystatechanged handler has been set in the JS, otherwise it just sends the whole data block once download is complete, as before.
Test Plan:
* Run the UIExplorer XMLHttpRequest example (in both OSS and Catalyst) to see incremental downloads working.
* Run the Movies app to see regular (non-incremental) downloads in action
* Run any network-based app in Catalyst shell to verify RKDataManager still works
Summary:
This allows you to select the displayed owner hierarchy, and see the styles,
props, and position.
@public
Test Plan:
Open the inspector, select something in the middle of the page. Click the
breadcrumb train in the inspector, and verify that:
- styles are reflected
- margin/padding/box is correct
- the highlight updates to show the selected item
See video as well.
[Video](https://www.latest.facebook.com/pxlcld/mqnl)
Screenshot
{F22518618}
Summary:
@public
PickerIOS doesn't look at the content of its list. It just keeps a list ref
and pushes new items in. Sadly this doesn't work with the naive reference checker
so new item lists don't trigger a native rerender.
The solution here is to ask PickerIOS to just pass its props down to native directly
Test Plan:
Implemented a simple Picker hooked up to a store getting new items.
Watched the list not update and then update after this diff as new items come in
Summary:
In order to add Push support to the Parse JS SDK in React Native, we need a way to receive the APNS device token from the JS context. This adds another event to PushNotificationIOS, so that code can respond to a successful registration.
Additionally, I've updated the `requestPermissions` call to accept an optional map of parameters. This way, developers can request a subset of user notification types.
Closes https://github.com/facebook/react-native/pull/1304
Github Author: Andrew Imm <andrewi@fb.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
- make overlay transparent to avoid obscuring the app
- show style in the inspector pane
- show margin+padding values, also width/height and abs position
@public
Test Plan:
Open the inspector somewhere, start selecting things. You should see correct
padding, margin, and dimentions values; in addition to all style properties
enumerated.
Summary:
@public
This PR adds quite a bit of functionality to the Touchable components, allowing the ms delays of each of the handlers (`onPressIn, onPressOut, onPress, onLongPress`) to be configured.
It adds the following props to `TouchableWithoutFeedback, TouchableOpacity, and TouchableHighlight`:
```javascript
/**
* Delay in ms, from the release of the touch, before onPress is called.
*/
delayOnPress: React.PropTypes.number,
/**
* Delay in ms, from the start of the touch, before onPressIn is called.
*/
delayOnPressIn: React.PropTypes.number,
/**
* Delay in ms, from the release of the touch, before onPressOut is called.
*/
delayOnPressOut: React.PropTypes.number,
/**
* Delay in ms, from onPressIn, before onLongPress is called.
*/
delayOnLongPress: React.PropTypes.number,
```
`TouchableHighlight` also gets an additional set of props:
```javascript
/**
* Delay in ms, from the start of the touch, before the highlight is shown.
*/
delayHighlightShow: React.PropTypes.number,
/**
* Del
...
```
Closes https://github.com/facebook/react-native/pull/1255
Github Author: jmstout <git@jmstout.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
This shows margin and padding visually when inspecting an element.
@public
Test Plan:
Go to the "UIExplorer", to the <View> page. Open the inspector, and start
selecting things. Padding and margin should be indicated. (Padding in dark
blue and margin in orange).
Summary:
@public
ErrorUtils.reportError is intended for reporting handled errors to the
server, like timeouts, which means that we shouldn't shove them in the
developer's face.
Test Plan: add `require('ErrorUtils').reportError(new Error('error'))` and see a useful error message with stack but no redbox. Debugger confirms `reportSoftException` is called but it doesn't do anything yet. `reportFatalError` and throwing exceptions still show redboxes.
Summary:
@public
Right now the profiler shows how long the executor took on JS but doesn't show
how long each of the batched calls took, this adds a *very* high level view of JS
execution (still doesn't show properly calls dispatched with setImmediate)
Also added a global property on JS to avoid trips to Native when profiling is
disabled.
Test Plan:
Run the Profiler on any app
{F22491690}
Summary:
Previously, if you were already inspecting an element, touching again would
select a completely different element because the touch position was
calculated relative to the current overlay.
This fixes it.
@public
Test Plan:
Open the inspector, click around, verify that every click selects the thing
you clicked on.
Summary:
Wraps the setImmediate handlers in a `batchUpdates` call before they are synchronously executed at the end of the JS execution loop.
Closes https://github.com/facebook/react-native/pull/1242
Github Author: James Ide <ide@jameside.com>
Test Plan:
Added two `setImmediate` calls to `componentDidMount` in UIExplorerApp. Each handler calls `setState`, and `componentWillUpdate` logs its state. With this diff, we can see the state updates are successfully batched.
```javascript
componentDidMount() {
setImmediate(() => {
console.log('immediate 1');
this.setState({a: 1});
});
setImmediate(() => {
console.log('immediate 2');
this.setState({a: 2});
});
},
componentWillUpdate(nextProps, nextState) {
console.log('componentWillUpdate with next state.a =', nextState.a);
},
```
**Before:**
"immediate 1"
"componentWillUpdate with next state.a =", 1
"immediate 2"
"componentWillUpdate with next state.a =", 2
**After:**
"immediate 1"
"immediate 2"
"componentWillUpdate with next state.a =", 2
Addresses the batching issue in #1232. cc @vjeux @spicyj
Summary:
This adds a parameter for fetching videos from the camera roll. It also changes the default to fetch both videos and photos.
Closes https://github.com/facebook/react-native/pull/774
Github Author: Joshua Sierles <joshua@diluvia.net>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
Adds support for JS async methods and helps guide people writing native modules w.r.t. the callbacks. With this diff, on the native side you write:
```objc
RCT_EXPORT_METHOD(getValueAsync:(NSString *)key
resolver:(RCTPromiseResolver)resolve
rejecter:(RCTPromiseRejecter)reject)
{
NSError *error = nil;
id value = [_nativeDataStore valueForKey:key error:&error];
// "resolve" and "reject" are automatically defined blocks that take
// any object (nil is OK) and an NSError, respectively
if (!error) {
resolve(value);
} else {
reject(error);
}
}
```
On the JS side, you can write:
```js
var {DemoDataStore} = require('react-native').NativeModules;
DemoDataStore.getValueAsync('sample-key').then((value) => {
console.log('Got:', value);
}, (error) => {
console.error(error);
// "error" is an Error object whose message is the NSError's description.
// The NSError's code and domain are also set, and the native trace i
Closes https://github.com/facebook/react-native/pull/1232
Github Author: James Ide <ide@jameside.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
@public
For some reason we were manually JSON-encoding the RCTDataManager responses, and then decoding them again on the JS side. Since all data sent over the bridge is JSON-encoded anyway, this is pretty pointless.
Test Plan:
* Test Movies app in OSS, which uses RCTDataManager
* Test any code that uses RKHTTPQueryGenericExecutor to make network requests (e.g. Groups)
* Test the Groups photo upload feature, which uses RKHTTPQueryWithImageUploadExecutor
Summary:
So when I first started porting JS files over from LearnGitBranching into a react native project, I some had require errors (for whatever reason) and I hit this error message a decent amount. I eventually understood it had nothing to do with failing to register the component (which btw sounds like some sign-up process, not actually an internal concept) but I figured we could expand on this message and describe why it might be happening.
I'm not 100% sure on what the second half should be, but open to feedback on this
Closes https://github.com/facebook/react-native/pull/826
Github Author: Peter Cottle <pcottle@fb.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
Without this, the displayName property wasn't found when looking at
`.constructor` on a component instance. Fixesfacebook/react-devtools#92.
Closes https://github.com/facebook/react-native/pull/1471
Github Author: Ben Alpert <balpert@fb.com>
Test Plan:
Used devtools on MoviesApp and saw RCTView instead of Unknown:
{F22491590}
Summary:
@public
This fixes an issue with the containerBackgroundColor property of `<Text>` nodes, where containerBackgroundColor was being overridden by the backgroundColor. I also fixed up the example so that it demonstrates the feature more clearly.
Test Plan:
* Check UIExplorer text example
* Run Catalyst snapshot tests and check MAdMan, Groups
Summary:
Just trying to [getCurrentPosition](https://github.com/facebook/react-native/blob/master/Libraries/Geolocation/Geolocation.js#L45) , and found the `errorBlock` of location request in timeout handler would cause red error like this:
```
2015-05-10 17:50:39.607 [warn][tid:com.facebook.React.JavaScript] "Warning: Cannot find callback with CBID 5. Native module may have invoked both the success callback and the error callback."
2015-05-10 17:50:39.610 [error][tid:com.facebook.React.JavaScript] "Error: null is not an object (evaluating 'cb.apply')
stack:
_invokeCallback index.ios.bundle:7593
<unknown> index.ios.bundle:7656
<unknown> index.ios.bundle:7648
perform index.ios.bundle:6157
batchedUpdates index.ios.bundle:13786
batchedUpdates index.ios.bundle:4689
<unknown> index.ios.bundle:7647
applyWithGuard index.ios.bundle:882
guardReturn index.ios.bundle:7421
processBatch index.ios.bundle:7646
URL: http://192.168.100.182:8081/index
Closes https://github.com/facebook/react-native/pull/1226
Github Author: henter <henter@henter.me>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
This adds new development feature to React Native that provides information
about selected element (see the demo in Test Plan).
This is how it works:
App's root component is rendered to a container that also has a hidden layer called
`<InspectorOverlay/>`. When activated, it shows full screen view and captures all
touches. On every touch we ask UIManager to find a view for given {x,y} coordinates.
Then, we use React's internals to find corresponding React component. `setRootInstance`
is used to remember the top level component to start search from, lmk if you have a
better idea how to do this. Given a component, we can climb up its owners tree
to provice more context on how/where the component is used.
In future we could use the `hierarchy` array to inspect and print their props/state.
Known bugs and limitations:
* InspectorOverlay sometimes receives touches with incorrect coordinates (wtf)
* Not integrated with React Chrome Devtools (maybe in followup diffs)
* Doesn't work with popovers (maybe put the element inspector into an `<Overlay/>`?)
@public
Test Plan:
https://www.facebook.com/pxlcld/mn5k
Works nicely with scrollviews
Summary:
With this in place, it's possible to upload a picture from the `CameraRoll` to Parse, for instance:
xhr = new XMLHttpRequest();
xhr.onload = function() {
data = JSON.parse(xhr.responseText);
var parseFile = new Parse.File(data.name);
parseFile._url = data.url;
callback(parseFile);
};
xhr.setRequestHeader('X-Parse-Application-Id', appID);
xhr.setRequestHeader('X-Parse-JavaScript-Key', appKey);
xhr.open('POST', 'https://api.parse.com/1/files/image.jpg');
// assetURI as provided e.g. by the CameraRoll API
xhr.send(new NativeFile(assetURI));
Closes https://github.com/facebook/react-native/pull/1357
Github Author: Philipp von Weitershausen <philikon@fb.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
HTTP headers are case-insensitive, so we should treat them that way when they're being set on `XMLHttpRequest`.
Closes https://github.com/facebook/react-native/pull/1381
Github Author: Philipp von Weitershausen <philikon@fb.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
@public
Our background color propagation mechanism is designed to make rendering of translucent content more efficient by pre-blending against an opaque background. Currently this only works for text however, because images are not composited into their background even if the background color is opaque.
This diff precomposites network images with their background color when the background is opaque, allowing them to take advantage of this performance optimization.
I've also added some logic to correctly crop the downloaded image when the resizeMode is "cover" or "contain" - previously it was only correct for "stretch".
Before:{F22437859}
After:{F22437862}
Test Plan: Run the UIExplorer "<ListView> - Paging" example with "color blended layers" enabled and observe that the images appear in green now, instead of red as they did before.
Summary:
Navigator overrides the `ref` prop of scene components so that it can call `onItemRef` and do internal bookkeeping. With callback refs, we can additionally call the original value of the `ref` prop as long as it's a function (that is, string refs are not supported). Note that the `ref` prop is moved to `reactElement.ref` out of `reactElement.props.ref`, which is why this diff accesses `child.ref`.
This diff adds support for callback refs and warns helpfully if a string ref was provided. It should be completely backwards compatible since scenes couldn't have been relying on the `ref` prop before.
cc @ericvicenti
Closes https://github.com/facebook/react-native/pull/1361
Github Author: James Ide <ide@jameside.com>
@public
Test Plan:
Write a renderScene implementation that puts a callback ref on the root component:
```js
renderScene() {
return <View ref={component => console.log('yes! this is called')} />;
}
```
Summary:
Fixes https://github.com/facebook/react-native/issues/1332
When the absolute left position is not set to zero on a provided sceneStyle, scene enabling is broken and no scene will be visible when it is pushed. This was broken recently when the scene disabling was modified to push the scenes offscreen.
Closes https://github.com/facebook/react-native/pull/1347
Github Author: Eric Vicenti <evv@fb.com>
@public
Test Plan: Tested when pushing a scene Navigator in the UIExplorer example while sceneStyle is set on the Navigator
Summary:
Fixes https://github.com/facebook/react-native/issues/1252
Scenes dismissed/popped via a gesture were not being removed. This is probably a regression from an earlier refactor.
Test plan: log statements after scene focusing now reports that `navigator.getCurrentRoutes().length` lowers after gesture. Tested on UIExplorer Navigator example
Closes https://github.com/facebook/react-native/pull/1346
Github Author: Eric Vicenti <evv@fb.com>
@public
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
Closes https://github.com/facebook/react-native/pull/1260
Github Author: Luke <kejinlu@gmail.com>
Test Plan: Created `class Foo extends React.Component` and made sure error messages were good.
Summary:
ActivityIndicator was forwarding all of its props except `style` to the inner native view. This meant that onLayout would report a zero-sized frame that was relative to the wrapper view instead of the parent of the ActivityIndicator.
This diff adds `onLayout` to the wrapper view instead of the native view.
In general, all components that forward props need to be audited in this manner.
Closes https://github.com/facebook/react-native/pull/1292
Github Author: James Ide <ide@jameside.com>
Test Plan: `<ActivityIndicator onLayout={...} />` reports the size of the spinner plus a position relative to its parent view.
Summary:
ListViewDataSource's default data extractor can actually expect another data form:
`{ sectionID_1: [ <rowData1>, <rowData2>, ... ], ... }`
Closes https://github.com/facebook/react-native/pull/1285
Github Author: Zhao Han <cx.chenghai+github@gmail.com>
Test Plan: Changed the ListViewExample to make sure all three formats work.
Summary:
`TextInput` does not automatically forward all props using the spread operator so we need to explicitly forward the `onLayout` prop.
Closes https://github.com/facebook/react-native/pull/1296
Github Author: James Ide <ide@jameside.com>
Test Plan:
Mount a TextInput component with an `onLayout` prop and see that the callback handler is invoked with the TextInput's frame.
Summary:
When I read documents, I usually 'search within page' to see where they talk about specific things.
So I found this fix to be pretty useful. Hope it'll be merged!
Closes https://github.com/facebook/react-native/pull/1146
Github Author: Yuta Okazaki <s04155yo@gmail.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
Some of the RCTTextView properties weren't set up correctly which would cause bugs when you'd set a property and then unset it, trying to revert to the default. This requires reading the default value from the dummy view instance, but some of these properties didn't have getters which was causing issues.
Fixes#1174
Closes https://github.com/facebook/react-native/pull/1175
Github Author: James Ide <ide@jameside.com>
Test Plan: Create a `<TextInput multiline={true}>` component. Give it a style with `color: 'blue'`, and then on the next render pass remove the style. No more red box.
Summary:
Pretty sure this shouldn't be @provides
Closes https://github.com/facebook/react-native/pull/837
Github Author: James Ide <ide@jameside.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
`mountSafeCallback` simply wraps a callback in an `isMounted()` check to prevent crashes when old callbacks are called on unmounted components.
@public
Test Plan:
Added logging and made sure callbacks were getting called through
`mountSafeCallback` and that things worked (e.g. photo viewer rotation etc).
Summary:
@public
document shimming must run before anything else. However, we don't currently guarantee that. This moves the document shimming into `document.js` which is used as a polyfill.
Test Plan:
* start server
* go to playground app
* require `NativeModules` as the first thing
* open chrome debugger
* no error
Summary:
SetState can be somewhat racy. By the time the route state finishes, another resetTo has already happened, so the origional route is no longer in the stack. Hence the redbox invariant "Calling pop to route for a route that doesn't exist!"
This could also be fixed in product code by not calling resetTo rapidly, but the navigator should be resilient to such shenanigans
@public
Test Plan: Cannot get AdsManager crash t7031976
Summary:
The index alone isn't so useful; pass the route as well. (I am using this to implement componentWill/DidFocus in a library instead of onWill/DidFocus; #1153).
Closes https://github.com/facebook/react-native/pull/1154
Github Author: James Ide <ide@jameside.com>
@public
Test Plan: Set up a navigator with a couple of scenes, and see that when onItemRef is called for each one, the route is passed in as the third argument.
Summary:
When gesturing rapidly between scenes, the navigator can get into an unresponsive state. A few minor fixes can avoid that case
@public
Test Plan: Rapid gestures on iOS device and simulator can no longer get into bad state
Summary:
In some situations, when quickly swiping back to a scene we are transitioning from, the scene is blank/missing. This is fixed by adding a check for the active gesture when we hide the scenes.
@public
Test Plan: Can no longer reproduce on simulator when quickly swiping back to the scene we are transitioning from
Summary:
Add `AlertIOS.prompt`
It's compatible with the js spec, with the exception that I had to add
a callback param since it's async. Also supports the same button configuration
as `AlertIOS.alert`.
@public
Test Plan:
I've updated the `AlertIOS` example on UIExplorer with every
valid combination of
parameters, so just going through it should be fine.
Summary:
Sometimes, when quicly backing out of a gesture, the scene isn't fully reset to the middle position and remains offset by a few pixels. This makes sure that never happens.
@public
Test Plan: Tested on iOS and I can no longer see the scenes stop when backing out of a gesture
Summary:
Previously it was possible for a gesture to be granted initiated if the start direction is not respected before the gesture detection distance gets reached, if the gesture direction is met eventually. This change ensures the gesture gets started in the right direction, otherwise the gesture action will set the responder.
@public
Test Plan: Fixes left-right swiping issue in AdsManager when a vertical swipe is intended.
Summary:
Now on fetch 0.8.1, the latest tagged release. Previous version used was 0.7.0. See #1162 cc @vjeux @jtremback
Closes https://github.com/facebook/react-native/pull/1192
Github Author: Brent Vatne <brent.vatne@madriska.com>
Test Plan: I arc patched and ran movies demo and storyline, they work fine
Summary:
Simply add an `onLayout` callback to a native view component, and the callback
will be invoked with the current layout information when the view is mounted and
whenever the layout changes.
The only limitation is that scroll position and other stuff the layout system
isn't aware of is not taken into account. This is because onLayout events
wouldn't be triggered for these changes and if they are desired they should be
tracked separately (e.g. with `onScroll`) and combined.
Also fixes some bugs with LayoutAnimation callbacks.
@public
Test Plan:
- Run new LayoutEventsExample in UIExplorer and see it work correctly.
- New integration test passes internally (IntegrationTest project seems busted).
- New jest test case passes.
{F22318433}
```
2015-05-06 15:45:05.848 [info][tid:com.facebook.React.JavaScript] "Running application "UIExplorerApp" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF"
2015-05-06 15:45:05.881 [info][tid:com.facebook.React.JavaScript] "received text layout event
", {"target":27,"layout":{"y":123,"x":12.5,"width":140.5,"height":18}}
2015-05-06 15:45:05.882 [info][tid:com.facebook.React.JavaScript] "received image layout event
", {"target":23,"layout":{"y":12.5,"x":122,"width":50,"height":50}}
2015-05-06 15:45:05.883 [info][tid:com.facebook.React.JavaScript] "received view layout event
", {"target":22,"layout":{"y":70.5,"x":20,"width":294,"height":204}}
2015-05-06 15:45:05.897 [info][tid:com.facebook.React.JavaScript] "received text layout event
", {"target":27,"layout":{"y":206.5,"x":12.5,"width":140.5,"height":18}}
2015-05-06 15:45:05.897 [info][tid:com.facebook.React.JavaScript] "received view layout event
", {"target":22,"layout":{"y":70.5,"x":20,"width":294,"height":287.5}}
2015-05-06 15:45:09.847 [info][tid:com.facebook.React.JavaScript] "layout animation done."
2015-05-06 15:45:09.847 [info][tid:com.facebook.React.JavaScript] "received image layout event
", {"target":23,"layout":{"y":12.5,"x":82,"width":50,"height":50}}
2015-05-06 15:45:09.848 [info][tid:com.facebook.React.JavaScript] "received view layout event
", {"target":22,"layout":{"y":110.5,"x":60,"width":214,"height":287.5}}
2015-05-06 15:45:09.862 [info][tid:com.facebook.React.JavaScript] "received text layout event
", {"target":27,"layout":{"y":206.5,"x":12.5,"width":120,"height":68}}
2015-05-06 15:45:09.863 [info][tid:com.facebook.React.JavaScript] "received image layout event
", {"target":23,"layout":{"y":12.5,"x":55,"width":50,"height":50}}
2015-05-06 15:45:09.863 [info][tid:com.facebook.React.JavaScript] "received view layout event
", {"target":22,"layout":{"y":128,"x":60,"width":160,"height":337.5}}
```
Summary:
NavigatorIOS supports four new properties:
- **rightButtonImageSource:** The source of an image to display in the top right. This must be a static image since UINavigationController only supports UIImages. Adding support for UIImageViews (or arbitrary views) is more complicated because custom views do not fade on touch and do not have hit slop the same way that UIImage buttons do. Usage: `rightButtonImageSource: ix('ImageName')`
- **backButtonImageSource:** Use a custom image for the back button. This does not replace the back caret (`<`) but instead replaces the text next to it.
- **leftButtonTitle**: Text for the left nav button, which supersedes the previous nav item's back button when specified. The main use case for this is your initial screen/UIVC which has nothing to go back to (since it is the first VC on the stack) but need to display a left button. This does hide the back button if there would have been one otherwise.
- **leftButtonImageSource:** Image source for the left button, super
Closes https://github.com/facebook/react-native/pull/263
Github Author: James Ide <ide@jameside.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
Simple one character change - add a missing space
Closes https://github.com/facebook/react-native/pull/1112
Github Author: Brent Vatne <brent.vatne@madriska.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
As per #941 - fixes bug with `TouchabeOpacity` always reseting child opacity to `1.0` after press.
A note about the code: we could probably use a general `getNativeProp(propName, callback)` function rather than `getOpacity` but just used that as it was simpler for this specific PR, perhaps that refactor could be left to another - or maybe there is a way to do this already that I missed.
Before:
![bug](https://cloud.githubusercontent.com/assets/90494/7287207/52d6a686-e907-11e4-8e16-04b2ddd0582c.gif)
After:
![after](https://cloud.githubusercontent.com/assets/90494/7287689/5aca4776-e90c-11e4-8c40-aa6bd3e822d8.gif)
Example code:
```javascript
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
TouchableOpacity,
} = React;
var TestIt = React.createClass({
render() {
return (
<View style={styles.container}>
<TouchableOpacity activeOpacity={0.3}>
<View style={styles.searchButton}>
<Text>
Closes https://github.com/facebook/react-native/pull/977
Github Author: Brent Vatne <brent.vatne@madriska.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
The default initialRoute was the first route, but it makes more sense for the default initialRoute to be the last route in the initialRouteStack.
Updated the docs to reflect that.
@public
Test Plan: Updated call sites and checked that they work. Not many places use initialRouteStack yet.
Summary:
jumpN will call enableScene for the dest scene, which makes sure the scene can be made visible, but we need to avoid resetting the opacity for it when it is already the presented scene. There is already a check to make sure we don't reset opacity for the transitioningFrom scene.
@public
Test Plan: Fixes the issue on Android device when jumping to a scene that is already presented
Summary:
`XMLHttpRequest.getResponseHeader` is case-insensitive, therefor the React-Native implementation needs to mimic this behavior as to not break libraries that are dependent on this.
There is a corresponding issue in `superagent` but this is the root cause (https://github.com/visionmedia/superagent/issues/636).
Closes https://github.com/facebook/react-native/pull/1138
Github Author: Ryan Pastorelle <rpastorelle@yahoo.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
Should resolve#1081
cc @ericvicenti
Closes https://github.com/facebook/react-native/pull/1082
Github Author: jmstout <git@jmstout.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Revert Plan: This seems legit, but I'm not qualified to review.
Summary:
A hack was implemented in Navigator to do this manually, but there is a proper function to get these styles for setting native props
@public
Test Plan: Testing Navigator behavior on iOS and Android
Summary:
Scenes with 0 opacity are being rendered on top of other scenes with full absolute positioning. On iOS this is fine, because the platform will not send touch events to a view with no opacity. On Android is poses a problem because the view on top, even with no opacity, is catching the touch events for the presented scene below.
This change enhances the scene enabling and hiding logic, has better naming, and improves the documentation of it.
@public
Test Plan: Tested transitions and gestures in slow motion on iOS and Android
Summary:
@public
{D1953613} added an optimization that allowed for shadow nodes that are not
backed by views, but didn't actually work robustly in the remove case because
the indices can get out of sync. That diff also started returning nil for raw
text nodes, which triggered this bug and broke "see more" functionality in the
`FBTextWithEntities` and `ExpandingText` components, leading to crashes in the
Groups app.
This diff fixes the issue by simply returning `UIView` placeholders again.
Slight perf/ memory cost but no more crashes and there should be no other
adverse affects.
We'll need to think up something more clever in order to properly support `nil`
views in the future, probably something that uses the shadow hierarchy to build
the View hierarchy, rather than mirroring identical commands to both - see
#1102.
Test Plan:
- TextUpdateTest fails without native changes, now passes with them.
- ExpandingText example no longer crashes.
- See More in Groups app no longer crashes.
Summary:
The `getAllKeys` callback type was completely missing the return value, and all of the callbacks are optional. This just fixes the types to match what the implementations are doing.
Closes https://github.com/facebook/react-native/pull/1079
Github Author: Emily Eisenberg <xymostech@gmail.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
Now you can pass a route to the pop function in the navigator context, and the Navigator will pop that scene off the stack and every scene that follows.
This changes the request API that bubbles up to the top-level navigator. The `pop` request had previously taken a route for `popToRoute`, but that is a more obscure use case. This makes the request API more closely match the context method naming.
@public
Test Plan: Verified this works by popping several routes in AdsManager. Experimented with UIExplorer Navigator example to make sure popToRoute still works as expected
Summary:
@public
The most common problem I've noticed is that the debugger is paused, so we
shouldn't ask the user if Chrome is open, because it usually is.
Test Plan: Try to reload with debugger paused, see new error message.
Summary:
When tapping a link quickly, it will cause two scenes to be pushed on. This prevents against that case by swallowing touches for all non-active scenes.
@public
Test Plan: Can no longer double-push scenes
Summary:
Requiring ExceptionsManager in renderApplication (added in D2023119) led to a transitive require of ExecutionEnvironment, which has to run after InitializeJavaScriptAppEngine.
InitializeJavaScriptAppEngine is the right place for this sort of logic because we control the order that things are loaded, so move the console.error hook initialization there.
@public
Test Plan: Loaded shell app in simulator with Chrome debugging with no errors.
Summary:
Fixes#534:
![screen shot 2015-03-31 at 7 52 10 pm](https://cloud.githubusercontent.com/assets/153704/6934038/742ddd34-d7e3-11e4-8f55-3eb7d9d3f1cd.png)
```jsx
<SegmentedControlIOS
tintColor="#ff0000"
values={['One', 'Two', 'Three', 'Four']}
selectedtIndex={0}
momentary={false}
enabled={true}
onValueChange={ (value) => console.log(value) } />
```
This only supports string-based segments, not images. Also doesn't support full customization (no separator images etc); I figure this is a good MVP to lock-down a basic API
I also included a snapshot test case, but the images keep coming out funky. When I look at the sim, I see that the text labels show up for the selected segment, but the snapshot keeps coming out with no text on those segments. I tried forcing a delay, but same result. Is that explainable?
Obviously happy to change anything about the API, code-style nitpicks, etc
Closes https://github.com/facebook/react-native/pull/564
Github Author: Clay Allsopp <clay.allsopp@gmail.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
@nicklockwood - Could I get a review of this?
Just took `RCTTextField` and ported it from `UITextField` to `UITextView` as you mentioned in another discussion, and removed any `UITextField` specific attributes.
- How do you think this should behave when there are subviews?
- Do you know how we can respond to the `UIControlEventEditingDidEndOnExit` event to respond to submit? Because `UITextView` isn't a `UIControl` we can't just use `addTarget` with `UIControlEventEditingDidEndOnExit`.
- Any other feedback?
Still going to look over the `UITextView` docs in more detail and make sure we expose all important options, and add it to the UIExplorer example, just putting this out here for feedback.
![multiline](https://cloud.githubusercontent.com/assets/90494/7310854/32174d6a-e9e8-11e4-919e-71e54cf3c739.gif)
Closes https://github.com/facebook/react-native/pull/991
Github Author: Brent Vatne <brent.vatne@madriska.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
It is very rare, but sometimes there is no active gesture when the responder gets released. This will avoid a redbox in that case
@public
Test Plan: Saw the redbox. No longer see the redbox. Hardcoded missing activeGesture while responder and verified no redbox
Summary:
Fixes#979.
Previously, a Text whose width is determined automatically (as opposed to set by a container) would position the text incorrectly after an update to the text *if* the text's width did not change (i.e., when changing only digits in a font with tabular numbers).
Every time RCTShadowText's RCTMeasure runs, it sets the text container's size to be the maximum allowed size for the text. When RCTText's drawRect is called later, it relied on layoutSubviews having been called to set the text container's size back to the proper width. But if RCTMeasure returned the same dimensions as last time, then RCTText's frame wasn't reset and so layoutSubviews was never re-called. With this change, we set the textContainer's size each time we draw the text.
We could also fix this by using a different NSTextContainer instance in RCTMeasure. Not sure what the pros and cons of that are.
Closes https://github.com/facebook/react-native/pull/989
Github Author: Ben Alpert <balpert@fb.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
NavigatorIOS with custom nav bar custom colors, working example included in
UIExplorer.
Based on pull request #318 to complete pending work based on comments.
Closes https://github.com/facebook/react-native/pull/695
Github Author: Eduardo <edo.lomeli@gmail.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
Simple linear easing also very useful.
Closes https://github.com/facebook/react-native/pull/794
Github Author: Ivan Starkov <istarkov@gmail.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
There are still many other props that can be added to further customize the SliderIOS component, but I had a specific need for these two so I just went ahead and added them.
Closes https://github.com/facebook/react-native/pull/799
Github Author: Brent Vatne <brent.vatne@madriska.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
Also fix RCTShadowText export name.
Closes https://github.com/facebook/react-native/pull/857
Github Author: "Dr. Kibitz" <info@drkibitz.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.