-
-
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
[2.15.0] {{link-to}} inside a partial stopped working #15621
Comments
I've come across a similar problem in 2.15, it seems that a partial rendered inside a yielded block from a component doesn't receive the yielded parameters from that component. Example: // -name.hbs
<p>{{name}}</p> component.js export default Component.extend({
name: "Ivan"
}) template.hbs {{yield name}} some-route-template.hbs {{#my-component as |name|}}
{{partial "name"}}
{{/my-component}} In this instance, the |
The same thing happens with an #each iteration. The value from #each isn't passed to the context of the partial.
Both record and index are undefined in the partial. |
Interestingly enough, I can still reference a "lost" variable's property by its name, e.g. in the |
Is this behavior legacy, or is there an alternative approach that should be considered? We've been trying to use components over partials, but for our largish app there are still many instances where this bug is breaking things. At this point, we are blocked from upgrading, and I am surprised this isn't affecting more folks. |
No, this isn't legacy behavior per-se, but it is fairly uncommon. You should totally migrate to using components whenever you can (it is massively simpler to reason about), but we should absolutely fix this ASAP. |
@rwjblue any pointers where I should start looking to help fix this? |
I submitted #15674 with some failing tests cases. It seems the issue isn’t as simple as accessing bound property values within the partial (at least it didn’t seem so with my testing). I believe the underlying issue has to do with the way we generate the references used by things like Sadly, I don’t have a smoking gun to point at though. :( |
we are also unable to upgrade due to this bug. similar to @thec0keman we have a fairly large ember app which was originally started using EAK, so there's still some lingering legacy functionality that we haven't yet brought to modern ember we don't have a lot of partials left, but enough that this is a blocker for us until we have the time to migrate / test the remaining partials to components |
This one should really get some higher priority, partials are broken since 2.15 and prevent people to upgrade from 2.14 to 2.16. |
+1 |
I'm going to take a look at this next week after EmberFest. |
This a bug in Glimmer. See in the referenced issue. |
A new glimmer version with the fix was released. After updating the glimmer version this bug should be fixed. I've opened a pull request for updating the glimmer version. |
FYI - The upgrade to Glimmer 0.29 is a large effort (and unlikely to happen before Ember 3.0.0), @chadhietala backported the fix to the 0.25 branch. We need to release that as a patch version and update to that version instead. I’ll try to get these releases done today... |
@rwjblue LMK if there is anything that i can help with the release which includes the patched 0.25 branch (as I'm working on upgrading Intercom at the moment). As far as I can tell, it hasn't yet reached ember canary |
The same problem also exists if using the with helper: {{#with someProperty as |youNameIt|}}
{{partial somePartial}}
{{/with}} Probably the patch will fix this too, but to be sure I do mention it here! |
Hi. Is there a fix released for this issue? As far as i can tell, most of the helpers are somewhat affected when used in a |
Ember 2.16.1 has been released which should fix the issues with partials. Please let me know if you're still seeing issues |
While these issues have been fixed, FYI I just found another issue with partials: I'll work on fixing this later today |
Are you guys completely sure it's been solved for 2.15? The twiddle from @Serabe (#15621 (comment)) still fails on 2.15.3, but works on 2.16.1. Incidentally, I've noticed that if you modify the partial to write the |
It is not. Ember 2.15 is not an LTS, so I don't think a fix will be coming. |
Confirm. |
Oh, ok. I thought the fix being backported to glimmer 0.25 would meant this working on Ember 2.15 too. Guess we'll skip directly to 2.16 then. Thanks!! |
After upgrading to 2.15.0 some of our tests started failing because a
{{#link-to}}
inside of a partial stopped working.This is the
{{link-to}}
in question. When rendering there are no immediate errors but the generated href is just#
and thedata-test-user-id
attribute is not output when testing. Clicking the link outputs this warning:This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.
Everything else inside of the partial still renders fine, it's just the link-to that fails.
Changing the partial to a component fixed the problem.
The text was updated successfully, but these errors were encountered: