platevoltage 6 days ago

I did the same thing with one of my projects. I built a simple webcam viewer that is optimized for USB microscopes as I couldn't find anything out there for this purpose. Basically all of the functionality was implemented in the renderer. As I was planning for App Store submission, I realized that a 500mb webcam viewer might not be the best thing. I decided to port it to Tauri V2 and got it down to about 15mb.

3
smusamashah 6 days ago

What is the difference between Tauri and Electron. From what I understand both use browser for rendering, except electron ships the whole browser while Tauri use the browser already there on the system.

SpaceL10n 6 days ago

That's part of it, but also Tauri uses Rust on the backend while Electron uses Node. Electron is way more mature with a larger developer community, but Tauri keeps gaining momentum. If memory safety, bundle size, and performance are important to you, Tauri is a nice choice. Electron is not bad but there's a reason there are so many new players.

whywhywhywhy 5 days ago

The main significant difference, Electron bundles it's own version of Chrome which means you have very few cross platform issues when shipping Mac/Windows/Linux. This trades off a few hundred meg for consistency in rendering.

Tauri uses the OS engine which means Windows uses Edge presumably and Mac uses Safari's Webkit so you're going to have rendering differences and feature differences there.

amelius 6 days ago

> If memory safety

But Tauri is just a wrapper around WebKit, which is written mostly in C++.

kevincox 6 days ago

Yes, but it is far more tested, fuzzed, studied and battle hardened than your app code will ever be. So in the grand scheme of things it isn't a high risk for stability or security.

Yes, it would be nice if the full stack is memory safe, but that isn't a good reason to not write your own code in a memory safe language.

Aeolun 6 days ago

It has very easy binding for your own rust code, so anything you actually care about (your own code) will be memory safe.

bloomca 6 days ago

Tauri uses native WebView (can be very outdated in old OS versions) and compiles to native machine code. Electron bundles full Chromium (rendering engine for HTML/CSS+V8 for JS) AND Node.js for your app code.

Honestly if there was an Electron without Node.js which would use literally any compiled language (although Rust is probably too low level), it would've been more tolerable.

platevoltage 6 days ago

Exactly. Electron ships with a copy of chromium in every app, while Tauri uses the native WebView of the operating system.

Electron is also way more mature, but Tauri is improving.

correa_brian 6 days ago

That's pretty sick. Nice work. What's it called? We're working on the app store submission this week.

platevoltage 6 days ago

I ended up calling it Microscopic View. I made a webpage for it and everything.

https://microscopic-view.jgarrettcorbin.com

I got tied up with other projects while I was trying to navigate the submission process (it was my first time), so it's not up yet, but I'd be happy send you a build if you want to check it out.

djfergus 6 days ago

I’d love to see something like this optimized for low end Android - old tablets are almost free and otherwise useless even for web browsing.

Also, what is your recommendation for finding a cheap usable microscope? My brief forays to aliexpress have just resulted in frauds and trash.

platevoltage 6 days ago

https://plugable.com/products/usb2-micro-250x/

This is the one I use. It is surprising good for the price. It just behaves as a regular webcam.

I primarily use it for micro soldering, so your mileage may vary, but it is very good for the price. I got it on Amazon where I believe they have an official store.

itsibitzi 5 days ago

Out of interest, how did you stream the video data to the frontend?

platevoltage 5 days ago

I used MediaStream, which is part of the standard Web API

https://developer.mozilla.org/en-US/docs/Web/API/MediaStream