Minor upgrade pain - change in variable shadowing behavior in Glimmer 2?
Low-priority issue, feel free to close if it's not helpful.
I'm reporting this because it was a minor source of upgrade pain / confusion for me when upgrading to Ember 2.10.0, and it's worth documenting if I can save others time.
The problem (worked in 2.9, broken in 2.10.0):
{{foo-component as |attrs|}}
{{bar-component bar=attrs.foo}}
{{/foo-component}}
The fix (works in 2.10.0):
{{foo-component as |value|}}
{{bar-component bar=value.foo}}
{{/foo-component}}
This is really my fault for using attrs as a variable name in a template. That said, it looks like something changed in Glimmer 2 to stop the block-scoped attrs from shadowing the attrs of the parent Component.
Definitely something we should fix. We do this here, where we basically transform anything with the literal value attrs into a different (private API) format.
We should ideally be tracking block params to ensure we are not breaking as |attrs|}} for folks...