vildantursic
vildantursic16mo ago

Embeding Dino compiled code within rust (Tauri) code, inside main.rs during build compilation.

Hi. Still not sure if this is question for Tauri community or Deno community, so I'll place on both Discord servers. Since Deno is built on Rust, is it be possible to write some functions is Deno and during tauri build (rust compilation) bundle them with rest of rust code and call that code via rust (Tauri) like invoke("my func") ? e.g.
// deno-code.ts
export const myFunc = (name: string): string => `Hello, ${name}`
// deno-code.ts
export const myFunc = (name: string): string => `Hello, ${name}`
-----
// react App.tsx
// ...
import { invoke } from "@tauri-apps/api"

const message = await invoke("myFunc", { name })
// ...
// react App.tsx
// ...
import { invoke } from "@tauri-apps/api"

const message = await invoke("myFunc", { name })
// ...
To be more clear, I don't want deno sidecar or separate deno file to run on some port. I would like those compiled deno functions (in rust) directly embeded in app.exe, precompiled with rest of main.rs functions. Thank you in advance
0 Replies
No replies yetBe the first to reply to this messageJoin