#Guidelines for where to put logic

9 messages · Page 1 of 1 (latest)

mellow trench
#

Hi everyone! I'm just starting out with Tauri v2 and I'm a little puzzled about where logic should reside, in Rust or in JavaScript. For example, the File System plugin provides both a JS and a Rust API, though I would have imagined it would be the server/Rust's job to handle files. The Window State plugin also provides APIs in both languages, though I had imagined this would be only a front end/JavaScript concern. Is there some existing documentation that provides guidelines on where to locate the logic of your Tauri desktop application?

languid ocean
#

to get a better view

mellow trench
#

Oh cool, I'll check that out. Thanks @languid ocean ! So as an example, my application is (partly) a file manager for multi-gigabyte files that live in S3. It will need to be able to transfer those files onto local network storage. This feels to me like a task for Rust as opposed to JavaScript, even though there's a JavaScript file system API. Or maybe JavaScript uses the file system while letting the user pick the save file location, then passes their choice to Rust, which does the network transfer?

languid ocean
#

and yes, it would be a task for Rust, as that would avoid CORS issues.

#

and to use the file system too

mellow trench
#

Perfect. Thanks very much for the pointers to the plugins repo!