-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
virtual component uses part to associate with container #42
Comments
Ah, yeah this is a bit of a problem isn't it. We might need a 2-dimensional map (the part maps to another map which contains renderer => container mapping). However I'm not quite sure this would work either because the renderer function might be defined within another renderer. This case: function App() {
return html`<p>${virtual(() => html`hello world`)}</p>`;
} So... I'm not sure what to do about this exactly. Will ponder on it some more... |
@matthewp first, thanks for a great library. Any resolution on this bug or thoughts what is the good solution may be? |
I haven't thought of a solution yet. I don't use virtual components a whole lot to be honest, maybe someone who uses them more will have a good idea for this... |
I have gave it a thought and tried out couple of ideas, but there is something about how lit-html directives work that does not allow having virtual components, and I propose to ditch it for now. But there is an alternative of course, that is already in place Only difference of course is that those are not really "Components" since they do not have scheduling and etc. They are more like composed hook but one that also returns a template |
I prose to ditch virtual part and document better how you can use above described method. |
I think ditching virtual components would be a drastic measure, people really like that part of Haunted. If this is the only problem I don't think that's enough to say we can't make it work. I'll try to free up some time to take a closer look into this issue myself. |
I fixed #69 so I have my brain wrapped around virtual components a little more than I had. So I might take a look at this issue soonish and see if I can come up with a solution. |
Since, container for virtual component is mapped to part in cache, same container is reused for other component:
I made demo reproducing the issue
I haven't done deep dive into solving it, but from first sight
container
can be mapped torenderer
instead ofpart
The text was updated successfully, but these errors were encountered: