Summary:
Makes sure request for geolocation use in the webview is handled.
This solves issue #7609
Currently use of geolocation in webview fails silently, as the permission request is never received by the native app.
**Test plan (required)**
1. Create new project with webview
2. Add javascript for geolocation:
```javascript
navigator.geolocation.getCurrentPosition(function (position) {
console.log('success', position)
}, function (error) {
console.log('could not determine position', error)
})
```
3. Run code and assert geolocation permission is requested, resulting in success (or error) callback being called
Closes https://github.com/facebook/react-native/pull/8305
Differential Revision: D3592887
fbshipit-source-id: 84fe2383fba8873431c5e89d154c0a4fd58ffb70
Summary:
This PR was split from commits originally in #8619. /cc dmmiller
These refactorings to the HierarchyOptimizer are in preparation for implementing support for inline views in #8619.
**Refactoring 1: Collapse add*LayoutOnlyNodeToLayoutOnlyNode**
addLayoutOnlyNodeToLayoutOnlyNode and addNonLayoutOnlyNodeToLayoutOnlyNode
had nearly identical implementations. They both walk thru the ancestors
looking for a nonlayout-only node and adjusting the passed in index at each
step. This introduces a new function, walkUpUntilNonLayoutOnly, which
takes care of that responsibility. This simplifies addNodeToNode
because it can now consider the type of the parent and the type of
the child independently.
**Refactoring 2: Extract addGrandchildren**
Pull out addLayoutOnlyNode's logic into a helper called
addGrandchildren. We will need to call this method in
another place later.
**Test plan (required)**
This change was tested with UIExplorer and a small test app and it's being used in my team's app.
Closes https://github.com/facebook/react-native/pull/8908
Differential Revision: D3592783
Pulled By: dmmiller
fbshipit-source-id: a513e8d381e71112ce6348bbee7d4a7c62c33619
Summary: RCTShadowText currently overrides a couple methods from RCTShadowView to reset the count of the cssNode children to 0. This diff instead moves that logic into RCTShadowView behind a configurable flag making it easier to reason about.
Reviewed By: javache
Differential Revision: D3586434
fbshipit-source-id: 4389a8119dc49e3fc4357174c87c0c69287ae385
Summary: fillCSSNode was only ever used in RCTShadowView to set the child count which is already performed in insert/remove subview calls and in RCTShadowText is was used to set the measure function which can be done in the initializer instead.
Reviewed By: majak, javache
Differential Revision: D3586418
fbshipit-source-id: de2155daf0f1702c8977bf23183a3b6a650d016b
Summary: Add some additional perf markers, and remove the usage of RCTProfileBlock as it completely breaks debugging / stepping in those blocks.
Reviewed By: majak
Differential Revision: D3579900
fbshipit-source-id: 8846dfc39b2448daa3669d5e1e8efb9096f183c5
Summary:
The `setupDevtools` for Android looks coming on [v0.30](22fbb6d46d), currently we need to run `adb reverse tcp:8097 tcp:8097`, I think get host IP (`10.0.2.2`, Genymotion: `10.0.3.2`) for Android will be better. (it can be found in `AndroidConstants` native module)
Closes https://github.com/facebook/react-native/pull/8811
Differential Revision: D3586177
Pulled By: javache
fbshipit-source-id: 3bfe04391b0fea608e4d3deab03dd376fab8727c
Summary:
Installing react-native gives a warning because of outdated version of yeoman-generator. The warning is ```npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue```.
This MR will update the yeoman-generator version to 0.21.0 to resolve this warning.
Closes https://github.com/facebook/react-native/pull/8859
Reviewed By: matryoshcow
Differential Revision: D3580087
Pulled By: bestander
fbshipit-source-id: 4daddd804679ab8e95e59cf0d0005f87d2f48e1c
Summary:
Addresses this comment: https://github.com/facebook/react-native/issues/2296#issuecomment-232446493
This pull request adds the `center` value to `ImageResizeMode`.
When set, it will center the image within its frame.
If the image is larger than its frame, the image is downscaled while maintaining its aspect ratio.
That is how the Android implementation works, too.
Sorry, don't have time to write tests. 😢
Any reviewers should make sure `RCTTargetRect` returns the correct value when:
- the image is smaller than its frame (ie: no downscaling needed)
- the image is larger than its frame (should be downscaled to avoid clipping)
Closes https://github.com/facebook/react-native/pull/8792
Differential Revision: D3586134
Pulled By: javache
fbshipit-source-id: 78fb8e5928284003437dac2c9ad264fa584f73ec
Summary:
I thought it would be useful to help clear out references to no longer used styles and also catch typos on style names to have flow error when we try to access a style that isn't defined.
Example:
```javascript
export default class AuthenticationScreen extends React.Component {
render() {
// This throws an error because `continer` is misspelled
return (
<View style={styles.continer} />
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
}
```
```javascript
export default class AuthenticationScreen extends React.Component {
render() {
// This throws an error because no fancyContainer style is defined
return (
<View style={[styles.container, styles.fancyContainer]} />
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
}
```
All credit goes to jeffmo in this tweet: https://twitter.com/lbljeffmo/status/755179096271888385
Also included in the PR is some cleanup on styles that
Closes https://github.com/facebook/react-native/pull/8876
Differential Revision: D3584983
Pulled By: yungsters
fbshipit-source-id: 0ee0e12ff3d976c137d932688e323c26690e0a52
Summary:
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.**
(You can skip this if you're fixing a typo or adding an app to the Showcase.)
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.
Make sure tests pass on both Travis and Circle CI.
**Code formatting**
Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/face
Closes https://github.com/facebook/react-native/pull/8869
Differential Revision: D3580218
Pulled By: JoelMarcey
fbshipit-source-id: 9f71825ed0a63739497ec7fa77081df0a72b6747
Summary:
Files were moved to the js/ directory so UIExplorer did not work anymore on iOS, this fixes the path.
Closes https://github.com/facebook/react-native/pull/8841
Differential Revision: D3576752
fbshipit-source-id: 921ddc2e158ee0c74dcf691a32504900c5d79e1d
Summary:
Attempt to fix https://github.com/facebook/react-native/pull/8612
We re-named `mainActivityPath` by `mainFilePath` in the `link` code, but we forgot to rename config parameters. Currently, link is broken.
- [x] `react-native link` should work for react-native 0.29+
Closes https://github.com/facebook/react-native/pull/8807
Differential Revision: D3576176
fbshipit-source-id: 60ecbd660563923696bbef1ed3b0900a7d58469f
Summary:
As per javache comments in #8734.
Also removes now useless feature detection check.
**Test plan**
Tested that rIC still works in UIExplorer example.
Closes https://github.com/facebook/react-native/pull/8795
Differential Revision: D3572566
Pulled By: javache
fbshipit-source-id: 261d13d8b03898313f8b4184d634c70f81a61b62
Summary:
For now, `PanResponder.create()` return a new object which may hold a handle
for interaction. The handle is created when the gesture starts, and it's cleared
when the gesture finishes.
However, the handle may become stale cause the owner (view) is removed or
re-rendered before the gesture finishes, which leaves InteractionManager
with handles that can never be removed.
In some cases, this blocks the app that waits for InteractionManager to
be idle and having leaky handles prevents InteractionManager from being idle
again.
The fix is to move the handle from the instance to the static variable, and
we'd clear it whenever a gesture finishes.
Reviewed By: sahrens
Differential Revision: D3550699
fbshipit-source-id: 412e9046a6cd9be34b3a7d572258008016a29f41
Summary:
This changes the JS location of the examples (2048, UIExplorer, Movies, and TicTacToe) to be set from RCTBundleURLProvider instead.
This also makes the example apps run the bundle script, which makes the build time longer.
Reviewed By: javache
Differential Revision: D3516371
fbshipit-source-id: 70e53c62feb81c067df4e2298e7d1f1458777490
Summary:
This changes the jest preprocessor so that files targetet at node.js will be run with the node-specific transform.
It also adapts tests that relied on inline requires.
Benefit: packager tests run faster now.
Reviewed By: cpojer
Differential Revision: D3562007
fbshipit-source-id: e06c86d545926a5c546458025f505dca115e7ea8
Summary: Instead of the somewhat odd concept of a "packager running predicate", just expose a class method for generating a JS bundle URL given a host, root, and options. This can be used by consumers that need custom behavior.
Reviewed By: javache
Differential Revision: D3564185
fbshipit-source-id: b1a7e66a2dada6a9eefe783b12b03fca7a330be3
Summary:
The description of `AlertIOS.prompt()` parameter `defaultValue` is wrong, correct it.
Closes https://github.com/facebook/react-native/pull/8793
Differential Revision: D3566939
fbshipit-source-id: c6378d8142c66e9f9b854f216afcf10c489ec750
Summary:
Make it more obvious that pull requests should generally target the `master` branch. Provide visible clarity in both the `CONTRIBUTING.md` and the actual pull request template.
Closes https://github.com/facebook/react-native/pull/8748
Differential Revision: D3566827
fbshipit-source-id: 6326f18b93594e928b1c4e0d09a739a8ccedaa62
Summary:
I went through and checked what React Native exports that we don't have any autogen docs for, and added the missing stuff into the whitelist. The extra docs seem useful.
Still not reference-documented because docgen chokes:
AppStateIOS
ART
Keyboard
LinkingIOS
Platform
RecyclerViewBackedScrollView
Touchable
UIManager
I also fixed up a bit of alphabetical order
Closes https://github.com/facebook/react-native/pull/8791
Differential Revision: D3566466
Pulled By: lacker
fbshipit-source-id: 0d7c1f242c96bf9afe5f8b54ea7e0b6891effa4b
Summary:
I updated the showcase instructions during the docdown but after getting some more requests I think these should be more specific.
Two things in particular. It isn't very useful to link to some generic page on the company's own website, especially if the company has zero news coverage. Secondly, this content should be in English because that's what most readers know.
So I just updated the instructions to say this.
Closes https://github.com/facebook/react-native/pull/8788
Differential Revision: D3564132
Pulled By: JoelMarcey
fbshipit-source-id: d75adda0d2161e795436d0075b814a40c69383a3
Summary:
The link to source of NativeMethodsMixin.js and ReactNativeBaseComponent.js in direct manipulation page is broken, fix it.
Closes https://github.com/facebook/react-native/pull/8774
Differential Revision: D3564954
Pulled By: JoelMarcey
fbshipit-source-id: 315fdbc5186b3f13e71ec84c9e683a7caaef1cfd