Skip to content

Commit 2e88633

Browse files
authored
chore: remove references to unused __TAURI_INTERNALS__.metadata (#11369)
1 parent 25cc565 commit 2e88633

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

Diff for: .changes/remove-unused-metadata-references.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@tauri-apps/api": patch:changes
3+
"tauri": patch:changes
4+
---
5+
6+
Remove references to no longer used `__TAURI_INTERNALS__.metadata.windows` and `__TAURI_INTERNALS__.metadata.webviews`.

Diff for: crates/tauri/scripts/bundle.global.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: crates/tauri/src/manager/mod.rs

-6
Original file line numberDiff line numberDiff line change
@@ -631,12 +631,6 @@ impl<R: Runtime> AppManager<R> {
631631
#[cfg(desktop)]
632632
pub(crate) fn on_webview_close(&self, label: &str) {
633633
self.webview.webviews_lock().remove(label);
634-
635-
if let Ok(webview_labels_array) = serde_json::to_string(&self.webview.labels()) {
636-
let _ = self.webview.eval_script_all(format!(
637-
r#"(function () {{ const metadata = window.__TAURI_INTERNALS__.metadata; if (metadata != null) {{ metadata.webviews = {webview_labels_array}.map(function (label) {{ return {{ label: label }} }}) }} }})()"#,
638-
));
639-
}
640634
}
641635

642636
pub fn windows(&self) -> HashMap<String, Window<R>> {

Diff for: packages/api/eslint.config.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,15 @@ export default [
4747
'@typescript-eslint/default-param-last': 'off',
4848
'@typescript-eslint/strict-boolean-expressions': 0,
4949
'no-return-await': 'warn',
50-
'@typescript-eslint/return-await': 'off'
50+
'@typescript-eslint/return-await': 'off',
51+
'@typescript-eslint/no-unused-vars': [
52+
'error',
53+
{
54+
argsIgnorePattern: '^_',
55+
varsIgnorePattern: '^_',
56+
caughtErrorsIgnorePattern: '^_'
57+
}
58+
]
5159
}
5260
}
5361
]

Diff for: packages/api/src/global.d.ts

-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ declare global {
2121
options?: InvokeOptions
2222
}) => void
2323
metadata: {
24-
windows: WindowDef[]
2524
currentWindow: WindowDef
26-
webviews: WebviewDef[]
2725
currentWebview: WebviewDef
2826
}
2927
plugins: {

Diff for: packages/api/src/mocks.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -136,22 +136,16 @@ export function mockIPC(
136136
* ```
137137
*
138138
* @param current Label of window this JavaScript context is running in.
139-
* @param additionalWindows Label of additional windows the app has.
140139
*
141140
* @since 1.0.0
142141
*/
143142
export function mockWindows(
144143
current: string,
145-
...additionalWindows: string[]
144+
..._additionalWindows: string[]
146145
): void {
147146
mockInternals()
148147
window.__TAURI_INTERNALS__.metadata = {
149-
windows: [current, ...additionalWindows].map((label) => ({ label })),
150148
currentWindow: { label: current },
151-
webviews: [current, ...additionalWindows].map((label) => ({
152-
windowLabel: label,
153-
label
154-
})),
155149
currentWebview: { windowLabel: current, label: current }
156150
}
157151
}

0 commit comments

Comments
 (0)