Commit Graph

8960 Commits

Author SHA1 Message Date
Lukas Piatkowski de82931931 Fix SamplingProfiler and HeapCapture for apps that lazy load react modules
Reviewed By: cwdick

Differential Revision: D4291903

fbshipit-source-id: 684ced8d6370494191cdb182a8e172680d69d17b
2016-12-07 10:43:48 -08:00
Martin Konicek 9b0e15cbb2 Remove dependency on Yeoman
Summary:
We stopped using Yeoman in https://github.com/facebook/react-native/pull/10786

I almost forgot to remove the now-unused dependency :)

**Test Plan**

- Published react-native to Sinopia
- Ran `react-native init MyApp`
- The app was generated correctly
- The app's node_modules folder doesn't contain Yeoman

Reviewed By: cpojer

Differential Revision: D4291619

fbshipit-source-id: 44c1ef8035fa2d8c40d4e8c505207245e1a95d3c
2016-12-07 10:43:48 -08:00
Don Yu bfe551d2d1 Implement onViewAppear by creating a new EventListener on ReactRootView listening for when it's attached to a RN Instance
Reviewed By: AaaChiuuu

Differential Revision: D4269272

fbshipit-source-id: 6dd54f8ab7befebd54e82ef355119ba302b9bfe5
2016-12-07 09:58:33 -08:00
Emil Sjolander 7f8c2985a8 Rename directories
Reviewed By: gkassabli

Differential Revision: D4284681

fbshipit-source-id: f0c6855c2c6e4389b7867f48f72cbb697830fc5a
2016-12-07 05:14:12 -08:00
David Aurelio cf3ae6c32a Use absolute paths from repo root
Summary: Rather than using relative paths from the build root, this switches all paths to absolute paths from the build root. This makes integration with a lot of tooling easier.

Reviewed By: jeanlauliac

Differential Revision: D4285474

fbshipit-source-id: 80d20e0f6dc61a310e72112b9654628bff81a4f0
2016-12-06 16:58:33 -08:00
Emil Sjolander a47678b3e9 Remove init from api
Reviewed By: gkassabli

Differential Revision: D4276177

fbshipit-source-id: c4404d0534f381dfacee0625b2847d38de58e038
2016-12-06 14:43:36 -08:00
Martin Konicek d3065f6895 CLI: Show npm / yarn output during 'react-native-init' when installing React and Jest
Summary:
I missed this while doing the Yeoman wipeout.

Currently we just print:

    Installing React...
    Installing Jest...

This diff makes it print the output of those commands.

**Test Plan**

Published react-native to Sinopia, ran `react-native init MyApp`, saw the output:

    Installing Jest...
    ⸨░░░░░░░░░░░░░░░⸩ ⠸ normalizeTree: ...

Reviewed By: bestander

Differential Revision: D4286640

fbshipit-source-id: e554f03a4729c2de85eba527f10f4b727de722e4
2016-12-06 13:58:31 -08:00
Martin Konicek 76cd2f7bf2 Allow configuring the way CLI installs react-native
Summary:
- Added an option to override the install command in CI environments (see comment in code)
- Simplify the verbose mode
- Simplify how options are passed round

Test plan (only tested on Mac OS):

    react-native init TestApp
    react-native init TestApp --version 0.36

In both cases the app was generated, package.json contained the correct version (latest, or 0.36).

    react-native init TestApp --verbose

Saw progress bar.

    react-native init InstallCommandTest --installCommand "npm install bad-package-doesnt-exist"

404 error is printed to stdout correctly.

    react-native init TestApp --installCommand "npm install react-native"

The app was generated.

    react-native init InstallCommandTest --installCommand "npm install react-native --verbose" --verbose

Saw verbose output from npm.

Reviewed By: bestander

Differential Revision: D4284642

fbshipit-source-id: f2cdee52ab64831ae3ca064d50f23c5f73a0301f
2016-12-06 13:28:30 -08:00
John Shelley d21aa92480 Android - Fix Overlay for Marshmallow 23+
Summary:
Currently any React Native apps that target API 23 or greater will crash on the first initial debug/dev build due to the overlay permission.

Sadly there isn't a concrete "request permission" baked into the Marshmallow permission system.
However, we can launch the overlay screen without starting the react app and once its turned on start the app.

 - https://github.com/facebook/react-native/issues/10454 - targetSdkVersion 23 lead crash / App crash for targeting 23+
 - https://github.com/facebook/react-native/pull/10479 - Add the overlay permission information / Larger discussion around targeting API 23+
- Intent to Overlay permission goes directly to the app in question, rather then the general full listing of applications. This allows a developer who is not familiar with the system to easily toggle the overlay without getting confused.

**Test plan (required)**
* Ran UIExplorer App on fresh install with Target 23
```
cd react-native
./gradlew :Examples:UI
Closes https://github.com/facebook/react-native/pull/11316

Differential Revision: D4286351

fbshipit-source-id: 024e97c08c40ee23646dd153794fcde7127b2308
2016-12-06 12:43:36 -08:00
Pieter De Baets 27acb71353 Fix target configuration in React.xcodeproj
Summary: The target config inside React.xcodeproj was messed up, with source files being included in multiple or wrong targets. I went over the files in React.xcodeproj and verified that each .m file was included only once and was in the right target and .h were in the right projects.

Reviewed By: majak

Differential Revision: D4284673

fbshipit-source-id: 99af61083c6ca81311e30f0ea0045d4e7bffc20c
2016-12-06 06:28:33 -08:00
Nelen 2190221c44 Added mocked functions to StatusBarManager
Summary:
**Description:**
Jest tests that use that StatusBar failing because the status bar functions aren't mocked.
Errors I ran into:
`TypeError: StatusBarManager. setNetworkActivityIndicatorVisible is not a function`
`TypeError: StatusBarManager. setHidden is not a function`
`TypeError: StatusBarManager. setStyle is not a function`

**Fix:**
Added mocks for all the functions that the StatusBar offers according to the docs: https://facebook.github.io/react-native/docs/statusbar.html

**Test plan (required)**
Verify that the tests using StatusBar and its functions succeed.
Closes https://github.com/facebook/react-native/pull/11322

Differential Revision: D4284536

Pulled By: cpojer

fbshipit-source-id: b67be8c0595d91ee9aca4784f457c0959d7e45d5
2016-12-06 05:58:32 -08:00
David Aurelio 2ab5d2809f Add bundle building logic
Summary: Adds the necessary functionality to serialize a series of `Module`s to a bundle and a source map in the context of the new Buck/Packager integration

Reviewed By: cpojer

Differential Revision: D4265867

fbshipit-source-id: f2d3e4ffed64a3dca817101faad7bced9f16edc7
2016-12-05 16:43:45 -08:00
David Aurelio 27e818fa69 Support relative paths in haste map
Summary: Since all paths are relative when building with the new Buck integration, `HasteMap` needed support for these.

Reviewed By: cpojer

Differential Revision: D4265888

fbshipit-source-id: 2d454bfd3866028d8d2c268c0fd318b148951dc9
2016-12-05 16:43:45 -08:00
David Aurelio c18373f438 Add source map helper
Summary: Adds a helper to produce index source maps for Buck builds

Reviewed By: cpojer

Differential Revision: D4265911

fbshipit-source-id: 9ca3c49876df5db039bae823c0458c98e6e05619
2016-12-05 16:43:45 -08:00
David Aurelio 67c9fe0b75 Don’t use spaces when amending module wrapper
Summary: since we use the same module wrapper amendment function for dev and prod builds, and code is already minified at this point, we minify ourselves by leaving out space.

Reviewed By: cpojer

Differential Revision: D4265967

fbshipit-source-id: 719a3bbfbc02c9af1bb3fa08317b2f1b92c141a5
2016-12-05 16:43:45 -08:00
David Aurelio 0336be8918 ModuleGraph: Also call back with module objects of entry points
Summary:
This changes the callback value of `Graph` function so that it also contains a separate property with `Module` instances of the entry points.

Having references to the entry point modules allows to e.g. create require calls to them dynamically to kick of bundle execution.

The commit also contains a refactoring of the `Graph` function and its helpers that reduces the need for extensive parameter passing and long nested functions.

Reviewed By: cpojer

Differential Revision: D4250772

fbshipit-source-id: 2edca77bbef2308d3176a62123b8cecd70e2c8c7
2016-12-05 16:43:45 -08:00
Jan Kassens 460a044f6c delete signedsource.js
Summary:
This module is not actually used inside of React Native. Projects that use this,
can now depend on https://www.npmjs.com/package/signedsource

Reviewed By: yungsters

Differential Revision: D4272511

fbshipit-source-id: 93eb74aa4ccfa8ef8743de2cfa92b5403de91e0a
2016-12-05 16:28:32 -08:00
Nicolas Cuillery 999b120920 Mention Yarn in blog post
Summary:
An original idea from GantMan #11311
Closes https://github.com/facebook/react-native/pull/11313

Differential Revision: D4281207

Pulled By: mkonicek

fbshipit-source-id: e878c0ace65c0f4614e0325f7f2f0b660559e754
2016-12-05 16:28:32 -08:00
David Aurelio d482743f91 Remove hmr require from initialization code
Reviewed By: cpojer

Differential Revision: D4265897

fbshipit-source-id: c39caeae875e6f5f5322542601e97cdf78f90dc6
2016-12-05 16:13:29 -08:00
Emil Sjolander 86e0f39863 Fix last missing reference to libcsslayout
Reviewed By: bestander

Differential Revision: D4279530

fbshipit-source-id: 809a6317f02bc2a770f50c8cb048aa3e2dfcf33f
2016-12-05 15:13:28 -08:00
Martin Konicek 70f07b1e4e Revert to downloading Boost from SourceForge for now
Summary: The unpkg mirror started returning HTTP 403 Forbidden for some reason.

Reviewed By: mkonicek

Differential Revision:
D4278637
Ninja: OSS only, tests already broken

fbshipit-source-id: 7dbfce40e8246f2a021ebe2592d24fa86c12bf21
2016-12-05 11:58:34 -08:00
Pieter De Baets 5ee8b41d56 Remove REACT_HEADERS from RN BUCK file
Reviewed By: emilsjolander

Differential Revision: D4231819

fbshipit-source-id: 78c1316d8e2bd8d9c0947b1c1c4dc857b74824ae
2016-12-05 10:43:33 -08:00
Adam Comella 2aca021504 iOS: Fix dequeueTasks crash in image loader
Summary:
This fixes a crash occurring [on this line](f9f32eb426/Libraries/Image/RCTImageLoader.m (L253)). It was reported in a comment in #10433.

The problem is that `task` is deallocated at this point and is unsafe to use. Removing it from `_pendingTasks` dropped its ref count to 0. [The ARC docs](http://clang.llvm.org/docs/AutomaticReferenceCounting.html#fast-enumeration-iteration-variables) state that, by default, loop variables in fast enumeration loops are not retained. That's why `task`'s ref count is 0.

It's likely we ran into this bug because the code disobeyed the [reverseObjectEnumerator docs](https://developer.apple.com/reference/foundation/nsarray/1415734-reverseobjectenumerator) which state that "you must not modify the array during enumeration". The default retention policy for fast enumeration seems to assume you follow this.

To fix this bug and avoid other potential pitfalls, the code now follows the docs and `_pendingTa
Closes https://github.com/facebook/react-native/pull/11296

Differential Revision: D4277167

Pulled By: javache

fbshipit-source-id: 1211b32935bab7f4080dc00b88d85348786e859a
2016-12-05 10:13:29 -08:00
gl8997@gmail.com 03fd91063b Update type check for NavigationCardStack
Summary:
The typecheck inside of NavigationCard is PropTypes.any while in NavigationCardStack it is  View.propTypes.style.

let's make them consistent to avoid unnecessary warnings. (e.g. trying to pass a animationStyle as cardStyle)
Closes https://github.com/facebook/react-native/pull/9808

Differential Revision: D4277323

Pulled By: ericvicenti

fbshipit-source-id: c30b4a21675cad98c19f5c6522e286d776bfa20d
2016-12-05 09:58:35 -08:00
Emil Sjolander 1ed114e549 Fix an error initializing needsCrossTrailingPos
Reviewed By: gkassabli

Differential Revision: D4271422

fbshipit-source-id: e8d72af742d96829684958780eb56e2c375df20c
2016-12-05 09:43:32 -08:00
Andres Suarez 6470c3fb51 Remove unused deps
Reviewed By: davidaurelio

Differential Revision: D4267485

fbshipit-source-id: 1118328960258969c775f61f598341d1d48d336a
2016-12-05 08:43:28 -08:00
Martin Konicek 5852684f7b Blogpost about react-native-git-upgrade
Reviewed By: mkonicek

Differential Revision:
D4277012
Ninja: OSS blog

fbshipit-source-id: bdb7db675f208f1103f0c34b9d71d3b0fdd5e875
2016-12-05 07:58:29 -08:00
Emil Sjolander 097d3173e9 Fix library name of yogacore
Reviewed By: bestander

Differential Revision: D4276884

fbshipit-source-id: c791aa3bb27fcf4b48d84427011eae6119fe6edf
2016-12-05 07:43:29 -08:00
Martin Konicek bf55df15db Git upgrade: Tweak wording
Reviewed By: mkonicek

Differential Revision:
D4276739
Ninja: OSS

fbshipit-source-id: 7480a3ee77ed8f6ab0d35f92b43a806bfe29a151
2016-12-05 06:28:34 -08:00
Martin Konicek caa9ab19bf Fix a bug in determining if yarn is available
Reviewed By: mkonicek

Differential Revision:
D4276707
Ninja: OSS

fbshipit-source-id: 79cb2942f27179681d1a8ebfd3bc5a97f544f7af
2016-12-05 06:13:33 -08:00
Martin Konicek f0490d67ff Git upgrade: Tweak README, bump version, fix a bug
Reviewed By: mkonicek

Differential Revision:
D4276644
Ninja: OSS only

fbshipit-source-id: 7bed331770d06addedf51e2ed09d0b9bde5b45ad
2016-12-05 05:58:29 -08:00
Emil Sjolander f4cde4f65c Add #pragma once and extern C to YGEnums.h
Reviewed By: gkassabli

Differential Revision: D4274156

fbshipit-source-id: 9fa0ae146bb9e5bd40d93fa3c56f83424ebd2bf9
2016-12-05 05:13:30 -08:00
Martin Konicek 682f540b41 Git upgrade: add a README
Reviewed By: mkonicek

Differential Revision:
D4276245
Ninja: OSS docs only

fbshipit-source-id: b7a7561932e3209dc34322f12a512eb5724791c3
2016-12-05 03:13:31 -08:00
Emil Sjolander b8708edf0f Update java package name to yoga
Differential Revision: D4271420

fbshipit-source-id: b3cf150569a2331868410339cd19e5c694f2059e
2016-12-05 02:58:32 -08:00
David Aurelio f9f32eb426 Load Indexed RAM format on android
Reviewed By: javache

Differential Revision: D4268243

fbshipit-source-id: fc969cfc69810d0477c926ffc79c23584fcbd7eb
2016-12-04 16:13:30 -08:00
Martin Konicek fb3906994e Unpublish blogpost that was published too early
Reviewed By: mkonicek

Differential Revision:
D4274302
Ninja: OSS only

fbshipit-source-id: 874c2c8ddbae93f6b6e362ccedcd3951267c455d
2016-12-04 11:28:27 -08:00
Emil Sjolander fd2fb6cd65 Update yoga library name
Reviewed By: bestander

Differential Revision: D4273387

fbshipit-source-id: 91373c6ef1e94b330fa249235ba97fec480e17c7
2016-12-04 05:28:29 -08:00
Jake Dawkins 6234a5dfa2 Fix iOS Picker Item Colors
Summary:
I want to resolve #11170 by passing the `color` prop from `PickerIOS.Item` to its implementation.

In `RCTPicker.m`, the label.textColor was already being set and used, but there was nothing referencing the past prop. I passed the prop to the implementation, checked if it exists, and if not, set the default color, like before.

I visually tested the **Colorful Pickers** example in UIExplorer. Those picker `Item`s pass in a `color` prop.

