This week was all about pushing through a major challenge: bringing hardware integration to the CircuitVerse desktop app built using Tauri. With the web version already working thanks to the Web Serial API, it was time to get the same functionality working on the desktop β and that came with a whole new set of problems to solve.
The week started with a productive meeting with Harsh Rao and my mentor, Aman Asrani, to discuss hardware integration for the desktop app.
Harsh gave us a thorough overview of how Tauri works. I learned that the desktop app internally uses a WebView to load the simulatorβs website.
This became the core issue because Web Serial APIs aren't supported inside a WebView, which meant our current browser-based solution wouldnβt work on the desktop app.
π Searching for a Workaround
To solve this, the first thing I needed was a way to differentiate between a browser and Tauri environment in the code. Harsh told us about the isTauri
hook, which made this detection easy.
He also explained that Tauri provides plugins for native functionalities (like file downloads using the fs
plugin), and that serial communication would need a plugin too.
So I began researching the Tauri ecosystem and came across a very informative article: Serial Communication with Tauri Plugin (v1)
This gave me a clear understanding of how serial plugins work within Tauri. However, the plugin described in the article only supported Tauri v1, and our project uses Tauri v2, so I had to keep searching.
π Finally, a Working Plugin for Tauri v2
After some digging, I found a plugin that supports Tauri v2:
tauri-plugin-serialplugin on crates.io
This plugin was exactly what I needed!
I read through its documentation, understood the setup and usage, integrated it into the Tauri project, and tested everything β and yes, it works perfectly until now! π
π Other Progress
- Alongside the Tauri integration work, I also:
- Resolved review comments on my previous PRs as suggested by Aman
- Cleaned up and improved the code for already added components
- Began preparing for the upcoming PR that will integrate the working serial port support into the desktop app
This week ended on a really positive note. We finally figured out a way to enable serial communication in the desktop version of CircuitVerse. The support and collaboration from Aman and Harsh were key to unblocking this task.
Collaboration really does lead to success β and this week proved that once again.
Next week, Iβll be working on polishing the Tauri integration further and raising a proper PR for the same after thorough testing.
Top comments (0)