Neutralinojs – Build lightweight cross-platform desktop apps with JavaScript
neutralino.js.org
neutralino.js.org
I respect the teams that will go through the effort to test and support this, but I can name on 3 fingers the engineers out of the 100+ I've worked with the past 10 years who wouldn't kick and scream about having to test in anything other than just chrome on their MacBooks.
Devs today are just not built for cross engine work, we're back in IE6 land again and if it comes down to them having to test in 3 engines to save the customer a gig of space and gigs of memory they'd rather just burn the cycles and space than have to do that.
Maybe other peoples experiences differ, if they do I'm jealous.
In this time also out on the normal internet, I've seen a shocking number of sites with critical functionality broken on safari. I'm talking nav, login, payment, on the sites of major brands, wireless carriers, saas companies.
So, do we face this challenge today? It exists certainly, but it seems like increasingly we are pretending it doesn't.
The only exception is 100vw and 100vh. On desktop, building an “app” that fills the screen with a header on top and a footer on bottom, this works great. On some mobile browsers, it places the footer below the browsers navbar because the navbar is not subtracted from the pages height.
I’ve had a heck of a time working around this in css, particularly because the fix for mobile seems to break desktop chrome.
But compared to even a decade ago, this is nirvana.
To test on Safari, you need a mac. That is a substantial cost. We assume it doesn't exist because we work at places that offer us macbooks (of note, all my teammates test on Safari because we easily can now), but when we are talking about the web at large this is a tremendous cost and is why so many websites are broken on Safari-exclusively (as opposed to both Safari and Firefox). So many websites, even from large companies, are developed by a handful of people, and their habits carry over. This establishes an expectation of not caring about Safari and all of its quirks, it gets relegated to "the user will just use another browser if it's broken".
For this problem to cease existing, Safari needs to be released on other operating systems. Until then, Safari will always be disregarded and untested.
Indexed DB LocalStorage Media keys SessionStorage Service Worker registrations and cache
Unless if the Web Applications was added to the Home Screen.
You want everything to be as deterministic as possible. If you ship an app today, you don't want to have to deal with future updates potentially breaking your code. I pretty strongly feel that OS-vendered web browsers executing desktop applications is a fundamentally flawed approach compared to the alternatives, it maximizes useless churn.
We don't know each other but you can add me to the list. First, I don't use a Mac, second I use Firefox. That means that if it works for me it should work for everybody else. Proof is that customers don't complain with me.
That doesn't mean anything or change anything, sorry. Maybe you can refuse to use Teams provided by your employer and quit your job just because of that, but nobody else does.
I’m getting close to switching — life’s too short, even if I believe in Firefox.
Atleast with websites, devs can ship a fix on the server immediately.
So the impact of different browsers behaving differently is much greater when distributing binaries with Neutralinojs. Having a bundled browser (eg Electron) atleast mitigates this vector for bugs
Edit: they have benchmarks for it, the difference doesn’t seem very significant
8MB vs 42MB for electron. That's pretty real savings IMO!
It's also using the existing shared libraries on your system, so there's a very real chance a lot of this 8MB might be ready resident & take zero additional space. It'd be great to see what the memory impact of launching a second & different app would be!
Personally I think the Electron hate is because people think every Electron app behaves as badly as Slack. Honestly 42MB is not that bad. But it hurts my soul that each app has it's own static copy of the browser, means there is zero chance for sharing. If you are running 2-3 apps it's fine but I want a world where we can potentially have dozens or even a hundred little gui apps running & it works fine, no problem. That would be on par with native apps & this is a clear demonstration of one way we could get there.
The missing next step is that this system launches a mini http/websocket server to run. It'd be interesting to explore using a lightweight Sandboxing multi vm to host apps on, might make the server side lighter weight too. Wasm, or cloudflare's workerd... The CRI folk have been busy building support for managing work let like things like this, & desktop could definitely pull some wins, now that folks like Neutralinojs and Tauri are starting to do better at desktop webapps.
Most electron apps don't use most of this code but it's at least mmapped in.
As for size, most web pages I visit are under 40MB. Suddenly 8MB Vs 42MB is a huge difference in overhead.
There's definitely been a trend of page loading tons of data & holding onto it. There's so many better architectures. Using http caching & just re-requesting pages of data on demand would be a huge architectural win for most pages. We can get fancier & use indexeddb or now sqlite, to let us free memory. The actual footprint of most pages/apps ought to be tiny.
That raises an interesting question of Neutralinojs, of how much of the incredibly good web shit we've built is available. A huge part of the Chrome size is that it supports hundreds of web platform APIs. Webkit doesn't AFAIK, it's up to the implementer to rebuild most of the Javascript APIs. It's gonna suck not having the ability to load your wasm sqlite on origin private file systems with a service worker cache layer web architecture to neutralinojs. I guess that's the massive mack-truck sized weakness I hadn't spotted with this whole plan. It makes me rather want something that can use whatever Chrome I have on the system, so disk & memory costs are low.
Electron should be updated much more often than that, and barring major new versions with breaking changes doing those updates should be effortless because the app is resilient enough to not need particular builds of Chromium.
I suppose if you could restrict to only Windows 11 it might help but there is still a ton of Windows 10 (and even 7!) out there. Does Windows 11 finally bundle Microsoft’s own standard C libraries?
I think the right path forward might be something like Sciter or Ultralight or even just a very stripped down version of Chromium. A web renderer is not that huge when it's stripped down and all the extensions and stuff a desktop app is not going to need are removed. You end up with something about as big as Qt or another cross-platform full stack UI toolkit.
At the end of the day none of this is any different from shipping containers or flatpaks, which bundle all the dependencies with them. In many ways Windows has escaped the DLL hell that plagued it in the past, whereas Linux still has some learning to do.
Just because you can wrap some web frontend framework around some libraries and take some fancy screenshots of your landing page doesn't make the software good.
For example on macOS, Electron plugs into the global menubar, making it easy for web app devs to give their Mac users native menus instead of falling back to a redundant in-app menubar. Nearly all electron apps on macOS take advantage of this feature, and if they migrated to PWAs they’d lose it.
PWAs also lack fine grained control over window chrome which puts them in an awkward twilight zone between browser window and desktop integrated web app.
- Golang server
- Use go:embed to embed the public folder of the frontend
- Open a webview pointing to localhost:ephermal port
Easy as pie, and less than a couple of kilobytes overhead.
I know that you can also compile the webview.cc into a dll specifically, and link against that. But I'd never done with Visual C++ because I am cross-compiling from Linux to Windows.
The README of the webview/webview project refers to the WebView2 SDK on NuGet, however [1]
> If you are on Windows, you might get a blank white screen. The reason for this is, accessing localhost from a UWP context is disabled by default. Run the following command with administrative privileges on the command prompt to fix this.
> CheckNetIsolation.exe LoopbackExempt -a -n="Microsoft.Win32WebViewHost_cw5n1h2txyewy"
> You may include this in your Windows setup files (with the user's consent) because users also may get an empty white screen on Windows.
Can this be avoided?
Still, glad there are many options for using web UI to create desktop apps these days.
[1]: Neutralino themselves link to this nice comparison table: https://github.com/Elanis/web-to-desktop-framework-compariso...
The introduction docs also claim "In Electron and NWjs, you have to install Node.js and hundreds of dependency libraries. Embedded Chromium and Node make simple apps bloaty. Neutralinojs offers a lightweight and portable SDK which is an alternative for Electron and NW.js."
Yet the installation here starts with NPM and depends on Node.
Sorry, but I don't see a significant difference between this and Electron just from the comparison chart linked in the docs. https://github.com/Elanis/web-to-desktop-framework-compariso...
Save for the fact that Neutralinojs is not listed as having any support for automated testing where Electron does.
The data there shows smaller and faster builds on empty apps but that doesn't count for much since no one ships empty apps.
Needs a fair comparison against its claimed competitors using app examples that at least mimic real world apps. For example, if building the typical kind of application people would build in Electron still results in a smaller deliverable and much faster build, that would start to make a case for a better developer experience.
Though I would guess that most developers would not switch and learn a new framework just to get slightly faster builds before considering test time. Integration test run times tend to take up most of the time in any build process.
The only reason anybody bothers with Apple’s similarly restricted-usage languages is because they open up access to a whole set of platforms as well as a set of frameworks so wide and deep (Cocoa/Cocoa Touch) that it’s practical to develop a highly quality polished app with them without bringing in any third party dependencies, which I don’t think Flutter will ever be able to do.
How you ensure the shared components are available seems more difficult, but it’s clearly more efficient for end users.
Your line of inquiry feels semi hostile to me & I'd like a lot to see a little more naunce & moderation & tentativeness rather than all guns blazing.
Most of your post seems to be about developer experience, of whether developers need node or what the build time is. Personally I think the choices here are incredibly smart & sensible, make perfect sense, and do a great job to do the most important thing, which is give the developers enormous leverage to build a maximally lightweight & fast desktop webapp.
Take a look at redbean server. How does it accomplish this?
How come?
By those numbers it compares remarkably will against Tauri.
Also:
Creating a portable application package#
The following guides are not documented yet.
Creating a portable application package for Linux Creating a portable application package for macOS Creating a portable application package for Windows
https://github.com/Elanis/web-to-desktop-framework-compariso...