Skip to content
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

Template-in-template: reimplement the feature #3058

Closed
denis-anisimov opened this issue Nov 27, 2017 · 3 comments
Closed

Template-in-template: reimplement the feature #3058

denis-anisimov opened this issue Nov 27, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@denis-anisimov
Copy link
Contributor

denis-anisimov commented Nov 27, 2017

Currently the feature is implemented asynchronously. It uses two unrelated features-maps and JS call.

We have issues with using two maps : the node becomes attached, detached and attached which is not expected.

We have very serious issues with implementing the feature via JS (call order on the server side and async nature of the code).

So we should not use JS at all for any tree node related features.

The proposition is too use only one dedicated NodeFeature for this feature which makes the node immediately available and handled on the same way as any other node on the client side.
Except that on the client side such nodes requires a special handling.

For all such virtual children features we should use one NodeFeature but introduce a subnamespaces into it.

See details in #2826.

It's very similar to #3057. But it has it's own logic of addressing the element on the client-side.

@Legioth
Copy link
Member

Legioth commented Nov 27, 2017

Earlier to today, you were talking about wrapping the nodes in VirtualChildrenList with something that contains metadata about how each specific child should be handled (e.g. for component renderer, template-in-template or @Id). One alternative that might be slightly less complex compared to a wrapper could be to introduce an additional field in the ElementData namespace that can contain a marker for what kind of type it is and any additional metadata that it needs?

@pleku pleku added this to the 1.0.0.alpha13 milestone Nov 27, 2017
@denis-anisimov
Copy link
Contributor Author

It would be good to reuse ElementData or any other existing NodeFeature but I don't think it's less complex.
The ElementData is a subclass of NodeValue which carries only one value, not a number of values. So it's not based on the HashMap and it has been done intentionally.
To be able to reuse it we should modify it to support multiple values and either it should be turned to NodeMap (so it will increase memory consumption : the main reason why it's NodeValue at the moment) or some another way for this specific case of limited additional payload values is needed. In the result I think it won't be less complex unfortunately.

@denis-anisimov
Copy link
Contributor Author

Actually after some attempts to reduce a number of features I've realized that I need one NodeFeature instead of three which will be able to behave like ElementData but carry 3 values instead of one.
And since we already have and use the ElementData I'm going to modify it and reuse.
It will allow to reduce a number of features and a need of interim StateNode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants