Skip to content

[WIP] Fix recursive calls and improve DOM building in build.ts#1

Draft
Copilot wants to merge 1 commit intomainfrom
copilot/fix-build-recursive-calls
Draft

[WIP] Fix recursive calls and improve DOM building in build.ts#1
Copilot wants to merge 1 commit intomainfrom
copilot/fix-build-recursive-calls

Conversation

Copy link

Copilot AI commented Nov 28, 2025

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original prompt

Fix issues in build.ts:

  • Remove incorrect recursive calls to build in the children handling, which incorrectly defines new custom elements instead of building the DOM structure.
  • Implement a proper recursive DOM building function to construct child elements from DescribeOptions.
  • Add support for beforeMount lifecycle hook.
  • Ensure event listeners are properly managed; remove click listener in disconnectedCallback (already done), but note that emit listeners are not removed (improvement suggestion).
  • Apply styles, className, attributes, emit listeners, and action click handlers to child elements recursively.
  • Append built child elements to the shadow root.
  • Keep the slot for light DOM content.

Refactor the code to use a helper function buildElement that recursively builds an HTMLElement from a DescribeOptions object.

This pull request was created as a result of the following prompt from Copilot chat.

Fix issues in build.ts:

  • Remove incorrect recursive calls to build in the children handling, which incorrectly defines new custom elements instead of building the DOM structure.
  • Implement a proper recursive DOM building function to construct child elements from DescribeOptions.
  • Add support for beforeMount lifecycle hook.
  • Ensure event listeners are properly managed; remove click listener in disconnectedCallback (already done), but note that emit listeners are not removed (improvement suggestion).
  • Apply styles, className, attributes, emit listeners, and action click handlers to child elements recursively.
  • Append built child elements to the shadow root.
  • Keep the slot for light DOM content.

Refactor the code to use a helper function buildElement that recursively builds an HTMLElement from a DescribeOptions object.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

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