Commit Graph

4880 Commits

Author SHA1 Message Date
Kyle Corbitt 78c6e416ae Merge pull request #5300 from NZAOM/master
add nzaom app to showcase
2016-01-15 11:06:49 +00:00
scott 538307d179 add nzaom app
change the key to `link `

format code stuff

format code stuff
2016-01-15 15:34:48 +08:00
Martín Bigio bba35f0415 Make Hot Loading work on OSS
Summary:
public

- Tweak OSS server to enable the HMR connection
- Remove client gating code.
- Resolve internal transforms plugins

After this diff, Hot Loading should work on OSS.

Reviewed By: javache

Differential Revision: D2803620

fb-gh-sync-id: b678180c884d2bfaf454edf9e7abe6b3b3b32ebe
2016-01-14 19:33:42 -08:00
Martín Bigio 0185df57bd Tweak Hot Loading gating code
Reviewed By: mmahoney

Differential Revision: D2815537

fb-gh-sync-id: d0a4d5c2a831c52cf3be6051a348ae9ba996f545
2016-01-14 19:33:34 -08:00
Philipp von Weitershausen 66158ab2bf Make the RCTSRWebSocketDelegate protocol part of RCTWebSocketModule public
Summary:
This allows consumers to subclass and extend `RCTWebSocketModule` and make use of the `RCTSRWebSocketDelegate` methods.

The use case here is to do some pre-processing of WebSocket data before handing it off to JS. Consumers could that in the following way:

```

interface MyWebSocketModule : RCTWebSocketModule
end

implementation MyWebSocketModule

// Don't use RCT_EXPORT_MODULE macro for this so we replace the existing RCTWebSocketModule.
+ (NSString *)moduleName { return @"RCTWebSocketModule"; }

RCT_EXTERN_METHOD(connect:(NSURL *)URL socketID:(nonnull NSNumber *)socketID)
RCT_EXTERN_METHOD(send:(NSString *)message socketID:(nonnull NSNumber *)socketID)
RCT_EXTERN_METHOD(close:(nonnull NSNumber *)socketID)

- (void)webSocket:(RCTSRWebSocket *)webSocket didReceiveMessage:(id)message
{
  [super webSocket:webSocket didReceiveMessage:[DoSomethingWith message]];
}

end
```

... and then returning a `MyWebSocketModule` ins
Closes https://github.com/facebook/react-native/pull/5321

Reviewed By: svcscm

Differential Revision: D2832374

Pulled By: nicklockwood

fb-gh-sync-id: f208516b2b2f76276223ffc972871d96afe87e27
2016-01-14 16:13:33 -08:00
Nick Lockwood e4c53c28ae Improved shadow performance
Summary:
public
React Native currently exposes the iOS layer shadow properties more-or-less directly, however there are a number of problems with this:

1) Performance when using these properties is poor by default. That's because iOS calculates the shadow by getting the exact pixel mask of the view, including any tranlucent content, and all of its subviews, which is very CPU and GPU-intensive.
2) The iOS shadow properties do not match the syntax or semantics of the CSS box-shadow standard, and are unlikely to be possible to implement on Android.
3) We don't expose the `layer.shadowPath` property, which is crucial to getting good performance out of layer shadows.

This diff solves problem number 1) by implementing a default `shadowPath` that matches the view border for views with an opaque background. This improves the performance of shadows by optimizing for the common usage case. I've also reinstated background color propagation for views which have shadow props - this should help ensure that this best-case scenario occurs more often.

For views with an explicit transparent background, the shadow will continue to work as it did before ( `shadowPath` will be left unset, and the shadow will be derived exactly from the pixels of the view and its subviews). This is the worst-case path for performance, however, so you should avoid it unless absolutely necessary. **Support for this may be disabled by default in future, or dropped altogether.**

For translucent images, it is suggested that you bake the shadow into the image itself, or use another mechanism to pre-generate the shadow. For text shadows, you should use the textShadow properties, which work cross-platform and have much better performance.

Problem number 2) will be solved in a future diff, possibly by renaming the iOS shadowXXX properties to boxShadowXXX, and changing the syntax and semantics to match the CSS standards.

Problem number 3) is now mostly moot, since we generate the shadowPath automatically. In future, we may provide an iOS-specific prop to set the path explicitly if there's a demand for more precise control of the shadow.

Reviewed By: weicool

Differential Revision: D2827581

