Feature Opportunity: IPC via SharedArrayBuffer and Async atomic waits coming to WKWebView #6269
Replies: 3 comments 4 replies
-
Sooo without actually looking to much into the new apis, this will most likely not be used for the new IPC (or if it will, it will be behind version checks) because wkwebview is only updated on new macos releases, meaning this would only work on macos 13.X (or even 14 if we're unlucky) and above 😭 So imho this is not a solution we should invest much time into until it's more broadly available (as-in, until tauri raises the min mac version accordingly) |
Beta Was this translation helpful? Give feedback.
-
I have a bit of a different take here, currently all IPC solutions provided to us by webviews (especially webkit) are incredibly underwhelming and there is no way for us to workaround except for shipping an http server shich ofc is a no-go. So this news (which I wasn't aware of actually) has me more excited than anything else and I would vote for adopting this as soon as possible (with a fallback to the current impl where shared memory ipc isn't supported) and also actively engage with the people implementing this, maybe we can help out, do testing, etc. Again to me this is the most exciting news for Tauri in ages! Edit: I agree though getting it in v2 would be tricky time-wise, but this should be a transparent upgrade anyway |
Beta Was this translation helpful? Give feedback.
-
Well, this is amazing news - and will come with security implications but is really exciting and I agree that looking into this will have exciting implications for a number of projects. Webkit taking this on could also have a benefit for the rest of the ecosystem. |
Beta Was this translation helpful? Give feedback.
-
I'm sure this is likely already on your radar as a potential strategy for Tauri's IPC reimplementation hopefully shipping in v2.
WebKit-7615.1.18.100.1, released about 2 weeks ago includes exciting support for shared memory data operations between spawned threads on the UI layer (WebAssembly and Worker contexts) as well as the Main thread FINALLY 🥳.
This functionality is exposed through the implementation of
Atomics.waitAsync
spec andSharedArrayBuffer
Objects spec API proposals through TC39.WebKit/WebKit#8578 (comment) describes the implementation and platform support surface attached to the merged changes that enable access to
SharedArrayBuffer
Objects docs usingAtomics.waitAsync()
docs on the main thread running JavaScriptCore.Safari and WKWebView support on Apple platforms is currently available in the Technology Preview release for version 16.3. It will likely be released along with the next minor updates to MacOS Ventura and iOS. Parity with Linux, Windows and Android seems to be a possibility with WebKit browsers on these platforms already supporting compatibility for the API specs in their latest versions.
Im sure there are potential limitations and bugs that will make implementing an IPC rearchitecture initiative challenging and time consuming regardless of the direction you decide is suitable to address the v2 solution.
This is less of on RFC proposal or feature request, the community seems interested in collaborating on this subject so I hope this can encourage meaningful dialogue and potential prototypes to determine feasibility.
Beta Was this translation helpful? Give feedback.
All reactions