Skip to content

Commit 9a79dc0

Browse files
authored
refactor(core): remove window endpoints (#6947)
1 parent 5a9307d commit 9a79dc0

File tree

29 files changed

+76
-3893
lines changed

29 files changed

+76
-3893
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri": patch
3+
"tauri-utils": patch
4+
---
5+
6+
Remove `enable_tauri_api` from the IPC scope.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-macros": patch
3+
---
4+
5+
Removed the module command macros.

.changes/remove-window.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 `window` JS APIs to its own plugin in the plugins-workspace repository.

core/tauri-config-schema/schema.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2508,11 +2508,6 @@
25082508
"items": {
25092509
"type": "string"
25102510
}
2511-
},
2512-
"enableTauriAPI": {
2513-
"description": "Enables access to the Tauri API.",
2514-
"default": false,
2515-
"type": "boolean"
25162511
}
25172512
},
25182513
"additionalProperties": false

core/tauri-macros/src/command_module.rs

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

core/tauri-macros/src/lib.rs

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55
use crate::context::ContextItems;
66
use proc_macro::TokenStream;
7-
use syn::{parse_macro_input, DeriveInput, ItemFn};
7+
use syn::{parse_macro_input, DeriveInput};
88

99
mod command;
10-
mod command_module;
1110
mod mobile;
1211
mod runtime;
1312

@@ -81,40 +80,3 @@ pub fn default_runtime(attributes: TokenStream, input: TokenStream) -> TokenStre
8180
let input = parse_macro_input!(input as DeriveInput);
8281
runtime::default_runtime(attributes, input).into()
8382
}
84-
85-
/// Prepares the command module enum.
86-
#[doc(hidden)]
87-
#[proc_macro_derive(CommandModule, attributes(cmd))]
88-
pub fn derive_command_module(input: TokenStream) -> TokenStream {
89-
let input = parse_macro_input!(input as DeriveInput);
90-
command_module::generate_run_fn(input)
91-
}
92-
93-
/// Adds a `run` method to an enum (one of the tauri endpoint modules).
94-
/// The `run` method takes a `tauri::endpoints::InvokeContext`
95-
/// and returns a `tauri::Result<tauri::endpoints::InvokeResponse>`.
96-
/// It matches on each enum variant and call a method with name equal to the variant name, lowercased and snake_cased,
97-
/// passing the context and the variant's fields as arguments.
98-
/// That function must also return the same `Result<InvokeResponse>`.
99-
#[doc(hidden)]
100-
#[proc_macro_attribute]
101-
pub fn command_enum(_: TokenStream, input: TokenStream) -> TokenStream {
102-
let input = parse_macro_input!(input as DeriveInput);
103-
command_module::generate_command_enum(input)
104-
}
105-
106-
#[doc(hidden)]
107-
#[proc_macro_attribute]
108-
pub fn module_command_handler(attributes: TokenStream, input: TokenStream) -> TokenStream {
109-
let attributes = parse_macro_input!(attributes as command_module::HandlerAttributes);
110-
let input = parse_macro_input!(input as ItemFn);
111-
command_module::command_handler(attributes, input).into()
112-
}
113-
114-
#[doc(hidden)]
115-
#[proc_macro_attribute]
116-
pub fn module_command_test(attributes: TokenStream, input: TokenStream) -> TokenStream {
117-
let attributes = parse_macro_input!(attributes as command_module::HandlerTestAttributes);
118-
let input = parse_macro_input!(input as ItemFn);
119-
command_module::command_test(attributes, input).into()
120-
}

0 commit comments

Comments
 (0)