Skip to content

Conversation

@nirmal
Copy link
Contributor

@nirmal nirmal commented Dec 15, 2025

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

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
Using the injected Renderer2 leaks a reference to the host element of the first ResizableDirective instance via the singleton PointerEventListeners
@mattlewis92 mattlewis92 changed the title Fix leak of Renderer2 instance perf: prevent leak of first DOM element that uses the mwlResizable directive Dec 16, 2025
Copy link
Owner

@mattlewis92 mattlewis92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for your contribution!

@mattlewis92 mattlewis92 enabled auto-merge (squash) December 17, 2025 11:18
@mattlewis92 mattlewis92 merged commit 9696702 into mattlewis92:main Dec 17, 2025
1 check passed
@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.13%. Comparing base (8fd74b7) to head (4613916).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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