4 ms·
If this requires installing WebView2 on Windows, then I'd recommend against this approach. I did something similar myself (to avoid distributing a bloated Elect
by datatraveler 1y ago
If this requires installing WebView2 on Windows, then I'd recommend against this approach. I did something similar myself (to avoid distributing a bloated Electron build), but, since the WebView2 installer sets its window title to "Microsoft Edge Update", I got a lot of negative feedback from a few very vocal Steam users who thought my game was trying to re-install Microsoft Edge--a browser they had meticulously removed all traces of. I think one Steam user even called my (free and open source) game "malware", just because of that window title (which only appeared on first run, when the WebView2 installer ran).
I'm sorry to say that if I had to do it again, I'd use Electron, despite the bloat. I bet Electron would also make distributing a Linux build easier, too. (WebView2 didn't work fullscreen on Proton when I last tested.)
Sorry to be a downer! Obviously, I originally loved this approach since I did something similar--it just didn't end up paying off. No one noticed that the download was ~100 MB lighter--but they sure noticed a brief flash of "Microsoft Edge" on their screen!
- skinnymuch 1y agoHah that is so unfortunate when it’s so much nicer not to be using electron.
- 20after4 1y agoIs there really no way to get around the webview2 installer? Why not package it in your app bundle somehow instead of installing it as an external dependency?
- magicalhippo 1y ago> Is there really no way to get around the webview2 installer? WebView2 supports both the auto-updating "Evergreen" version and a fixed version[1]: In the Fixed Version distribution mode, you control the timing of updates to the WebView2 Runtime for your app. You download a specific version of the WebView2 Runtime and then package it with your WebView2 app. The WebView2 Runtime on the client isn't automatically updated. [1]: https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution?tabs=dotnetcsharp#details-about-the-fixed-version-runtime-distribution-mode https://learn.microsoft.com/en-us/microsoft-edge/webview2/co...
- datatraveler 1y agoFor me personally, I was trying to avoid bundling an entire browser runtime, so I viewed that approach (bundling WebView2's runtime instead of downloading on demand, only if needed) as no better than using Electron. At the time, that also wouldn't have solved my "Linux support" problem, but the blog post author is using webivew (which uses WebKitGTK on Linux), so that might not be relevant to them either. At which point I have nothing relevant to say!
- moron4hire 1y agoI made an attempt at using WebKitGTK on Linux to build a WebGL game a couple of years ago. I was basing it on some existing code that I had already done a ton of work with to optimize and make cross-browser compatible. Had basically 99% feature parity between Chrome and Firefox. Lack of standards support in WebKit made it painful to use and even meant losing major features like VR support. WebKit and WebKitGTK were both extremely unstable in their own ways. And I never could figure out a decent debugging scenario setup.
- echelon 1y agoI wonder if Tauri is subject to this. The sooner Tauri grows Electron/Chrome bundling capabilities, the better. Chunky and predictable beats confusion, errors, and inconsistencies.
- mort96 1y agoBy that logic, every website should bundle their own web browser. They don't. Browsers are consistent enough, especially when you limit your web browsers to only those that OSes provide as web view components.
- surajrmal 1y agoBundling your dependencies is in fact something applications like to do though. The question becomes whether your browser/runtime is the layer you stop including deps or the os native apis which that browser is built on top is. When you get to physical products the OS is absolutely part of the dependencies you want to control and deploy, even if it largely exists to run a single application.
- raincole 1y agoBy that logic, every app that utilizes Python scripting should bundle their own Python runtime. And they do.
- mort96 1y agoPython is neither backwards nor forwards compatible. The web is very stable. And most people don't have a Python runtime installed. Almost everyone has an OS with a web view component already installed.
- echelon 1y agoSafari and Edge scare the user about pointer lock control, which makes it annoying/impossible to build nice 3D games or visualizations in Tauri. Every on click event is met with a huge, scary browser-native alert. Chrome doesn't do that. That's just one of dozens of browser inconsistencies we've recently dealt with. It's just the most egregious.
- flashgordon 1y agoOut of curiosity how do you feel about wasm? Reason I am asking is I've been doing something like this but using Go and phaserjs. I've found the experience pretty awesome and my main target was the web so didn't think beyond that. My choice was based on comfort with Go and a big frustration with the react eco system (also low expertise there).
- hu3 1y agoInteresting. Aere you using Ebiten for wasm? https://ebitengine.org/en/documents/webassembly.html https://ebitengine.org/en/documents/webassembly.html
- flashgordon 1y agoDang I am not sure why I was downvoted. But to your question I just used a basic MVP pattern where the Go side was pushed events from the browser and the game lib did the validation and called back methods on the browser to update the view state. So the browser side was very stateless for me. This made my testing a lot easier.
- CuriouslyC 1y agoI started out really hyped for Deno, but I feel like in most cases Bun or WASM end up being better options. WASM is a great option because it has real security unlike Deno, it's a bit more involved to work with but that project setup cost gets amortized over the life of a big project, so the main downside is build chain speed, but Go is pretty good there.
- flashgordon 1y agoYeah build speed was actually quite good (I am sure rust-wasm has better over all performance but I am not that advanced yet). Two things I still am not able to get a feel for is: a. load time - the Go wasm bundles can be large (TinyGo should help) but even with 25mb -> 5mb - that 5mb feels like big especially on a mobile download (i think?). But this is one off so I can suck it up. b. This feels like a big one. I am only doing turn based games so may not be a big issue but it feels like the wasm <-> browser ser/deser can be a killer. Thank fully I am not doing high (or even medium) FPS games so will deal with that later :D
- CommonGuy 1y agoThis shouldn't be a problem with Windows 11 anymore? AFAIK, the "evergreen" version of WebView2 is installed by default.
- datatraveler 1y agoIt might even be better than that. It sounds like Microsoft pushed WebView2 to (at least some) Windows 10 computers (N.B. Steam says 32% of users are still on Windows 10). Of course, the docs still say: > Even if your app uses the Evergreen distribution mode, we recommend that you distribute the WebView2 Runtime, to cover edge cases where the Runtime wasn't already installed. https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution?tabs=dotnetcsharp https://learn.microsoft.com/en-us/microsoft-edge/webview2/co... I wish we knew how prevalent that situation was. Not sure what the failure mode would be. But it sure would be nice to be able to assume that a modern WebView always exists on Windows! That certainly wasn't the case back when I made my decision circa 2022.
- ZeWaka 1y agoIt was added in 22H2 Windows 10.
- rovingeye 1y agoMicrosoftEdgeWebview2Setup.exe /silent /install
- debugnik 1y agoI'm assume (wrongly?) that installing this dependency is managed by Steam before the first run, not up to them.
- zamadatix 1y agoOne can opt in to the common redistributables (which usually makes sense if the thing you're looking for is covered) or decide to package custom steps into InstallScript files https://partner.steamgames.com/doc/sdk/installscripts https://partner.steamgames.com/doc/sdk/installscripts. In either approach, Steam will automatically manage the runtime dependency installation for the user before the "Play" button appears.
- rovingeye 1y agoThanks for the info. Looks like they're using /silent right there in the example "Steam customers love a quick and silent install. Add silent or quiet parameters to all run process commands and only add what you absolutely need for the game."
- zigzag312 1y agoImpeller renderer is about 100 KB [0]. You still need to add things like text layouting library and image codecs to that size. A few MB in total I guess, but much less than a full web engine. While Flutter could be used to draw UI to texture, Impeller could also be used by other UI frameworks. Recently, Avalonia team experimented with replacing Skia and a Flutter developer asked, if they are interested in using Impeller and even offered some help [1]. This would probably be suitable, as a more lightweight alternative to WebView, for integrating into game engines. [0] https://chromium.googlesource.com/external/github.com/flutter/engine/+/refs/heads/flutter-3.6-candidate.4/impeller/docs/faq.md https://chromium.googlesource.com/external/github.com/flutte... [1] https://www.reddit.com/r/dotnet/comments/1nv3snm/comment/nh7ed2v/ https://www.reddit.com/r/dotnet/comments/1nv3snm/comment/nh7...
- surajrmal 1y agoEven if you don't opt for gpu compositing, you can be 8x more performant than skia by writing something yourself. Skia is optimized for portability, not necessarily performance.
- nik_ca 1y agoomg, not the electron, please! How about NW.js?