Skip to content

BREAKING: drop deprecated event.details alias on KeyborgFocusInEvent#175

Open
layershifter wants to merge 1 commit into
microsoft:mainfrom
layershifter:perf/drop-event-details-alias
Open

BREAKING: drop deprecated event.details alias on KeyborgFocusInEvent#175
layershifter wants to merge 1 commit into
microsoft:mainfrom
layershifter:perf/drop-event-details-alias

Conversation

@layershifter
Copy link
Copy Markdown
Member

@layershifter layershifter commented May 18, 2026

Summary

KeyborgFocusInEvent.details is an @deprecated alias of event.detail carried for early consumers that predate the CustomEvent.detail migration. The known consumer chain — Tabster's src/State/FocusedElement.ts and the rest of its codebase — reads e.detail exclusively, and the field has been marked deprecated for several releases.

Drops the interface field and the per-dispatch event.details = details assignment in setupFocusEvent.

The KeyborgFocusInEvent interface collapses to a type alias:

// before
export interface KeyborgFocusInEvent extends CustomEvent<KeyborgFocusInEventDetails> {
  /** @deprecated - used `event.detail` */
  details?: KeyborgFocusInEventDetails;
}

// after
export type KeyborgFocusInEvent = CustomEvent<KeyborgFocusInEventDetails>;

Matching KeyborgFocusOutEvent's existing shape.

Public API impact

KeyborgFocusInEvent no longer carries the optional details field. Consumers should use event.detail. Worth a deprecation-removal call-out in the release notes (or a major bump if the maintainers prefer strict semver).

`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) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
keyborg
All exports
3.974 kB
1.627 kB
3.962 kB
1.622 kB
-12 B
-5 B
keyborg
createKeyborg() & disposeKeyborg()
3.806 kB
1.586 kB
3.794 kB
1.58 kB
-12 B
-6 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
keyborg
KEYBORG_FOCUSIN constant
64 B
80 B
🤖 This report was generated against dfd7fe32327b37d8746c44aef6cebeda1ecc2397

@layershifter layershifter changed the title perf: drop deprecated event.details alias on KeyborgFocusInEvent BREAKING: drop deprecated event.details alias on KeyborgFocusInEvent May 18, 2026
@layershifter layershifter marked this pull request as ready for review May 18, 2026 10:33
@layershifter layershifter requested review from a team and mshoho as code owners May 18, 2026 10:33
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.

2 participants