Skip to content

Commit cbcbe05

Browse files
committed
refactor: Remove AlchemyHTMLElement base class
No component extends it anymore after moving every custom element to plain HTMLElement and connectedCallback. The base class encouraged the very constructor-time DOM work that violated the Web Components spec and broke cloneNode (SortableJS drag and drop). Dropping it removes the tempt to repeat that pattern and the documentation now points new components at extending HTMLElement directly.
1 parent 0df64b0 commit cbcbe05

3 files changed

Lines changed: 1 addition & 305 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ The admin interface uses a **hybrid architecture**:
188188

189189
**Modern Web Components** (preferred for new features):
190190
- Custom elements in `app/javascript/alchemy_admin/components/`
191-
- Base class: `AlchemyHTMLElement` (extends `HTMLElement`)
191+
- Extend `HTMLElement` directly; do all DOM work in `connectedCallback`
192192
- Examples: `alchemy-sitemap`, `alchemy-element-editor`, `alchemy-datepicker`
193193
- Vanilla JavaScript (no framework dependency)
194194

app/javascript/alchemy_admin/components/alchemy_html_element.js

Lines changed: 0 additions & 129 deletions
This file was deleted.

spec/javascript/alchemy_admin/components/alchemy_html_element.spec.js

Lines changed: 0 additions & 175 deletions
This file was deleted.

0 commit comments

Comments
 (0)