16 ms·
Show HN: DeskGap – Like Electron, but uses the system webview
- boooohoooo 8y ago"Older Windows’ do not have a modern browser engine, only the one that powers Internet Explorer." ...as if that's an excuse.
- patr0nus 8y agoHi HN, DeskGap is another try to build an lightweight alternative to Electron. Compared to the existing attempts [0, 1], I choose not to go that far and bundle a real Node.js with it[2]. And to battle test the framework, I wrapped squoosh[3] into a desktop app[4] with DeskGap, and successfully submitted it to the app stores. [0] https://github.com/pojala/electrino https://github.com/pojala/electrino [1] https://github.com/jscherer92/Quark https://github.com/jscherer92/Quark [2] https://deskgap.com/#faq https://deskgap.com/#faq [3] https://squoosh.app https://squoosh.app [4] https://github.com/patr0nus/Pym/ https://github.com/patr0nus/Pym/
- kodablah 8y agoHowdy, can you compare the system-side webview with https://github.com/zserge/webview https://github.com/zserge/webview? Specifically, what control do you use on windows, MSHTML or have you incorporated the recently-freed-from-UWP (I think) Edge API? EDIT: Appears the latter [0]. Great work. I wonder how this affects bundling...does this make it a UWP app? 0 - https://github.com/patr0nus/DeskGap/blob/master/core/src/win/webview.cpp https://github.com/patr0nus/DeskGap/blob/master/core/src/win...
- patr0nus 8y agoNo it's still a Win32 app. As you supposed, It's freed from UWP[0] ;). [0]https://docs.microsoft.com/en-us/windows/communitytoolkit/controls/wpf-winforms/webview https://docs.microsoft.com/en-us/windows/communitytoolkit/co...
- DaiPlusPlus 8y agoWhat happens if you run an EdgeHTML-using application on Windows 7 or 8? I noticed that the EdgeHTML control in WinForms and WPF is not a drop-in replacement for the old WebBrowser control (i.e. it isn’t a subclass, so you must use one or the other, but Microsoft didn’t document the best way to switch between controls based on feature-detection).
- chrismorgan 8y agoWhen you try to call the API, it will fail as it’s not there. The precise failure mode will depend on the application. One possibility would be to crash outright. Another would be to try the EdgeHTML control, then fall back to MSHTML. Yet another would be to try EdgeHTML, then complain in an alert, notifying the user of the requirement for the new version of Windows.
- deleted 8y ago[deleted]
- alexandernst 8y agoHow is Deskgap lightweighter than Electron if, at the end of the day, it's using the browser on my OS (which, let's assume, is Chrome)?
- patr0nus 8y agoNo it would not be. Hopefully Electron will actually do this in some day.
- accatyyc 8y agoBecause if it uses the same browser binary as your other web apps (tabs or other DeskGap apps), the OS can share memory between them. Not possible with electron since every app bundles its own Chromium binary.
- TomMarius 8y agoThat is incorrect. Programs can't share memory just because they've been launched from the same binary. This is just reusing a DLL and saving disk space thanks to it.
- akdor1154 8y agoPretty sure they can on Linux at least.
- MrStonedOne 8y agoYou are confusing data memory and code memory.
- TomMarius 8y agoI am not, actually I am pointing out that the comment I replied to does.
- accatyyc 8y agoBoth code memory and data memory will be shared by any modern OS. The code memory will of course be shared since it's the same, and the data memory will be shared until modified. Then that memory page will be copied for the process that changed it (check out copy-on-write). And then there's disk memory, which isn't as important IMO but still it will of course be smaller since you don't ship the whole browser stack for each application.
- Wehrdo 8y agoLooks like a great project! The webpage mentions the app size, but no mention of RAM usage, which is a bigger concern with Electron apps to me. Can you comment on how it compares?
- patr0nus 8y agoBased on my experiences of using Safari, Edge and Chrome, the RAM overhead is lower. However as the app gets more complex the overhead becomes irrelevant. So for now I consider DeskGap a good place for simple apps. But if you start to build something like VS Code, the RAM usage can’t be good, either.
- cotelletta 8y agoI'm going to avoid installing Windows 10 for as long as possible, so I hope this never takes off. No offense.
- pault 8y agoIt has barely started and still pre-alpha, but I would add revery[0]. I know the team working on it and they have a good history of finishing what they start. [0] https://github.com/revery-ui/revery https://github.com/revery-ui/revery
- styfle 8y agoThanks for making DeskGap! I have been watching these types of tools (desktop js frameworks) and I'm glad the DeskGap docs[0] explain the difference between existing tools like Electrino and Quark although the most notable difference is that those two projects are no longer maintained. I just added DeskGap to my list of Awesome Desktop JS frameworks[1]. [0]: https://deskgap.com/#there-are-already-similar-attempts-electrino-and-quark-for-instance-out-there-what-makes-deskgap-different https://deskgap.com/#there-are-already-similar-attempts-elec... [1]: https://github.com/styfle/awesome-desktop-js https://github.com/styfle/awesome-desktop-js
- Klonoar 8y agoThese projects completely overlook _why_ people choose Electron over the system view. - Nobody wants to be testing against multiple browser/rendering engines in 2019. - Nobody wants to wait for a vendor to update their implementation when Chrome has the feature available almost immediately. Edit: Since I can already see the litany of armchair-quarterback-desktop-app-authors, I'm just going to link to the comment from the guy who actually migrated Slack away from WKWebView. https://news.ycombinator.com/item?id=18763449 https://news.ycombinator.com/item?id=18763449 Blows my mind we're still debating this.
- Octoth0rpe 8y ago> Nobody wants to be testing against multiple browser/rendering engines in 2019. That's certainly _one_ reason why. I would posit that the main reason is that web developers would like to reuse their webapp skillset for building desktop apps. This seems like it accomplishes the goal. Re: testing against multiple browsers, frankly this is _mostly_ a solved problem. The big gaps between rendering engines is on the real fringe of css at this point, which most of us aren't bothering to use. Also, many people builting on top of electron (and presumably this platform) are using css toolkits like blueprint, and most of those take care of most of your cross browser issues anyway. So, largely not a concern.
- Klonoar 8y agoIt is not a mostly solved problem. The people behind Slack, Spotify, and so on have actually commented on these threads explaining the exact line of reasoning. This stuff isn't limited to just CSS, and it makes total business sense to avoid it.
- Octoth0rpe 8y agoMaybe I'm just spoiled having doing web dev back in the netscape 4 era when things were _really_ bad. These days it seems like a reset stylesheet and a couple polyfills and you're good to go. I don't doubt that certain problem spaces still run into major cross browser issues, but I guess I've been lucky enough to avoid those problems for the last couple of years.
- tbodt 8y agoRequiring your Windows users to have the October 2018 update makes no sense.
- airstrike 8y agoRead the entire article till you get to this part: https://deskgap.com/#why-is-the-supported-version-of-windows-so-high-any-plan-of-supporting-windows-7-and-linux https://deskgap.com/#why-is-the-supported-version-of-windows...
- MrEricSir 8y agoWish they had more technical details here. IE 9 was an update just like the Windows 10 October 2018 update, but applies as far back as Vista. IE 9 is much more compliant with modern ECMAScript standards than IE 8 ever was. IE has been available as a COM component in Windows applications for ages -- at least as far back as XP -- so it could be done.
- userbinator 8y agoI find it amusing that the opening paragraph describes it as a "framework for building cross-platform desktop apps" and then shortly below that in the "Supported Platforms" section it lists one Mac OS and one very specific version of Windows. No Linux at all. Even native Windows apps are more cross-platform than that! (I have written a few which will work on any version of Windows starting at Win95...)
- patr0nus 8y agoI shared your concern before I started the project, and talked about this in the readme's FAQ[0]. [0] https://deskgap.com/#faq https://deskgap.com/#faq
- jgillich 8y agoThe majority of Linux users use a GTK desktop, IMO WebkitGTK would be preferable.
- Vogtinator 8y agoNo - that's built on webkit, which is apparently becoming the next IE.
- Fnoord 8y agoI use a GTK desktop on my Linux desktop computers (Ubuntu/Debian and Kali). However, I prefer Qt applications. They look very well on my GTK desktop.
- dotancohen 8y agoI'm glad to see that you are considering the Qt component. Qt looks good on Gnome, KDE, and other desktops. It is also relatively lightweight for what it offers.
- deleted 8y ago[deleted]
- filmor 8y ago
- tptacek 8y agoThere was about a year and a half worth of security work done on Electron (particularly targeting the Node integration and how Node APIs were exposed). I worry that not a lot of people know just how insecure Electron apps used to be, and would generally worry that new Electron frameworks not designed specifically to be secure are going to recapitulate a lot of that.
- Gaelan 8y agoI mean, the easy answer is make the web view send messages to Node instead of doing the node integration.
- Erlich_Bachman 8y agoWhat is the attack vector that this protects against? Electron apps don't usually just run user-provided code off the internet? They just run the code provided by the app vendor?
- pvg 8y agoXSS in the app or things it displays/depends on end up being RCE on the client.
- cf 8y agoIs there anything like Electron from a cross-platform and ease of development standpoint but way more lightweight? I often find applications written in it to be very sluggish and resource intensive even when the web or mobile version of the same application is significantly smaller and faster.
- hestefisk 8y agoSorry but: zzzzzz. Did I mention that Riot (Synapse client) uses 25% cpu consistently when idle on my windows 10 laptop? This is a beefy Lenovo X1.
- MrEricSir 8y agoA cross-platform native webview could be an elegant way to monetize an application via web ads while minimizing bloat.
- janci 8y agoYou mean IE on windows? No, thanks.
- zapzupnz 8y agoAccording to the website, it doesn't use IE's engine, it uses Edge's. Soon, that will be Chromium.
- stevefan1999 8y agoWill there ever be KDE support, since Qt also provided a HTML toolkit?
- svrtknst 8y agoI feel like there should be an option that lies between either "Install a new webview with every app" and "completely trust a previously installed webview". I guess the downside is that that would be just a new .Net Framework, where an app requires you to install the Whatever Webview 2.5 in order to run, but it'd be neat to dodge Safari, while still having leaner Electron apps. It could possibly be solved by specifying supported webviews in the application.
- wolfi1 8y agoI'm a little bit confused, why would the executable be larger than packed with Electron? One would assume that if you don't need to pack chromium the executable size should be comparably smaller
- vijaybritto 8y agoThe main problem that everyone has with electron is the RAM consumption right?! If the webviews are anyway gonna increase the RAM to electron levels while being significantly hard to test and deploy then this will not work out ever. I'm only bothered about low RAM memory usage not the disk space.
- snarfy 8y agoA simple hello world style app in electron and in my own project [1] show electron using ~100mb while the webview based project ~50mb, so there's that. [1] https://github.com/zenakuten/webview-cs https://github.com/zenakuten/webview-cs
- accatyyc 8y agoIf you’re concerned about RAM, using this approach makes a lot of sense. Every process of your system browser running, (different tabs, different apps with web view), the OS can share memory between since it’s the same binary. With electron, each app bundles their own browser and memory cannot be shared since it’s different binaries.
- IronBacon 8y agoI've seen a day ago a recording of a presentation from last week FOSDEM where two other libraries, Lorca[0] (Go + HTML5) and Webview[1] (C++/C/Go), were described that are similar in scope to this one. From the webview project page: It supports two-way JavaScript bindings (to call JavaScript from C/C++/Go and to call C/C++/Go from JavaScript). It uses Cocoa/WebKit on macOS, gtk-webkit2 on Linux and MSHTML (IE10/11) on Windows. [0]https://github.com/zserge/lorca https://github.com/zserge/lorca [1]https://github.com/zserge/webview https://github.com/zserge/webview edit: the link to the video https://video.fosdem.org/2019/UD2.120/godesktopapps.webm https://video.fosdem.org/2019/UD2.120/godesktopapps.webm and the presentation slides https://fosdem.org/2019/schedule/event/godesktopapps/attachments/slides/2994/export/events/attachments/godesktopapps/slides/2994/slides.pdf https://fosdem.org/2019/schedule/event/godesktopapps/attachm...
- youwishboye 8y agodoes no developer care about Linux anymore?
- disillusion 8y agoI think it's interesting how debates about Electron inevitably end up with the arguments 'the developer wants X' vs 'the user wants Y'. However, there's one aspect a lot of people seem to overlook in their arguments: pragmatism. The ideal application: - uses almost no memory - uses almost no disk space - is extremely fast - costs (next to) nothing - and has all the features in the world - presented in a manner that automatically shows the user only the exact features (s)he cares about In the real world, we have to balance the project/product requirements. In the end, only these things matter: - It yields a net profit (monetary or otherwise) for the company or owner - It has (and keeps) added value in comparison to similar software - It's fun to design and develop in/for - It has bugfixes and new features in a timely manner, without taking up too much development time - It has a pretty, easy to use interface - It's quick and snappy enough to run Adding that all up, and developing in something like Electron is a no-brainer: mean time between iterations is faster, design and development is more fun and the end user has a product that is fast enough for their needs packed with features. Try that in any low level language or without control over the engine and you'll have to severely hamper one of these goals.
- diegoperini 8y agoThis comment should be posted under each Electron vs The World discussion as a reminder by a bot. Disclaimer: I hate Electron. (but really appreciate and admire its developers)
- jamil7 8y agoPretty perfect summary and the reason why I pick native for side projects and electron for paid work (unless explicitly requested).
- fxfan 8y ago> snappy enough to run > Electron is a new brainer Not everyone on earth is a dev/gamer/video-editor. For regular people, electron is a cancer that needs to be nipped in the bud. Remember, 91% of the desktop on earth is Windows (meaning regular USD 300 machines). And of them I'd wager less than 10% fit have machines where electron is snappy (1.2K Thinkpads). What the earth needs is a better cross platform native GUI framework. NOT electron.
- wolframhempel 8y agoI'm glad to see how this debate has matured from focusing on the technical downsides to focusing on the business and end-user benefits. But at the same time, whenever I have Blender open, effortlessly displaying eight different 3D views and UV mappers and the Spotify app, almost crashing my system by playing music, I can't help but wish that more developers would walk the extra mile for the user experience.
- vianneychevalie 8y agoSome of the apps like Spotify, or more recently Microsoft Teams are completely equivalent in their web version. The browser is better at preventing system crashes from a tab than a single encapsulated web app.
- flintchip 8y agorandom and probably irrelevant spotify tip: I absolutely hated how slow and buggy the app was, until I realised it was down to it attempting to index music locally all the time my app speed increased massively by going to settings > local files, and turning off all of the options of where to show songs from
- fauigerzigerk 8y ago>Spotify app, almost crashing my system by playing music Apparently the debate has matured from focusing on technical downsides to making unfalsifiable claims about technical downsides.
- a-barpetia 8y agohttps://github.com/cztomczak/phpdesktop https://github.com/cztomczak/phpdesktop, same concept without memory leak. Please, check it out
- Razengan 8y agoAs a user, I don't like Electron; "webapps" always feel clunky and alien compared to native apps and the rest of the OS. As a developer, I can appreciate Electron's utility in targeting multiple platforms, but one has to wonder: Why isn't there a good, open, cross-platform UI library already, that compiles to the native UI of each OS? Has there even been an initiative to make one? You'd think the global developer community would have come together to tackle this problem by now, consider how it's such a pain point for all of us and users as well.
- pault 8y agoNative UI frameworks don't have a 1:1 match on features and UI components, and a cross-platform library would have to compromise on the lowest common denominator or use so many conditionals that you would be maintaining three different codebases anyway.
- cpburns2009 8y agoThere's actually plenty of them. Off the top of my head: (C) libui; (C++) wxWidgets; (Java) SWT; (JavaScript) ReactNative; (Pascal) Lazarus. Then there's the non-native toolkits that either emulate the OS: (C) GTK; (C++) Qt; (Java) Swing. There's also Tk (Tcl) but I'm not sure where that falls.
- c-smile 8y ago> Why isn't there a good, open, cross-platform UI library already, that compiles to the native UI of each OS? It is either "good native" or cross-platform. But not both in reality. In principle can do something very basic using stock platform widgets - some application that uses only basic widgets: buttons and plain text textareas - all others are too different on different platforms. If your app is slightly more than that you will have problems even with basic stuff. Consider this native UI example (Notepad++) : https://i.kinja-img.com/gawker-media/image/upload/c_lfill,w_768,q_90/ba6wdcpkmlgrb1qgd9gm.jpg https://i.kinja-img.com/gawker-media/image/upload/c_lfill,w_... and something like Sublime Text Notepad++ is a disaster even native platform API. Sublime Text uses custom non-native renderer - consistent UI styling.
- hardwaresofton 8y agoBTW for those looking for interesting cross-platform focused UI systems, Nuklear is pretty cool: https://github.com/vurtun/nuklear https://github.com/vurtun/nuklear
- atrilumen 8y agoCool, thanks. I'm tempted to make a Node binding.
- glenrivard 8y agoThis space will go to Flutter. Probably faster than anyone realizes.
- mgamache 8y agoI am hoping Microsoft's moving Edge to chromium will allow this project to work on a more Windows platforms. The new Edge will support Windows 7 & 8. https://www.theverge.com/2018/12/6/18128648/microsoft-edge-chrome-chromium-browser-changes https://www.theverge.com/2018/12/6/18128648/microsoft-edge-c...
- T3RMINATED 8y agothis is garbage because on Windows using the IE WebView gives you total CRAP Rendering.
- lincpa 8y agoI embed a Web server in my project, and when the project starts, ChromePortable is automatically launched to open the Project home page. Simple, stable, good compatibility.
- c-smile 8y agoSciter (https://sciter.com https://sciter.com) then, as it is not like Electron - it is not using any web view at all. But it does use HTML/CSS in the same way as WPF uses XAML for UI definitions. Sciter allows to use best parts of two worlds: flexibility of HTML/CSS/script for UI definitions and richness, power and compactness of native code as Sciter is designed to be embeddable from the very beginning. In what UI engine you can create your own HTML element with native C++ (Rust, Go, etc) controller when you need to? And on all Windows versions starting from XP, Mac OS from 10.7, all Linuxes with GTK3 including Raspberry Pi...
- fastbmk 8y agoWhat about Flutter? Soon it will be able to run on multi-platform desktops.
- mezzode 8y agoI still think that first-class support for PWAs will be a more promising alternative to Electron