Skip to content

Add defineCustomElement helper and refactor components#1

Open
0xDazzer wants to merge 3 commits into
HowProgrammingWorks:sonnetfrom
0xDazzer:refactor-define-custom-element
Open

Add defineCustomElement helper and refactor components#1
0xDazzer wants to merge 3 commits into
HowProgrammingWorks:sonnetfrom
0xDazzer:refactor-define-custom-element

Conversation

@0xDazzer

Copy link
Copy Markdown

Summary

  • Introduce a defineCustomElement factory (static/define-custom-element.mjs) that encapsulates the boilerplate of defining a custom element: attaching the shadow root, cloning the template content, declaring observedAttributes, and resolving element references by id.
  • Refactor the profile components to use the new helper, removing the duplicated setup code across each component.

Changes

  • New: static/define-custom-element.mjs
  • Refactored 10 profile components to use the helper (net -32 lines)

🤖 Generated with Claude Code

tshemsedinov and others added 2 commits June 12, 2026 10:25
Introduce a defineCustomElement factory that wires up the shadow DOM,
template cloning, observed attributes and element references, then
refactor the profile components to use it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@0xDazzer 0xDazzer force-pushed the refactor-define-custom-element branch from 1f15b95 to d47feac Compare June 12, 2026 08:32
Resolve leftover direct this.<el> access that survived conflict
resolution and would be undefined on the refactored components:
- profile-search: this.nameInput/this.emailInput
- profile-directory: this.list
- profile-item: this.openBtn/this.deleteBtn

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants