Summary: Like GuardedAsyncTask, et al, but for Runnables.
Reviewed By: achen1
Differential Revision: D4537287
fbshipit-source-id: 8ae60c7007843c0b7d8e5c3835d0847921fb3db5
Summary:
findNodeHandle is considered an internal module. The one to use is ReactNative.findNodeHandle. We need to rely on this because we will have two different renderers and we need the renderers to inject themselves with findNodeHandle before it is used.
I use ReactNative.findNodeHandle from inside the module because I think this leads to a cycle somewhere or might not play well with inline require otherwise.
There is also one in UIManager but that is definitely a cycle so I'm going to try to avoid that one.
Reviewed By: spicyj, bvaughn
Differential Revision: D4533911
fbshipit-source-id: f771641ea5c5366ccbaff68c42202fa6f8c18cb3
Summary:
Looks like a recent change in Yoga causes the height of an absolutely positioned fullscreen view to break.
This works around the issue by using the newly introduced percentage `height` instead.
Reviewed By: jingc
Differential Revision: D4530240
fbshipit-source-id: 86d758576c6984686f30d7504e11f9ec3ce469bd
Summary:
I think this update is Critical as I wanted to add a different module name to be the same as the Android module name. I simply lost 6 hours until I found out that the Macro does not accept String syntax. Almost drove me crazy. Please, at least do something about it. Thanks.
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**
Explain the **motivation** for making this change. What existing problem does the pull request solve?
Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
**Test plan (required)**
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI
Closes https://github.com/facebook/react-native/pull/11634
Differential Revision: D4533312
Pulled By: lacker
fbshipit-source-id: 2c547f791ed76ba62e0c7e5cabc2830dbae34075
Summary:
React Native 0.39 introduced a breaking change through a new C-based implementation of css-layout. Developers were encouraged to remove unnecessary flex: 1 styles where no longer required to address any resulting layout issues.
The SwipeableListView has not yet been updated to reflect this change. Specifically, SwipeableRow still sets flex: 1 even though it shouldn't.
This was resulting in a rendering issue for folks when they upgraded to React Native 0.39 and used SwipeableListView that caused significant initial flickering when rendering a SwipeableListView. The solution was simply to remove flex: 1 from the SwipeableRow implementation.
This small change removes flex: 1 to resolve this issue.
Suggested reviewer (initial SwipeableListView contributor): fred2028
See this issue for more details: https://github.com/facebook/react-native/issues/11441
Closes https://github.com/facebook/react-native/pull/11521
Differential Revision: D4532562
Pulled By: lacker
fbshipit-source-id: 5c2907186d00481a731bd81794947a019465a031
Summary:
Some nodes have a value of NaN initially so if we assign the value of the input in the constructor it is possible we get NaN as a value and then it will break when trying to update the value. Initializing at 0 is actually fine with this node since it will get updated properly in the `update` method.
**Test plan**
Tested in an app that uses native animated diffclamp where I noticed the issue. Made sure this change fixed it.
Closes https://github.com/facebook/react-native/pull/12279
Differential Revision: D4527866
fbshipit-source-id: add3fc0d86ffcf4ddcd01ff3251f2373eeaa2cf5
Summary:
Addresses an issue introduced in 6a8200df95. While that commit successfully avoids extracting the docs while developing locally, it neglected to handle the case when the site was being built for deployment. As a result this broke CI.
Options are now optional as they should be, and the site generation script will ensure docs are built during deployment.
Closes https://github.com/facebook/react-native/pull/12267
Differential Revision: D4523906
Pulled By: lacker
fbshipit-source-id: ee00d5653eb98b16b94734299bb15ba5473a0f61
Summary: We deprecated `transformMatrix` and `decomposedMatrix` in D3239960 10 months ago. This revision finally removes remains of this functionality from native code.
Reviewed By: mmmulani
Differential Revision: D4515760
fbshipit-source-id: b4d5b7e834ac4a775f4992b28270b4ff961889a6
Summary: Now layout direction (LTR or LTR) can be specified not only for whole app but also for view subtree via `direction` style property.
Reviewed By: mmmulani
Differential Revision: D4510206
fbshipit-source-id: 4e56c5886b6e42f2343165eb76be897e681c5ba4
Summary:
This only affects the website when it is hosted locally using express. The current version of the website is annoyingly sluggish, as the whole docs structure is parsed on each request.
In this PR, we store the result of extracting the Markdown sources in memory, significantly speeding up page loads. We also delay the extraction of docs until a request is made that would require them (e.g. anything that hits `/react-native/docs/*`).
There is still a 8 second delay when the docs are first visited, as expected. This can be improved in a later PR.
Any changes to the docs structure may require a server restart to take effect. This is rare enough that I don't think it is a blocker. This PR significantly speeds up first page load times on the homepage and any non-docs site, and speeds up subsequent page loads on Docs. This will make for a better web development experience.
Extracting the docs on each request takes around 8 seconds. Storing these in memory allows us to virtuall
Closes https://github.com/facebook/react-native/pull/12203
Differential Revision: D4516697
Pulled By: hramos
fbshipit-source-id: 05276e9827c82e38ccf064209b3fd38005f8e247
Summary:
The stall watchdog is handy to detect stalls, but it doesn't really tell us what was
happening. This diff makes it easy to track React perf and bridge traffic during any stall, and
prints it out if the stall exceeds the threshold.
Reviewed By: yungsters
Differential Revision: D4479439
fbshipit-source-id: 87f94913ec341a648d7744249597dc30b29759ab
Summary:
Fixes#11272Fixes#11572Fixes#11781
The main changes here are:
* This depends on the latest CocoaPods (1.2.0). It’s currently in RC, but if I’m not mistaken a proper release is expected soon. /cc dantoml
* Adds required header search paths for the jschelpers and cxxreact subspecs.
* Makes the jschelpers and cxxreact headers private to building React Native, not visible to the user’s project.
* It uses the canonical upstream Yoga v1.0.0 podspec: https://github.com/facebook/yoga/blob/master/Yoga.podspec
* Consistent styling.
I have been able to get our app to build again using this https://github.com/artsy/emission/pull/437. The spec has some warnings, but otherwise fully passes lint.
rh389 sjmueller Could you please test with your projects?
Closes https://github.com/facebook/react-native/pull/12089
Differential Revision: D4518605
fbshipit-source-id: ecf86232d8b1af52d139eadd1acc10f5c1d42c29
Summary:
Currently it is not trivial for people to get started with React Native. `react-native init MyApp` just creates a simple app with a single screen. People have to spend time figuring out how to add more screens, or how to accomplish very basic tasks such as rendering a list of data or handling text input.
Let's add an option: `react-native init --template navigation` - this creates a "starter" app which can be easily tweaked into the actual app the person wants to build.
**Test plan (required)**
- Checked that 'react-native init MyApp' still works as before:
<img width="487" alt="screenshot 2017-02-02 16 56 28" src="https://cloud.githubusercontent.com/assets/346214/22559344/b2348ebe-e968-11e6-9032-d1c33216f490.png">
<img width="603" alt="screenshot 2017-02-02 16 58 04" src="https://cloud.githubusercontent.com/assets/346214/22559370/c96a2ca6-e968-11e6-91f7-7afb967920fc.png">
- Ran 'react-native init MyNavApp --template'. This prints the available templates:
```
$ react-native init MyNavApp
Closes https://github.com/facebook/react-native/pull/12170
Differential Revision: D4516241
Pulled By: mkonicek
fbshipit-source-id: 8ac081157919872e92947ed64ea64fb48078614d
Summary: I figured out that the uncaught rejection that happens on transform error originated from a "fork" along the chain, where we both "then" on a promise, and return that promise. In that case Node.js, legitimately I think, identifies this as an uncaught rejection case. One solution, in this changeset, is to do the side-effects as part of the promise chain instead of "forking". Another option would be to add an explicit error handler to the additional "then", but it seems we don't have to handle that case here.
Reviewed By: davidaurelio
Differential Revision: D4515592
fbshipit-source-id: 17d813cfdbc76685b6273b8d94e97d948fd68674
Summary:
Fix#241 and successor for #302
Added new property ```display``` with ```YGDisplayFlex``` and ```YGDisplayNone```. Allows to hide nodes from the layout without the need to remove it from the DOM.
Closes https://github.com/facebook/yoga/pull/369
Reviewed By: astreet
Differential Revision: D4501141
Pulled By: emilsjolander
fbshipit-source-id: 0dfeee381f6d1e4bbba81926126b83dd7abab9d6
Summary:
Corresponding iOS PR: https://github.com/facebook/react-native/pull/11002
This adds an onScroll event to TextInput which is useful when a multiline TextInput has so much content that it is scrollable.
**Test plan (required)**
Verified the event works properly in a test app. Also, my team uses this event in our app.
Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/11001
Differential Revision: D4220941
Pulled By: mkonicek
fbshipit-source-id: 7e420579946f2ae840c9e1fcdc8afab68007da17
Summary:
In my RN checkout, I use "upstream" as my remote instead of "origin" -> this lets me run `scripts/bump-oss-version.js --remote upstream 0.41.1` for example.
Also made the script executable so we don't need to put `node` in front of it, and updated the Releases.md doc.
Closes https://github.com/facebook/react-native/pull/12230
Differential Revision: D4515070
Pulled By: mkonicek
fbshipit-source-id: f218a6b77959588ee5f625b8589ac080dd010034
Summary:
If a user sets `color.ui` or `color.diff` to `always` in their git configuration files, the output of `git diff` will contain some "color characters" as well as the diff. When you try to apply this diff with color characters with `git apply` you will get `fatal: unrecognized input`.
I think this is the cause of issue #11543
Reproduce in git with:
```
mkdir git-test
cd git-test/
git init
echo "foo" > bar.txt
git add bar.txt
git commit -m "First"
echo "foomobile" > bar.txt
git add bar.txt
git diff HEAD > new.patch --color=always
git reset --hard HEAD
git apply new.patch --check
```
Set `--color=never` or `--no-color` and the unrecognized input error should disappear and the patch be applied successfully.
Closes https://github.com/facebook/react-native/pull/12211
Differential Revision: D4514132
fbshipit-source-id: 3622df6ece92794c8a175f0599f5a276d92e82e8
Summary:
We really need a better list view - so here it is!
Main changes from existing `ListView`:
* Items are "virtualized" to limit memory - that is, items outside of the render window are unmounted and their memory is reclaimed. This means that instance state is not preserved when items scroll out of the render window.
* No `DataSource` - just a simple `data` prop of shape `Array<any>`. By default, they are expected to be of the shape `{key: string}` but a custom `rowExtractor` function can be provided for different shapes, e.g. graphql data where you want to map `id` to `key`. Note the underlying `VirtualizedList` is much more flexible.
* Fancy `scrollTo` functionality: `scrollToEnd`, `scrollToIndex`, and `scrollToItem` in addition to the normal `scrollToOffset`.
* Built-in pull to refresh support - set set the `onRefresh` and `refreshing` props.
* Rendering additional rows is usually done with low priority, after any interactions/animations complete, unless we're about to run out of rendered content. This should help apps feel more responsive.
* Component props replace render functions, e.g. `ItemComponent: ReactClass<{item: Item, index: number}>` replaces `renderRow: (...) => React.Element<*>`
* Supports dynamic items automatically by using `onLayout`, or `getItemLayout` can be provided for a perf boost and smoother `scrollToIndex` and scroll bar behavior.
* Visibility callback replaced with more powerful viewability callback and works in vertical and horizontal mode on at least Android and iOS, but probably other platforms as well. Extra power comes from the `viewablePercentThreshold` that lets the client decide when an item should be considered viewable.
Demo:
https://www.facebook.com/groups/576288835853049/permalink/753923058089625/
Reviewed By: yungsters
Differential Revision: D4412469
fbshipit-source-id: e2d891490bf76fe14df49294ecddf78a58adcf23
Summary:
The back view in <SwipeableRow /> should not be rendered unless the front view has been
rendered and its layout has been measured.
Reviewed By: fred2028
Differential Revision: D4509584
fbshipit-source-id: 72ad0c8e7dec258ae3a1ba88c0adeb9ad0bfdf6d