perf: prevent leak of first DOM element that uses the mwlResizable directive#136
Merged
mattlewis92 merged 4 commits intomattlewis92:mainfrom Dec 17, 2025
Merged
perf: prevent leak of first DOM element that uses the mwlResizable directive#136mattlewis92 merged 4 commits intomattlewis92:mainfrom
mattlewis92 merged 4 commits intomattlewis92:mainfrom
Conversation
Remove singleton pattern from PointerEventListeners. Each ResizableDirective now creates its own instance of PointerEventListeners instead of using a shared static instance. This prevents leaking of the the Renderer2 instance that the singleton holds onto when the DOM it's associated with is destroyed
mattlewis92
reviewed
Dec 16, 2025
Using the injected Renderer2 leaks a reference to the host element of the first ResizableDirective instance via the singleton PointerEventListeners
mattlewis92
reviewed
Dec 16, 2025
projects/angular-resizable-element/src/lib/resizable.directive.ts
Outdated
Show resolved
Hide resolved
mattlewis92
reviewed
Dec 16, 2025
projects/angular-resizable-element/src/lib/resizable.directive.ts
Outdated
Show resolved
Hide resolved
mattlewis92
reviewed
Dec 16, 2025
projects/angular-resizable-element/src/lib/resizable.directive.ts
Outdated
Show resolved
Hide resolved
mattlewis92
reviewed
Dec 16, 2025
projects/angular-resizable-element/src/lib/resizable.directive.ts
Outdated
Show resolved
Hide resolved
mattlewis92
approved these changes
Dec 17, 2025
Owner
mattlewis92
left a comment
There was a problem hiding this comment.
LGTM, thanks for your contribution!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #136 +/- ##
==========================================
+ Coverage 81.00% 81.13% +0.13%
==========================================
Files 5 5
Lines 279 281 +2
Branches 59 59
==========================================
+ Hits 226 228 +2
Misses 42 42
Partials 11 11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Remove singleton pattern from PointerEventListeners.
Each ResizableDirective now creates its own instance of PointerEventListeners instead of using a shared static instance. This prevents leaking of the the Renderer2 instance that the singleton holds onto when the DOM it's associated with is destroyed