Commit Graph

9864 Commits

Author SHA1 Message Date
Jean Lauliac bac576c433 packager: BatchProcessor: use Promise for queue()
Reviewed By: cpojer

Differential Revision: D4572181

fbshipit-source-id: 34c3824f05efd93847df9ba5931b0735c6711c28
2017-02-20 08:45:19 -08:00
Jean Lauliac 1a5b56d070 packager: introducing async/await, return of the yarn
Summary:
The first time I tried to commit this changeset, it was causing many new packages to be installed, because the dependency would depend on newer versions that what we have installed. So, I had made a diff so upgrade all the babel packages. Unfortunately this caused some problem as the newer versions of Babel are more strict on some syntaxes. Of course, these have to be addressed, but I don't want this changeset to be coupled with Babel upgrades and the issues that arise from it.

So instead, I decided to install the slightly older version of the async-to-generator module. At first I tried with just doing:

    yarn add babel-plugin-transform-async-to-generator@6.16.0

But, `yarn` is stubborn: because this module depends on a caret version of `babel-helper-remap-async-to-generator`, it installs the very last version of it, that itself needs more recent versions of other Babel modules. So, instead, I add to install a slightly older version of the dependency manually, then then the plugin:

    yarn add babel-helper-remap-async-to-generator@6.16.0
    yarn add babel-plugin-transform-async-to-generator@6.16.0

This allows us to have a `yarn.lock` with only a minimal amount of changes, and uncouple this change from any Babel upgrades. Because we only have a few new modules, the `node_modules` folder also stays the same, 133M, and it gives us confidence this will not cause significant startup time regressions.

Reviewed By: cpojer

Differential Revision: D4578733

fbshipit-source-id: deb0f720b895b7196aaf432adec3e56f18663940
2017-02-20 08:45:18 -08:00
Emil Sjolander 6ac6bf007a Fix behaviour of wrapping container within align-items: not stretch
Reviewed By: astreet

Differential Revision: D4578614

fbshipit-source-id: 5d22a3a673735587384d775189158a87bb1d457d
2017-02-20 07:32:06 -08:00
Janic Duplessis 61d3741461 Fix native animated event lag on Android
Summary:
Native animated events sometimes end up lagging a frame behind on android because we perform the update in the normal animation loop instead of doing it immediately when we receive the event. We had the same issue on iOS and was fixed in a similar way.

Moved some code around to have a method that updates a list of node that we can use to update the node in the animated event handler and also use it in the animation update loop.

**Test plan**
Tested that it did fix sticky headers lagging a frame behind during momentum scrolling in my PR #11315 and also tested the native animations examples still work properly.
Closes https://github.com/facebook/react-native/pull/11994

Reviewed By: mkonicek

Differential Revision: D4488977

Pulled By: sahrens

fbshipit-source-id: 831a1565bc7b8fa88cadd5a8c1be876fbdefbf66
2017-02-20 06:00:34 -08:00
Pieter De Baets bdd27f4696 Break apart -[RCTComponentData propBlockForKey:inDictionary:]
Reviewed By: shergin

Differential Revision: D4578549

fbshipit-source-id: 726773fdf8c97cdcc3b0540b32278e36c00b19b5
2017-02-20 05:15:25 -08:00
Pieter De Baets ebe3355de7 Create NSDataBigString
Reviewed By: bnham

Differential Revision: D4559734

fbshipit-source-id: 6766093524ae79ed2a41285d33eb2207993a7d0e
2017-02-20 05:00:58 -08:00
Ashok Menon 1635c02e92 Simplifying Struct definition.
Summary:
Since we are reading from a file, we should make sure this struct is packed, just in case we change it down the line and the compiler decides it might want to introduce padding, we're now protected against that.

There was also a discussion about the fact that people might use `ptr += sizeof(BundleHeader)` as an idiom in their code, which would currently be incorrect, if padding was introduced at the end of the file. Actually, it remains incorrect to do that now, because a RAM bundle header is a different size to a BC Bundle header. If people are properly testing their code, they should spot this pretty quickly, because it will always be an incorrect thing to do with a RAM bundle, so this isn't as bad as previously thought: where the code only succeeds when the compiler deigns to not pad the struct at the end.

