Skip to content

Commit cebd752

Browse files
authored
refactor(core): remove the clipboard APIs (#6728)
1 parent 276e4a3 commit cebd752

File tree

8 files changed

+12
-192
lines changed

8 files changed

+12
-192
lines changed

.changes/remove-clipboard.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri": patch
3+
"api": patch
4+
---
5+
6+
Moved the `clipboard` feature to its own plugin in the plugins-workspace repository.

core/tauri/scripts/bundle.global.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/tauri/src/app.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,6 @@ pub struct AppHandle<R: Runtime> {
264264
pub(crate) manager: WindowManager<R>,
265265
#[cfg(all(desktop, feature = "global-shortcut"))]
266266
global_shortcut_manager: R::GlobalShortcutManager,
267-
#[cfg(feature = "clipboard")]
268-
clipboard_manager: R::ClipboardManager,
269267
/// The updater configuration.
270268
#[cfg(updater)]
271269
pub(crate) updater_settings: UpdaterSettings,
@@ -320,8 +318,6 @@ impl<R: Runtime> Clone for AppHandle<R> {
320318
manager: self.manager.clone(),
321319
#[cfg(all(desktop, feature = "global-shortcut"))]
322320
global_shortcut_manager: self.global_shortcut_manager.clone(),
323-
#[cfg(feature = "clipboard")]
324-
clipboard_manager: self.clipboard_manager.clone(),
325321
#[cfg(updater)]
326322
updater_settings: self.updater_settings.clone(),
327323
}
@@ -480,8 +476,6 @@ pub struct App<R: Runtime> {
480476
manager: WindowManager<R>,
481477
#[cfg(all(desktop, feature = "global-shortcut"))]
482478
global_shortcut_manager: R::GlobalShortcutManager,
483-
#[cfg(feature = "clipboard")]
484-
clipboard_manager: R::ClipboardManager,
485479
handle: AppHandle<R>,
486480
}
487481

@@ -494,8 +488,6 @@ impl<R: Runtime> fmt::Debug for App<R> {
494488

495489
#[cfg(all(desktop, feature = "global-shortcut"))]
496490
d.field("global_shortcut_manager", &self.global_shortcut_manager);
497-
#[cfg(feature = "clipboard")]
498-
d.field("clipboard_manager", &self.clipboard_manager);
499491

500492
d.finish()
501493
}
@@ -639,13 +631,6 @@ macro_rules! shared_app_impl {
639631
self.global_shortcut_manager.clone()
640632
}
641633

642-
/// Gets a copy of the clipboard manager instance.
643-
#[cfg(feature = "clipboard")]
644-
#[cfg_attr(doc_cfg, doc(cfg(feature = "clipboard")))]
645-
pub fn clipboard_manager(&self) -> R::ClipboardManager {
646-
self.clipboard_manager.clone()
647-
}
648-
649634
/// Gets the app's configuration, defined on the `tauri.conf.json` file.
650635
pub fn config(&self) -> Arc<Config> {
651636
self.manager.config()
@@ -1513,9 +1498,6 @@ impl<R: Runtime> Builder<R> {
15131498
#[cfg(all(desktop, feature = "global-shortcut"))]
15141499
let global_shortcut_manager = runtime.global_shortcut_manager();
15151500

1516-
#[cfg(feature = "clipboard")]
1517-
let clipboard_manager = runtime.clipboard_manager();
1518-
15191501
#[allow(unused_mut)]
15201502
let mut app = App {
15211503
runtime: Some(runtime),
@@ -1524,15 +1506,11 @@ impl<R: Runtime> Builder<R> {
15241506
manager: manager.clone(),
15251507
#[cfg(all(desktop, feature = "global-shortcut"))]
15261508
global_shortcut_manager: global_shortcut_manager.clone(),
1527-
#[cfg(feature = "clipboard")]
1528-
clipboard_manager: clipboard_manager.clone(),
15291509
handle: AppHandle {
15301510
runtime_handle,
15311511
manager,
15321512
#[cfg(all(desktop, feature = "global-shortcut"))]
15331513
global_shortcut_manager,
1534-
#[cfg(feature = "clipboard")]
1535-
clipboard_manager,
15361514
#[cfg(updater)]
15371515
updater_settings: self.updater_settings,
15381516
},

core/tauri/src/endpoints.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ use serde_json::Value as JsonValue;
1313
use std::sync::Arc;
1414

1515
mod app;
16-
#[cfg(clipboard_any)]
17-
mod clipboard;
1816
#[cfg(dialog_any)]
1917
mod dialog;
2018
mod event;
@@ -81,8 +79,6 @@ enum Module {
8179
Http(http::Cmd),
8280
#[cfg(global_shortcut_any)]
8381
GlobalShortcut(global_shortcut::Cmd),
84-
#[cfg(clipboard_any)]
85-
Clipboard(clipboard::Cmd),
8682
}
8783

8884
impl Module {
@@ -167,13 +163,6 @@ impl Module {
167163
.and_then(|r| r.json)
168164
.map_err(InvokeError::from_anyhow)
169165
}),
170-
#[cfg(clipboard_any)]
171-
Self::Clipboard(cmd) => resolver.respond_async(async move {
172-
cmd
173-
.run(context)
174-
.and_then(|r| r.json)
175-
.map_err(InvokeError::from_anyhow)
176-
}),
177166
}
178167
}
179168
}

core/tauri/src/endpoints/clipboard.rs

Lines changed: 0 additions & 76 deletions
This file was deleted.

tooling/api/docs/js-api.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tooling/api/src/clipboard.ts

Lines changed: 0 additions & 75 deletions
This file was deleted.

tooling/api/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
*/
1515

1616
import * as app from './app'
17-
import * as clipboard from './clipboard'
1817
import * as dialog from './dialog'
1918
import * as event from './event'
2019
import * as globalShortcut from './globalShortcut'
@@ -34,7 +33,6 @@ const invoke = tauri.invoke
3433
export {
3534
invoke,
3635
app,
37-
clipboard,
3836
dialog,
3937
event,
4038
globalShortcut,

0 commit comments

Comments
 (0)