Tauri Apps without Rust? Write Your Backend in Javascript
TL;DR I wrote Tauri-specific rust bindings for BareKit as a Tauri plugin so you can write your backend in javascript without touching rust at all (other than enabling the plugin) or split your logic between javascript and rust. Most modules on NPM work out of the box. Native addons are autolinked. Mobile is supported as well. Interested? Read on! The plugin: tauri-plugin-bare-kit . I have to…
The headline "Tauri Apps without Rust? Write Your Backend in Javascript" discusses a new plugin that allows developers to write their backend in Javascript without needing to touch Rust, at least initially. This plugin, called tauri-plugin-bare-kit, is a Tauri plugin that works by writing a backend in Javascript using BareKit, a small and modular JavaScript runtime for desktop and mobile.
BareKit provides an asynchronous, event-driven architecture, and is built around libuv and V8, though it supports switching out V8 for other engines. Most modules on NPM work out of the box with BareKit, and native addons are autolinked. The plugin also supports mobile.
The plugin uses BareKit's C-API through FFI to deeply integrate BareKit with Tauri, allowing for simple import of worklets from webview, running of Javascript, and a simple but powerful two-way communication between code running in the webview and on Bare. BareKit worklets have no restrictions that front-end code has, and can access the filesystem and OS APIs.
However, loading remote code in your backend is not a common practice, and autolinking native addons as part of the application build for all supported platforms is necessary.
While the plugin does not expose any of the Tauri APIs to Bare, it enables simpler apps to require only one line of Rust code to enable the plugin. The plugin is designed to allow simple apps to run their backend in Javascript, while allowing for more complex use cases and deeper OS integration to be written in Rust. This plugin could potentially make Tauri apps more accessible to developers who prefer Javascript over Rust.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.