-
Notifications
You must be signed in to change notification settings - Fork 492
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
Moving the webview brigde to React-Native Core #109
Comments
@alinz it is good idea! But could you check PRs?) |
This should be a core functionality for sure, but perhaps a more high level approach (e.g. executing arbitrary JS in the webview) would be more useful. I'm not sure how that would work on iOS, but I do know that would be easy to implement on Android. Writing your own bridging implementation (at least RN to webview) would be trivial if that kind of communication is possible |
@goldenice RN's WebView has already implemented run arbitrary JS. what I want to add is the reverse one. WebVIew send a message back to RN. If you look into the implementation of WebView, you will see most of the important classes are inlined and because of that you can't extend it. That's what I want to do in core. |
You have my vote. But approve pending PRs pretty please |
+1 |
2 similar comments
+1 |
+1 |
Is there a PR for the react-native core? |
working on it. should be send to them by couple of days. |
+1 |
Since I'm still behind and react-native 30 is just around the corner, I will delay this and release the new version of app this weekend. Extremely busy with other stuff but I will find a time this weekend and make it available for you guys. |
+1 |
1 similar comment
+1 |
@alinz we're waiting)) |
+1 |
3 similar comments
+1 |
+1 |
+1 |
RN 0.30 is here :) |
Is it including the bridge integrated?
|
doesnt seem like it...? -> release notes |
+1 |
1 similar comment
+1 |
+1 for this feature |
+1 |
3 similar comments
+1 |
+1 |
+1 |
@tioback the rpc feature allows me to return a promise to the 'caller' and then resolve it from inside the react app (passing the result of the function call); it's almost like a sync function call, which is what I want |
@tioback @naltimari Could you direct me to where I can get to know more about this rpc feature? Is this something built in react native now ? |
@sidevesh check the v2 branch of the project. The rpc allows you to offer an API to the webview so it can call methods from your app (that's what I'm working on). Unfortunately the v2 branch is still not compatible with RN40+, so I had to resort to use vext's fork of the master branch, and then implement an rpc-like feature in the injectScript |
@naltimari okay thanks!! |
thankyou great work, does this support cache? |
so whats the status for this on react native 0.45 and above? was this integrated in core? i cant see on documentation that this supports android. |
+1 |
1 similar comment
+1 |
Hi, so any news when this will be merged into core? |
+1 |
1 similar comment
+1 |
@alinz , just wondering if we could use this with expo react native? Thanks |
The core WebView component has communication features now |
No it doesn't. Core has a f'ed up version with .postMessage that gets overrided by websites in the wild, rendering it useless. |
Eventually this functionality will get moved into core: alinz/react-native-webview-bridge#109. But leaving it out for now.
+1 |
2 similar comments
+1 |
+1 |
FYI, the core WebView is being extracted into a new community-supported version here: https://github.com/react-native-community/react-native-webview If you'd like to help us create a really solid, cross-platform WebView, this is a great time to do it. ❤️ |
For sure. The whole RN community owes you @jamonholmgren a great deal in your spearheading effort there, consolidating contributions into a community developed WebView that doesn't suck for all platforms. I'm not a native dev however so I can't help with the native side. What's the maturity of WKWebView in https://github.com/react-native-community/react-native-webview? Is it time yet to discuss a more robust https://github.com/CRAlpha/react-native-wkwebview seems to have a pretty robust API that's iOS for this RN<>WebView communication. But from what I remember when I tried using it, it had issues and just didn't work right in my app with message passing (I don't remember exactly how, it was a while ago). But if it works well now, it can be the basis of adoption for react-native-community/react-native-webview & expanding it for Android's side of WebView that would share the same RN<>WebView bridge api. |
@fungilation Thanks for the kind words!! It's been my honor to work with so many amazing developers on this.
I've heard this several times and I think it's something to consider for sure. I'd like to tackle it myself, in fact. I have some ideas, including one really interesting API I saw recently (I'll have to search for it again). Perhaps we could create an issue about it on the new repo. |
I started an issue at react-native-webview/react-native-webview#66 to discuss this further. |
I've written a wrapper the simplifies calling methods between react-native and the DOM. |
@kirill578 why your project is better than this? Are you supporting all features? if then can you send us PR to make it better? |
The requirement for a project I am working on is to be able to reuse existing code written in I was considering to use this library in the beginning, but as the requirements to reuse the code grew, the switch statement inside at the end of the day it looked to me that there is bunch of boiler plate code, so the idea behind adding new code that can be reused now, is a single liner. and the library handles all the serialization of successful or unsuccessful function invocation, which will also support rejecting an invocation with a timeout. Last but not least, it's built as a wrapper for Ideally it could become a PR for |
I found solution here is a link to stackoverflow |
Going to close this |
Hello guys,
I have decided that, it is time to move this project into core. one of the problem with maintaining this project is not be able to extend the native class and as a result I have to copy and paste the entire source code of WebView implementation of react-native. This makes it very difficult. So what I'm asking is goto this link and vote that one. If I get the confirmation from core-team I will make a PR request to WebView and I will merge this project to core.
The text was updated successfully, but these errors were encountered: