From 3176fca2b0efba1ef2840d83b4fd02a7a2bb5d80 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Mon, 18 May 2026 12:15:58 +0200 Subject: [PATCH] perf: drop deprecated event.details alias on KeyborgFocusInEvent `event.details` was kept as an `@deprecated` alias of `event.detail` for Tabster and other early consumers. The known consumer chain (Tabster's src/State/FocusedElement.ts and elsewhere) reads `e.detail` exclusively, and the field has been marked deprecated for multiple releases. Dropping the field plus the per-dispatch assignment trims a few bytes from every focus-in event handler call site. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/FocusEvent.mts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/FocusEvent.mts b/src/FocusEvent.mts index 1cdba78e6..455f3eb45 100644 --- a/src/FocusEvent.mts +++ b/src/FocusEvent.mts @@ -43,12 +43,7 @@ export interface KeyborgFocusInEventDetails { originalEvent?: FocusEvent; } -export interface KeyborgFocusInEvent extends CustomEvent { - /** - * @deprecated - used `event.detail` - */ - details?: KeyborgFocusInEventDetails; -} +export type KeyborgFocusInEvent = CustomEvent; export interface KeyborgFocusOutEventDetails { originalEvent: FocusEvent; @@ -229,9 +224,6 @@ export function setupFocusEvent(win: Window): void { detail: details, }); - // Tabster (and other users) can still use the legacy details field - keeping for backwards compat - event.details = details; - details.isFocusedProgrammatically = target === data[LAST_FOCUSED_PROGRAMMATICALLY]?.deref();