Improve local compilation specific errors#54230
Closed
pmvald wants to merge 8 commits intoangular:mainfrom
Closed
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.
devversion
approved these changes
Feb 5, 2024
packages/compiler-cli/src/ngtsc/annotations/directive/src/shared.ts
Outdated
Show resolved
Hide resolved
jessicajaniuk
approved these changes
Feb 5, 2024
Contributor
jessicajaniuk
left a comment
There was a problem hiding this comment.
reviewed-for: public-api
devversion
approved these changes
Feb 6, 2024
Member
devversion
left a comment
There was a problem hiding this comment.
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.
jessicajaniuk
pushed a commit
that referenced
this pull request
Feb 6, 2024
…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
jessicajaniuk
pushed a commit
that referenced
this pull request
Feb 6, 2024
…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
Contributor
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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