-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[Glimmer] Nested components no longer have access to their parent? #11170
Comments
I'm seeing the same thing as well in ember-cli-happy-splitter. Among other uses, I was using the parentView to manually set the target (so Ember.Component.send() sends actions to the right place) and to create computed properties (Ember.computed.readonly('parentView.someParentProperty'). My structure is similar, but I also support arbitrary levels of nesting: {{#happy-split-container}}
{{#happy-split-view}}<p>left panel</p>{{/happy-split-view}}
{{~ happy-splitter-bar ~}}
{{#happy-split-view}}
{{#happy-split-container isVertical=false}}
{{#happy-split-view}}<p>top right panel</p>{{/happy-split-view}}
{{~ happy-splitter-bar ~}}
{{#happy-split-view}}<p>bottom right panel</p>{{/happy-split-view}}
{{/happy-split-container}}
{{/happy-split-view}}
{{/happy-split-container}} |
@wycats it seems maybe the definition of |
This also seems to affect the use of |
nearestOfType, nearestWithProperty, and parentView all seem to have changed. This is a common pattern to follow for child components pulling data from (or pushing data to) a wrapper of some sort. |
Seeing this in Canary. This is potentially a very big change, as nested components are very commonly used. |
This seems to break a large number of addons |
Unfortunately this is preventing me from doing much in-depth testing of the 1.13-beta.1 branch |
Given the relatively large number of addons that are affected by this, I think we should attempt to match the 1.12 semantics with Given the initial example: {{#ivy-tab-list}}
{{#ivy-tab}}Tab 1{{/ivy-tab}}
{{#ivy-tab}}Tab 2{{/ivy-tab}}
...
{{/ivy-tab-list}} Inside the Even though we should definitely fix this issue, I do believe that the better pattern would be to use block params and provide each {{#ivy-tab-list as |list|}}
{{#ivy-tab list=list}}Tab 1{{/ivy-tab}}
{{#ivy-tab list=list}}Tab 2{{/ivy-tab}}
{{/ivy-tab-list}} Yes, I realize that may not be as aesthetically pleasing but it is easier to reason about. In the long run, I think the following is the best API: {{#ivy-tab-list as |list|}}
{{#list.ivy-tab}}Tab 1{{/list.ivy-tab}}
{{#list.ivy-tab}}Tab 2{{/list.ivy-tab}}
{{/ivy-tab-list}} It allows the tldr; I think we should deprecate accessing |
👍 @rwjblue - This would bring semantics closely in line with ruby conventions like = form_for 'user' do |f|
= f.input 'email' Does this mean that |
@truenorth - I am unsure, I will have to confer with the smart core team members |
i would like to explore this |
#11266 should fix this issue. We decided not to deprecate accessing |
Can we reopen this? https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/lib/hooks/component.js#L25 seems to have lost the changes by @rwjblue. Or, is there another syntax to be using now? |
👍 |
Here is a shim I threw together for nearestWithProperty that works with Ember 2.0.0
|
I recently tried upgrading ivy-tabs to Ember 1.13 and ran into some issues around changes to
parentView
in components. Prior to 1.13, a nested component could access its outer component throughparentView
. I was using this in ivy-tabs to register anivy-tab
component with theivy-tab-list
that contained it, among other things:It seems that with the 1.13 upgrade,
parentView
is now always the "routable" view that rendered the component, and I don't see a way for components to access each other at all. Is my example an intended use case? If not, is there some other way to do what I want?The text was updated successfully, but these errors were encountered: