-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add shared process pool so cookies and localStorage are shared across webviews in iOS #138
Conversation
…rage are shared across webviews (react-native-webview#68)
👏 |
So this is awesome and we actually need it on one of our projects at Infinite Red; thanks for the PR @kylemantesso ! A couple questions, though:
<WebView
source={{ uri: "https://infinite.red/react-native" }}
sharedProcess={true}
/> This could result in some pretty subtle bugs if someone was relying on the previous behavior. At the very least, we should introduce as a breaking change but allow opting out with
I'd lean toward "no", but just putting it out there. <WebView
source={{uri: "https://infinite.red/ignite"}}
processPool="MAIN"
/> We could then track each process pool in a dict in native code. Again, this is probably not necessary, but just putting it out there. Thanks again! |
…t-native-webview # Conflicts: # ios/RNCWKWebView.h # js/WebViewTypes.js
Thanks @jamonholmgren! We also need this for a project, so keen to get it in! I have refactored to make shared process pool optional, as per point 1 above. It will be a breaking change, but can be opted out by passing At this point we don't have a requirement for multiple process pools, but given the refactor this should make it easier to add later if it is required. |
Can we merge this? |
@felixmeziere did you test this PR ? |
@Titozzz about to implement it on my project, is there a defined set of steps to test every feature? |
Sadly not yet 😔 but we will need one |
Anything I can do to get this merged? What kind of testing do we need to perform? |
@kylemantesso @felixmeziere Apologies, I was out most of last week due to the holiday. Have both of you tested this in your projects? If so, I'd say it's good to merge. |
Hello, sorry about this, I've been working on a huge refactoring of the code, hopefully it will land soon, and I can get back to PRs. 😄 |
@jamonholmgren Yes we are currently using it in our project for authentication cookie and local storage and it is working well. |
Should this be released as breaking since the default behaviour changed? |
This works just fine in our project. Thanks! |
@kylemantesso Can you resolve the conflicts? After that, I'd say we merge as breaking change. cc @Titozzz . |
…t-native-webview # Conflicts: # ios/RNCWKWebView.m # js/WebView.ios.js
@jamonholmgren @Titozzz have merged changes and have tested, confirmed working to share cookies/localStorage in iOS. Can we please merge this as a breaking change? |
# [3.0.0](v2.15.0...v3.0.0) (2019-01-07) ### Features * **WKWebview:** Add shared process pool so cookies and localStorage are shared across webviews in iOS ([#138](#138)) ([afadc62](afadc62)), closes [#68](#68) ### BREAKING CHANGES * **WKWebview:** useSharedProcessPool prop is set to true by default. If you want the old behavior, please use useSharedProcessPool={false}
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…are shared across webviews in iOS (react-native-webview#138) * fix(WKWebview): [iOS] Add shared process pool so cookies and localStorage are shared across webviews (react-native-webview#68) * Add optional shared process pool BREAKING CHANGE: useSharedProcessPool prop is set to true by default. If you want the old behavior, please use useSharedProcessPool={false}
# [3.0.0](react-native-webview/react-native-webview@v2.15.0...v3.0.0) (2019-01-07) ### Features * **WKWebview:** Add shared process pool so cookies and localStorage are shared across webviews in iOS ([react-native-webview#138](react-native-webview#138)) ([afadc62](react-native-webview@afadc62)), closes [react-native-webview#68](react-native-webview#68) ### BREAKING CHANGES * **WKWebview:** useSharedProcessPool prop is set to true by default. If you want the old behavior, please use useSharedProcessPool={false}
@kylemantesso does localStorage survive an app restart on iOS. I'm noticing that it's cleared every time I reload my app in Expo Go. Im not having much luck finding the behaviour documented anywhere |
# [3.0.0](react-native-webview/react-native-webview@v2.15.0...v3.0.0) (2019-01-07) ### Features * **WKWebview:** Add shared process pool so cookies and localStorage are shared across webviews in iOS ([#138](react-native-webview/react-native-webview#138)) ([afadc62](react-native-webview/react-native-webview@afadc62)), closes [#68](react-native-webview/react-native-webview#68) ### BREAKING CHANGES * **WKWebview:** useSharedProcessPool prop is set to true by default. If you want the old behavior, please use useSharedProcessPool={false}
Add a shared process pool in iOS to allow shared cookies and localStorage between webviews. This brings iOS into line with expected behaviour in Android.