Back

Deno Desktop

244 points3 hoursdocs.deno.com
leleat56 minutes ago

> Shared CEF runtime across apps. Every app currently bundles its own CEF copy. A managed shared runtime would drop binary sizes to a few MB per app. On the roadmap.

This[0] sounds interesting. I am not familiar with CEF, so I wonder how the versioning works. When different apps require different versions of CEF, do we just essentially end up with the electron model where every app bundles their own browser (just slightly less bad). Or is there still an advantage to a "shared runtime" in that case?

[0]: https://docs.deno.com/runtime/desktop/comparison/

lwansbrough31 minutes ago

Similar to something I'm working on for games: https://jumpjet.dev

WASM you can bundle for Windows, macOS, Linux, Android, iOS and web. Like Deno Desktop, it doesn't rely on a browser engine.

ai_fry_ur_brain16 minutes ago

Do you reccomend and resources for building w/ & learning about wasm?

jorisw2 hours ago

> Web technology is the most widely-known UI toolkit in the world.

Poor choice of words there IMHO.

The reason Electron apps get a lot of flak is because they are everything _but_ a UI toolkit. They consistently miss the mark in adopting UI patterns from their host OS.

Web tech is just web tech. Yes it will allow you to render a button, but even unstyled, the button won't necessarily look native to the OS, and will vary between browsers.

Culonavirus44 minutes ago

That is not why people use Electron. The goal is not and never was to just be a "UI toolkit" and "adopting UI patterns from their host OS".

Chromium has so much stuff packed into it, its insane. All that utility comes with Electron. And that's a good thing.

If you ever worked with video, for example, you know that having the full power of a modern browser in a desktop app is a game changer. Video playback (not to mention transcoding, which is also possible with modern web and webcodecs) is a complex beast, implementing that yourself is massive undertaking, not to mention in a desktop app that is supposed to work on win/mac/lin. I've built apps with Electron in tens of hours that would otherwise take me tens of days or more (and thats with AI because I'm not a video expert).

conradludgate2 hours ago

How is it a poor choice of words? It might not be "native" UI, but they never claimed as such.

I've always felt that native UI on Linux always looks incredibly ugly and I'd much rather use a nicely styled HTML+CSS layout instead.

In my experience, Electron mostly gets flak for being bloated and slow, it not being native is sometimes a secondary point people add on top.

I've always wanted to build a direct-browser integration that could use HTML+CSS for the layout, but avoids needing a JS runtime. Idk how lightweight servo is but one day I hope I will see my idea come to light

noufalibrahim1 hour ago

I don't mind the idea of using HTML components and widgets to style desktop applications. CSS and the DOM are widely known and reusing those for desktop apps is probably a good idea.

The problem, as you've pointed out, is that electron apps are bloated and slow. If they became the default and my editor, chat client, terminal, and everything else that I keep open were just thin layers around web applications, I'd rather figure out a way to move things into a browser rather than pull a piece of the browser out to wrap these applications.

wiseowise40 minutes ago

There’s a point where it stops scaling in the browser, whether it’s due to scale or poor practices. For example Slack is annoyingly slow to start up and work in my FF, but works OK as an Electron app.

smackeyacky52 minutes ago

Looking native has long left the station as an objection about a UI.

Like 25 years ago. Nobody gives a damn since Microsoft stopped giving a damn.

vintermann35 minutes ago

I'm not part of the Apple world, but I thought they gave a damn?

jabwd29 minutes ago

Nah they stopped caring as well. Developing an application for macOS is hell nowadays. I hate the state of things but both Apple and Microsoft dropped the ball. Linux is even worse, so yeah I don't see a reality out of this unless we actually create something that surpasses the web in all measures.

LunaSea36 minutes ago

Who cares if it looks native?

Native UIs change all the time too and not always for the better.

Abishek_Muthian2 hours ago

Every time I use Zed across Linux, macOS and Windows , I'm amazed stable and performant it's GPUI framework is. As a user, I'm very happy with it; of course some basic features like accessibility is missing but I'm sure it will be implemented soon.

As a developer, I'm not sure what's the barrier for entry is apart from Rust then again it's the USP as well.

fny2 hours ago

Live reload. GUI development in compiled languages is a pain compared to web development.

eklavya1 hour ago

Try dioxus, it has live reload but it's a work in progress.

+1
ga_to50 minutes ago
wiseowise43 minutes ago

> Web tech is just web tech. Yes it will allow you to render a button, but even unstyled, the button won't necessarily look native to the OS, and will vary between browsers.

The irritating, and unnecessary, pedantry.

utopiah2 hours ago

> look native to the OS

Is that a problem? A button with a legible label is a button. The host OS doesn't have to look exactly like the applications it runs.

jorisw2 hours ago

Consistency is a large factor in any good design, UI design more so.

gf0001 hour ago

Consistent like what? Like maybe a decade ago one could say that osx was consistent, but nowadays even SwiftUI and cocoa is visibly different, let alone every second app that uses electron. And people don't care.

Windows has like 4 frameworks available on a bare new, latest OS install, just go deep enough in the "settings" or whatever they call it, and you can reach down to winforms. And on top the start menu is a react element!

(And in Linux you have the gtk and the qt world, and everything else)

Gigachad2 hours ago

They have internal consistency. The iOS version looks like the macos version which looks like the web version, etc.

This upsets HN users but the rest of the world decided that apps looking like windows built ins doesn't matter.

+1
ahartmetz2 hours ago
eterevsky1 hour ago

Within OS consistency is much less of thing a thing than Web design conventions. Windows by itself has had several different UI frameworks over the years, so different "native" Windows programs can look completely different from each other.

p-e-w1 hour ago

That’s why HN users constantly advocate for Vim, a program in which every single thing works completely differently from every other modern application.

vintermann32 minutes ago

Yes, if there's one lesson from historical UI research that still holds, it's that mode switching is expensive. That's why people install vi plugins everywhere.

Wait...

wilg2 hours ago

None of that changes whether it's a UI toolkit, which it surely is.

pjmlp2 hours ago

Yeah, it is mostly laziness and cost cutting at the expense of users.

Nowadays there isn't even an excuse anymore, just vibe code it away in native frameworks.

gf0001 hour ago

Which native framework?

Even in a "post-vibe code" era I wouldn't want to create multiple versions of the same app, and none of the "platform-native" GUI toolkits run on everything.

SwiftUI is apple-only, gtk has pretty bad compatibility on non-linux, qt is decent but requires C++ or python, and even so still not much for mobile. Don't even get started on "Windows frameworks", because as I write this sentence they may have left a new one in the ditch.

Flutter may be the closest, but why didn't they go with e.g. Java instead of a new language?

So yeah, if you want a truly universal UI then web is your best bet.

kajman1 hour ago

I never thought I'd defend Electron, but I'd rather use the bloated web UI than a vibe coded Qt/GTK version I'm positive will not have seen any human QA.

ThatMedicIsASpy1 hour ago

When I can modify my desktop/theme (KDE) with css I will happily start doing it since that sounds easy.

sheept2 hours ago

I was wondering how this integrates with Deno's permission system, which is one of its biggest strengths especially for letting agents run amok on your device.

The CLI reference page[0] notes,

> The permissions you grant at compile time are baked into the compiled binary:

I think it would be nice if this could be surfaced to the user somehow, like letting the user know and decide which permissions they want to give access to.

[0]: https://docs.deno.com/runtime/reference/cli/desktop/#runtime...

porridgeraisin2 hours ago

> What deno desktop doesn't have yet

> Runtime permissions for desktop apps (a permission prompt on every filesystem / network access, i.e. Deno's permission system applied to desktop sandboxing).

bel82 hours ago

I'm happy for competition in this space, specially because Deno can run true TypeScript directly and not just strip types like the current Node implementation.

With that said, this is going to eat a lot of Tauri market. Why would I use Tauri now? The 150mb of additional bundle size is just an extra 1 to 10 seconds of download time in most internet connections and you get a reliable rendering engine.

flohofwoe1 hour ago

Deno also just strips the type annotations when running TS code - at least by default. To get type checking you'll need to run via `deno run --check`, or use the separate `deno check` subcommand. No big deal since type checking and linting usually happens automatically in the IDE during development.

aabhay47 minutes ago

Tauri doesn't lock you in to one JS ecosystem. In fact, it doesn't require you to use javascript at all.

Also, we've had several developer framework startups get acquired -- Astro, Nuxt, UV, Bun, Vite. It doesn't exactly inspire confidence in a software that you want to last and give support for years.

swiftcoder1 hour ago

> and you get a reliable rendering engine

How is it more reliable than Tauri - aren't they both using the system webview?

bel81 hour ago

Deno Desktop can bundle CEF (Chromium Embedded Framework) according to https://docs.deno.com/runtime/desktop/comparison

fiatpandas1 hour ago

Deno desktop can use system web view OR embed CEF. Tauri is just system web view.

aabhay56 minutes ago

The benefit of Deno Desktop is it's like Tauri except for when you want it to be Electron???

jpace1211 hour ago

> Why would I use Tauri now?

You’re “backend” isn’t JavaScript.

solarkraft2 hours ago

This is a smart thing to ship. For me it would totally be a consideration when deciding on a platform to use.

sjeno2 hours ago

agree, small footprint & cross-platform looks like a nice alternative to electron or tauri..

franz8992 hours ago

Their comparison page shows some savings, but not in every case (~40 MB / ~150 MB) https://docs.deno.com/runtime/desktop/comparison/

krawcu1 hour ago

Why did they describe electrobun as macOS only? I checked their docs and it has support for Windows, macOS and Linux

https://docs.deno.com/runtime/desktop/comparison/ https://github.com/blackboardsh/electrobun#platform-support

lillesvin2 hours ago

As much as I like cross-platform stuff, I also really like native UIs that follow native UX patterns, etc.

deely32 hours ago

We spend a lot of time using different browsers. As far as I know there no web engine that use native OS UI for rendering.

sureglymop2 hours ago

Looks actually good!

I wonder if it supports opening invisible browser windows and doing things like intercepting cookies. In my desktop application I leverage a hidden browser window to manage auth state and use it like a proxy for the rest of the application. Might try to port it to deno desktop.

droidjj2 hours ago

> The default WebView backend uses the operating system's own webview for small binaries, and you still have the entire npm ecosystem available through Deno's Node compat layer.

Sounds like a similar architecture to Tauri, but your business logic is in typescript instead of rust.

progx2 hours ago

> Opt into the bundled Chromium (CEF) backend when you need identical rendering across macOS, Windows, and Linux.

Sound more like Electrobun

DaanDL1 hour ago

I swear we're just going to end up with Java again.

wiseowise25 minutes ago

Java would be a killer platform if they shipped built-in, tauri-like, UI.

mfru44 minutes ago

At this point I think that would be a more sane outcome than whatever it is we have right now.

daft_pink1 hour ago

Is it going to support iOS/Android?

arikrahman1 hour ago

I've decided on using a Clojure/Flutter hybrid that gets the best of all worlds. May integrate move from Bun to using Deno here https://codeberg.org/arik/clutter

utopiah2 hours ago

Interesting but IMHO as we see on mobile providing WebViews work. Maybe instead of having Electron, Tauri, Electrobun, now Deno desktop but also plenty of alternatives then desktop browsers should provide WebViews on desktop with sandbox and permissions that make those applications usable. The alternatives listed here would just be fallback for a transition period until the WebViews are "good enough".

pjmlp2 hours ago

Webviews have always worked since MSHTML, the issue is being comfy helping Google's market share instead of writing portable Web code.

utopiah2 hours ago

That's a whole can of worms, Micro$lop entangling its own browser with its OS, getting a (gentle) slap on the hand for its abuse of monopoly position for it, having to remove it claiming it's "impossible", etc.

andyferris2 hours ago

Is it not a web view? With nodejs capabilities from the “backend” half of the app for normal desktop app filesystem access etc?

utopiah2 hours ago

If a Web View is not provided by a browser then it's an already installed browser then it's as they say "web rendering engine" that they ship along.

I'm trying to argue that it should already be available via Firefox, Chromium, etc on desktop.

numlock8660 minutes ago

How does this differ from electrobun, which they explicitly mention, but make no point about? I had a quick drive with deno desktop and don't see how it's better. If anything it's lacking in comparison in my opinion. But hey, we can build desktop apps with deno now, too. So they got that going I guess ...

actionfromafar56 minutes ago

I think for a little while longer, you can catch bun anything, electro or not, refugeess just by not being bun.

wg01 hour ago

I hope bun desktop is coming soon?

bossyTeacher1 hour ago

How is this better than Electron?

IshKebab1 hour ago

Vastly easier to set up, optionally lets you use platform web renderers, Typescript by default, you can use the Deno API instead of Node (compatible with less code but much better designed), built-in auto update, you can use Fresh which IMO is the best web framework.

m00dy2 hours ago

would be cool to have a comparison with tauri.

tarcon2 hours ago

They really did their best comparing it with other tools here https://docs.deno.com/runtime/desktop/comparison/

porridgeraisin2 hours ago

While I've never liked to use deno compared to node and bun, this looks particularly good. The zero config options are nice, all the features seem to be in the place I like, and I'm happy they're not dogmatic about using the system webview and let you ship your own CEF. The state of system webviews on non-windows platforms is horrendous.

SudoSlayer902 hours ago

[dead]

huflungdung2 hours ago

[dead]

nimchimpsky2 hours ago

[dead]

DiabloD32 hours ago

I don't get the point of this.

The world is trying to make computers faster and more accessible, more web UI slop isn't going to help that. Dumping Javascript entirely is the first step on that road.

vinkelhake2 hours ago

I've seen variants of this comment for many years. The alternative to "web UI slop" would presumably be one of the many native toolkits.

I see it in a different way. The fact that "web UI slop" has managed to make great inroads on the desktop is an indictment of the state of native toolkits. If you think it's a problem that desktop apps are being written with web toolkits, the solution for that isn't to shame (as the term "web UI slop" clearly tries to do), but rather to figure out how to improve the native toolkits.

The opportunity to improve those toolkits was always there, and the ball was dropped.

kombine49 minutes ago

Yes, native UI toolkits are not perfect, even though I consider Qt very close to one (I'm sure naysayers will find nitpicks). In the end, the choice is between the apps that eat 1GB of your RAM and learning to deal with some idiosyncrasies of native toolkits.

DiabloD31 hour ago

It hasn't made any inroads on the desktop though... all anyone did was just package their own SWA into a self-contained browser that serves its own content. They continue to be websites, with all the pitfalls of them.

I don't need to spend 2GB-4GB of RAM just to have a over-glorified IRC clone!

Also, the native toolkits are fine. Windows has two toolkits, the ShellUI/MFC family (which does everything required, although it doesn't always get hidpi on legacy apps correct; it gets integration for blind people and also unicode/multilingual correct, and also works with touch interfaces), and WinUI does it more modernly (and ticks all the boxes). OSX has its toolkit, seems to nail everything correctly. Linux has Qt (lets ignore GTK for now, only reason you use GTK is if you want to appear Gnome-native), and Qt also does native++ uplifting on other toolkits (ie, native widget + additional feature expansion, plus perfect mimicry of native look for entirely new widgets), plus Qt does everything you need to do correctly and easily.

There are also new UI toolkits coming up through the ranks that are trying to knock Qt off that #1 position. None of the WebUIs would even place in this race.

Web UI toolkits always look non-native, are hard to interpret, often use low contrast (and frankly ugly) colorschemes, are easy to use in ways that do not comply with usability standards across OSes, and usually do nothing for A11Y.

The opportunity to improve those toolkits was always there, and the ball was dropped.

jaimehrubiks2 hours ago

This web page stole my scroll liberty