Skip to content
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

[BUGFIX lts] Ensure Component Lookup Is Well Formed #19336

Merged
merged 2 commits into from
Jan 14, 2021

Conversation

chadhietala
Copy link
Contributor

This PR introduces an assertion during the component name refinement to
assert that the lookup syntax is well formed. If a developer
accidentally types ":" instead of "::" you will end up with a runtime
erorr that looks like:

Uncaught Error: Assertion Failed: fullName must be a proper full name
    at assert (vendor.js:52729)
    at Container.lookup (vendor.js:16581)
    at Class.lookup (vendor.js:43950)
    at layoutFor (vendor.js:28680)
    at lookupComponentPair (vendor.js:28697)
    at lookupComponent (vendor.js:28711)
    at RuntimeResolver._lookupComponentDefinition (vendor.js:28992)
    at RuntimeResolver.lookupComponentHandle (vendor.js:28837)
    at CompileTimeLookup.lookupComponentDefinition (vendor.js:25065)
    at LazyCompiler.resolveLayoutForTag (vendor.js:60366)

This message is not actionable for developers. This PR will causes a
compile time error to occur with the following information:

Malformed component lookup in "test.js". Got <Foo:Bar \/> but you must use \"::\" to indicate a lookup

This PR introduces an assertion during the component name refinement to
assert that the lookup syntax is well formed. If a developer
accidentally types ":" instead of "::" you will end up with a runtime
erorr that looks like:

```
Uncaught Error: Assertion Failed: fullName must be a proper full name
    at assert (vendor.js:52729)
    at Container.lookup (vendor.js:16581)
    at Class.lookup (vendor.js:43950)
    at layoutFor (vendor.js:28680)
    at lookupComponentPair (vendor.js:28697)
    at lookupComponent (vendor.js:28711)
    at RuntimeResolver._lookupComponentDefinition (vendor.js:28992)
    at RuntimeResolver.lookupComponentHandle (vendor.js:28837)
    at CompileTimeLookup.lookupComponentDefinition (vendor.js:25065)
    at LazyCompiler.resolveLayoutForTag (vendor.js:60366)
```

This message is not actionable for developers. This PR will causes a
compile time error to occur with the following information:

```
Malformed component lookup in "test.js". Got <Foo:Bar \/> but you must use \"::\" to indicate a lookup
```
@rwjblue rwjblue changed the title bugfix: Ensure Component Lookup Is Well Formed [BUGFIX lts] Ensure Component Lookup Is Well Formed Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants