Shopify / Shopify/remote-dom

`bubbles` config not applied to `dispatchEvent()`

Open
#585 2 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

The bubbles configuration in remoteEvents is not automatically applied to events returned by dispatchEvent() functions. This forces developers to manually duplicate the bubbles configuration in each event constructor call.

Current behavior
static get remoteEvents() {
  return {
    click: {
      bubbles: true,  // This configuration is ignored
      dispatchEvent() {
        return new Event('click', {bubbles: true}); // Manual duplication required
      },
    },
  };
}
Expected behavior

The remote-dom framework should:

  1. Read the bubbles configuration from the event definition in remoteEvents
  2. Automatically apply it to any event returned by dispatchEvent()
  3. Override any bubbles setting in the returned event with the configured value
static get remoteEvents() {
  return {
    click: {
      bubbles: true,  // This should be automatically applied
      dispatchEvent() {
        return new Event('click'); // No manual bubbles specification needed
      },
    },
  };
}

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 by tracing how remoteEvents definitions and dispatchEvent() results are handled in the remote-dom codebase; the issue does not name a file or test. Verify the behavior with an event whose configured bubbles value differs from the returned event, and consider the work complete when the configured value consistently overrides the returned event's setting.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.