This diff also cleans up how headers are initialised. `BundleHeader` has a constructor that explicitly zero-initialises it so we can rely on the default initializer to do the right thing now.

Reviewed By: mhorowitz

Differential Revision: D4572032

fbshipit-source-id: 7dc50cfa9438dfdfb9f842dc39d8f15334813c63
2017-02-20 04:30:19 -08:00
Valentin Shergin c02c78a681 Splitting `RCTRootView.m`, decoupling RCTRootContentView
Reviewed By: javache

Differential Revision: D4570067

fbshipit-source-id: 91305d0c175af135ce2f22d7992bee68c13da80e
2017-02-19 23:19:47 -08:00
Valentin Shergin ba170ec78c Simplifying mess with RCTRootViewSizeFlexibility
Summary:
Now things look much more clear, I hope.
This diff:
 * Introduces new property of `RCTRootShadowView` `availableSize` which represents exactly what we transmit to layout engine;
 * Illuminates conflict between logical `availableSize` and explicitly specified size of DOM node (current `size`);
 * Splits overcomplicated `setSize:forView:` method into two unrelated ones;
 * Changes actual values of `RCTRootViewSizeFlexibility` enum constants for simpler usage;
 * Completely removes `sizeFlexibility` concept from `RCTRootShadowView` (in favor of special values of `availableSize`);
 * Makes the code clearer finally.

This is beginning of big effort to improve `RCTRootView` and co.

Reviewed By: mmmulani

Differential Revision: D4562834

fbshipit-source-id: f5baaf2859ea430d44645a6b5d35f222f15a668e
2017-02-19 23:19:47 -08:00
Mathieu Baudet 4a893ee071 remove unused includes in fbobjc/Libraries
Reviewed By: swolchok

Differential Revision: D4507573

fbshipit-source-id: 7fc6df52bc37c39698c7897be567758469417218
2017-02-19 18:33:49 -08:00
Aaron Chiu 555e456754 add markerAnnotation to QPL JS API
Reviewed By: javache

Differential Revision: D4575107

fbshipit-source-id: 55d2fe86c863d3234ffe9e6520bf3ee96c41012d
2017-02-19 18:15:29 -08:00
Nicolas Cuillery 927b356245 Fix react-native-git-upgrade cache busting
Summary:
**Motivation**

This PR fixes #12420.

For the first time, the version 0.41.2 includes a change in the generator (see #12162). The [require cache busting](https://github.com/facebook/react-native/blob/master/react-native-git-upgrade/cliEntry.js#L157-L163) of `react-native-git-upgrade`, designed to face this situation , was ineffective.

The entry in `require.cache` is the file path including the `.js` extension. We have to delete this entry with the same key.

**Test plan**

- Publish `react-native-git-upgrade` to Sinopia,
- Follow the reproduction steps of #12420
- 👉 The name of the app shouldn't be changed
Closes https://github.com/facebook/react-native/pull/12422

Differential Revision: D4585549

Pulled By: mkonicek

fbshipit-source-id: 508ac925c17d02b7739d47f9351a5aa336589f2e
2017-02-18 16:45:50 -08:00
Martin Konicek 8c0e6ecfc0 Android: Support HTTP headers for source prop on <Image> components
Summary:
A copy of https://github.com/facebook/react-native/pull/7791 because of our very imperfect tools that mirror the changes from pull requests in the fb monorepo. The internal Phabricator revision for #7791 is in an 'abandoned' state (by foghina probably because of changing teams) and Phabricator doesn't allow me to claim that revision and merge it. Therefore I'm creating a new one.

(It's not foghina's fault, no one probably knew about this "abandoned Phabricator revision" edge case, don't remember we hit it before.)

Will try to keep attribution (git blame) to rigdern when merging.
Closes https://github.com/facebook/react-native/pull/12448

Differential Revision: D4584743

Pulled By: mkonicek

fbshipit-source-id: 66e5b88134fca1980adc4cd8a2ff17c42e10022c
2017-02-18 04:45:11 -08:00
Max Malm c7f2c53fbf Cast name to String to ensure .match is available
Summary:
PR for issue #12444

In `validateProjectName` in `react-native-cli` `name.match` is called but it's not certain that `name`is a String. This casts `name`to a String before doing the match.

I didn't find any tests for this file so I didn't add any.

Reproduce:
```
cd react-native-cli
npm install
node index.js init 123
```

Before this PR the code throws an exception, after this PR the intended `console.error` is printed.
Closes https://github.com/facebook/react-native/pull/12447

Differential Revision: D4584041

fbshipit-source-id: 117e76570aa9975ac851192b030c5a77daf19bcc
2017-02-17 20:01:43 -08:00
Kevin Gozali cb68b97289 android: stop logging console logs from webview
Summary: We're logging all console logs from webview. This strips console logging for non debug builds

Reviewed By: AaaChiuuu

Differential Revision: D4578071

fbshipit-source-id: 79b21012a6ef215eb35701911662a720cb6be280
2017-02-17 18:30:12 -08:00
Aaron Chiu 1fa95ed390 inline a bunch of NativeModule requires
Reviewed By: shergin

Differential Revision: D4578180

fbshipit-source-id: 3764ffd32eb7e4698e928740bc72bbad02876894
2017-02-17 16:49:38 -08:00
Aaron Chiu dc0df40770 add a way to call QPL.markerTag()
Reviewed By: mhorowitz

Differential Revision: D4564193

fbshipit-source-id: a63262eeb62c2945249e7021a59da0ff5df44918
2017-02-17 16:31:13 -08:00
Mehdi Mulani 93a263d874 Make RCTRefreshControl not dependent on order of setting properties
Summary: With the Cxx bridge, properties are not guaranteed to be set it any order (and furthermore, they should not be). RCTRefreshControl previously had its title set first, and would crash otherwise. This fixes that.

Reviewed By: mhorowitz

Differential Revision: D4580253

fbshipit-source-id: 39baecceb8b67c6a851c08ba9cabbf4dc99359cb
2017-02-17 15:16:01 -08:00
Andrew Rasmussen bf5aa9e1e7 Product Pains -> Canny
Summary:
We migrated everyone on Product Pains over to our new service, Canny. We also moved every product's feedback to a product-specific subdomain (eg. https://react-native.canny.io/feature-requests).

This PR updates every Product Pains URL over to its new Canny version.

Changes only affect docs, blog posts, and bot responses - not the React Native library itself.

**Test plan**

I visited https://react-native.canny.io/feature-requests. Since there are no code changes this seems sufficient but let me know if I need to run the blog website or something.
Closes https://github.com/facebook/react-native/pull/12429

Differential Revision: D4581492

Pulled By: hramos

fbshipit-source-id: 7d124ab7ed9228d47f1bc4417d8992f15ff17f01
2017-02-17 15:02:23 -08:00
Hector Ramos 6ad41a81bc Clean up Animated docs
Summary:
After taking a look at the existing animation docs, I found that most of the documentation on using `Animated` was spread out throughout the Animations guide and the `Animated` API reference, without any particular structure in place.

This PR aims to clean up the API reference, focusing on documenting all the provided methods exhaustively, and deferring to the Animations guide for long form examples and supporting content.

The `Easing` module is referred to at various points in the API reference, so I decided to clean up this doc as well. easings.net provides some handy visualizations that should make it easier for the reader to understand what sort of easing curve each method provides.

The site was built locally, and I verified all three documents render correctly.

![screencapture-localhost-8079-react-native-docs-animations-html-1487212173651](https://cloud.githubusercontent.com/assets/165856/23004694/d3db1670-f3ac-11e6-9d4e-0dd6079b7c5c.png)

Closes https://github.com/facebook/react-native/pull/12410

Differential Revision: D4581314

Pulled By: hramos

fbshipit-source-id: 27c0bce2afac8f084311b9d6113a2641133b42e5
2017-02-17 14:48:17 -08:00
Aaron Chiu e81258a15b add Systrace to all PerformanceLogger.js markers
Reviewed By: alexeylang

Differential Revision: D4567843

fbshipit-source-id: 00cac36d2b73f827723546a04edd6b89267c26bb
2017-02-17 12:01:06 -08:00
Dan Abramov 118e88393e Guard against missing native module
Reviewed By: martinbigio

Differential Revision: D4579114

fbshipit-source-id: a2e9f634748e1c56eb9867bfb9e3e66e9cdc5e93
2017-02-17 10:07:01 -08:00
Ashok Menon 3148cc09ae Fix CI runs
Summary: I broke Circle CI builds by moving a file, so I am updating the OSS build setup with details of the move. Whilst I was testing the change, I noticed that the UI Explorer build was also already broken, so this diff also changes some of its configuration to make it build again.

Reviewed By: javache

Differential Revision: D4579137

fbshipit-source-id: 4cbb1ef148075280b991cbc5bb47bf96ec3d543a
2017-02-17 09:17:19 -08:00
Pieter De Baets 591de3e278 Move tryBytecode to bundle specifier
Reviewed By: amnn

Differential Revision: D4559898

fbshipit-source-id: 917bef5a1d753b52e9e967f3029eb158935feee6
2017-02-17 06:00:55 -08:00
Alexey Lang ba029becbe Support QuickPerformanceLogger.js in CxxBridge
Reviewed By: javache

Differential Revision: D4573567

fbshipit-source-id: 3ef9da38fb178cf4c1400b4a991a9e85f3ec3755
2017-02-17 06:00:54 -08:00
dlowder-salesforce e29ba72ba7 Add missing reference image for tvOS ImageSnapshotTest
Summary:
This should fix the failing ImageSnapshotTest that was added to the IntegrationTests for iOS and tvOS.
Closes https://github.com/facebook/react-native/pull/12391

Differential Revision: D4578345

Pulled By: javache

fbshipit-source-id: 13ff305276c46256fcdbb9fc070a8c08cdc0dd0a
2017-02-17 05:20:15 -08:00
Pieter De Baets 0c8e925a18 Move initializedExecutorWithContextProvider API
Reviewed By: dcaspi

Differential Revision: D4558591

fbshipit-source-id: 821d6a6d4e42d1c67559fde102a0558eb623733b
2017-02-17 02:30:45 -08:00
Mike Grabowski 096acbd53d Match on `s.version` only
Summary:
Recent PR by alloy adds `s.cocoapods_version`. That makes `release script` also modify that value. Adding `\` makes `sed` match on a dot character (I believe missing `\` was a mistake).

Used and tested here: https://github.com/facebook/react-native/commits/0.42-stable

CC bestander
Closes https://github.com/facebook/react-native/pull/12381

Differential Revision: D4558370

Pulled By: bestander

fbshipit-source-id: 3bee7bac3002c0c83c100ce9d0c67463e030a428
2017-02-16 20:44:59 -08:00
Spencer Ahrens 6283878e17 API update and bug fixes
Reviewed By: bvaughn, yungsters

Differential Revision: D4563798

fbshipit-source-id: 0591cef7c854b525d77e526af783284d9696cb48
2017-02-16 19:04:04 -08:00
Spencer Ahrens 5042bae259 Clean up separator stuff
Reviewed By: bvaughn

Differential Revision: D4561262

fbshipit-source-id: 990f338c197851252bea4902fa86249d6e1c975b
2017-02-16 19:04:04 -08:00
Spencer Ahrens 63d3ea17a7 Improve flow typing
Summary:
- Properly inherit flow types from base components, including `defaultProps`
- template-ify the `Item` type as it flows from the `data` prop into `ItemComponent`

Note that for `SectionList` is is harder to do the `Item` typing because each section in the
`sections` array can have a different `Item` type, plus all the optional overrides...not sure how to
tackle that.

Reviewed By: yungsters

Differential Revision: D4557523

fbshipit-source-id: a0c5279fcdaabe6aab5fe11743a99c3715a44032
2017-02-16 19:04:04 -08:00
Pieter De Baets c529a06cb8 Remove unused RCTMessageQueue
Reviewed By: mhorowitz

Differential Revision: D4564975

fbshipit-source-id: 62cb686fe5fefb4ec4a8f5db44898a95496420be
2017-02-16 15:18:43 -08:00
Charles Chen 274e7ba592 Make flow types update to date with proptypes with ImageSource
Summary:
As the task covered, we would like to update the ImageSource flow type.

Edit the flow types for ImageSource to map to the propTypes ImageSourcePropType.js

Reviewed By: mmmulani

Differential Revision: D4573836

fbshipit-source-id: ef3f5365e00b4926c75188f345811f5cfa4bfd3c
2017-02-16 15:18:43 -08:00
Pieter De Baets 11e59e3ff4 Move some utilities to RCTCxxUtils
Reviewed By: mhorowitz

Differential Revision: D4551173

fbshipit-source-id: db01d3205ec1feb54c815c0f0fc688fc7a4823d0
2017-02-16 14:02:03 -08:00
Andrew Y. Chen be5235f86d Fail safely if there are extra DrawView commands in ClippingDrawCommandManager
Reviewed By: ahmedre

Differential Revision: D4525823

fbshipit-source-id: ebae2fe813f86b33a4ede3d42a9968a05f4bb451
2017-02-16 13:45:08 -08:00
Ashok Menon 14dc219810 Deleting Optimized Bundle!
Reviewed By: javache

Differential Revision: D4566164

fbshipit-source-id: 1fbd3dd04f24399e93e3c6ec58956e6e18f1683f
2017-02-16 13:30:55 -08:00
Alexey Lang 7c97008fa8 Support QuickPerformanceLogger.js in the old bridge
Reviewed By: javache

Differential Revision: D4566647

fbshipit-source-id: 1a6448b89b14f4ce9f2192e9f7b4e28b8dcb52b7
2017-02-16 11:33:48 -08:00
Jean Lauliac c27c45cd45 Revert D4559304: FBReactKit/js: upgrade babel dependencies
Differential Revision: D4559304

fbshipit-source-id: fb371aecf48a2dc957ccc6d6715b8ee694335fec
2017-02-16 11:15:49 -08:00
Jean Lauliac 8be2a27aab Revert D4559167: packager: introducing async/await
Differential Revision: D4559167

fbshipit-source-id: de887a737ad1d02ef07a431ee0713d0bad65eb85
2017-02-16 10:59:57 -08:00
Lukas Wöhrl 167ac4993a Removed duplicate code by calculating with mainSize/crossSize
Summary:
This PR removes some duplicate code by calculating with ```mainSize```/```crossSize``` and converting that to ```width``` or ```height``` at the end. See #395 .
Closes https://github.com/facebook/yoga/pull/396

Reviewed By: astreet

Differential Revision: D4564713

Pulled By: emilsjolander

fbshipit-source-id: 0b24e69cc9dc75cdf93deeb6c076dcacf134c6d8
2017-02-16 07:45:18 -08:00
Emil Sjolander 1b5eb36e2f Fix up some small issues with YGUnitAuto
Reviewed By: wwjholmes

Differential Revision: D4567045

fbshipit-source-id: ace5fd89bd534a6bb5ec7dba0c3afbf13d62d7c9
2017-02-16 06:59:33 -08:00
Pieter De Baets 53b387638e Move JSBigString to its own header
Reviewed By: mhorowitz

Differential Revision: D4551162

fbshipit-source-id: 2374e05e60942211e50af86ed42eb194e5e82bbe
2017-02-16 06:59:30 -08:00
Pieter De Baets 5d4ff693b4 Move RCTFollyConvert to the correct namespace
Reviewed By: mhorowitz

Differential Revision: D4551124

fbshipit-source-id: 40a0a8ca818710a7529798b8244d9c133eb5c22d
2017-02-16 06:59:27 -08:00
Janic Duplessis ae57b25134 Change cursor color when using selectionColor on Android
Summary:
This matches the behavior on iOS, there was no way before to change the cursor color per input, it was only possible to change it globally via the theme. Ideally cursor color and selection color would be 2 different props but I think this is better than what we have (and matches iOS).

Sadly there is no api to change it pragmatically (only possible via xml) so this uses reflection and can easily break so it is wrapped in a try catch to avoid crashes. I think it is better to just silently fail in this case. Definetly not super happy about the solution but I think it's worth adding since it is possible to do it natively using xml so it would suck not to be able to do it in RN.

**Test plan**
Tested that the cursor has the same color as before the change when not setting the prop and that it gets the selectionColor color when set.
Closes https://github.com/facebook/react-native/pull/12280

Differential Revision: D4571858

Pulled By: astreet

fbshipit-source-id: 7dca2db33a0a4eecb6115b45155549b1265ffbed
2017-02-16 04:45:35 -08:00
Lukas Piatkowski a2addbd932 BREAKING: Change the js1 - packager - RN App protocol to version 2
Reviewed By: cwdick

Differential Revision: D4551991

fbshipit-source-id: 395c38ee5c71ddc24d8743e7ec90cc89de087503
2017-02-16 04:30:00 -08:00
Janic Duplessis 33817b83d6 Allow listener for native Animated.event
Summary:
We used to not send events to JS when there was a native Animated.event but we do now so we can easily enable the listener property.

**Test plan**
Tested that the listener gets called when using native Animated.event.
Closes https://github.com/facebook/react-native/pull/12323

Differential Revision: D4556407

fbshipit-source-id: 0b17f331a352d03a47f1611c667433fd5a58696c
2017-02-16 00:32:43 -08:00
Jeremy Kun c728915944 Update grammar and typos in documentation
Summary:
I was reading the documentation and noticed a few typos and grammar mistakes.

- rely -> relies
- Adding 'a' and 'its' and 'the' where appropriate
- Minor simplifications
Closes https://github.com/facebook/react-native/pull/12385

Differential Revision: D4570713

Pulled By: hramos

fbshipit-source-id: dbf0506306fd16b3454a2ec96792bda2c7bcaa70
2017-02-15 20:16:10 -08:00
Sriraman 0b0c600a1b Fix the height of the app icons in showcase
Summary:
I have fixed the app icons height to `100px` in the showcase. So, the UI won't jump on loading.

**Motivation :** https://twitter.com/Vjeux/status/831698720055926784
Closes https://github.com/facebook/react-native/pull/12394

Differential Revision: D4570652

Pulled By: hramos

fbshipit-source-id: 02ac9792aa944111b913306bf28a186736097d38
2017-02-15 20:00:48 -08:00
Dan Abramov 3135a639e6 Update "Getting Started" to match latest Android Studio
Summary:
The "Configure" menu includes a dropdown:

<img width="221" alt="screen shot 2017-02-13 at 20 43 57" src="https://cloud.githubusercontent.com/assets/810438/22902608/8bb2ddf4-f22d-11e6-9d02-da498e06dfed.png">

I also clarified the UI role of labels (a tab and a checkbox) because I didn't notice them at first.
Closes https://github.com/facebook/react-native/pull/12365

Differential Revision: D4570633

Pulled By: hramos

fbshipit-source-id: 00fdf8fb9f933a37de76deed6dedfb8dfa4f15a0
2017-02-15 20:00:42 -08:00
Jean Lauliac 26304dacf1 packager: introducing async/await
Summary:
allow-large-files

By using async/await the code is (1) less nested, (2) more compact and (3) more robust (no exceptions running away, and much less risks of forgetting to call the callback/resolve, or mistakenly calling it twice). I now tend to think we could switch to it for all the callsites that are not in a perf-critical path.

I switched from 'request' to 'node-fetch' because 'request' has an annoying callback with 2 arguments. So it's simpler to use an interface that's (1) already returning a Promise and (2) that is becoming standard.

This changeset was a way for me to start experiment with introducing async/await in packager codebase, and it looks pretty good so far.

Reviewed By: cpojer

Differential Revision: D4559167

fbshipit-source-id: 89a328c5766c2ba890e9d0e67a81a38dac6cfc73
2017-02-15 13:47:52 -08:00