-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable LOG_VIEW_LOOKUPS for {{outlet}} keyword.
Note: that {{outlet}} templates without a view instance do not get a default view any longer (the template is just rendered).
- Loading branch information
Showing
2 changed files
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89cf0a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rwjblue If outlet templates no longer get a default view, does that mean that the markup between Glimmer and current Ember will be different?
I'm finding a test assertion that appears to expect a
<div class='ember-view'>
tag for an outlet:https://github.com/emberjs/ember.js/blob/idempotent-rerender/packages/ember/tests/component_registration_test.js#L72
Based on some debugging on master, the first
<div class="ember-view">
in that assertion appears to be the generatedApplicationView
. On the Glimmer branch this element is replaced with a tagless OutletView. Also your assertion change here appears to indicate that application view should not be rendered.I'm not trying to suggest there's a problem here, I'm just trying to figure out if removing the first part of the selector in the component_registration_test shown above is the right way to make that test pass.
89cf0a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mitchlloyd OutletView extends metamorph_view, which has two properties: It is virtual (not in the tree hierarchy) and tagless.
I expect that outlets have no view so that they match this behavior: Not present in the view hierarchy (no view) and tagless (no element).
If there is some case where my reading of the code is wrong and we used to have elements for outlets, then they should continue to have elements. We can do this without a view though.
89cf0a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On master, outlets are always
OutletViews
(which are tagless) and they always build a child view. Usually the child isview:default
(which is tagless). But the topmost outlet usesview:toplevel
(which is not tagless) instead. That's the tag you see at the top of an application running master.Outlets also accept the
view
andviewClass
parameters, which let people provide a custom view. They're expected to inherit fromEmber.OutletView
(which is tagless -- we do not publicly expose an outlet view implementation that is not tagless).On glimmer, most outlets don't have views at all.
OutletView
is still used, but only for the topmost outlet, and there it's only so that it can effectively broadcast route changes to all the other outlets by dirtying them at the appropriate time.It does look to me like we have an incompatible change here. We should guarantee a topmost application view. The easiest way to do it would be to change
ember-routing/lib/system/router.js
so that when it creates the topmost outlet, it passestagName: 'div'
(incidentally, I see that it is still using a vestigial_isTopLevel
parameter, which is totally ignored).It would be tempting to solve the problem by just making OutletView have a tag, because we only use OutletView at the top level. But that would also break compatibility for anyone who is actually inheriting from OutletView.
89cf0a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for the insights here. The fact that only the top level outlet has an
OutletView
helps me make sense of what I've seen. I've tried setting theOutletView
tagName
to 'div' and I'm running into a few issues (MostlyEmber.View.views should be empty
errors fromember-dev
. I'll see if I can work through the test failures.89cf0a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am taking a look at those test issues. I'm pretty sure it's because the tests themselves are buggy. The first one I looked at it creating two Application instances and only properly cleaning up one of them.
89cf0a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah that makes sense. I noticed that views with
tagName === ''
aren't_registered()
which is probably why these test issues didn't show up beforehttps://github.com/emberjs/ember.js/blob/idempotent-rerender/packages/ember-views/lib/views/states/in_dom.js#L18-L20
Sounds like you've got this well in-hand, I'll leave this one alone.
89cf0a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For completeness: I've also discovered that it's not good enough to make the top level outlet itself have a tag. That would introduce an extra layer of tags in the situation where the ApplicationView already got defined to have a tag.For compatibility, we have to make sure it's not the top outlet but the top outlet's child that is always a view with a tag.
89cf0a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this in 5c5585d