Summary:
118e88393e broke autodoc generation because autodoc isn't smart enough to understand some patterns.
I'm working around it by using the same trick as this file was using previously: reassigning the class variable.
Similarly, using a property initializer produces bad output so I had to remove it:
<img width="146" alt="screen shot 2017-02-20 at 19 00 36" src="https://cloud.githubusercontent.com/assets/810438/23138561/09ebb476-f7a0-11e6-8fad-92c5a01503c3.png">
cc ericnakagawa mkonicek for review
Closes https://github.com/facebook/react-native/pull/12479
Differential Revision: D4591285
Pulled By: gaearon
fbshipit-source-id: 5884620a08874298b1b2c810e8fb769eba4e1199
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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