-
-
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
[WIP] [BUGFIX beta] Support concatenatedProperties in contextual components #14956
[WIP] [BUGFIX beta] Support concatenatedProperties in contextual components #14956
Conversation
Given a component `my-comp` with a `concatenatedProperties: ['foo']` this: ```hbs {{component (component (component "my-comp" foo=1) foo=2)}} ``` should produce `foo: [1, 2]` (unless there are other values in the class, then those values would be concatenated as well). This is not happening due to `curryArgs` does not take into account the `concatenatedProperties` and `mergedProperties` properties. One of the problems with current implementation is that these properties work at mixin level, thus making them only accessible working out the `proto` (see emberjs/rfcs#209 for more details. This initial draft does not fully work. For this to continue I need to know some details: 1. Is there an implemented way in glimmer to create an Reference that is a collection of reference? I need to concatenate two references/array of references into an array. 2. Is the `proto` method expensive enough not to continue?
☔ The latest upstream changes (presumably #15014) made this pull request unmergeable. Please resolve the merge conflicts. |
@Serabe hey, why did this pull close? Issue still not fixed in ember |
I can try to give this another try, the thing was supporting this is (or at least was) pretty expensive and nobody had requested it in over two years. We can try and give it another go. |
Yes, I know. The problem with |
so, at such example will be create two extra waste components at runtime? |
Yes. |
@Serabe anyway, is it possible add to ember? |
@AnastasiyaYelets @KirillSuhodolov this won't be fixed. This feature would be pretty expensive computationally and had some undesired side-effects from initialising the component each time. Please, for anyone reading this, the behaviour that won't be fixed is not that concatenated properties won't work if a component is invoked as a contextual component, but that concatenated properties work in nested contextual components. Let me show this with an example: {{! this won't concatenate properties }}
{{#with (component "my-component" classNames="first-declaration") as |comp|}}
{{#with (component comp classNames="second-declaration") as |nestedComp|}}
{{component nestedComp}}
{{/with}}
{{/with}}
Thank you! |
Given a component
my-comp
with aconcatenatedProperties: ['foo']
this:should produce
foo: [1, 2]
(unless there are other values in the class, thenthose values would be concatenated as well).
This is not happening due to
curryArgs
does not take into account theconcatenatedProperties
andmergedProperties
properties. One of the problemswith current implementation is that these properties work at mixin level, thus
making them only accessible working out the
proto
(see emberjs/rfcs#209 formore details.
This initial draft does not fully work. For this to continue I need to know
some details:
a collection of reference? I need to concatenate two references/array of
references into an array.
proto
method expensive enough not to continue?