You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not 100% sure this is a bug, this might just be a Q&A.
I am trying to compartmentalize some parts of my codebase responsible of specific features in plugins. For example, I am trying to group all features related to blocking screen sleep in a plugin, that can be invocated from the front-end.
Example:
// src/integrations/sleepblocker.rsuse log::info;use tauri::plugin::{Builder,TauriPlugin};use tauri::{Runtime};#[tauri::command]pubfnenable() -> Result<(),String>{// TODOinfo!("ENABLE!!!!");Ok(())}#[tauri::command]pubfndisable() -> Result<(),String>{// TODOinfo!("DISABLED!!!!");Ok(())}/** * Plugin in charge of preventing the app from going to sleep */pubfninit<R:Runtime>() -> TauriPlugin<R>{Builder::<R>::new("sleepblocker").invoke_handler(tauri::generate_handler![enable, disable]).setup(|_app, _api| {// TODOOk(())}).build()}
And from the UI, based on user interaction on the setting view:
await invoke("plugin:sleepblocker|enable");
Doing so gives me the following error (browser console):
Unhandled Promise Rejection: "sleepblocker.enable not allowed. Plugin did not define its manifest"
Do local plugins really need a manifest? Do I need to move it out of src/ and to its own lib? I do not intend to publish my plugin, it's really just for me to organize my code.
Or is there a way to define the permissions/manifest locally? Or can I just whitelist all permissions from local plugins?
Unfortunetely yes. Support for inline plugins was added here: #8781. While there are no docs yet, hopefully the PR helps you to figure it out (it includes an update to our main example app).
I'll close this issue but feel free to keep discussing it. If you're facing any bugs we can reopen it :)
Describe the bug
I am not 100% sure this is a bug, this might just be a Q&A.
I am trying to compartmentalize some parts of my codebase responsible of specific features in plugins. For example, I am trying to group all features related to blocking screen sleep in a plugin, that can be invocated from the front-end.
Example:
And from the UI, based on user interaction on the setting view:
Doing so gives me the following error (browser console):
Do local plugins really need a manifest? Do I need to move it out of
src/
and to its own lib? I do not intend to publish my plugin, it's really just for me to organize my code.Or is there a way to define the permissions/manifest locally? Or can I just whitelist all permissions from local plugins?
Reproduction
cf. code above
Expected behavior
No response
Full
tauri info
outputThe text was updated successfully, but these errors were encountered: