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
Completely remove the concept of isVirtual #10903
Completely remove the concept of isVirtual #10903
Conversation
Is there an alternative to |
22e3852
to
113e0a7
Compare
MetamorphView (and the Metamorph mixin) are the final bastion of virtual views. This commit removes much of their use. MetamorphView had two behaviors: First, it was tagless. Second, it was not included in the view hierarchy. The first concept (taglessness) is still valid in Ember post-Glimmer. For this, we use `tagName: ''`. The second concept (virtual views) is not longer present. So views which previously used MetamorphView will not longer be able to escape the view hierarchy. In most cases, the intent was likely to be tagless and being virtual was simply a side effect. OutletView and EachView will now be present in childViews and will be parentViews. `{{render` used to always create a view. Now, it will only create a view if one is set by the user. By default it is only a componentNode and has no view at all. The final spot MetamorphViews are used it for the default itemView and emptyView on EachView. This should be easy to address in a manner similar to {{render: If the user does not specify a view, none should be required. After this, MetamorphView will no longer be used by internals.
113e0a7
to
6368254
Compare
@stefanpenner - This PR is against the Glimmer branch (not sure if you saw that), and the idea is that there is essentially no such thing as a virtual view any more. See the commit description in 3aea201 for more details, but here is a snippet:
|
Completely remove the concept of isVirtual
This is clearly going to pwn many app users as the glimmer API lands in 1.x or is this merely part of the opt-in world of glimmerland? |
@stefanpenner - Why? Are there cases when you actually want to deal with the virtual views? |
@rwjblue i gave the example ^ Lots of code relies on existing virtual views provided by ember and addons, being transparent. When attrs leaked into childView many things broke, this will do the same. |
The goal, with Glimmer, is that the logical tree of views is the same as the semantic tree. If you do not want a view, don't use one. For example with
And
These will not appear in Once the helper API is made public (I believe this is the intent, would appreciate a +1 though) anyone can create view-less logic this way. These helpers do create morphs in a render node tree, and sometimes create a ComponentNode without a view. Must of how Does this assuage your concerns @stefanpenner? Virtual views out, semantic view tree and render nodes in. |
I'm fine with new style code losing this concept but How does affect legacy code relying on its own isVirtual views not polluting the parents childViews list |
@stefanpenner You're right. The |
This seems like a breaking change to much code. Even just the attrNodes entering childViews caused pain. I am unsure if we can responsibly introduce this in the 1x timeframe. If we must, then we should likely doit with a deprecation phase. |
To be clear, draggable-each will break for other reasons (it is using _childViews which was removed). Anyways, let's focus on This seems mega crazy to me. The only time I can see this mattering is if you have a Can you explain further? |
but this was the actual intent of Although draggableEach will break but I have seen several other projects (app code) that rely on isVirtual in this same way. We can fix draggableEach, we can't fix other peoples app code. ChildViews being contaminated with once virtual views will be an upgrade hazard, and as such should go through a deprecation phase. Luckily 1.12 could contain this deprecation phase, before the above code theoretically lands in 1.13. If a deprecation phase exists, I suspect we have done our due diligence. |
After some discussion, we've decided that deprecating use of I believe @rwjblue (the legend) claimed he would pick this up. |
MetamorphView (and the Metamorph mixin) are the final bastion of virtual views. This commit removes much of their use.
MetamorphView had two behaviors: First, it was tagless. Second, it was not included in the view hierarchy. The first concept (taglessness) is still valid in Ember post-Glimmer. For this, we use
tagName: ''
.The second concept (virtual views) is not longer present. So views which previously used MetamorphView will not longer be able to escape the view hierarchy. In most cases, the intent was likely to be tagless and being virtual was simply a side effect.
OutletView and EachView will now be present in childViews and will be parentViews.
{{render
used to always create a view. Now, it will only create a view if one is set by the user. By default it is only a componentNode and has no view at all.The final spot MetamorphViews are used it for the default itemView and emptyView on EachView. This should be easy to address in a manner similar to {{render: If the user does not specify a view, none should be required.
After this, MetamorphView will no longer be used by internals.