Skip to content

Domkit: Rebuilding dynamic components#57

Merged
yuxiaomao merged 3 commits intoHeapsIO:masterfrom
trethaller:patch-1
Jun 2, 2025
Merged

Domkit: Rebuilding dynamic components#57
yuxiaomao merged 3 commits intoHeapsIO:masterfrom
trethaller:patch-1

Conversation

@trethaller
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

@rcstuber rcstuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the code looks like it only looks for the uiInitFunction in the super classes. Doing it like this still throws an "Missing initComponent()" error in the class constructor for me. See: https://github.com/HeapsIO/domkit/blob/1333393c1a0e079542ef70808cd8b9e1b4d9c167/domkit/Macros.hx#L437

@trethaller
Copy link
Copy Markdown
Contributor Author

@rcstuber you're right! this is actually a bug. Usually we define a base class for all domkit components which actually has @:uiNoComponent and does not call initComponent(), so this hasn't been a problem for us, but thanks for pin-pointing the problem, I've filed a ticket HeapsIO/domkit#25

@rcstuber
Copy link
Copy Markdown

The issue with this seems that if the markup needs variables passed to the constructor then the function defined through uiInitFunction needs those too, but it gets implemented as an overridden method, so the method signature may vary from one sub-component to the other which won't compile. Am I missing something maybe?

@yuxiaomao yuxiaomao merged commit ff8aa60 into HeapsIO:master Jun 2, 2025
@yuxiaomao
Copy link
Copy Markdown
Collaborator

It now works for me and let's merge this very useful doc

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.

3 participants