Re:Golang Desktop App with Webview/Lorca, WASM and Bazel
by FeistyOtter on Tuesday August 11, 2020 @04:21AM
(#24118311)
I am only familiar with Electron (due to its hype), what is native webview, is it like a browser? If yes why is it better? Asking as someone who has never developed any desktop apps.
[ Parent
| on HN ]
Re:Golang Desktop App with Webview/Lorca, WASM and Bazel
by flohofwoe on Tuesday August 11, 2020 @06:23AM
(#24118892)
It's a minimal native application which creates a window with an HTML widget in it, essentially a mini-browser wrapped in a native application. The difference to Electron is that this browser isn't a bundled Chromium, but the browser engine that's integrated with the operating system (Edge on Windows, WebKit on macOS and Linux), so the application installer is much, much smaller.
When I tinkered with https://github.com/webview/webview on macOS a minimal Hello World application was around 26 kBytes (kilo, not mega), which is about 7000x smaller than a default macOS Electron instance (173 MBytes).
Re:Golang Desktop App with Webview/Lorca, WASM and Bazel
by philsnow on Tuesday August 11, 2020 @07:25AM
(#24119198)
> this browser isn't a bundled Chromium, but the browser engine that's integrated with the operating system
so I wouldn't have to worry about various electron app packages shipping with versions of Chromium from three years ago?
Re:Golang Desktop App with Webview/Lorca, WASM and Bazel
by flohofwoe on Tuesday August 11, 2020 @07:29AM
(#24119218)
The downside is that as the application developer you no longer can control the browser version your code is running on, so you may need different code paths for WebKit vs Edge, or old vs new browser versions, but this is the same problem normal webpages have to deal with.
But at least you can call out into native code and native operating system APIs, unlike "real" web applications.
Re:Golang Desktop App with Webview/Lorca, WASM and Bazel
by Philip-J-Fry on Tuesday August 11, 2020 @04:31AM
(#24118372)
It uses what is built into the OS, the native UI control which renders web pages. It doesn't need to download a whole 200mb Chromium or anything like that.
So your binaries can be really small too. Seems like faster start up times also.