Commit Graph

5008 Commits

Author SHA1 Message Date
Chirag 099827372d Merge pull request #5501 from arjunkomath/patch-2
Add 'Feline for Product Hunt' into Showcase Apps
2016-01-23 16:22:45 -05:00
Arjun Komath e3bb55335a Add 'Feline for Product Hunt' into Showcase Apps 2016-01-24 02:17:26 +05:30
Christopher Dro 2b309a426a Updates to Text & IntentAndroid
Summary: Closes https://github.com/facebook/react-native/pull/5496

Reviewed By: svcscm

Differential Revision: D2858772

Pulled By: androidtrunkagent

fb-gh-sync-id: 5edf52af256efe6bb7ae1f8bcc2622d7e6a1298c
2016-01-23 11:01:33 -08:00
Konstantin Raev 0331c02c8f added buck to circle.ci build infra
Summary: Closes https://github.com/facebook/react-native/pull/5333

Reviewed By: svcscm

Differential Revision: D2858779

Pulled By: androidtrunkagent

fb-gh-sync-id: 2458f6324384378ea9f6dd67dc170d42e418aa24
2016-01-23 10:50:35 -08:00
Konstantin Raev ae45d8bd4c More fixes to BUCK and java builds of OSS React Native
Reviewed By: mkonicek

Differential Revision: D2849743

fb-gh-sync-id: 7d0ae9a2fcfda8c017b60af3e8fe7fa4029ab6ea
2016-01-23 02:58:33 -08:00
DougBanksPersonal cc30e2b57c Update RCTNavigator.m
Summary:
I am using ReactNative in a hybrid App.

We have a setup like so:

Native Navigation Controller
  Native Tab Controller
    Native View Controller wrapping React
      React Navigation Controller
        React View Controller 1
          React View Controller 2
  Native View Controller 2.

When I pop Native View Controller 2 off the Navigation stack, I get a seg fault on this line:

NSUInteger indexOfFrom = [_currentViews indexOfObject:fromController.navItem];

I believe what's happening:
Your code is listening to Nav Controller transitions, assuming that they are all from React Native Nav Controllers.
You are catching this one instead, which is actually a Native Nav Controller transition.
You start trying to access the pushed/popped view controllers as if they were react native view controllers.

In this case, the view controllers are not react native -> no navItem field -> seg fault.

Solution: if we are catching this transition but it isn't from our react native nav controller, just
Closes https://github.com/facebook/react-native/pull/5495

Reviewed By: svcscm

Differential Revision: D2857473

Pulled By: nicklockwood

fb-gh-sync-id: cc7f0a16e2e0cea56ca9e49bcb87db4ebd3a0905
2016-01-22 17:27:32 -08:00
sunnylqm 5a5386414f AndroidViewPager -> ViewPagerAndroid
Summary: Closes https://github.com/facebook/react-native/pull/5471

Reviewed By: svcscm

Differential Revision: D2854830

Pulled By: androidtrunkagent

fb-gh-sync-id: 59fc6db6cbb96c2a7b3b23295e470ffb251c39fa
2016-01-22 15:55:35 -08:00
Elliot Hesp f644af34ef Correctly bind Touchable.js setTimeout
Summary:
Fixes https://github.com/facebook/react-native/issues/5337

`this.setTimeout` is undefined and the scope wasn't being passed through causing a RedBox error.
Closes https://github.com/facebook/react-native/pull/5376

Reviewed By: svcscm

Differential Revision: D2838623

Pulled By: androidtrunkagent

fb-gh-sync-id: 513210298b6c39d812047a03d8f2edd5c11e46f6
2016-01-22 14:45:35 -08:00
Dale Jefferson 969c520126 Use renderSeparator in List View Example
Summary: Closes https://github.com/facebook/react-native/pull/5443

Reviewed By: svcscm

Differential Revision: D2856259

Pulled By: androidtrunkagent

fb-gh-sync-id: 68b4f5d16c852bbf06cd65346c32b8c6d3f2d36c
2016-01-22 14:21:37 -08:00
David Aurelio a23785ca2e Pass on the bundle name rather than the ID when getting transform options
Summary:
public

This is needed to bring numerical module IDs back.

The numerical ID of the main module will always be `0` and is therefore of no use when used as conditional. We have to pass on the name, which will be preserved, when requesting transform options.

Reviewed By: martinbigio

Differential Revision: D2855106

fb-gh-sync-id: f9bc40e753b1b283ce0b00068e3c9964a541ad9b
2016-01-22 13:55:29 -08:00
David Aurelio a0c5fb99a0 Backout "Use numeric identifiers when building a bundle"
Summary:
public

The reverted change doesn’t play nice with inline requires, let’s revert it for now.
I will bring it back after fixing it or adapting inline requires

Reviewed By: martinbigio

Differential Revision: D2854771

fb-gh-sync-id: 32fdbf8ad51240a9075b26502decb6328eed4b29
2016-01-22 11:39:30 -08:00
Christoph Pojer 717207a23f Hotfix jest startup time
Summary:
I talked about this a bunch before. node-haste2 will resolve this issue. Right now node-haste1 looks into eevery single node_module recursively even though we only need to look into a finite-set of them. Some node_modules are huge so it takes a long time. haste2 doesn't eagerly look into node_modules so it doesn't have this issue. This diff blacklists the modules from node-haste but since we use the `resolve` npm module as a fallback we'll still be able to require them.

public

Reviewed By: kassens

Differential Revision: D2852384

fb-gh-sync-id: 113f1bd9c66fcd712c2549a7110a3e752b0e4a69
2016-01-22 11:35:35 -08:00
Nick Lockwood 2cbc912756 Added support for width & height for text images
Summary:
public

Previously, `<Image>` elements embedded inside `<Text>` ignored all style attributes and props apart from `source`. Now, the `width`, `height` and `resizeMode` styles are observed. I've also added a transparent placeholder to be displayed while the image is loading, to prevent the layout from changing after the image has loaded.

Reviewed By: javache

Differential Revision: D2838659

fb-gh-sync-id: c27f9685b6976705ac2b24075922b2bf247e06ba
2016-01-22 11:32:32 -08:00
Martin Konicek f20453baee Update Releases.md 2016-01-22 18:55:35 +00:00
Martin Konicek cb5314243e Update release.sh 2016-01-22 18:53:47 +00:00
David Aurelio 722bc73c0d Distinguish between module ID and name
Reviewed By: martinbigio

Differential Revision: D2854975

fb-gh-sync-id: 8c75037d5d7f6155369d4ec581158ebabf445bac
2016-01-22 10:40:29 -08:00
Dave Miller 798acac18e Fix a crash in Image when passed an invalid uri
Summary:
public

Fix https://github.com/facebook/react-native/issues/5465

Instead of returning null when we fail to parse the Uri, just return an empty Uri which somewhat hides the problem but does prevent the crash

Reviewed By: mkonicek

Differential Revision: D2854902

fb-gh-sync-id: 71265d5e52302e174b898af5be25ac698abcf9ab
2016-01-22 10:38:33 -08:00
Nick Lockwood cd2eed0d36 RCTGzipData() acceps nil input, but was not marked as returning nullable output
Reviewed By: milend

Differential Revision: D2854721

fb-gh-sync-id: 336b3261f1694bcc173f267582561c0314c0cea0
2016-01-22 08:40:29 -08:00
Martin Konicek 581434ac04 Add BUCK files 2016-01-22 16:20:13 +00:00
Nick Lockwood 36e0dd2d48 Fixed screen size bug on iPhone6+
Summary:
public

This diff fixes a bug in RCTScreenScale() on iPhone6+. The issue was due to the fact that the iPhone6+'s virtual screen resolution of 414x736 points 3x resolution (1242x2208 pixels) does not match its actual screen resolution, which is 1080p (1080x1920 pixels).

I did not realize that `[UIScreen mainScreen].nativeBounds` reports the *actual* resolution, not the virtual resolution, and was dividing by the virtual scale (3.0) instead of the actual native scale factor (2.6).

This only affects iPhone6+, because for all other iOS devices, the virtual resolution matches the native resolution.

Reviewed By: milend

Differential Revision: D2854663

fb-gh-sync-id: bce8965a151e2f005a02a5f6b54f259d01b9ab12
2016-01-22 08:19:36 -08:00
Martín Bigio c4b948f62e Make "Loading from pre-bundle" message more distinctive
Reviewed By: javache

Differential Revision: D2849126

