Skip to content

refactor(bundle-size): drop dead code paths + declare class fields#540

Open
layershifter wants to merge 3 commits into
microsoft:masterfrom
layershifter:chore/bundle-size-stack-3
Open

refactor(bundle-size): drop dead code paths + declare class fields#540
layershifter wants to merge 3 commits into
microsoft:masterfrom
layershifter:chore/bundle-size-stack-3

Conversation

@layershifter
Copy link
Copy Markdown
Member

Summary

Mechanical hygiene with no behavioural change:

  • declare-ify class fields that are assigned in constructors so TypeScript skips emitting init code for them in the compiled JS.
  • Audit Utils.ts to remove dead helpers and inline tiny one-shot utilities at call sites.
  • Drop legacy webkit/moz/ms fullscreen vendor-prefix branches in Outline (all currently-supported browsers expose the standard API).

Stack context

Stacked on top of #539. Net new in this PR: the source-file cleanups above.

layershifter and others added 3 commits May 11, 2026 11:41
\`patch-package\` postinstall hook applies three changes to
keyborg@2.14.0 covering both the ESM (\`dist/index.js\`) and CJS
(\`dist/index.cjs\`) bundles:

1. \`event.details = details\` — drop the \`@deprecated\` alias of
   \`event.detail\`. Tabster reads \`e.detail\` exclusively (verified
   across src/State/FocusedElement.ts and the rest of the codebase).

2. \`triggerKeys\` / \`dismissKeys\` props + the supporting
   \`shouldDismiss\` / \`scheduleDismiss\` / \`dismissTimer\`
   machinery. Tabster only ever calls \`createKeyborg(getWindow())\`
   with no props.

3. \`canOverrideNativeFocus\` runtime probe. Replaces the
   \`_canOverrideNativeFocus\` flag with the implicit-true assumption
   modern browsers (everything since IE9) already satisfy. The
   conditional \`details.isFocusedProgrammatically\` write becomes
   unconditional — semantically identical when override works.

Bundle deltas (createTabster default-mode):
  keyborg slice: 3.71 → 3.12 kB (-590 B, -16%)
  createTabster:  30.78 → 30.18 kB (-600 B)
  getModalizer:   38.47 → 37.87 kB (-600 B)
  getMover:       44.54 → 43.94 kB (-600 B)
  getCrossOrigin: 89.64 → 89.04 kB (-600 B)
  allExports:     92.09 → 91.50 kB (-590 B)

Tests pass: 3 pre-existing failures, no regressions across default,
uncontrolled, and root-dummy-inputs modes.

Stop-gap until upstream microsoft/keyborg can release the same
trims (the changes belong there, not as a Tabster-side fork).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
tabster
all exports
113.84 kB
30.937 kB
111.247 kB
30.242 kB
-2.593 kB
-695 B
tabster
createTabster (core)
39.761 kB
11.892 kB
38.541 kB
11.563 kB
-1.22 kB
-329 B
tabster
focusable.findAll
0 B
0 B
38.564 kB
11.572 kB
🆕 New entry
tabster
focusable.findLast
0 B
0 B
38.565 kB
11.571 kB
🆕 New entry
tabster
focusable.findNext
0 B
0 B
38.565 kB
11.571 kB
🆕 New entry
tabster
focusable.findPrev
0 B
0 B
38.565 kB
11.571 kB
🆕 New entry
tabster
getCrossOrigin
110.623 kB
30.244 kB
108.034 kB
29.572 kB
-2.589 kB
-672 B
tabster
getDeloser
49.268 kB
14.234 kB
47.975 kB
13.883 kB
-1.293 kB
-351 B
tabster
getGroupper
47 kB
13.593 kB
45.749 kB
13.256 kB
-1.251 kB
-337 B
tabster
getModalizer
49.072 kB
14.378 kB
47.795 kB
14.021 kB
-1.277 kB
-357 B
tabster
getMover
54.653 kB
15.887 kB
53.286 kB
15.507 kB
-1.367 kB
-380 B
tabster
getObservedElement
45.564 kB
13.484 kB
44.344 kB
13.16 kB
-1.22 kB
-324 B
tabster
getOutline
48.867 kB
14.216 kB
46.883 kB
13.758 kB
-1.984 kB
-458 B
tabster
getRestorer
42.518 kB
12.52 kB
41.287 kB
12.185 kB
-1.231 kB
-335 B

🤖 This report was generated against a579ebbd50e37f1565551549fe57bbc9ddafab64

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.

1 participant