Summary: public
Added RCTDataRequestHandler, which is responsible for loading data URLs. This moves the logic for data URL handling out of RCTImageDownloader (no longer needed) and into the RCTNetwork library, where it makes more sense.
This also means that it is now possible to load data URLs via XHR, and use them for purposes other than just images.
Reviewed By: javache
Differential Revision: D2540964
fb-gh-sync-id: 4f0418bd6b9186f047cc8297276bb970795af104
Summary: @public
We previously discovered that using an NSURLSessionDataTask to load local files is noticably less efficient than using regular filesystem methods.
This diff adds RCTFileRequestHandler as a replacement for RCTHTTPRequestHandler when loading local files. This reduces loading time when loading local files via XMLHttpRequest, as well as improving the performance for some image load requests.
Reviewed By: @javache
Differential Revision: D2531710
fb-gh-sync-id: 259714baac131784de494d24939f42ad52bff41a
Summary:
This diff implements highlighting of tapped text subranges for the iOS `<Text>` component, styled to match how iOS webkit views highlight links (translucent grey overlay with rounded corners).
Highlighting is enabled by default for any `<Text>` component which has an onPress handler. To disable the highlight, add `suppressHighlighting={true}` to the component props.
Summary:
@public
I've increased the warning levels in the OSS frameworks, which caught a bunch of minor issues. I also fixed some new errors in Xcode 7 relating to designated initializers and TLS security.
Test Plan:
* Test the sample apps and make sure they still work.
* Run tests.
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:
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.