mdn / mdn/browser-compat-data

api.CustomElementRegistry - Scoped custom element registry, Safari TP 214 supports constructor

Open
#27,035 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

browser:safari data:api p4
Dominant language
JSON
Stars
5.8k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
186

Description

What type of issue is this?

Missing compatibility data

What information was incorrect, unhelpful, or incomplete?

The CustomElementRegristry data will need to be changed to account for the new "Scoped custom element registry" feature, which lets developers create their own registries, in addition to using the global one (via window.customElements).

My understanding is that you can now do new CustomElementRegistry(). This wasn't possible before.

What browsers does this problem apply to, if applicable?

No response

What did you expect to see?

New BCD data that captures the fact that new CustomElementRegistry() works in some browsers.

Did you test this? If so, how?

I tested the above JS expression in Chromium, and it worked there. I am unclear as to whether the feature is implemented fully/correctly in Chromium, because the Chromestatus entry isn't showing the feature has having shipped, and was last updated in 2022: https://chromestatus.com/feature/5090435261792256

This comment: https://github.com/whatwg/html/issues/10854#issuecomment-2816888199 says that the feature has shipped in Safari TP.
See STP214 release notes: https://developer.apple.com/documentation/safari-technology-preview-release-notes/stp-release-214#Web-API

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

MDN page related to this: https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry

HTML spec, which now mentions the feature: https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-api

Do you have anything more you want to share?

Corresponding MDN content issue: https://github.com/mdn/content/issues/38266

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry

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 with the api.CustomElementRegistry entry and review the HTML spec, Safari Technology Preview 214 release notes, MDN's CustomElementRegistry page, and the linked Chromium and WHATWG discussions. Verify which browsers support new CustomElementRegistry(), then update the compatibility data with confirmed support and ensure the entry distinguishes this scoped-registry feature.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, web-dev
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.