From 4b479d6d3f94f803e61361bdfac55e3b7c1521bc Mon Sep 17 00:00:00 2001 From: Joshua Smith <3375071+josmithua@users.noreply.github.com> Date: Wed, 20 Jan 2021 13:49:11 -0400 Subject: [PATCH] chore(docs): update repo references with new repo location (#1657) Co-authored-by: Thibault Malbranche --- .all-contributorsrc | 2 +- README.md | 26 +++++++++++++------------- apple/RNCWebView.m | 4 ++-- docs/Custom-Android.md | 8 ++++---- docs/Guide.md | 17 +++++++---------- docs/README.portuguese.md | 22 +++++++++++----------- package.json | 4 ++-- react-native-webview.podspec | 2 +- 8 files changed, 41 insertions(+), 44 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 4fc330f..a5f00ab 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,6 +1,6 @@ { "projectName": "react-native-webview", - "projectOwner": "react-native-community", + "projectOwner": "react-native-webview", "repoType": "github", "repoHost": "https://github.com", "files": [ diff --git a/README.md b/README.md index 3090d04..d389851 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # React Native WebView - a Modern, Cross-Platform WebView for React Native -[![star this repo](http://githubbadges.com/star.svg?user=react-native-community&repo=react-native-webview&style=flat)](https://github.com/react-native-community/react-native-webview) +[![star this repo](http://githubbadges.com/star.svg?user=react-native-webview&repo=react-native-webview&style=flat)](https://github.com/react-native-webview/react-native-webview) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors) -[![Known Vulnerabilities](https://snyk.io/test/github/react-native-community/react-native-webview/badge.svg?style=flat-square)](https://snyk.io/test/github/react-native-community/react-native-webview) +[![Known Vulnerabilities](https://snyk.io/test/github/react-native-webview/react-native-webview/badge.svg?style=flat-square)](https://snyk.io/test/github/react-native-webview/react-native-webview) [![NPM Version](https://img.shields.io/npm/v/react-native-webview.svg?style=flat-square)](https://www.npmjs.com/package/react-native-webview) [![Lean Core Extracted](https://img.shields.io/badge/Lean%20Core-Extracted-brightgreen.svg?style=flat-square)][lean-core-issue] @@ -38,19 +38,19 @@ This project follows [semantic versioning](https://semver.org/). We do not hesit Current Version: ![version](https://img.shields.io/npm/v/react-native-webview.svg) - [11.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v11.0.0) - Android setSupportMultipleWindows. -- [10.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v10.0.0) - Android Gradle plugin is only required when opening the project stand-alone -- [9.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v9.0.0) - props updates to injectedJavaScript are no longer immutable. -- [8.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v8.0.0) - onNavigationStateChange now triggers with hash url changes -- [7.0.1](https://github.com/react-native-community/react-native-webview/releases/tag/v7.0.1) - Removed UIWebView -- [6.0.**2**](https://github.com/react-native-community/react-native-webview/releases/tag/v6.0.2) - Update to AndroidX. Make sure to enable it in your project's `android/gradle.properties`. See [Getting Started Guide](docs/Getting-Started.md). -- [5.0.**1**](https://github.com/react-native-community/react-native-webview/releases/tag/v5.0.0) - Refactored the old postMessage implementation for communication from webview to native. -- [4.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v4.0.0) - Added cache (enabled by default). -- [3.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v3.0.0) - WKWebview: Add shared process pool so cookies and localStorage are shared across webviews in iOS (enabled by default). -- [2.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/2.0.0) - First release this is a replica of the core webview component +- [10.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v10.0.0) - Android Gradle plugin is only required when opening the project stand-alone +- [9.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v9.0.0) - props updates to injectedJavaScript are no longer immutable. +- [8.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v8.0.0) - onNavigationStateChange now triggers with hash url changes +- [7.0.1](https://github.com/react-native-webview/react-native-webview/releases/tag/v7.0.1) - Removed UIWebView +- [6.0.**2**](https://github.com/react-native-webview/react-native-webview/releases/tag/v6.0.2) - Update to AndroidX. Make sure to enable it in your project's `android/gradle.properties`. See [Getting Started Guide](docs/Getting-Started.md). +- [5.0.**1**](https://github.com/react-native-webview/react-native-webview/releases/tag/v5.0.0) - Refactored the old postMessage implementation for communication from webview to native. +- [4.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v4.0.0) - Added cache (enabled by default). +- [3.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v3.0.0) - WKWebview: Add shared process pool so cookies and localStorage are shared across webviews in iOS (enabled by default). +- [2.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v2.0.0) - First release this is a replica of the core webview component **Upcoming:** -- this.webView.postMessage() removal (never documented and less flexible than injectJavascript) -> [how to migrate](https://github.com/react-native-community/react-native-webview/issues/809) +- this.webView.postMessage() removal (never documented and less flexible than injectJavascript) -> [how to migrate](https://github.com/react-native-webview/react-native-webview/issues/809) - Kotlin rewrite - Maybe Swift rewrite @@ -79,7 +79,7 @@ For more, read the [API Reference](./docs/Reference.md) and [Guide](./docs/Guide ## Contributing -See [Contributing.md](https://github.com/react-native-community/react-native-webview/blob/master/docs/Contributing.md) +See [Contributing.md](https://github.com/react-native-webview/react-native-webview/blob/master/docs/Contributing.md) ## Contributors diff --git a/apple/RNCWebView.m b/apple/RNCWebView.m index 17998f8..0f80776 100644 --- a/apple/RNCWebView.m +++ b/apple/RNCWebView.m @@ -99,7 +99,7 @@ static NSDictionary* customCertificatesForHost; BOOL _savedKeyboardDisplayRequiresUserAction; // Workaround for StatusBar appearance bug for iOS 12 - // https://github.com/react-native-community/react-native-webview/issues/62 + // https://github.com/react-native-webview/react-native-webview/issues/62 BOOL _isFullScreenVideoOpen; #if !TARGET_OS_OSX UIStatusBarStyle _savedStatusBarStyle; @@ -165,7 +165,7 @@ static NSDictionary* customCertificatesForHost; name:UIKeyboardWillShowNotification object:nil]; // Workaround for StatusBar appearance bug for iOS 12 - // https://github.com/react-native-community/react-native-webview/issues/62 + // https://github.com/react-native-webview/react-native-webview/issues/62 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showFullScreenVideoStatusBars) name:UIWindowDidBecomeVisibleNotification diff --git a/docs/Custom-Android.md b/docs/Custom-Android.md index ba4edbe..39ccccf 100644 --- a/docs/Custom-Android.md +++ b/docs/Custom-Android.md @@ -1,6 +1,6 @@ While the built-in web view has a lot of features, it is not possible to handle every use-case in React Native. You can, however, extend the web view with native code without forking React Native or duplicating all the existing web view code. -Before you do this, you should be familiar with the concepts in [native UI components](https://reactnative.dev/docs/native-components-android). You should also familiarise yourself with the [native code for web views](https://github.com/react-native-community/react-native-webview/blob/master/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java), as you will have to use this as a reference when implementing new features—although a deep understanding is not required. +Before you do this, you should be familiar with the concepts in [native UI components](https://reactnative.dev/docs/native-components-android). You should also familiarise yourself with the [native code for web views](https://github.com/react-native-webview/react-native-webview/blob/master/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java), as you will have to use this as a reference when implementing new features—although a deep understanding is not required. ## Native Code @@ -105,7 +105,7 @@ public class NavigationCompletedEvent extends Event { You can trigger the event in your web view client. You can hook existing handlers if your events are based on them. -You should refer to [RNCWebViewManager.java](https://github.com/react-native-community/react-native-webview/blob/master/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java) in the react-native-webview codebase to see what handlers are available and how they are implemented. You can extend any methods here to provide extra functionality. +You should refer to [RNCWebViewManager.java](https://github.com/react-native-webview/react-native-webview/blob/master/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java) in the react-native-webview codebase to see what handlers are available and how they are implemented. You can extend any methods here to provide extra functionality. ```java public class NavigationCompletedEvent extends Event { @@ -199,7 +199,7 @@ If you want to add custom props to your native component, you can use `nativeCon For events, the event handler must always be set to a function. This means it isn't safe to use the event handler directly from `this.props`, as the user might not have provided one. The standard approach is to create a event handler in your class, and then invoking the event handler given in `this.props` if it exists. -If you are unsure how something should be implemented from the JS side, look at [WebView.android.js](https://github.com/react-native-community/react-native-webview/blob/master/js/WebView.android.js) in the React Native source. +If you are unsure how something should be implemented from the JS side, look at [WebView.android.js](https://github.com/react-native-webview/react-native-webview/blob/master/js/WebView.android.js) in the React Native source. ```javascript export default class CustomWebView extends Component { @@ -213,7 +213,7 @@ export default class CustomWebView extends Component { finalUrl: 'about:blank', }; - _onNavigationCompleted = event => { + _onNavigationCompleted = (event) => { const { onNavigationCompleted } = this.props; onNavigationCompleted && onNavigationCompleted(event); }; diff --git a/docs/Guide.md b/docs/Guide.md index 134defe..9fa6493 100644 --- a/docs/Guide.md +++ b/docs/Guide.md @@ -55,7 +55,7 @@ class MyWeb extends Component { ### Loading local HTML files -Note: This is currently not working as discussed in [#428](https://github.com/react-native-community/react-native-webview/issues/428) and [#518](https://github.com/react-native-community/react-native-webview/issues/518). Possible workarounds include bundling all assets with webpack or similar, or running a [local webserver](https://github.com/futurepress/react-native-static-server). +Note: This is currently not working as discussed in [#428](https://github.com/react-native-webview/react-native-webview/issues/428) and [#518](https://github.com/react-native-webview/react-native-webview/issues/518). Possible workarounds include bundling all assets with webpack or similar, or running a [local webserver](https://github.com/futurepress/react-native-static-server).
Show non-working method @@ -302,8 +302,7 @@ export default class App extends Component { {}} injectedJavaScript={runFirst} @@ -322,7 +321,7 @@ By setting `injectedJavaScriptForMainFrameOnly: false`, the JavaScript injection _Under the hood_ -> On iOS, ~~`injectedJavaScript` runs a method on WebView called `evaluateJavaScript:completionHandler:`~~ – this is no longer true as of version `8.2.0`. Instead, we use a `WKUserScript` with injection time `WKUserScriptInjectionTimeAtDocumentEnd`. As a consequence, `injectedJavaScript` no longer returns an evaluation value nor logs a warning to the console. In the unlikely event that your app depended upon this behaviour, please see migration steps [here](https://github.com/react-native-community/react-native-webview/pull/1119#issuecomment-574919464) to retain equivalent behaviour. +> On iOS, ~~`injectedJavaScript` runs a method on WebView called `evaluateJavaScript:completionHandler:`~~ – this is no longer true as of version `8.2.0`. Instead, we use a `WKUserScript` with injection time `WKUserScriptInjectionTimeAtDocumentEnd`. As a consequence, `injectedJavaScript` no longer returns an evaluation value nor logs a warning to the console. In the unlikely event that your app depended upon this behaviour, please see migration steps [here](https://github.com/react-native-webview/react-native-webview/pull/1119#issuecomment-574919464) to retain equivalent behaviour. > On Android, `injectedJavaScript` runs a method on the Android WebView called `evaluateJavascriptWithFallback` #### The `injectedJavaScriptBeforeContentLoaded` prop @@ -344,8 +343,7 @@ export default class App extends Component { @@ -357,9 +355,9 @@ export default class App extends Component { This runs the JavaScript in the `runFirst` string before the page is loaded. In this case, the value of `window.isNativeApp` will be set to true before the web code executes. -By setting `injectedJavaScriptBeforeContentLoadedForMainFrameOnly: false`, the JavaScript injection will occur on all frames (not just the top frame) if supported for the given platform. However, although support for `injectedJavaScriptBeforeContentLoadedForMainFrameOnly: false` has been implemented for iOS and macOS, [it is not clear](https://github.com/react-native-community/react-native-webview/pull/1119#issuecomment-600275750) that it is actually possible to inject JS into iframes at this point in the page lifecycle, and so relying on the expected behaviour of this prop when set to `false` is not recommended. +By setting `injectedJavaScriptBeforeContentLoadedForMainFrameOnly: false`, the JavaScript injection will occur on all frames (not just the top frame) if supported for the given platform. However, although support for `injectedJavaScriptBeforeContentLoadedForMainFrameOnly: false` has been implemented for iOS and macOS, [it is not clear](https://github.com/react-native-webview/react-native-webview/pull/1119#issuecomment-600275750) that it is actually possible to inject JS into iframes at this point in the page lifecycle, and so relying on the expected behaviour of this prop when set to `false` is not recommended. -> On iOS, ~~`injectedJavaScriptBeforeContentLoaded` runs a method on WebView called `evaluateJavaScript:completionHandler:`~~ – this is no longer true as of version `8.2.0`. Instead, we use a `WKUserScript` with injection time `WKUserScriptInjectionTimeAtDocumentStart`. As a consequence, `injectedJavaScriptBeforeContentLoaded` no longer returns an evaluation value nor logs a warning to the console. In the unlikely event that your app depended upon this behaviour, please see migration steps [here](https://github.com/react-native-community/react-native-webview/pull/1119#issuecomment-574919464) to retain equivalent behaviour. +> On iOS, ~~`injectedJavaScriptBeforeContentLoaded` runs a method on WebView called `evaluateJavaScript:completionHandler:`~~ – this is no longer true as of version `8.2.0`. Instead, we use a `WKUserScript` with injection time `WKUserScriptInjectionTimeAtDocumentStart`. As a consequence, `injectedJavaScriptBeforeContentLoaded` no longer returns an evaluation value nor logs a warning to the console. In the unlikely event that your app depended upon this behaviour, please see migration steps [here](https://github.com/react-native-webview/react-native-webview/pull/1119#issuecomment-574919464) to retain equivalent behaviour. > On Android, `injectedJavaScript` runs a method on the Android WebView called `evaluateJavascriptWithFallback` > Note on Android Compatibility: For applications targeting `Build.VERSION_CODES.N` or later, JavaScript state from an empty WebView is no longer persisted across navigations like `loadUrl(java.lang.String)`. For example, global variables and functions defined before calling `loadUrl(java.lang.String)` will not exist in the loaded page. Applications should use the Android Native API `addJavascriptInterface(Object, String)` instead to persist JavaScript objects across navigations. @@ -388,8 +386,7 @@ export default class App extends Component { (this.webref = r)} source={{ - uri: - 'https://github.com/react-native-community/react-native-webview', + uri: 'https://github.com/react-native-webview/react-native-webview', }} /> diff --git a/docs/README.portuguese.md b/docs/README.portuguese.md index 9977ab6..05beaf7 100644 --- a/docs/README.portuguese.md +++ b/docs/README.portuguese.md @@ -1,9 +1,9 @@ # React Native WebView - Um moderno, multiplataforma WebView para React Native -[![star this repo](http://githubbadges.com/star.svg?user=react-native-community&repo=react-native-webview&style=flat)](https://github.com/react-native-community/react-native-webview) +[![star this repo](http://githubbadges.com/star.svg?user=react-native-webview&repo=react-native-webview&style=flat)](https://github.com/react-native-webview/react-native-webview) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors) -[![Known Vulnerabilities](https://snyk.io/test/github/react-native-community/react-native-webview/badge.svg?style=flat-square)](https://snyk.io/test/github/react-native-community/react-native-webview) +[![Known Vulnerabilities](https://snyk.io/test/github/react-native-webview/react-native-webview/badge.svg?style=flat-square)](https://snyk.io/test/github/react-native-webview/react-native-webview) **React Native WebView** é um moderno, bem apoiado, e multiplataforma WebView para React Native. É projetado para substituir o WebView embutido(que sera [removido do core](https://github.com/react-native-community/discussions-and-proposals/pull/3)). @@ -36,21 +36,21 @@ Esse projeto segue [versionamento semântico](https://semver.org/). Não hesitam Versão atual: ![version](https://img.shields.io/npm/v/react-native-webview.svg) -- [8.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v8.0.0) - onNavigationStateChange agora é disparado quando alterado o hash da URL. +- [8.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v8.0.0) - onNavigationStateChange agora é disparado quando alterado o hash da URL. -- [7.0.1](https://github.com/react-native-community/react-native-webview/releases/tag/v7.0.1) - UIWebView removido. +- [7.0.1](https://github.com/react-native-webview/react-native-webview/releases/tag/v7.0.1) - UIWebView removido. -- [6.0.**2**](https://github.com/react-native-community/react-native-webview/releases/tag/v6.0.2) - Update para AndroidX. Tenha certeza de habilitar no `android/gradle.properties` do seu projeto. Veja o [Getting Started Guide](https://github.com/react-native-community/react-native-webview/blob/master/docs/Getting-Started.md). +- [6.0.**2**](https://github.com/react-native-webview/react-native-webview/releases/tag/v6.0.2) - Update para AndroidX. Tenha certeza de habilitar no `android/gradle.properties` do seu projeto. Veja o [Getting Started Guide](https://github.com/react-native-webview/react-native-webview/blob/master/docs/Getting-Started.md). -- [5.0.**1**](https://github.com/react-native-community/react-native-webview/releases/tag/v5.0.0) - Refatorou a antiga implementação postMessage para comunicação da visualização da webview para nativa. -- [4.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v4.0.0) - Cache adicionada(habilitada por padrão). -- [3.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v3.0.0) - WKWebview: Adicionado um pool de processos compartilhados para que os cookies e o localStorage sejam compartilhados nas webviews no iOS (habilitadas por padrão) -- [2.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v2.0.0) - Primeiro lançamento, esta é uma réplica do componente principal do webview. +- [5.0.**1**](https://github.com/react-native-webview/react-native-webview/releases/tag/v5.0.0) - Refatorou a antiga implementação postMessage para comunicação da visualização da webview para nativa. +- [4.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v4.0.0) - Cache adicionada(habilitada por padrão). +- [3.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v3.0.0) - WKWebview: Adicionado um pool de processos compartilhados para que os cookies e o localStorage sejam compartilhados nas webviews no iOS (habilitadas por padrão) +- [2.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v2.0.0) - Primeiro lançamento, esta é uma réplica do componente principal do webview. **Seguinte:** - remoção do this.webView.postMessage() ( - nunca documentado e menos flexível que o injectJavascript) -> [Como migrar](https://github.com/react-native-community/react-native-webview/issues/809) + nunca documentado e menos flexível que o injectJavascript) -> [Como migrar](https://github.com/react-native-webview/react-native-webview/issues/809) - Reescrita em Kotlin - talvez reescrita em Swift @@ -79,7 +79,7 @@ Para mais informações, leia a [API Reference](./docs/Reference.md) e o [Guia]( ## Contribuindo -Veja [Contributing.md](https://github.com/react-native-community/react-native-webview/blob/master/docs/Contributing.md) +Veja [Contributing.md](https://github.com/react-native-webview/react-native-webview/blob/master/docs/Contributing.md) ## Contribuidores diff --git a/package.json b/package.json index 1756a3e..acdf4fa 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ ], "license": "MIT", "version": "11.0.3", - "homepage": "https://github.com/react-native-community/react-native-webview#readme", + "homepage": "https://github.com/react-native-webview/react-native-webview#readme", "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "start:android": "react-native run-android", @@ -74,7 +74,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/react-native-community/react-native-webview.git" + "url": "https://github.com/react-native-webview/react-native-webview.git" }, "files": [ "android", diff --git a/react-native-webview.podspec b/react-native-webview.podspec index 69a9f82..7ed0835 100644 --- a/react-native-webview.podspec +++ b/react-native-webview.podspec @@ -12,7 +12,7 @@ Pod::Spec.new do |s| s.homepage = package['homepage'] s.platforms = { :ios => "9.0", :osx => "10.13" } - s.source = { :git => "https://github.com/react-native-community/react-native-webview.git", :tag => "v#{s.version}" } + s.source = { :git => "https://github.com/react-native-webview/react-native-webview.git", :tag => "v#{s.version}" } s.source_files = "apple/**/*.{h,m}" s.dependency 'React-Core'