fb-gh-sync-id: 28b42650de3716b43d228e83ede215aaa9098858
2016-01-22 06:57:28 -08:00
Moz Morris f7cb745195 Update Tutorial.md with missing Component import
Summary: Closes https://github.com/facebook/react-native/pull/5484

Reviewed By: svcscm

Differential Revision: D2854745

Pulled By: androidtrunkagent

fb-gh-sync-id: b89a8dbef33cc0d89d5e94fa7c5f35219d7c8147
2016-01-22 06:54:33 -08:00
David Aurelio 35e1fd8826 Use `std::numeric_limits` in C++
Summary:
Instead of using `UINT32_MAX` in C++ code, use `std::numeric_limits<uint32_t>::max()`. The `UINT32_MAX` macro is not available in all compilation setups
Closes https://github.com/facebook/react-native/pull/5481

Reviewed By: svcscm

Differential Revision: D2854545

Pulled By: androidtrunkagent

fb-gh-sync-id: 00a70b429c78bcf120866bb59fae2ffe6330a910
2016-01-22 03:24:33 -08:00
Andrei Coman 2a70c53947 Don't NPE in reactTagForTouch
Summary:
This NPEs because the layout is null if the TextView has recently
changed. However, this also means that the TextView hasn't been laid out yet, so
the default TextView tag is correct.

public

Reviewed By: oli

Differential Revision: D2848412

fb-gh-sync-id: 5faf793d17f50283c153dc0d43fb717e8764cb7d
2016-01-21 15:33:08 -08:00
David Aurelio 89207a1171 `require` implementation for unbundles: Systrace and guard
Summary:
public

Adds two feature to the require implementation for unbundled code:
- Ports Systrace from `require.js`
- Prevents already loaded modules from being overwritten by repeated calls to `nativeRequire` with the same ID

Reviewed By: martinbigio

Differential Revision: D2850345

fb-gh-sync-id: 122e2d5d4a64b2e868d4cf6e5079810f59b1db18
2016-01-21 14:14:08 -08:00
Martín Bigio c434893878 Hot Loading should be disabled by default
Summary:
public

Although the feature itself is gated, once the user is on the experiment we want to make sure hot loading starts disabled up until the feature is enabled through the dev menu.

Reviewed By: javache

Differential Revision: D2850070

fb-gh-sync-id: 66e69e152806d3bb01985afe20827e3b9cffeb41
2016-01-21 14:13:59 -08:00
David Aurelio 17e1ceb543 Add ability to load “unbundles” to android
Summary:
public

This adds the ability to load “unbundles” in RN android apps. Unbundles are created by invoking the packager with the `unbundle` command rather than `bundle`.

The code detects usage of an “unbundle” by checking for the existence of a specific asset.

Reviewed By: astreet

Differential Revision: D2739596

fb-gh-sync-id: d0813c003fe0fa7b47798b970f56707079bfa5d7
2016-01-21 14:13:50 -08:00
Martín Bigio 0963192b18 Bump js/package.json version to clear cache
Reviewed By: sam-swarr

Differential Revision: D2851399

fb-gh-sync-id: 0fbeb7d4c6d669f981e3f5139387e506a3670931
2016-01-21 13:57:42 -08:00
Martin Kralik c14cc123d5 API for cancelling RCTTouchHandler
Reviewed By: spicyj

Differential Revision: D2846573

fb-gh-sync-id: 652864c773d03c24f0d68dd8335401eb052fc1bf
2016-01-21 13:46:52 -08:00
tfallon@mail.depaul.edu 528e30987a Adding ETag handling to packager improves local development
Summary: Closes https://github.com/facebook/react-native/pull/2473

Reviewed By: svcscm

Differential Revision: D2669385

Pulled By: mkonicek

fb-gh-sync-id: bb9ee4a309a05e0da0ccc7663a373f4a53b9a0a2
2016-01-21 13:00:35 -08:00
Andrei Coman 29238eb3eb Remove timeouts from react instance loading
Reviewed By: lexs

Differential Revision: D2847813

fb-gh-sync-id: b4cb08633da8e637b0ec25a29bc21b963e337deb
2016-01-21 12:04:17 -08:00
Sokovikov c2d75d7a65 Android AppState
Summary: Closes https://github.com/facebook/react-native/pull/5152

Reviewed By: svcscm

Differential Revision: D2850250

Pulled By: mkonicek

fb-gh-sync-id: 0b5063fa7121d4e304a70da8573c9ba1d05a757c
2016-01-21 11:47:21 -08:00
Hedger Wang 2263cddd02 Enable ES7 async functions in jest
Reviewed By: voideanvalue

Differential Revision: D2840780

fb-gh-sync-id: b86eed0078115d41e4400074f41244e4ae688762
2016-01-21 11:19:32 -08:00
Huang Yu f453e14c8f Fix StyleSheet 'textAlign' for AndroidTextInput. Closes #2702
Summary:
change `setTextAlign` and `setTextAlignVertical` to receive argument of type `String` (the same as in `StyleSheet`), so that native props and stylesheet props are calling the same ReactMethod

- add demo (may not be necessary)
Closes https://github.com/facebook/react-native/pull/4481

Reviewed By: svcscm

Differential Revision: D2823456

Pulled By: mkonicek

fb-gh-sync-id: 349d17549f419b5bdc001d70b583423ade06bfe8
2016-01-21 11:08:34 -08:00
Martin Konicek dc96935681 Fix a tiny typo in error message
Reviewed By: davidaurelio

Differential Revision: D2850195

fb-gh-sync-id: 8177ce2f8d7f799edc559b4f5a0da99d865874a7
2016-01-21 10:59:59 -08:00
Kyle Corbitt ba4101dc4a Simplified AlertIOS
Summary:
Ok, so this started as fixing #5273 but ended up getting a little more complicated. 😄

Currently, AlertIOS has the following API:

* `alert(title, message, buttons, type)`
* `prompt(title, defaultValue, buttons, callback)`

I've changed the API to look like the following:

* `alert(title, message, callbackOrButtons)`
* `prompt(title, message, callbackOrButtons, type, defaultValue)`

I know that breaking changes are a big deal, but I find the current alert API to be fairly inconsistent and unnecessarily confusing. I'll try to justify my changes one by one:

1. Currently `type` is an optional parameter of `alert`. However, the only reason to change the alert type from the default is in order to create one of the input dialogs (text, password or username/password). So we're in a weird state where if you want a normal text input, you use `prompt`, but if you want a password input you use `alert` with the 'secure-text' type. I've moved `type` to `prompt` so all text input is now done with `pro
Closes https://github.com/facebook/react-native/pull/5286

Reviewed By: svcscm

Differential Revision: D2850400

Pulled By: androidtrunkagent

fb-gh-sync-id: 2986cfa2266225df7e4dcd703fce1e322c12b816
2016-01-21 10:57:26 -08:00
sunnylqm 7d457b09b4 Turn to ES6
Summary: Closes https://github.com/facebook/react-native/pull/5460

Reviewed By: svcscm

Differential Revision: D2850417

Pulled By: androidtrunkagent

fb-gh-sync-id: 8ba8bf935de53676cb4930712fabfe832208213f
2016-01-21 10:41:43 -08:00
David Aurelio cb4fca3590 Use numeric identifiers when building a bundle
Summary:
public

Since the combination of node and haste modules (and modules that can be required as both node and haste module) can lead to situations where it’s impossible to decide an unambiguous module identifier, this diff switches all module ids to integers. Each integer maps to an absolute path to a JS file on disk.

We also had a problem, where haste modules outside and inside node_modules could end up with the same module identifier.

This problem has not manifested yet, because the last definition of a module wins. It becomes a problem when writing file-based unbundle modules to disk: the same file might be written to concurrently, leading to invalid code.

Using indexed modules will also help indexed file unbundles, as we can encode module IDs as integers rather than scanning string IDs.

Reviewed By: martinbigio

Differential Revision: D2842418

fb-gh-sync-id: 97addd28e964ac5f2b5081dcd3f36124d2864df8
2016-01-21 10:37:15 -08:00
David Aurelio 2902701566 Remove now unnecessary tweaking of global
Summary:
public

When we were debugging in the main window JS context in Chrome, the global environment had to be tweaked so that DOM features wouldn’t be detected.

Since we switched to debugging within a web worker, we don’t need to do this tweaks any more.

Reviewed By: bestander

Differential Revision: D2850239

fb-gh-sync-id: 886f2f7ac5c579c3fd4a424d5341bc6bc0432c0d
2016-01-21 10:26:33 -08:00
Martín Bigio 4362e98170 Unit test reloading when hot loading is enabled
Reviewed By: sahrens

Differential Revision: D2824276

fb-gh-sync-id: a81acd20eb5b7d3da61becac00e4bdbea6b61a2f
2016-01-21 09:52:33 -08:00
Dave Miller 747be0bf5c Change the js signature to be Promise based and dynamically detect it used as a callback
Summary:
Making the default people see when they look at the module the Promise based version

public

Reviewed By: davidaurelio

Differential Revision: D2850048

fb-gh-sync-id: e0815983ed798c202047cb071e65ce63a52fd1af
2016-01-21 09:49:34 -08:00
Martín Bigio c888e6583f Unit test `worker.js`
Summary:
public

We had a bug a few weeks ago which caused transform errors not to be shown properly. The problem was on this piece of code, so lets unit test it.

Reviewed By: davidaurelio

Differential Revision: D2849990

fb-gh-sync-id: 9f6bb8a8b7d59bbaa3577c29cee37fb23a50d66f
2016-01-21 09:10:37 -08:00
sunnylqm edb523c6d7 adjust getSize so that its doc can be shown on the page
Summary: Closes https://github.com/facebook/react-native/pull/5426

Reviewed By: svcscm

Differential Revision: D2848229

Pulled By: nicklockwood

fb-gh-sync-id: d1cc28af889c3b1e26a098044e85e0b10032a776
2016-01-21 08:23:36 -08:00
Martín Bigio 5d9163b87d Improve error message
Summary:
There's a long standing issue on open source (https://github.com/facebook/react-native/issues/4968). Until someone gets some free bandwidth to fix it lets at the very least improve the error message to guide users to the issue and suggest workarounds.

public

Reviewed By: mkonicek

Differential Revision: D2849051

fb-gh-sync-id: ef7913442ceabcab2076141bd13ab1ceeb529759
2016-01-21 08:16:34 -08:00
Dave Miller 9baff8f437 Make CameraRoll work with Promises
Summary:
public
This is the first module moving to the new model of working with Promises.

We now warn on uses of callback version.  At some point we will remove that.

Reviewed By: davidaurelio

Differential Revision: D2849811

fb-gh-sync-id: 8a31924cc2b438efc58f3ad22d5f27c273563472
2016-01-21 08:07:41 -08:00
Nick Lockwood 34d5fa2695 RCTUtils Obj-C nullability annotations
Summary:
Add Objective-C nullability annotations to RCTUtils

public

Reviewed By: javache

Differential Revision: D2797331

fb-gh-sync-id: b918179625865760edc8c6fcc189ad78f819f3e3
2016-01-21 07:50:43 -08:00
Janic Duplessis d33b554f5d Make the packager work with babel strict mode transform
Summary:
At the moment we have to disable strict mode for the transform-es2015-modules-commonjs because strict mode leaks to the global scope and breaks the bridge. It was due to the way the polyfills were bundled in the package. To fix it, I wrapped the polyfill modules in an IIFE. Then when strict mode was enabled some polyfills were broken due to strict mode errors so that was fixed too. Also removed the IIFE from the polyfills that included one.

This diff doesn't enable the strict mode transform since some internal facebook modules depend on it not being enabled. When #5214 lands we could make the default babel config shipped with OSS react-native use strict mode modules and facebook could just modify the babel config to disable it if needed.

This will allow removing `"strict": false` from https://github.com/facebook/react-native/blob/master/packager/react-packager/.babelrc#L16

Fixes #5316
Closes https://github.com/facebook/react-native/pull/5422

Reviewed By: svcscm

Differential Revision: D2846422

Pulled By: davidaurelio

fb-gh-sync-id: a3e2f8909aa87dabab2b872c61b887e80220fb56
2016-01-21 07:23:34 -08:00
Martin Konicek d806b75544 Update Releases.md 2016-01-21 15:04:30 +00:00
Martin Konicek e10166a1a3 Update Releases.md 2016-01-21 15:03:25 +00:00
Martin Konicek f97138f36f Build first-party C++ deps of OSS React Native with Buck
Reviewed By: sdwilsh

Differential Revision: D2840290

fb-gh-sync-id: 3dd4f7ee83a520d5c01f7864f443a04aa73b35fa
2016-01-21 05:24:31 -08:00