[BUGFIX beta] Only pass isComponent with a dash #11222
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, any key looked up in the container was listed as a component by
isComponent
. Additionally, the assertion for dashless components was upon lookup incomponent_lookup
. This commit makesisComponent
filter for dashes as well as presence in the container.All paths (like
{{dashless}}
) in the container returned true fromisComponent
, which in turn handled keyword redirects and the catch-all keyword behavior. It turn out that, using the Ember-CLI resolver, amodule named
app/dashless/template
will resolve bothtemplate:components/dashless
andtemplate:dashless
. Thus when using pods, theisComponent
check fordashless
would pass.This means if
dashless
was used as a bound variable in a template, it would be treated like a component and throw an error (for not having a dash).Additionally, the
isComponent
check not filtering for dashes means all template keywords (likeyield
,if
,outlet
) were creating container lookups. This is far less performant that splitting than scanning the string for a dash.This commit does not fix all cases. If you name a route with a dash, and use that same dashed name as a variable in a template bad behavior will manifest: The template of that route will render with a generated component backing it. This problem must be resolved when routable components are landed.