-
Notifications
You must be signed in to change notification settings - Fork 382
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
How the current model and the v1 model should interact? #130
Comments
Well, then |
I might change my mind. Because it's expected that existing libraries (which use the current model) and new libraries (which use a new model) will be used in the same page together, I think Blink should support co-existence of both models in the same page somehow. Let me work on this issue and have a proposal about how both models interact with each other after the Slots Proposal is spec-ed. |
I'll update this document soon to explain how v0 and v1 interact each other in Blink. After that, let me close this bug. |
I disagree with the idea that both models should interact with each other. Why should new |
@esprehn, I used to have the same opinion with you, however, I've changed my mind after chatting @dglazkov . The reason I remember is that someone might want to create a (v1) widget which makes use of existing (v0) widgets, and vice-versa, I think. @dglazkov , WDTY? I think everyone doesn't like bringing unnecessary complexity to our code base unless there is a string use case for that. |
For clarification, the main concern is about re-distribution. Suppose that there is an existing <v0-component>'s shadow tree:
....
<content select="xxx"></content>
... If another developer wants to create <link rel=import href="third_party/v0-component.html">
<v1-component>'s shadow tree:
<slot name="aaa"></slot>
<v0-component>
<slot name="bbb"></slot> # I want to pass node xxx to v0-component, via *redistribution*.
</v0-component>
<html>
...
<link rel=import href="v1-component.html">
...
<v1-component>
<div slot=aaa>...</div>
<xxx slot=bbb>...</div>
</v1-component>
</html> If we decide not to support this use case, the things could be simpler, I think. |
It's a tradeoff that we need to think through carefully. I think the decision depends on balancing
To understand the number in the first item, we could the component v0/component v1 scenario into 2 buckets:
The bucket 1 is all good, because then it is the framework's responsibility to homogenize (or disallow) v0/v1 components across. The bucket 2 is highly problematic, because then the burden of encountering and resolving breakage falls on the user of the component (not the developer). So.. the questions are: how big is bucket 2 and how does it compare with the cost of complexity? |
I feel like this discussion is more appropriately done on blink-dev or on the Blink issue tracker. Having said that, it seems quite trivial to build v1 API on top of v0 API you've already implemented modulo avoid unwrapping slots and other edge cases. You can take a look at https://bugs.webkit.org/attachment.cgi?id=260929&action=review which is my WIP implementation of v1 API on top of left-over v0 API implementation. I'm completely rewriting our implementation right now in WebKit but this WIP patch might be more of interest to you guys. |
In any cases, whether to support or not, Blink needs a spec about how Blink should behave if both models are used in the same tree of trees. Please also see the relevant discussion in https://groups.google.com/a/chromium.org/d/msg/blink-dev/lLfzjTPuZtk/IGtniXW4AAAJ. |
I think we do not have any action item for this issue in terms of the v1 spec. Let me close this issue, |
I'm aware that this might not be a design goal of the v1 spec, however, let me file an issue here because this would be a serious issue in Blink.
I guess other browser vendors might not be interested in solving this kind of problems, however, I appreciate your ideas.
The problem is one tree of trees can be composed of both models, the current model and v1 model, in Blink. Blink should support both models for a while (maybe forever?)
e.g.
In such case, I'm afraid that we can't support two distribution models in the same tree of trees well. There is no much attention on this case so far.
I'm feeling that one tree of trees should be used exclusively by either model.
e.g.
I meant that we might want to have a restriction such as:
invald here means one tree of trees includes both, the current shadow tree and v1 shadow tree.
The text was updated successfully, but these errors were encountered: