refactor(compiler-cli): improve diagnostic with help link#64361
refactor(compiler-cli): improve diagnostic with help link#64361thePunderWoman merged 1 commit intoangular:mainfrom
Conversation
...es/compiler-cli/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.ts
Outdated
Show resolved
Hide resolved
|
Can you also please add that it fixes #45033. |
|
To fix the scope of the commit message should be |
...es/compiler-cli/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.ts
Outdated
Show resolved
Hide resolved
|
Also this change breaks some test, can you PTAL. |
|
Looks interesting. Although I think it would be a PR with several commits on a PR to add it, I don't know what the team would think. |
We're already doing this for runtime errors (but only if the error actually has a doc entry. Those error are marked by a negative value) example: angular/packages/core/src/errors.ts Lines 49 to 51 in e34776a |
hadn’t noticed that the runtime errors were already being referenced. From what I see, for example, NG2009 belongs to the common package range according to the comment: * Error code ranges per package:
* - core : 100-999
* - forms: 1000-1999
* - common: 2000-2999
* - animations: 3000-3999
* - router: 4000-4999
* - platform-browser: 5000-5500
*/ |
|
That looks to be a bug in how we generate the error page. That's not a runtime error but a compiler error. |
|
Can you file an issue for that. On Angular.io we had a distinction between both type of errors. https://v17.angular.io/errors |
e82c9b2 to
46a98fa
Compare
packages/compiler-cli/src/ngtsc/typecheck/extended/api/get-find-more-text.ts
Outdated
Show resolved
Hide resolved
46a98fa to
2577c6d
Compare
packages/compiler-cli/src/ngtsc/typecheck/extended/api/format-extended-error.ts
Outdated
Show resolved
Hide resolved
2577c6d to
f17f3ed
Compare
|
Can you have a look at the failing tests ? Some expect to match the exact error message. |
packages/compiler-cli/src/ngtsc/typecheck/extended/api/format-extended-error.ts
Show resolved
Hide resolved
f17f3ed to
a599401
Compare
|
Can you please rebase on main, it should fix the remaining broken test. |
a599401 to
e30afcd
Compare
|
@JeanMeche Hello, is there anything else I should do? |
packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
Show resolved
Hide resolved
e30afcd to
fed77ed
Compare
kirjs
left a comment
There was a problem hiding this comment.
Curious why didn't this break any tests?
Would be also nice to see formatExtendedError tested?
fed77ed to
d27a2fd
Compare
packages/compiler-cli/src/ngtsc/typecheck/extended/api/format-extended-error.spec.ts
Outdated
Show resolved
Hide resolved
7ae4589 to
7f94841
Compare
|
This change requires a cleanup on our side in Google's code base for us to be able to land it. We'll do it in due time aligned with our priorities. |
|
@JeanMeche Thank you very much |
7f94841 to
85073e3
Compare
Add help link to extended template diagnostic messages to provide users with additional guidance and documentation resources. This enhancement improves developer experience by making it easier to understand and resolve complex template issues through direct access to relevant Angular documentation with detailed examples and explanations for each diagnostic type.
85073e3 to
c63777e
Compare
|
This is good to go. |


PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the new behavior?
Fixes #45033
This PR enhances Angular's extended diagnostics by adding documentation links to error messages, improving the developer experience when encountering template errors.
Benefits
Faster Problem Resolution: Developers can immediately access detailed explanations and examples
Self-Documenting Errors: Reduces the need to search external documentation
Consistent Experience: All extended diagnostics now provide uniform help resources
Educational Value: Helps developers understand Angular best practices
Impact
No breaking changes: Only enhances error messages
No performance impact: Changes are compile-time only
Improved DX: Better onboarding for developers learning Angular templates
Testing
Verified that diagnostic messages display correctly with new links
Confirmed that existing error examples and formatting are preserved
Ensured links point to valid Angular documentation URLs
Does this PR introduce a breaking change?