Open chriskrycho opened 3 years ago
This bug may be a bigger issue than stated above, because the currying of params is broken even for the initial dynamic component creation, not just the invocation. This breaks in 3.28+ (possibly before, we moved from 3.24) we experience this issue when creating a component with any dynamic params.
For instance this worked before:
{{#let (component "link-to" "home") as |link|}}
{{#link}}go home{{/link}}
{{/let}}
Yeah, when I investigated this originally, I found that because of the special handling for at least this, but maybe also a few of the other built-ins, the curried form specifically doesn't work at all with the positional params. The strict mode refactors unfortunately missed this case. My own POV is that it technically should be fixed for the 3.28 LTS if possibleβ¦ but from conversations with @pzuraq it was non-trivial to do so, and given that folks also have to update to non-positional params immediately anyway to be able to move forward from 3.28, just recommending that they do so seems the best path forward. π©
If anyone else hits this, I have a codemod that fixes these.
π Describe the Bug
On 3.27.2 and 3.28.0, creating a curried instance of
LinkTo
with the{{component}}
helper and then invoking it as a curly component with a positional argument for the route (rather than the named@route=
argument) throws an error.π¬ Minimal Reproduction
In the application template:
(demo repo here)
π Actual Behavior
This will result in the following errors:
π€ Expected Behavior
Curried
{{link-to}}
invocations should still work through 3.28, as this behavior is not deprecated until 4.0.π Environment
β Additional Context
We may not want to waste time fixing this. It's technically a breaking change, but the fix is trivial, forward-compatible for 4.0 (and indeed unblocks migration to 4.0!), and it's not clear whether fixing it on the source side would be worth the hassle.
I'm mostly opening this just so that if anyone else hits it when upgrading, they have something to see in search results etc.!