perf: drop WeakRefInstance IE11 shim#143
Merged
layershifter merged 4 commits intomicrosoft:mainfrom Apr 23, 2026
Merged
Conversation
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>
📊 Bundle size reportUnchanged fixtures
|
This was referenced Apr 22, 2026
ecb567e to
944e6dd
Compare
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>
944e6dd to
9f4e238
Compare
mshoho
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
WeakRefInstanceshim with nativeWeakRef..browserslistrcalready excludes IE 11, so the shim's fallback branch was dead code on every supported target.Disposableinterface and the unusedKeyborgCore.isDisposed()method (its bodyreturn !!this._winwas inverted — returnedtruebefore dispose — which further confirms nothing on the supported path ever called it).WeakRefsupport🤖 Generated with Claude Code