DrSensor / DrSensor/nusa

<define-element>

Open
#60 4 comments 0 reactions 0 assignees View on GitHub
enhancement priority: low
Dominant language
JavaScript
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Has same signature as `` but for defining a custom-element.

```html




0

```

It only fetch then apply linked modules when the custom-element is in view.

> **Note** that it use `root=open/closed` instead of `shadowroot=open/closed` to avoid ghosted elements

> **Warning** it may cause layout shift

## TODO
- [ ] define custom-element
- [ ] `extends` from existing `HTML<*>Element`
- [ ] delete custom-element from registry when disconnected from document
- [ ] immediate query and lazy bind on every `slotchange`

## Related
### [Declarative Syntax for Custom Elements](https://github.com/WICG/webcomponents/blob/gh-pages/proposals/Declarative-Custom-Elements-Strawman.md) (strawman proposal)
Maybe *partially* rewriting the current implementation as module 🤔
> **Warning**: Don't ever rewrite `` as module!
```html






import { scope } from "nusa"
@scope
class MyElement extends HTMLFormElement {
/* ~ */
}

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.