![dec-01-2016 22-07-46](https://cloud.githubusercontent.com/assets/9259509/20821696/ae45d704-b812-11e6-9720-0045d6c0bcd4.gif)

The basic picker does not pass the color prop to the picker `Item`, and there are no errors. Basic functionality is still in tact:

![dec-01-2016 22-09-35](https://cloud.githubusercontent.com/assets/9259509/20821730/ee544f74-b812-11e6-9294-a1b45e78d9f7.gif)
Closes https://github.com/facebook/react-native/pull/11260

Differential Revision: D4272370

fbshipit-source-id: 5fa33c40526dda59ca2ab527c31351bcd27e5cf3
2016-12-03 18:58:29 -08:00
Tim Yung ebe0c85fbe JS: Modernize SignedSource
Reviewed By: cpojer

Differential Revision: D4271506

fbshipit-source-id: b3eff94de9ce2c179d62d57eace9a40797aed397
2016-12-03 12:13:28 -08:00
Tim Yung dd97443f2b RN: Delete Dead `sign` Module
Reviewed By: cpojer

Differential Revision: D4271550

fbshipit-source-id: ffab21055f3e51fccf8640a568703aa8cc20bd0f
2016-12-03 11:58:33 -08:00
Emil Sjolander b9cedaefa6 Rename java API
Reviewed By: IanChilds

Differential Revision: D4265345

fbshipit-source-id: 69ecfd8fac214f86b8b70647b9b909acd83d78b5
2016-12-03 04:44:10 -08:00
Emil Sjolander 85ac5fc354 Rename C api
Differential Revision: D4259190

fbshipit-source-id: 26c8b356ca464d4304f5f9dc4192bff10cea2dc9
2016-12-03 04:44:10 -08:00
David Aurelio b1a23914fa JSIndexedRAMBundle: Don't read null bytes for scripts
Summary:
`JSIndexedRAMBundle` used to read scripts including the terminating null bytes. That worked on iOS, but not on Android, where we have an ascii-only optimization.
This changes that behavior to only read the actual script data excluding the terminal null.

Reviewed By: javache

Differential Revision: D4265374

fbshipit-source-id: 7e6f943666aee610d79939cef09b103305803c69
2016-12-03 02:28:37 -08:00
Connor Garber 9c0ea77684 Android home path reminder visible twice on linux
Summary:
The line
`Please make sure you export the correct path for 'ANDROID_HOME' if you did not install the Android SDK using Android Studio.`
was visible twice (one on top of another) in the docs when viewing linux instructions. I removed the block that set it visible on both linux and windows and incorporated it into the existing windows block.
Closes https://github.com/facebook/react-native/pull/11276

Differential Revision: D4269783

Pulled By: hramos

fbshipit-source-id: 423fca3219567cf96d91aefc43d1ddabb2403728
2016-12-02 20:43:28 -08:00
Sagiv Ofek f9ab788c6b Add more info link for warnedMissingNativeAnimated
Summary:
Add link with more details of how to resolve warnedMissingNativeAnimated warning.
Closes https://github.com/facebook/react-native/pull/11224

Differential Revision: D4268352

fbshipit-source-id: 679574570aea2f4ec7083247d5b6dcba378e8560
2016-12-02 15:28:31 -08:00
Damien Varron e9d459275a Add missing closing brace in docs
Summary:
This is a minor documentation fix

fixes #11150
Closes https://github.com/facebook/react-native/pull/11253

Differential Revision: D4268276

fbshipit-source-id: 67c8f9b4c77a2c781c09376bf4fc15a61b3db490
2016-12-02 15:28:31 -08:00
Ben Kalman fb4f71f4ac Add missing backtick in PanResponder.js docs
Summary: Closes https://github.com/facebook/react-native/pull/11274

Differential Revision: D4268360

fbshipit-source-id: 8d92300830e4568de14350a539c11b8773c425c0
2016-12-02 15:13:34 -08:00
Ben Clayton 833961e05d <Text> Expose Android's includeFontPadding property to JavaScript.
Summary:
By default Android will put extra space above text to allow for upper-case accents or other ascenders. With some fonts, this can make text look slightly misaligned when centered vertically.

We have found that the effect is very noticeable with certain custom fonts on Android. On iOS the font aligns vertically as expected.

Android exposes a property `includeFontPadding` that will remove this extra padding if set to false. This PR exposes that to JS, and adds it to the documentation and UIExplorer.
Closes https://github.com/facebook/react-native/pull/9323

Differential Revision: D4266713

Pulled By: lacker

fbshipit-source-id: f9711254bc26c09b4586a865f0e95ef4bf77cf3f
2016-12-02 12:58:36 -08:00
Nicolas Cuillery 9c5efa34fb Announcement of react-native-git-upgrade
Summary:
Ping mkonicek

![fireshot capture 4 - easy upgrades relying on git_ - http___localhost_8079_react-native_](https://cloud.githubusercontent.com/assets/4425455/20825225/fe93bcb2-b862-11e6-8f0d-123ef2c9071f.png)
Closes https://github.com/facebook/react-native/pull/11263

Differential Revision: D4265603

Pulled By: mkonicek

fbshipit-source-id: 8e496f0d76536744f2b25848a974f240bb5fae3e
2016-12-02 11:58:36 -08:00
Mike Grabowski 59ed3f8351 Update docs with releases information
Summary:
We have changed the release schedule but haven't updated docs yet. This is a small PR that aims to fix it where applicable.

Likely to be cherry-picked to 0.40 branch since its the new one following that system.

Differential Revision: D4266155

Pulled By: mkonicek

fbshipit-source-id: 952af7a0f35a3d984aeadb6efe02f0990830ed8b
2016-12-02 11:28:54 -08:00