Shopify / Shopify/remote-dom

Event listeners are never released

Open
#562 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
91
Avg merge
9d 14h
Merged PRs (30d)
38

Description

SignalRemoteReceiver when detaching nodes is currently only releasing properties but not event listeners.

https://github.com/Shopify/remote-dom/blob/59f7bdd4ac314e6a468a0a5a4fd3a1c4a497137e/packages/signals/source/SignalRemoteReceiver.ts#L322-L324

Attempting to release them causes an issue when re-ordering nodes though, as the repositioned node will keep referencing the released listener.

The corresponding PR that highlights the issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/signals/source/SignalRemoteReceiver.ts at lines 322-324 and review the detach and node-reordering behavior described in PR 559. Determine how listener release interacts with repositioned nodes; done means detached listeners are released without leaving reordered nodes referencing released listeners.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.