Permalink
Switch branches/tags
Commits on Oct 23, 2018
  1. Refactor

    RSNara authored and facebook-github-bot committed Oct 23, 2018
    Summary: I did a bit more refactoring to NetworkOverlay.
    
    Reviewed By: TheSavior
    
    Differential Revision: D10476158
    
    fbshipit-source-id: da26251f8dfd12dd592da3ae5367efa37ec07669
Commits on Oct 19, 2018
  1. Use "Legacy Build System"

    RSNara authored and facebook-github-bot committed Oct 19, 2018
    Summary:
    React Native needs to be updated to support XCode 10 (GitHub issue: [19573](https://github.com/facebook/react-nåative/issues/19573)). Until we make that change, our CI needs to rely on the legacy build system in XCode 10 to build `RNTester`, as opposed to the new build system made default in XCode 10. This diff uses the `-UseModernBuildSystem=NO` `xcodebuild` flag to enforce that requirement.
    
    **Note:** I did a search within `react-native-github/scripts` for `xcodebuild` and passed in the `-UseModernBuildSystem=NO` flag. I figured that every time we use `xcodebuild`, we should enforce the build system.
    
    � This should hopefully fix the `react-native-oss-ios` test.
    
    Reviewed By: hramos
    
    Differential Revision: D10456139
    
    fbshipit-source-id: 795f32b3ceba6a5a24ab6ccbf4f5160d42746801
Commits on Oct 18, 2018
  1. Additional Flow changes to files that use this component

    RSNara authored and facebook-github-bot committed Oct 18, 2018
    Summary:
    This diff includes:
    1. Touchups to the `CameraRollView` typings.
    2. Typings for `CameraRollViewExmaple`.
    3. Flow fixes for internal callsites.
    
    Reviewed By: yungsters
    
    Differential Revision: D10362686
    
    fbshipit-source-id: 48bf3fba0566e9c5c062aee3342d669f6c143d9f
  2. Remove createReactClass from CameraRollView

    RSNara authored and facebook-github-bot committed Oct 18, 2018
    Summary:
    Related to #21581
    
    Remove createReactClass from CameraRollView.
    
    Reviewed By: TheSavior
    
    Differential Revision: D10351036
    
    fbshipit-source-id: 394545ac143917e3b483dfc6186e5f45732c602a
  3. Fix flow types in file

    RSNara authored and facebook-github-bot committed Oct 18, 2018
    Summary:
    This diff just builds on top of the open source PR:
    1. I add a bunch of extra flow typings to the file.
    2. I refactor some of the JavaScript code.
    
    Reviewed By: TheSavior
    
    Differential Revision: D10351693
    
    fbshipit-source-id: a6d828518150c11d66a179c5c3fe835cc80a8dfb
Commits on Oct 16, 2018
  1. Remove createReactClass from LayoutEventsTest

    RSNara authored and facebook-github-bot committed Oct 16, 2018
    Summary:
    Related to #21581
    
    Remove createReactClass from LayoutEventsTest and refactor a little bit.
    
    Reviewed By: TheSavior
    
    Differential Revision: D10345794
    
    fbshipit-source-id: 40e42f6e9afece5ddf527f91927e75cb1669b696
Commits on Oct 12, 2018
  1. Move createStrictShapeTypeChecker to deprecated

    RSNara authored and facebook-github-bot committed Oct 12, 2018
    Summary:
    Related to #21342
    
    Move createStrictShapeTypeChecker to DeprecatedCreateStrictShapeTypeChecker.
    
    Reviewed By: hramos
    
    Differential Revision: D10341526
    
    fbshipit-source-id: 30e7f22ae574af620ead9c1a0766f00611b282b6
  2. Fix crashes on invalid regex

    RSNara authored and facebook-github-bot committed Oct 12, 2018
    Summary:
    **Problem:**
    When you type an invalid regex into the input field of the RNTester app, it crashes. What's worse is that it remembers the input string so refreshing the view doesn't get rid of the error. Observe:
    https://pxl.cl/jdm3
    
    Reviewed By: yungsters
    
    Differential Revision: D10349249
    
    fbshipit-source-id: aab5977bd47271e9a4ff6202c93b47550da778d2
Commits on Oct 1, 2018
  1. Make Flow types more strict

    RSNara authored and facebook-github-bot committed Oct 1, 2018
    Summary: Many of the optional types from the PR could have been made non-optional. I just made the change because it was simple enough to make and verify.
    
    Reviewed By: TheSavior
    
    Differential Revision: D10131969
    
    fbshipit-source-id: b84693b5549708d7948fe3fd54295bc80be93790
Commits on Sep 29, 2018
  1. Renames of ImageSource, ImageStyle, and TextProps propTypes

    RSNara authored and facebook-github-bot committed Sep 29, 2018
    Reviewed By: TheSavior
    
    Differential Revision: D10101195
    
    fbshipit-source-id: 5c8cde81f92cac87b6cfe3fc1a36c78e4862c5ff
Commits on Sep 27, 2018
  1. Fix internal flow typings

    RSNara authored and facebook-github-bot committed Sep 27, 2018
    Summary: Fixing internal flow typings so that D10085505 can land.
    
    Reviewed By: TheSavior
    
    Differential Revision: D10090690
    
    fbshipit-source-id: cace32332e85e9e9be243bcc49fba471ae1d2864
  2. Fix internal flow problems

    RSNara authored and facebook-github-bot committed Sep 27, 2018
    Summary: D10013265 introduces flow types for `PanResponder`. This diff fixes the facebook-internal flow errors that surface as a result.
    
    Reviewed By: TheSavior
    
    Differential Revision: D10035046
    
    fbshipit-source-id: fbba3d61e68851dda2da4f8e98238e0fdb35a27e
Commits on Sep 25, 2018
  1. Fix RNTester build failure in CI (#21304)

    RSNara authored and facebook-github-bot committed Sep 25, 2018
    Summary:
    Pull Request resolved: #21304
    
    If you cd into `~/fbsource/xplat/js/react-native-github` and run:
    
    ```
    xcodebuild -project RNTester/RNTester.xcodeproj -scheme RNTester -configuration Release -sdk iphonesimulator -derivedDataPath RNTester/build -quiet
    ```
    
    The command fails with the following error:
    ```
    ➜  react-native-github xcodebuild -project RNTester/RNTester.xcodeproj -scheme RNTester -configuration Release -sdk iphonesimulator -derivedDataPath RNTester/build -quiet
    === BUILD TARGET RNTester OF PROJECT RNTester WITH CONFIGURATION Release ===
    + DEST=/Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app
    + [[ Release = *Debug* ]]
    + [[ -n '' ]]
    + case "$CONFIGURATION" in
    + DEV=false
    +++ dirname /Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/../scripts/react-native-xcode.sh
    ++ cd /Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/../scripts/..
    ++ pwd
    + REACT_NATIVE_DIR=/Users/ramanpreet/fbsource/xplat/js/react-native-github
    + cd /Users/ramanpreet/fbsource/xplat/js/react-native-github/../..
    + '[' -z '' ']'
    + export NVM_DIR=/Users/ramanpreet/.nvm
    + NVM_DIR=/Users/ramanpreet/.nvm
    + [[ -s index.ios.js ]]
    + ENTRY_FILE=RNTester/js/RNTesterApp.ios.js
    + [[ -s /Users/ramanpreet/.nvm/nvm.sh ]]
    ++ command -v brew
    + [[ -x /usr/local/bin/brew ]]
    ++ brew --prefix nvm
    + [[ -s /usr/local/Cellar/nvm/0.33.11/nvm.sh ]]
    + [[ -x /Users/ramanpreet/.nodenv/bin/nodenv ]]
    ++ command -v brew
    + [[ -x /usr/local/bin/brew ]]
    ++ brew --prefix nodenv
    + [[ -x /usr/local/Cellar/nodenv/1.1.2/bin/nodenv ]]
    + '[' -z node ']'
    + '[' -z '' ']'
    + export CLI_PATH=/Users/ramanpreet/fbsource/xplat/js/react-native-github/local-cli/cli.js
    + CLI_PATH=/Users/ramanpreet/fbsource/xplat/js/react-native-github/local-cli/cli.js
    + '[' -z '' ']'
    + BUNDLE_COMMAND=bundle
    + [[ -z '' ]]
    + CONFIG_ARG=
    + type node
    + BUNDLE_FILE=/Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app/main.jsbundle
    + node /Users/ramanpreet/fbsource/xplat/js/react-native-github/local-cli/cli.js bundle --entry-file RNTester/js/RNTesterApp.ios.js --platform ios --dev false --reset-cache --bundle-output /Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app/main.jsbundle --assets-dest /Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app
    warning: the transform cache was reset.
    Loading dependency graph, done.
    
    Unable to resolve module `babel/runtime/helpers/classCallCheck` from `/Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/js/RNTesterApp.ios.js`: Module `babel/runtime/helpers/classCallCheck` does not exist in the Haste module map
    
    This might be related to #4968
    To resolve try the following:
      1. Clear watchman watches: `watchman watch-del-all`.
      2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
      3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
      4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.
    
    Error: Unable to resolve module `babel/runtime/helpers/classCallCheck` from `/Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/js/RNTesterApp.ios.js`: Module `babel/runtime/helpers/classCallCheck` does not exist in the Haste module map
    
    This might be related to #4968
    To resolve try the following:
      1. Clear watchman watches: `watchman watch-del-all`.
      2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
      3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
      4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.
        at ModuleResolver.resolveDependency (/Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:209:1301)
        at ResolutionRequest.resolveDependency (/Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:83:16)
        at DependencyGraph.resolveDependency (/Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/node-haste/DependencyGraph.js:238:485)
        at Object.resolve (/Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/lib/transformHelpers.js:180:25)
        at dependencies.map.result (/Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/DeltaBundler/traverseDependencies.js:311:29)
        at Array.map (<anonymous>)
        at resolveDependencies (/Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/DeltaBundler/traverseDependencies.js:307:16)
        at /Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/DeltaBundler/traverseDependencies.js:164:33
        at Generator.next (<anonymous>)
        at step (/Users/ramanpreet/fbsource/xplat/js/react-native-github/node_modules/metro/src/DeltaBundler/traverseDependencies.js:266:307)
    
    + [[ false != true ]]
    + [[ ! -f /Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app/main.jsbundle ]]
    + echo 'error: File /Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app/main.jsbundle does not exist. This must be a bug with'
    error: File /Users/ramanpreet/fbsource/xplat/js/react-native-github/RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app/main.jsbundle does not exist. This must be a bug with
    + echo 'React Native, please report it here: https://github.com/facebook/react-native/issues'
    React Native, please report it here: https://github.com/facebook/react-native/issues
    + exit 2
    ** BUILD FAILED **
    ```
    
    Basically, we're missing the `babel/runtime/helpers/classCallCheck` function. Installing `babel/runtime` fixed the issue.
    
    Reviewed By: mjesun
    
    Differential Revision: D10021475
    
    fbshipit-source-id: 3709bedb2fdaf552fa8c620c3515a5bc68deb771
Commits on Sep 17, 2018
  1. Fix RNTester build

    RSNara authored and facebook-github-bot committed Sep 17, 2018
    Summary: WKWebViews aren't available on Apple TV. When I landed [the WKWebView stack](https://our.intern.facebook.com/intern/diff/D9362001/), I inadvertently broke the RNTester osTV build. This diff fixes it.
    
    Reviewed By: shergin
    
    Differential Revision: D9844322
    
    fbshipit-source-id: 6de0fbfd13aba38cca7530c9fb486c7cde0afc82
Commits on Sep 10, 2018
  1. Implement onPress for Virtual Text nodes

    RSNara authored and facebook-github-bot committed Sep 10, 2018
    Summary:
    When text nodes are nested, as below, `onPress` handlers need to be correctly invoked:
    ```
    render() {
      return (
        <Text onPress={() => console.warn('hi')}>
          hi
          <Text onPress={() => console.warn('ramanpreet')}>ramanpreet</Text>
        </Text>
      );
    }
    ```
    
    In the above example, clicking on "hi" should warn "hi", and clicking on "ramanpreet" should warn "ramanpreet". This diff implements that behaviour.
    
    Reviewed By: shergin
    
    Differential Revision: D9696905
    
    fbshipit-source-id: 2daf24e76c3b3c37aa36cd1540e54876a367faf7
  2. Setup event emitters for `TextShdowNode` and `ParagraphShadowNode`

    RSNara authored and facebook-github-bot committed Sep 10, 2018
    Summary:
    This diff includes two changes:
    1. `TextShadowNode` represents virtual texts. For the time being, virtual text nodes only need touch capabilities so that they can handle `onPress` events for their children. Therefore, we should set the `TextShadowNode`'s `EventEmitterT` to `TouchEventEmitter`.
    2. Since `ParagraphShadowNode` extends an instance of the `ConcreteViewShadowNode` template, it automatically uses the `ViewEventEmitter` if no event emitter is specified. I think it's better to make the event emitter explicitly specified. So, I've included that change in this diff.
    
    Reviewed By: shergin
    
    Differential Revision: D9696906
    
    fbshipit-source-id: ac053ffdde4c2fbc6351f177c07a2ada4445cbb8
  3. Modify `RCTTouchableComponentViewProtocol` to get touch event emitter…

    RSNara authored and facebook-github-bot committed Sep 10, 2018
    … at point
    
    Summary:
    This diff includes two changes:
    1. Even though `RCTViewComponentView` conforms to `RCTTouchableComponentViewProtocol`, it never implemented this protocol. This diff makes the correction.
    2. Make the necessary changes to `RCTSurfaceTouchHandler` required by the changes in `RCTTouchableComponentViewProtocol`. This means modifying the `ActiveTouch` struct to hold `SharedTouchEventEmitter`s. It also means passing in the touch point to the `componentView`'s `touchEventEmitterAtPoint` method.
    
    Reviewed By: shergin
    
    Differential Revision: D9696909
    
    fbshipit-source-id: 3d4a833f7dbae6d0238a0807eb2220250ccbae3d
  4. Extract TouchEventEmitter from ViewEventEmitter

    RSNara authored and facebook-github-bot committed Sep 10, 2018
    Summary: In the future, we may want some components (like Virtual Text) to handle only touch events. Therefore, I've extracted `TouchEventEmitter` from `ViewEventEmitter`.
    
    Reviewed By: shergin
    
    Differential Revision: D9696903
    
    fbshipit-source-id: f6acc90d8ff53b5e6badaa472a5e099fb7cf03ff
  5. Remember ShadowNode of RawText's parent in attribute string

    RSNara authored and facebook-github-bot committed Sep 10, 2018
    Summary:
    When a user clicks on some text, `RCTSurfaceTouchHandler` will call into a method on `RCTParagraphComponentView`. That method (i.e: `touchEventEmitter`) would be responsible for identifying the closest ancestral `<Text/>` component to which we should dispatch the `onPress` event, given the point where the user clicked. To answer this query, we'll use a data structure called `UIAttributedString`.
    
    This data structure represents a string, and a corresponding mapping from sequences of its characters to some arbitrary data. In this attributed string, we'll map sequences of characters to their closest ancestral `ParagraphShadowNode` or `TextShadowNode`. That way, when we get a click event on `RCTParagraphComponentView`, we can just look at the character that was clicked, and use that information to do a lookup in the attributed string to find the shadow node who's EventEmitter is responsible for processing the click event.
    
    Reviewed By: shergin
    
    Differential Revision: D9696904
    
    fbshipit-source-id: a199649981ad271afa85414ce4c3f056851348be
  6. Refactor BaseTextShadowNode::getAttributedString to recurse on Shared…

    RSNara authored and facebook-github-bot committed Sep 10, 2018
    …ShadowNode
    
    Summary: Previously, `BaseTextShadowNode::getAttributedString` used to recurse on a list of `SharedShadowNode`s (i.e: the children). In the `RawText` base case of this recursion, we'll need to record the parent of the current `RawText` (so that we can dispatch the `onPress` event to it). Therefore, we need to start recursing using the `SharedShadowNode` itself, and not its children.
    
    Reviewed By: shergin
    
    Differential Revision: D9696908
    
    fbshipit-source-id: dbf3f9c21a7ae4de421d0355c4e5900b3947dc2a
Commits on Aug 16, 2018
  1. Gate usage of WebKit 10.0 APIs

    RSNara authored and facebook-github-bot committed Aug 16, 2018
    Reviewed By: mmmulani
    
    Differential Revision: D9362001
    
    fbshipit-source-id: 62cde6bcc1f190c168973b173ce55c029328bfbf
  2. Dynamically load WebKit

    RSNara authored and facebook-github-bot committed Aug 16, 2018
    Summary:
    @public
    
    We can't dynamically link `WebKit` because doing so will impact cold start of all our Apps.
    
    This diff includes a few changes:
     1. Weakly link the `WebKit` framework in the `ReactInternal` library, so that the compiler doesn't die when it encounters a WebKit symbol.
     2. Undo dynamic linking of WebKit in Catalyst.
     3. Undo dynamic linking of WebKit in AdsManager
     4. Before the first `WKWebView` is instantiated, dynamically load the `WebKit` framework.
    
    The end result of these changes is that WebKit will be loaded only when it's going to be used.
    
    Reviewed By: mmmulani
    
    Differential Revision: D6564328
    
    fbshipit-source-id: a45a44e774d0c61c1fb578a6fa3d16bb08f68ac9
  3. Warn when 'scalesPageToFit' prop is used

    RSNara authored and facebook-github-bot committed Aug 16, 2018
    Summary:
    @public
    
    The `WKWebView` class doesn't expose a `scalesPageToFit` property, unlike `UIWebView`. Therefore, the `scalesPageToFit` RN prop is be a bit tricky to implement with `WKWebView`.
    
    For the time being, this diff adds warnings to `<WebView/>` whenever `useWebKit={true}` and `scalesPageToFit` is set. I've also updated the documentation to reflect that we don't support `scalesPageToFit` prop with the new implementation of `<WebView/>`.
    
    Reviewed By: shergin
    
    Differential Revision: D6429271
    
    fbshipit-source-id: adf858cb67ba221c70d6d6f1bd6cff505e90c365
  4. Move WKWebView into WebView.ios.js

    RSNara authored and facebook-github-bot committed Aug 16, 2018
    Summary:
    @public
    
    This diff adds the `useWebKit` property to the `<WebView/>` React Native component. On iOS, when this property is true, we use `RCTWKWebView`. Otherwise, we use `RCTWebView`. On Android, this property does nothing.
    
    Reviewed By: shergin
    
    Differential Revision: D6423374
    
    fbshipit-source-id: 006bfaaf12984fac0174c0b5bb897c009c026cd0
  5. Implement 'automaticallyAdjustContentInsets' and 'contentInset' props

    RSNara authored and facebook-github-bot committed Aug 16, 2018
    Summary:
    @public
    
    This diff introduces two new props:
    1. **automaticallyAdjustContentInsets**: Controls whether to adjust the content inset for web views that are placed behind a navigation bar, tab bar, or toolbar. The default value is true.
    1. **contentInset**: The amount by which the web view content is inset from the edges of the scroll view. Defaults to {top: 0, left: 0, bottom: 0, right: 0}.
    
    **Note:** There're some inconsistencies between how `UIWebView` and `WKWebView` render web pages with respect to the `contentInset` property. These two videos illustrate the problem:
    
    **UIWebView**
    [[ P58674349 | Playground.js ]]
    https://pxl.cl/9R9V
    
    **WKWebView**
    [[ P58674348 | Playground.js ]]
    https://pxl.cl/9R9W
    
    Here's a stack overflow answer describing the problem: https://stackoverflow.com/a/35472603.
    
    Reviewed By: shergin
    
    Differential Revision: D6432181
    
    fbshipit-source-id: aee6dac65d28435381ebec90519474b4707c7bab
  6. Implement 'backgroundColor' style

    RSNara authored and facebook-github-bot committed Aug 16, 2018
    Summary:
    @public
    
    This diff implements background colors for the `RCTWKWebView` component by proxying the background color prop to the underlying `WKWebView` and its underlying `UIScrollView`.
    
    There's few differences between `backgroundColor` in `RCTWebView` and `RCTWKWebView` implementations:
    1. With `UIWebView,` the background color gets applied after the page loads. With `WKWebView`, this isn't necessarily true. This results in a white flicker on solid backgrounds because sometimes, the background color is set before the page loads. This video illustrates the problem: https://our.intern.facebook.com/intern/px/p/9QBH
    1. As far as I can tell, `WKWebView` doesn't handle transparent backgrounds correctly. Either that, or I could be setting the background color incorrectly. I set the background color to `rgba(1, 1, 1, 0.5)` and recorded how both `RCTWebView` and `RCTWKWebView` render. These two videos indicate the differences:
    **RCTWebView: Lighter background**
    https://pxl.cl/9R13
    **RCTWKWebView: Darker background**
    https://pxl.cl/9R1b
    
    I tried to replicate this on the web. According to [[ https://our.intern.facebook.com/intern/fiddle/zCHu/ | this fiddle ]], `RCTWebView` is correct. Clearly, RCTWKWebView is rendering transparent backgrounds a bit darker than necessary. This doesn't seem simple to debug, so I've created a task to document this work: T23815343. I'll get to it eventually.
    
    Reviewed By: shergin
    
    Differential Revision: D6398209
    
    fbshipit-source-id: 1812cb68133bc18a3278f6b328d7b085362528b0
  7. Implement 'dataDetectorTypes' prop

    RSNara authored and facebook-github-bot committed Aug 16, 2018
    Summary:
    When text is rendered in `WKWebView` WebKit component, the component itself can detect things like phone numbers, flight numbers, links, etc. and render them with additional functionality.
    
    For example, when the text `apple.com` is detected, if the `link` data detector type is enabled, the web view will actually render a link that takes the user to the Apple home page.
    
    In this diff, I implement the `dataDetectorTypes` prop. The data detector types supported are:
    1. phoneNumber
    1. link
    1. address
    1. calendarEvent
    1. trackingNumber
    1. flightNumber
    1. lookupSuggestion
    
    These enums are documented in the [[ https://developer.apple.com/documentation/webkit/wkdatadetectortypes | WKDataDetectorTypes docs ]].
    
    Reviewed By: shergin
    
    Differential Revision: D6392546
    
    fbshipit-source-id: 4dd373f0ac52f898163cd959eeef6672e55b42a6
  8. Implement 'mediaPlaybackRequiresUserAction' prop

    RSNara authored and facebook-github-bot committed Aug 16, 2018
    Summary:
    HTML video elements can have the `autoplay` attribute, which forces them to play automatically whenever they load on the page.
    
    In this diff, I introduce a new prop `mediaPlaybackRequiresUserAction`, which allows us to control whether video or audio element autoplays even when `autoplay` is set.
    
    Reviewed By: shergin
    
    Differential Revision: D6382256
    
    fbshipit-source-id: 617508653910d600bc43f7f68c6dfd17ab1b6dd8
  9. Implement 'allowsInlineMediaPlayback` prop

    RSNara authored and facebook-github-bot committed Aug 16, 2018
    Summary:
    For iPhones with small screen sizes (e.g: iPhone 5s), inside the `<WKWebView/>` component, videos will play in fullscreen mode. In this diff, I introduce a prop called `allowsInlineMediaPlayback` that when set to true, will allow videos to play inline.
    
    **Note:** For videos to play inline, the HTML video element must also have a `playsinline` attribute on it.
    
    Reviewed By: shergin
    
    Differential Revision: D6379770
    
    fbshipit-source-id: a0130720ffede6c24a90cad0c97a75b657d77017
  10. Implement 'onShouldStartLoadWithRequest' prop

    RSNara authored and facebook-github-bot committed Aug 16, 2018
    Summary:
    @public
    
    This diff introduces the native backend for a new WKWebView prop: `onShouldStartLoadWithRequest`.
    
    In the final component, the behaviour will be as follows: Whenever the user navigates around in the web view, we call `onShouldStartLoadWithRequest` with the navigation event. If `onShouldStartLoadWithRequest` returns `true`, we continue the navigation. Otherwise, we abort it.
    
    Reviewed By: shergin
    
    Differential Revision: D6370317
    
    fbshipit-source-id: e3cdd7e2a755125aebdb6df67e7b39116228bdfb
  11. Implement 'reload' and 'stopLoading' methods

    RSNara authored and facebook-github-bot committed Aug 16, 2018
    Summary:
    @public
    
    This diff implements the `reload` and `stopLoading` methods for `WKWebView`. Their functionality is self-explanatory.
    
    Reviewed By: shergin
    
    Differential Revision: D6369292
    
    fbshipit-source-id: ba176f4406e0a67606406f36dd66f7615f4796c3
  12. Implement 'goForward' and 'goBack' methods

    RSNara authored and facebook-github-bot committed Aug 16, 2018
    Summary:
    @public
    
    This diff implements the `goForward` and `goBack` methods on `WKWebView`.
    1. `goForward` moves the web view one screen forward in the browser history.
    1. `goBack` moves the web view one screen back in the browser history.
    
    Reviewed By: shergin
    
    Differential Revision: D6367495
    
    fbshipit-source-id: e100ca00e92a6eaa30d2af1af642ba79a9c9feae
  13. Implement 'injectJavaScript' method

    RSNara authored and facebook-github-bot committed Aug 16, 2018
    Summary:
    @public
    
    This diff introduces a method called `injectJavaScript(script)` on the React Native `<WKWebView/>` component. When called with a string, it evaluates that string as JavaScript within the web view.
    
    Reviewed By: shergin
    
    Differential Revision: D6367445
    
    fbshipit-source-id: f68afeff42535dc991747f96a63f3c956faf13d3
  14. Implement 'decelerationRate' prop

    RSNara authored and facebook-github-bot committed Aug 16, 2018
    Summary:
    @public
    
    The content that renders within the `WKWebView` instance actually renders inside a `UIScrollView`. On that scroll view, we can adjust the `decelerationRate`, which controls how fast the view stops scrolling after the user lets go while scrolling.
    
    In this diff, I implemented the `decelerationRate` prop for `WKWebView`, which gets forwarded to the `UIScrollView` instance underlying the web view.
    
    **Note:** Even though we accept a floating point value for the deceleration rate, the native `UIScrollView` component only allows two inputs:
    1. `UIScrollViewDecelerationRateNormal`: 0.998
    2. `UIScrollViewDecelerationRateFast`: 0.99
    
    As far as I know, it seems to just round up to the nearest valid `CGFloat` (or down if number > 0.998), for any invalid numbers.
    
    Reviewed By: mmmulani
    
    Differential Revision: D6307262
    
    fbshipit-source-id: 98c4395702415aa36519f9e9bd84f043be3a5881
  15. Implement 'scrollEnabled' prop

    RSNara authored and facebook-github-bot committed Aug 16, 2018
    Summary:
    @public
    
    The content of `WKWebView` renders within a scrollview. In this diff, I'm introducing the prop `scrollEnabled` to allow developers to control whether scrolling is enabled within the scroll view, or not.
    
    Reviewed By: mmmulani
    
    Differential Revision: D6307001
    
    fbshipit-source-id: 5a199c6c3b8535e45a5a3cb6041e822bb7af2362