Skip to content

perf: drop WeakRefInstance IE11 shim#143

Merged
layershifter merged 4 commits intomicrosoft:mainfrom
layershifter:perf/drop-weakref-shim
Apr 23, 2026
Merged

perf: drop WeakRefInstance IE11 shim#143
layershifter merged 4 commits intomicrosoft:mainfrom
layershifter:perf/drop-weakref-shim

Conversation

@layershifter
Copy link
Copy Markdown
Member

@layershifter layershifter commented Apr 22, 2026

Summary

  • Replaces the internal WeakRefInstance shim with native WeakRef. .browserslistrc already excludes IE 11, so the shim's fallback branch was dead code on every supported target.
  • Drops the companion Disposable interface and the unused KeyborgCore.isDisposed() method (its body return !!this._win was inverted — returned true before dispose — which further confirms nothing on the supported path ever called it).
  • Public API unchanged.

WeakRef support

image

🤖 Generated with Claude Code

layershifter and others added 2 commits April 22, 2026 19:49
Four-PR plan to shrink keyborg's emitted bundle: drop the IE11
WeakRef shim, refactor classes to closures for better minification,
then measure ES2022 target and plain tsc emit as spikes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
First implementation plan in the bundle-size reduction stack.
Subsequent PRs (closure refactor, ES2022 spike, tsc-emit spike)
will get their own plans as the stack progresses.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@layershifter layershifter requested review from a team and mshoho as code owners April 22, 2026 18:05
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
keyborg
All exports
6.991 kB
2.077 kB
6.606 kB
1.957 kB
-385 B
-120 B
keyborg
createKeyborg() & disposeKeyborg()
6.755 kB
2.028 kB
6.37 kB
1.904 kB
-385 B
-124 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
keyborg
KEYBORG_FOCUSIN constant
64 B
80 B
🤖 This report was generated against f85618e6335ccb113ed0d126ab3c27a1c4671821

The WeakRefInstance class was a shim for IE11, which has since been
dropped from the browserslist target. Replacing it with the native
WeakRef removes the indirection and shrinks the bundle.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@layershifter layershifter force-pushed the perf/drop-weakref-shim branch from 944e6dd to 9f4e238 Compare April 22, 2026 19:00
@layershifter layershifter merged commit f823bc9 into microsoft:main Apr 23, 2026
3 checks passed
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