- From: Sasha Firsov <notifications@github.com>
- Date: Mon, 02 Oct 2023 21:25:57 -0700
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 3 October 2023 04:26:03 UTC
> It requires server configuration and resources.
Not necessary. If we deine imperative registry API as self-registering in current context, there would be no need for any server side special handling. Plain import JS module with payload like following suffice:
```js
// WCL
export defalut function register( contextComponent, tagmap={} ){
contextComponent.define(tagMap["my-custom-element"] || "my-custom-element", class MyCustomElement{ ... } )
contextComponent.define(tagMap["my-another-element"] || "my-another-element", class MyLuckyElement{ ... } )
}
```
```js
// caller
import someLib from 'path/wcl.js'
// within component ...
someLib.register(this)
```
_disclaimer_: syntax is not exact, just an idea
--
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/1033#issuecomment-1744169351
You are receiving this because you are subscribed to this thread.
Message ID: <WICG/webcomponents/issues/1033/1744169351@github.com>
Received on Tuesday, 3 October 2023 04:26:03 UTC