-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support message passing and keeping native WebView in memory when react component is unmounted #2469
Open
donaldchen
wants to merge
19
commits into
react-native-webview:master
Choose a base branch
from
discord:11.18.1-discord-2
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
support message passing and keeping native WebView in memory when react component is unmounted #2469
donaldchen
wants to merge
19
commits into
react-native-webview:master
from
discord:11.18.1-discord-2
Commits on Mar 28, 2023
-
[ios] support maintaining WebView and iFrame state when moving WebVie…
…w in view hierarchy make sure release function is defined for Android WebView react component (#3) [iOS] support releasing native WebView without a ref to the React WebView (#4) fix EXC_BAD_ACCESS error by removing WKWebView reference to RNCWebView Support message passing to native webview without react tag (#6) fix EXC_BAD_ACCESS during remount situations (#7) There are some specific edge cases where a crash currently happens 1) Let's say RNCWebview A is mounted on the screen. 2) RNCWebview B starts to mount (while A is still mounted) with the same webview key 3) RNCWebview B removes the WKWebview from A and attaches it to itself 4) RNCWebview A starts to unmount, and upon unmounting tries to remove WKWebview A from itself. Since RNCWebview B already did this step from (3), this causes a crash. Here we only remove the view if the currently "set" RNCWebview inside the shared dict (where we keep track of the active view for a key) is self fix segfault with webview remount (#8) * fix another segfault * address comments
Configuration menu - View commit details
-
Copy full SHA for b96df7b - Browse repository at this point
Copy the full SHA b96df7bView commit details -
[android] support maintaining WebView and iFrame state when moving We…
…bView in view hierarchy * add support to reuse instance with webViewKey * change up * address comments related to layout params * add nullability checks * fix * get full stack trace * add secondary map * rename to ifHasInternalWebView * additional fixes * fix * fix boolean [android] add messaging passing without a react tag (#12) This PR adds messaging passing. This was much simpler to do than the iOS counter part. This is the analogue to the following PR: #6. I've followed the same test plan. The sample app was really nice to use when testing. In the previous PR #11, I broke all native->react-native communication since events were being passed by the `InternalWebView` viewId not the `RNCWebView` viewId. This is now fixed. [android] check source prop if changed (#14) * [android] check source prop if changed * detect if new source is null too
Configuration menu - View commit details
-
Copy full SHA for 91e5515 - Browse repository at this point
Copy the full SHA 91e5515View commit details -
Configuration menu - View commit details
-
Copy full SHA for 63c586a - Browse repository at this point
Copy the full SHA 63c586aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d53293 - Browse repository at this point
Copy the full SHA 8d53293View commit details -
* message passing cleanup - rename onMessage -> ReactNativeWebviewOnMessageWithWebViewKey (due to globally unique event names) - add a small wrapper for listening to events - rename `enableMessaging` to `messagingWithWebViewKeyEnabled` * remove empty line * fix spacing * fix spacing p2 * additional cleanup * update comments * make this a bit safer
Configuration menu - View commit details
-
Copy full SHA for fd7cb69 - Browse repository at this point
Copy the full SHA fd7cb69View commit details -
Configuration menu - View commit details
-
Copy full SHA for 293273d - Browse repository at this point
Copy the full SHA 293273dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 413cae3 - Browse repository at this point
Copy the full SHA 413cae3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9db5879 - Browse repository at this point
Copy the full SHA 9db5879View commit details -
Configuration menu - View commit details
-
Copy full SHA for c1e4fc5 - Browse repository at this point
Copy the full SHA c1e4fc5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 87883fc - Browse repository at this point
Copy the full SHA 87883fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for c1465a9 - Browse repository at this point
Copy the full SHA c1465a9View commit details -
Configuration menu - View commit details
-
Copy full SHA for d1e4433 - Browse repository at this point
Copy the full SHA d1e4433View commit details -
Configuration menu - View commit details
-
Copy full SHA for 267b40a - Browse repository at this point
Copy the full SHA 267b40aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4343e47 - Browse repository at this point
Copy the full SHA 4343e47View commit details -
on Android, rename RNCWebView to RNCWebViewContainer. rename Internal…
…WebView to RNCWebView
Configuration menu - View commit details
-
Copy full SHA for 2eeb82f - Browse repository at this point
Copy the full SHA 2eeb82fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 285811d - Browse repository at this point
Copy the full SHA 285811dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e9a0e44 - Browse repository at this point
Copy the full SHA e9a0e44View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a1ef63 - Browse repository at this point
Copy the full SHA 6a1ef63View commit details
Commits on Mar 29, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 8299671 - Browse repository at this point
Copy the full SHA 8299671View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.