Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(tauri): add plugin_boxed methods#13837

Merged
Legend-Master merged 2 commits into
tauri-apps:devfrom
WSH032:feat/plugin-dyn
Jul 18, 2025
Merged

feat(tauri): add plugin_boxed methods#13837
Legend-Master merged 2 commits into
tauri-apps:devfrom
WSH032:feat/plugin-dyn

Conversation

@WSH032
Copy link
Copy Markdown
Contributor

@WSH032 WSH032 commented Jul 16, 2025

Describe the problem

Because this PR is small enough, I didn’t open a feature request issue in advance.

I am implementing the feature to add tauri plugins from Python for pytauri: pytauri/pytauri#220.
In pyo3/pytauri, we cannot use generics, so I store these TauriPlugin as Box<dyn Plugin>.

However, Box<dyn Plugin> itself does not implement the Plugin trait, so I cannot use them in Builder::plugin and AppHandle::plugin.

Describe the solution you'd like

Therefore, I would like to add plugin_dyn methods to accept Box<dyn Plugin> instead of impl Plugin<R>.

Alternatives considered

Alternatively, we could impl Plugin<R> for Box<dyn Plugin<R>>. But I don't really like this approach, because it would result in Box<Box<dyn Plugin<R>>>.

But if tauri doesn't want to add a new API, I can also accept this implementation.

@WSH032 WSH032 requested a review from a team as a code owner July 16, 2025 16:58
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 16, 2025

Package Changes Through 55faa2d

There are 7 changes which include @tauri-apps/cli with patch, tauri-cli with minor, @tauri-apps/api with minor, tauri-runtime-wry with patch, tauri-bundler with patch, tauri with minor, tauri-utils with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.6.0 2.7.0
tauri-utils 2.5.0 2.6.0
tauri-bundler 2.5.0 2.5.1
tauri-runtime 2.7.0 2.7.1
tauri-runtime-wry 2.7.1 2.7.2
tauri-codegen 2.3.0 2.3.1
tauri-macros 2.3.1 2.3.2
tauri-plugin 2.3.0 2.3.1
tauri-build 2.3.0 2.3.1
tauri 2.6.2 2.7.0
@tauri-apps/cli 2.6.2 2.6.3
tauri-cli 2.6.2 2.7.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

Legend-Master
Legend-Master previously approved these changes Jul 17, 2025
Copy link
Copy Markdown
Contributor

@Legend-Master Legend-Master left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't mind adding it personally

Comment thread crates/tauri/src/app.rs Outdated
@WSH032 WSH032 changed the title feat(tauri): add plugin_dyn methods feat(tauri): add plugin_boxed methods Jul 17, 2025
Legend-Master
Legend-Master previously approved these changes Jul 17, 2025
Copy link
Copy Markdown
Contributor

@Legend-Master Legend-Master left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will wait for you to sign the commits when you get back 🙃

Comment thread crates/tauri/src/app.rs Outdated
@FabianLars FabianLars added this to the 2.7 milestone Jul 17, 2025
@Legend-Master Legend-Master merged commit 7f3c989 into tauri-apps:dev Jul 18, 2025
20 checks passed
@WSH032 WSH032 deleted the feat/plugin-dyn branch August 15, 2025 05:43
zphrs pushed a commit to zphrs/tauri that referenced this pull request Jan 4, 2026
* feat(tauri): add `plugin_dyn` methods

* refactor: rename `plugin_dyn` to `plugin_boxed`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants