Most active commenters
  • yoav(5)

113 points CharlesW | 28 comments | | HN request time: 1.248s | source | bottom
1. sshine ◴[] No.42200114[source]
How do they manage the OS-specific stuff with pure TypeScript? How does it compare in benchmarks against Tauri for size and speed?
replies(2): >>42200206 #>>42200232 #
2. semireg ◴[] No.42200206[source]
A: native bindings written in zig
3. c0wb0yc0d3r ◴[] No.42200232[source]
I dug through it a tiny bit because I was curious as well. To me it looks like OS-specifics aren't dealt with in the project. It uses bun to run the TypeScript. From the getting started docs the project just opens a browser window for the UI. I didn't look to see if this meant the user's default browser or a bundled browser.
replies(1): >>42200661 #
4. mdaniel ◴[] No.42200560[source]
Bold choice: https://electrobun.dev/docs/guides/Compatability#:~:text=No%... (that text appears right next to "macOS (arm)")

Given that, I was curious how their workflows folder looked but, well, that answers that question: https://github.com/blackboardsh/electrobun/tree/9ce4ed636100...

replies(2): >>42200701 #>>42200822 #
5. yoav ◴[] No.42200661{3}[source]
Native bindings written in c/objc and a zig binary that bun spawns.
6. veidr ◴[] No.42200676[source]
So this aspires to be something like Tauri, but with Zig for the fast/native bits, and leaning harder on and more opinionated about the frontend/UI part?

That's a pretty interesting proposal, but also a staggeringly huge amount of work.

replies(1): >>42200712 #
7. yoav ◴[] No.42200701[source]
It’s still early and it’s just me working on it so I’m trying to get to stability and then building for (distribute apps to) windows and linux before making all the cli stuff work to let you dev on other OSes.

So “no immediate plans” means check back next year after the 1.0.0 release

replies(1): >>42201629 #
8. yoav ◴[] No.42200712[source]
It’s only been a few months but yes it’s a huge undertaking.

I’m only picking up steam though and my whole career has been taking on these kinds of huge projects so it’s just getting started.

replies(1): >>42200750 #
9. veidr ◴[] No.42200750{3}[source]
Awesome. :) Good luck.

I think it's a really attractive package for an early-stage one-person project. Nice docs, and cute bunny.

FWIW, it also seems super-sensible to focus on Mac only for now, and get the basics working well there — a good Mac DX could provide the traction/momentum to get more contributors to help build out the obvious cross-platform promise.

replies(2): >>42201283 #>>42201314 #
10. bobajeff ◴[] No.42200767[source]
>Security and Performance with isolation between the main and webview processes

That's one of the performance characteristics I'm afraid will hinder certain applications.

It sounds like you need to use a IPC bridge to share data between the main process and renderor. Which means copying all the shared data. Like if I wanted to use ffmpeg for decoding video then each frame I'm waiting for a the decoded image to be copied before rendering it.

replies(2): >>42200780 #>>42200881 #
11. afavour ◴[] No.42200780[source]
Eh, it’ll hinder certain applications but very few, really. Assuming the webview is intended for UI and very little else.
12. bearjaws ◴[] No.42200822[source]
Not supporting arm is dead on arrival for anyone looking to build cross platform...
replies(1): >>42201693 #
13. yoav ◴[] No.42200881[source]
Originally I had it going via browser -> postmessage -> zig -> bun via named pipes and then bun -> zig via named pipe -> js via evaluate js.

I’m building https://colab.sh/ with electrobun and that rpc was pretty slow when trying to load multi MB files in the code editor.

Last week I added an encrypted socket rpc option directly between bun and browser.

Loading a 2MB file went from a few seconds to 400ms.

I made it so that in contexts where CORS allows it automatically upgrades to the socket based faster RPC.

That’s via RPC though. electrobun also exposes a custom views:// scheme in the browser context that can load files directly from specific sandboxed places in the file system. More to improve there but for a very big file you’d be better off writing it to the file system that would be much faster.

14. dmazzoni ◴[] No.42201110[source]
I'm a fan of more frameworks for desktop apps that wrap system webview rather than embedding Chromium.

Chromium is awesome and all, but it's just way overkill for many apps, and doesn't make sense for the download size and the need to support auto-update for security features.

replies(1): >>42201225 #
15. hresvelgr ◴[] No.42201225[source]
I feel the reason the system web-view is eschewed in these frameworks is because you have no choice but to maintain compatibility with 3-4 browsers: Edge/IE on Windows, Safari on Mac, and Firefox on Linux (usually).
replies(2): >>42201247 #>>42201478 #
16. yoav ◴[] No.42201247{3}[source]
The number 1 request I get from people is to add the ability to optionally bundle chromium.

I personally prefer the system webview because you don’t have to rush update your app for every chromium security update. And on the web making things cross browser is a normal part of the job and instinct imo.

But there are a ton of early startups that only have bandwidth to support chrome/chromium in their complex webapps and want a quick way to port their web app to desktop app. For them taking on the security burden and increasing bundle size is a good tradeoff to getting that consistency.

Luckily electrobun has a custom zig bsdiff implementation that generates update diffs as small as 4KB and self extracting executable that uses zstd so at least the file size is less relevant of a concern compared to electron.

replies(2): >>42201583 #>>42201782 #
17. klabb3 ◴[] No.42201283{4}[source]
> it also seems super-sensible to focus on Mac only for now

I’m the first guy to agree to reduced scope, but unfortunately the reality of cross platform is that the subtle details affect the APIs, and once you add more platforms, you can realize issues too late. As a simple example, MacOS has a concept of “showing/activating the app” whereas Windows has… well individual windows. They add up, especially if you add mobile to the mix.

I think the most sensible is to keep the api surface small, and also to peek at electron, tauri etc to learn and try not making expensive mistakes.

18. Carrok ◴[] No.42201300[source]
Why do so many projects fail to include any screenshots at all?

Maybe the authors don't think it's necessary, but step 3 under `Getting Started` is called `Creating UI`. Why would they not show what the result of the tutorial looks like?

replies(1): >>42201503 #
19. brailsafe ◴[] No.42201314{4}[source]
Ya, I kind of hate to say it, but it feels like because of Window's backwards compatibility and variation in UI styles over the years, people expect Mac apps to be comparatively pretty consistent, and consistently good. There's some wiggle room, but usually it's some niche open source app that's just too generally useful to prioritize mac
20. thayne ◴[] No.42201478{3}[source]
> Firefox on Linux (usually).

No, linux is usually webkit (which is also what safari is based on). Both Gtk and Qt have webkit-based widgets.

I'm not aware of a gecko based webview for desktop. Unfortunately, Firefox's technology is even more poorly suited for embedding than chromium's.

21. Ringz ◴[] No.42201503[source]
Not only are screenshots often missing, but I’m also surprised by how many projects fail to describe the purpose and goals of their project in short, simple sentences. Many mistakenly assume that only users and developers visit the website or repository, not decision-makers. More ELI5 ("Explain Like I'm 5") can never hurt.
22. lolinder ◴[] No.42201583{4}[source]
> you don’t have to rush update your app for every chromium security update

I'm interested to hear more about this—if you're using security-sensitive features in a WebView, aren't you then at the mercy of the OS to patch them whenever they see fit? And if you're not using features that have security implications, why do you need the latest version of Chromium at all times?

23. thayne ◴[] No.42201629{3}[source]
What does "not supported" mean?

Does it mean "you can probably get this to work, but it's not my OS so I won't go out of my way to help you" or "the build process depends on something only available on macs"?

There isn't an obvious reason it wouldn't be possible to build on linux or WSL at least on windows.

24. sschueller ◴[] No.42201693{3}[source]
It's the other way around, they only support arm at the moment: https://github.com/blackboardsh/electrobun/issues/10#issueco...
25. littlestymaar ◴[] No.42201782{4}[source]
> But there are a ton of early startups that only have bandwidth to support chrome/chromium in their complex webapps and want a quick way to port their web app to desktop app.

Ugh!

People writing web apps without supporting anything else than Chrome should burn in hell. (And that's a pretty useless decision anyway since “supporting chrome” really means supporting two engines: Chromium and WebKit, because Chrome on iOS uses WebKit internally …)

26. throwaway888abc ◴[] No.42201803[source]
"...and cross-platform desktop applications" the homepage says

But, Sadly, this is mac only[0] no windows or linux ? Do I understand it correctly ?

[0] https://electrobun.dev/docs/guides/Compatability

27. kookamamie ◴[] No.42201808[source]
> Ship updates to your users that are tiny

What about the users that are medium or large?