-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Improve local compilation specific errors #54230
Conversation
…ed symbol errors in local compilation mode A single error code is created to unify the common error pattern in local compilation mode where an imported const cannot be resolved, but needs to be resolved. This mainly happens for Angular decorator fields such as @Component.template. The error messages are also upgraded to be more centered around this unifying theme.
…OMPILATION_UNRESOLVED_CONST The trailing error message comes from tracing the chain of DymaicValue which leads to a mostly useless error that highlights the same symbol as the original message and emits the error message "Unknown reference". This error message is removed in the favour of the original message which suffices.
packages/compiler-cli/src/ngtsc/annotations/directive/src/shared.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed-for: public-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Feel free to add merge ready when addressed
packages/compiler-cli/src/ngtsc/annotations/common/src/diagnostics.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/annotations/common/src/diagnostics.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/annotations/directive/src/shared.ts
Outdated
Show resolved
Hide resolved
…TION_UNRESOLVED_CONST` in common scenarios A helper `validateLocalCompilationUnresolvedConst` is added to encapsulate a common pattern which leads to the error `LOCAL_COMPILATION_UNRESOLVED_CONST`.
…styles array for the error LOCAL_COMPILATION_UNRESOLVED_CONST Currently the whole array is highlighted.
…LATION_UNRESOLVED_CONST when an unresolved symbol used for @component.styles Currently the correct error message is shown only if @component.styles is an array with some unresolved element. This change supports the new case of string type for the @component.styles field.
… event name in local compilation mode Currently the error is a generic error "selector must be a string ...". This commit makes the error more specific to local compilation and adds some action items.
…argument in local compilation mode Currently the error is a generic error "selector must be a string ...". This commit makes the error more specific to local compilation and adds some action items.
…rtAs in local compilation mode Currently the error is a generic error "exportAs must be a string ...". This commit makes the error more specific to local compilation and adds some action items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-for: public-api
…OMPILATION_UNRESOLVED_CONST (#54230) The trailing error message comes from tracing the chain of DymaicValue which leads to a mostly useless error that highlights the same symbol as the original message and emits the error message "Unknown reference". This error message is removed in the favour of the original message which suffices. PR Close #54230
…LATION_UNRESOLVED_CONST when an unresolved symbol used for @component.styles (#54230) Currently the correct error message is shown only if @component.styles is an array with some unresolved element. This change supports the new case of string type for the @component.styles field. PR Close #54230
This PR was merged into the repository by commit f39cb06. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
As per request from customers, we need to have more clear and actionable error messages for local compilation.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information