Theoretically speaking, yes, but in practice it seems most people just gave up and simply ship their apps with embedded Chromium, which is why now almost every single piece of software has installer that's at least 500 MB large.
Theoretically speaking, yes, but in practice it seems most people just gave up and simply ship their apps with embedded Chromium, which is why now almost every single piece of software has installer that's at least 500 MB large.
I know pessimism about software is in fashion, but exaggerating the problem doesn't help. The actual size of the latest version of Electron (on Windows) is 181 MB uncompressed, 77 MB zip-compressed, and 51 MB 7z-compressed. Not great, but again, let's not make it look worse than it is.
Also, there is hope. Microsoft's WebView2 [1] means that Windows has a modern, shared, embeddable web rendering engine for the first time in several years. And Tauri [2] is making it easier for web developers to take advantage of WebView2 on Windows, and WebKit on Mac and Linux, to create lightweight native applications using web technologies.
[1]: https://docs.microsoft.com/en-us/microsoft-edge/webview2/
I've got too many scars from needing to ship shared Microsoft runtimes in the past to be entirely happy about this current situation.
Webviews for GUIs is the worst of all worlds. You're packaging up two separate event based runtimes, chromium and node, and have no ability to interface with V8, meaning youre actually losing significant performance by having to serialize/deserislize data from node, to the browsers window, then deserislized on message in the browsers packaged JS engine.
It makes no sense to treat your desktop GUIs as closed sandboxes, what's the threat model?
Electron is not simply chromium, it has a bunch of optimizations, fixes, and prebundled functionality.
WebView2 btw is awesome (I've spent a lot of time with it already, see my profile if you want to know why)
As a business would you save 120MB in filesize, or thousands of hours in development time?
Electron isn't even unique in this. Blender is over 200MB now. Photoshop and Autodesk products have been big for a long time.
Is the V8 performance benefit really that high compared to something like C# just calling system calls?
Either go native or Web standards.
It can replicate Electron UI/UX without the bloat or Chrome marketing.
Wasm is also quite slower and bulkier because you'd have to compile your entire runtime into wasm, and then have it in the browser.
I read that and cannot avoid thinking: yeah well, sooner or later someone is going to want to play an MP3 file. Should now all GUI toolkits include multimedia playback support?
Someone is going to want to display and edit a PSD file, does it mean the GUI toolkit should be able to handle the Photoshop file format?
I get where it's going (I've been a GUI developer myself, working with Qt which does include a browser engine), but to be honest I think that already crosses the line from GUI framework to do-it-all framework.
I think it’s easier to flip the script. If you didn’t include the ability for your toolkit to display HTML with a browser widget how do you imagine your user proceeding? I don’t think most end-programmers would be expected to know how to take WebKit and maybe a JS engine and make it into a custom widget in your framework.
I used to see a few things like Acrobat Reader (now killed off by pdf.js), Word (the college seems to now launch the web version by default), Skype (now Electron MS Teams) etc.
To be honest I've done a complete 180 in my views on electron. As long as the application is well made and optimised (which, to be fair, is somewhat rare) I often prefer it to native. People talk about vendor lock-in when it comes to their data, but very few people seem to consider OS lock-in as another, just as important factor. If I'm using a native app that only runs on windows, that'll discourage me from moving over the linux should the want ever arise (and it does). Obviously there are exceptions like Sublime, which are both native and cross-platform, but like the well made electron apps, they're an exception to the rule
Don't get me wrong, its better, you can always instantly tell how much work has been put into an electron app, especially on windows (and when you have a dark theme on) because the poorly made ones will use a default white titlebar, whereas those with some effort will have the titlebar match the rest of the application. So Teams has that going for it.
But optimisation wise, yeh, its not pretty. I used to use Linux at work, and it was soley responsible for my twice-weekly crashes (I knew because sometimes, if I were quick enough, I could stop the crash before my laptop slowed to a halt by force closing teams). On Windows, its better, but thats not saying much.
https://tomtalks.blog/2021/06/microsoft-teams-2-0-will-use-h...
The actual bundled size is about 120MB, it can be lowered. Actual memory usage is about the same but is relative on how much memory your system has overall.
So far my "tool" to do this is simply a template repository with some conveniences, providing in essence a skeleton for these types of apps. I hope to flesh this out a little more, and expose a much richer API, as well as convert some of my existing popular apps (like 22120[1]) to the "framework".
The benefit of this is Graderjs has a built in 'app builder' that can create a cross-platform binary (excluding or ignoring the necessity (on MacOS) and near-necessity (on Windows) to sign your executable somehow, that lets you display your UI in JS/HTML/CSS using the already installed browser engine, as well as run code in NodeJS and using the rich APIs[2] of the browser engine itself. I'm really happy with this project and think that, even tho it's small now, it will in time become my most popular and powerful one: even bigger than my remote browser and popular web archiver.
Just give it time! :)
[0]: https://firefox-source-docs.mozilla.org/remote/index.html
[1]: https://github.com/i5ik/22120
[2]: https://chromedevtools.github.io/devtools-protocol/tot/Brows...
The GraderJS: https://github.com/i5ik/graderjs
For Windows you don't have to include the WebView2 installer, your installer, can basically include a "stub", the evergreen bootstrapper [2], that then goes out to the internet and grabs the latest version.
edit: The great thing about WebView2 is that Microsoft keeps their control up to date. (At least on Windows, not sure what that is going to be on other platforms, time will tell)
[1] https://www.microsoftedgeinsider.com/en-us/download/?platfor...
[2] https://developer.microsoft.com/en-us/microsoft-edge/webview...
[1]: https://docs.microsoft.com/en-us/microsoft-edge/webview2/con...
Thanks for expanding on that part. It's really nice how Microsoft deals with these updates.
Why? Chrome supports those platforms. There's no reason for Edge to not.
ShellExecuteW(NULL, L"open", (LPCWSTR)wuri, NULL, NULL, SW_SHOWNORMAL);
[[NSWorkspace sharedWorkspace] openURL:nsurl];
::execlp ("xdg-open", "xdg-open", s.c_str(), (char*)NULL);First, that's 500MB initially. It goes up from there.
Second, that works only if a small number of apps are bundling Chrome, and RAM can keep up; once too many Electron apps promulgate, people will start installing fewer apps.
If your I dunno, weather widget starts consuming 1GB to show me current weather, I'm going to trash it, if it conflicts with my IDE.
[EDIT:] I thought it was for quite a while after it wasn't any more. [/EDIT]
B) As was mentioned, I think both in the article itself and several comments here, then you get to contend with the same problem Web devs do: Browser differences.