fb-gh-sync-id: 853aa018e1d61d5f88304c6fc1b78f9d7e739804
2016-01-14 14:04:34 -08:00
Christoph Pojer 4074b7980e Cache all module data
Summary:
We used to only cache the `dependencies` and `name` of a Module but we were actually accessing two more fields (async dependencies and the `isHaste` field) which meant we were always reading every single file from disk. In D2644383 I noticed that but realized that the Promise was cached, meaning we would read every file once *per instance* and I didn't think about cross-instance reads over time. My initial version added more caching (but also missed the `isHaste` field) but then I got rid of the cache call for `dependencies`. So my change from before didn't make anything worse but it also didn't make anything better. This change now caches everything until the contents of the file actually changes.

public

Reviewed By: martinbigio

Differential Revision: D2831569

fb-gh-sync-id: 74081abc0ce3ca96b4e56c3c9b6d24aa84f7496c
2016-01-14 13:48:33 -08:00
Andrei Coman 25c3dd140f Add phone-pad keyboard
Summary:
With the numeric keyboard now being an actual numeric keyboard (before
it was actually phone-pad), we need a proper phone-pad keyboard as well.

public

Reviewed By: dmmiller

Differential Revision: D2830707

fb-gh-sync-id: 80a1d314eac730e691de73a31342c014a2fa5ba6
2016-01-14 11:42:34 -08:00
James Ide ebf42d9813 Merge pull request #5317 from jamesfzhang/patch-2
Add Jukebox app to showcase
2016-01-14 10:49:25 -08:00
James Zhang aeec3f3b81 Add Jukebox app to showcase 2016-01-14 10:47:50 -08:00
Martín Bigio 469bb7fbfd Improve error wording when fail to launch debugger
Reviewed By: javache

Differential Revision: D2829484

fb-gh-sync-id: a3402ece1f5cd19e8408fa3ab89adf7a26c66de9
2016-01-14 10:02:34 -08:00
Nick Lockwood e5381072dd Fixed transparent border around UIExplorer headers
Summary:
public

This was caused by the change to background color propagation, but was actually due to having an unnecessary wrapper view around the headers, which was itself a workaround for a padding bug that was fixed some time ago :-)

Reviewed By: tadeuzagallo

Differential Revision: D2830890

fb-gh-sync-id: b64e701dedb90b357ed7c463b745de021f38637b
2016-01-14 09:56:35 -08:00
Nick Lockwood ff6a2c3998 Deprecated `scrollResponderScrollWithoutAnimationTo`
Summary:
public

This diff deprecates `scrollResponderScrollWithoutAnimationTo` and replaces it with an optional `animated` param in `scrollResponderScrollTo`. This is more consistent with our other APIs.

Using the old `ScrollResponder.scrollResponderScrollWithoutAnimationTo` or  `ScrollView.scrollWithoutAnimationTo` functions will still work, but will trigger a warning.

Reviewed By: javache

Differential Revision: D2823479

fb-gh-sync-id: 259966512104ca7b3995c9586144812a91b8d3e9
2016-01-14 07:42:34 -08:00
Chirag 90d2787aef Merge pull request #5301 from sunnylqm/patch-10
Update React Native dependency version
2016-01-14 09:37:15 -05:00
Konstantin Raev 892497408c Open sourced Camera Roll module
Reviewed By: mkonicek

Differential Revision: D2827804

fb-gh-sync-id: c1f06f148855bc4f69da8e19b8445988f1b022b3
2016-01-14 04:33:11 -08:00
Dave Miller f8c384ffdd Consolidate event dispatch to one method that gets the context and event dispatcher
Reviewed By: andreicoman11

Differential Revision: D2827596

fb-gh-sync-id: 3971237aa5eb08934a341e1486c7130381252c99
2016-01-14 04:30:36 -08:00
Dave Miller 393adacfa6 Fix WebView not to double load the URL
Reviewed By: andreicoman11

Differential Revision: D2823397

fb-gh-sync-id: deb04ab22bee7022bc8bcb61fa4c24f86eddbaa8
2016-01-14 04:28:32 -08:00
sunnylqm 5835d26a75 update onResume arguments 2016-01-14 20:01:40 +08:00
sunnylqm f903625df1 Update React Native dependency version 2016-01-14 16:53:56 +08:00
Gaëtan Renaudeau 1abd12b68b configureScene: add routeStack in second argument
Summary:
Giving routeStack in second parameter of configureScene allows to do more advanced scene configuration.
I have use-case where I can only determine the scene config from the navigation context (not only from the route object but also from where it's located).
Closes https://github.com/facebook/react-native/pull/5254

Reviewed By: svcscm

Differential Revision: D2828415

Pulled By: androidtrunkagent

fb-gh-sync-id: 27b6c79b24cbc194e080541e9202ca84c55a0bc4
2016-01-13 13:27:31 -08:00
Adam Miskiewicz 00659864bc Fixing CLI to pass "sourcemap-output" option to bundler.
Summary:
Currently, the CLI is not passing the sourceMapURL option to the bundler, so source maps are output as "null".
Closes https://github.com/facebook/react-native/pull/5288

Reviewed By: svcscm

Differential Revision: D2828092

Pulled By: androidtrunkagent

fb-gh-sync-id: 2e464ddf65f0d4fcbff3c50281391cb30b5c799c
2016-01-13 12:53:35 -08:00
Adam Miskiewicz f25b1a9a1a Merge pull request #5291 from olegbl/patch-1
Add details about undoing require() image sizing
2016-01-13 15:07:54 -05:00
Oleg Lokhvitsky edf30065ea Add details about undoing require() image sizing
It can be overridden with undefined to scale dynamically
2016-01-13 11:46:26 -08:00
Janic Duplessis f5062d0840 Add doc for RefreshControl on the website
Summary:
Exposes the doc for RefreshControl and add a link to the component page in ScrollView.
Closes https://github.com/facebook/react-native/pull/5209

Reviewed By: svcscm

Differential Revision: D2818217

Pulled By: mkonicek

fb-gh-sync-id: eb1ae70103e6a02af3a12866509f68eacc413dfd
2016-01-13 11:34:31 -08:00
Brent Vatne f8f5cb1fcf Fix content offset calculations when scrolling up
Summary:
The offset is cached so it doesn't need to calculate the entire height on each scroll, but the cached value was being thrown away when you scroll up -- this fixes that. Found this because it was breaking an infinite scroll view that depended on the contentOffset.y value reported from onScroll.
Closes https://github.com/facebook/react-native/pull/5278

Reviewed By: svcscm

Differential Revision: D2827556

Pulled By: dmmiller

fb-gh-sync-id: 0897b89de427cada7389113991444f57c970f980
2016-01-13 07:31:55 -08:00
Chirag cac56a61fc Merge pull request #5276 from sunnylqm/patch-9
give a more detailed bundle example
2016-01-13 09:55:30 -05:00
James Ide 66cd8f71eb Set the versions in package.json and React.podspec to 0.0.0-master
Summary:
The current versions in these files is 0.12.0, which is out of date. Better to claim no version than the wrong version, so this diff changes the versions to 0.0.0-master.

Release branches will still have the correct versions.
Closes https://github.com/facebook/react-native/pull/5241

Reviewed By: svcscm

Differential Revision: D2819277

Pulled By: javache

fb-gh-sync-id: 99d4682e5d1f571e241f306caf309b2944483909
2016-01-13 06:15:01 -08:00
Martin Konicek c95cfe890e Remove extra newline in npm-shrinkwrap.json 2016-01-13 14:14:26 +00:00
Gaëtan Renaudeau 963f26cea8 add ScrollResponder#scrollResponderZoomTo animated second argument
Summary:
ScrollResponder was missing a non animated version for zoomToRect.

- scrollResponderScrollTo <> scrollResponderScrollWithoutAnimationTo
- ~~scrollResponderZoomTo <> 🆕 **scrollResponderZoomWithoutAnimationTo**~~
- `scrollResponderZoomTo(rect, animated = true)`
Closes https://github.com/facebook/react-native/pull/5268

Reviewed By: svcscm

Differential Revision: D2823311

Pulled By: nicklockwood

fb-gh-sync-id: ea409d332963f56e8b58ec2c086db3f6815058f7
2016-01-13 02:55:33 -08:00
sunnylqm 0359046af1 give a more detailed bundle example 2016-01-13 11:35:01 +08:00
Martín Bigio 51621b14cb Get rid of deprecated `fs.existSync`
Reviewed By: mmahoney

Differential Revision: D2824569

fb-gh-sync-id: efed6e88f566110b8286ea59563c2904b3dd8059
2016-01-12 16:45:33 -08:00
Christoph Pojer 801b83da2d Support "free" mocks.
Summary:
It's possible that a mock doesn't have an associated real module that it maps to. This is actually very common in www, where we have JS mocks for dynamic PHP JS modules. The implementation I chose seems like the smartest one for now: if a module cannot be resolved, we look up whether we have a mock with the same id. If we do, we just resolve it. That's it! And it also only does the minimum amount of resolution necessary.

public

Reviewed By: martinbigio

Differential Revision: D2822277

fb-gh-sync-id: 7c9fbb6f69a0c0c85157c0650f5719d94a02410e
2016-01-12 15:33:32 -08:00
Alexander Blom e2641a237a Scan parent class' methods for @ReactProp and @ReactPropGroup annotations
Summary:
When class A declares a ReactProp method foo() and class B that extends from A overrides foo(), it loses the annotation so it has to be duplicated. To allow "inheriting" annotation on Override, we need to scan parent class methods for annotation as well. This diff implements the required logic.

public

Reviewed By: dkoroskin

Differential Revision: D2818278

fb-gh-sync-id: 7e9ae728cc70ce2345db7bc48b3857a0e91c4ca3
2016-01-12 13:41:38 -08:00
Brent Vatne 2ed199fa2b Update KnownIssues.md 2016-01-12 12:02:48 -08:00
Denis Koroskin 44cd2e0e73 In ReactPropertyProcessor, use switch over key String instead of HashMap<String,Integer> lookup followed by a switch over int.
Summary: public Switch over a String is essentially a switch(string.hashCode()) and it is faster than a HashMap lookup. It also doesn't use extra memory, and doesn't require static initialization (startup penalty). Plus I believe this way the generated code looks more readable.

Reviewed By: lexs

Differential Revision: D2818223

fb-gh-sync-id: d9100ec0f8ad556c347681cbe1433d066076d3e5
2016-01-12 11:52:38 -08:00
Kelvin De Moya 888749220d Enable JSX files extension
Summary:
JSX extension is much used in React, this would be a natural addition for React Native.
See: https://github.com/facebook/react-native/issues/2303
Closes https://github.com/facebook/react-native/pull/5233

Reviewed By: svcscm

Differential Revision: D2818888

Pulled By: mkonicek

fb-gh-sync-id: 856d1b8ba9ff88ba08a00923174e3284f359d774
2016-01-12 08:25:36 -08:00
trave7er 48cb144c2d fix lint warnings: single/double quotes, and semi-colons
Summary:
fixed lint warnings for TextInputExample.ios.js file
Closes https://github.com/facebook/react-native/pull/5216

Reviewed By: svcscm

Differential Revision: D2818390

Pulled By: mkonicek

fb-gh-sync-id: 8ada7038a1ca73f8c158945264cf6dbfe1c23fcc
2016-01-12 08:18:32 -08:00
Andy Street bfcce36efb Update Android.mk files to fix github build
Summary:
public

Since we don't use BUCK in OSS, we also have to update the Android.mk files :(

Reviewed By: bestander

Differential Revision: D2823434

fb-gh-sync-id: 4feef307f8f158653ef8e76d72447d79f47c329a
2016-01-12 07:41:38 -08:00
Martin Konicek 9bbcb5baf7 Update bots/README.md 2016-01-12 15:11:24 +00:00
Andy Street e29eaaddc8 WebWorkers: Add simple integration test
Summary:
public

Adds a simple integration test that verifies that a message can be posted to/from the worker andthat it's torn down properly.

Reviewed By: lexs

Differential Revision: D2815244

fb-gh-sync-id: 00c0d8933d785b2913d378c0589b2fbabf0d0edb
2016-01-12 04:52:16 -08:00
Andy Street 0be36a2c80 WebWorkers: implement tear down and terminate()
Summary:
public
Previously we did no cleanup when the executor was torn down and didn't expose a way to tear down the worker from JS. Now we do.

Termination happens synchronously and waits the the worker's MessageQueueThread to finish and join.

Reviewed By: mhorowitz

Differential Revision: D2815240

fb-gh-sync-id: 786beb30d4d64556586b91727f32e379c667a965
2016-01-12 04:52:10 -08:00
Andy Street b0519c8280 Update WebWorkers API to return message object in onmessage
Summary:
public

I wasn't obeying the web workers API correctly: I had missed that the message isn't sent directly but is attached to a message object in a data field.

Reviewed By: lexs

Differential Revision: D2811247

fb-gh-sync-id: 8e51414766e0cfe382ee9bdde8f0d66e269cb83a
2016-01-12 04:52:01 -08:00
Andy Street 72d1826ae3 WebWorkers: Implement initial WebWorkers API
Summary:
public

Implements a basic WebWorkers API that allows posting messages between the main JS thread and a worker background thread. It follows the existing webworkers API from JS. Currently passed memory needs to be JSON serializable and is copied (unfortunately, this is what webkit does as well, but with a more advanced serialization/deserialization process).

There are a lot of TODO's: I'll add tasks for them once this is accepted.

Reviewed By: lexs

Differential Revision: D2779349

fb-gh-sync-id: 8ed04c115d36acf0264ef1f6a12a65dd0c14ff18
2016-01-12 04:51:53 -08:00
Andy Street dd60964736 WebWorkers: Add c++ API for working with MessageQueueThread
Summary:
public

Adds a fbjni API similar to JNativeRunnable so that you can post ##std::function<void()>## to MessageQueueThreads.

Reviewed By: lexs

Differential Revision: D2779094

fb-gh-sync-id: 8f873fc93fb6b817268e9422c0b6f85c3e453676
2016-01-12 04:51:45 -08:00
Eric Raio 5fb1966509 Adding `resetTo` documentation in Navigator methods
Summary: Closes https://github.com/facebook/react-native/pull/5220

Reviewed By: svcscm

Differential Revision: D2818993

Pulled By: bestander

fb-gh-sync-id: 0bc0feb68e6c6f6132203daef586d78489047731
2016-01-12 04:47:37 -08:00
Aleksei Androsov 5061fde317 FormData can append only string or object with uri
Summary:
I fix FormData type checking.

Simple test case:
```js
var fd = new FormData();

// JS Error.
// Because all non-string values threaded as "blob"
fd.append('number', 1);
```
Closes https://github.com/facebook/react-native/pull/4390

Reviewed By: svcscm

Differential Revision: D2818377

Pulled By: nicklockwood

fb-gh-sync-id: 8b3f27476af21c5fd65b844034579372172ea73c
2016-01-12 03:25:33 -08:00
Morgan Pretty 43dcdaffe2 ActionSheetIOS support for presentation from modal view controller
Summary:
Currently the RCTActionSheetManager attempts to present itself from the 'rootViewController' of the key window, presenting a modal from a view controller which is already presenting a modal is not allowed on iOS and this fails with the following error appearing in the XCode debugger (but not the chrome debugger):

```
Warning: Attempt to present <UIAlertController: 0x7fca85b14f40> on <UINavigationController: 0x7fca84812000> whose view is not in the window hierarchy!
```

This change recursively looks through modally presented view controllers until it finds the top one and then uses that to present the action sheet.
Closes https://github.com/facebook/react-native/pull/5263

Reviewed By: svcscm

Differential Revision: D2823201

Pulled By: nicklockwood

fb-gh-sync-id: aad1ad88115563f633fd9aaea8e27d1d155a6c27
2016-01-12 03:14:35 -08:00
Sebastian Gronewold 6623e482b2 See issue #4886
Summary:
brentvatne this is the pull request you requested
See issue #4886

On iOS the plist key NSLocationAlwaysUsageDescription was ignored and the location could not be retreived when using this key. Now both keys NSLocationWhenInUseUsageDescription and NSLocationAlwaysUsageDescription are supported. If NSLocationAlwaysUsageDescription is set, NSLocationWhenInUseUsageDescription will be simply ignored according to https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW18

I read the contribution guidelines regarding the Objective-C coding standards. Hopefully my line length breaks are okay - otherwise just give me a shout and I will fix that. Didn't write any line of Objective-C before so^^
Closes https://github.com/facebook/react-native/pull/5093

Reviewed By: svcscm

Differential Revision: D2823206

Pulled By: nicklockwood

fb-gh-sync-id: dd856a18416796749025e4b32d9c72895401916d
2016-01-12 03:11:31 -08:00
Martín Bigio 97dcc66e7a Use same options on dependencies and bundle commands
Reviewed By: sam-swarr

Differential Revision: D2821362

fb-gh-sync-id: c07c2f74f237ab95ad4f4a89b7e35af4ca9e8c6b
2016-01-11 15:31:33 -08:00
Janic Duplessis e08a7f3587 Fix launching text editor from a redbox stacktrace on windows
Summary:
Launch the editor with cmd on windows.
Closes https://github.com/facebook/react-native/pull/5238

Reviewed By: svcscm

Differential Revision: D2819943

Pulled By: pcottle

fb-gh-sync-id: a38f88bb9be72871cc3a37367973371176799d9e
2016-01-11 13:27:31 -08:00