- From: gima <notifications@github.com>
- Date: Sun, 24 Nov 2024 04:54:56 -0800
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <WICG/webcomponents/issues/754/2495985299@github.com>
### Use-case: * **<ins>Single Page App uses webcomponents</ins>** (window.customElements.define) to implement - for example - a chat app text input element. * **<ins>The site developers push live updates to their users.</ins>** * **<ins>Old webcomponent elements are replaced with their updated counterparts.</ins>** In this case - when the old chat-text-input webcomponent element is updated - the old webcomponent definition remains alive. This: * Pollutes the tag namespace * Takes up memory directly. And indirectly via all the dependencies that the webcomponent's implementing class has. This is the case because there exists no mechanism to un-define said old webcomponents and allow their resources to be freed by garbage collection. --- ### An alternative to this would be to **<ins>allow instantiating</ins>** custom **<ins>classes that extend HTMLElement</ins>** **<ins>without needing to register</ins>** a tag for **<ins>them at all</ins>**. When added to DOM, these would then present themselves as anonymous tags. Or have a randomly generated custom tag assigned to them. In which case the custom tag would be common to elements of one class. It could also be derived from the class's name, but should be different from other classes of the same name. An anonymous class should also be allowed without making it's corresponding random tag less valuable than for a class with a name. -- Reply to this email directly or view it on GitHub: https://github.com/WICG/webcomponents/issues/754#issuecomment-2495985299 You are receiving this because you are subscribed to this thread. Message ID: <WICG/webcomponents/issues/754/2495985299@github.com>
Received on Sunday, 24 November 2024 12:55:00 UTC