|
|
|
|
|
by pier25
1220 days ago
|
|
The problem with Electron is that it's bloated by including a full browser engine and Node. A couple of years ago I worked on an app that ran on 5 platforms (iOS, Android, Windows, macOS, ChromeOS). Initially we used Phonegap and Electron but then we created our own native wrapper that used the OS webview. Our macOS app went from 100MB to 5MB of download size and the memory usage also went down considerably. IIRC correctly it consumed like 15MB of memory. It certainly didn't look native but for our use case (education) that was not an issue. We were able to target 5 platforms with a very small team and the GUI was a single codebase made with InfernoJS and MobX. |
|
People prefer Electron because it gives them a consistent environment across operating systems, OS versions/update patch numbers, browser versions etc.
If you write your app to work in all possible combinations of the above - like you'd write a web page - you can use OS web view.
But not everybody wants to do that because it's not as straight forward as just writing your app and being able to fully rely on your environment. Perhaps you actually need features that aren't universally available in the OS web view yet, and performance degradation because of polyfills is not acceptable.
Also, OS web view is usually locked down more than Electron. It's basically a browser without the UI around it. Then you need to hack your own native bridge instead of just using whatever Electron made. I guarantee your version is going to be worse, you simply don't have the combined resources of the Electron open source project.