René's URL Explorer Experiment


Title: feat(ivy): convert all ngtsc diagnostics to ts.Diagnostics by alxhub · Pull Request #31952 · angular/angular · GitHub

Open Graph Title: feat(ivy): convert all ngtsc diagnostics to ts.Diagnostics by alxhub · Pull Request #31952 · angular/angular

X Title: feat(ivy): convert all ngtsc diagnostics to ts.Diagnostics by alxhub · Pull Request #31952 · angular/angular

Description: Historically, the Angular Compiler has produced both native TypeScript diagnostics (called ts.Diagnostics) and its own internal Diagnostic format (called an api.Diagnostic). This was done because TypeScript ts.Diagnostics cannot be produced for files not in the ts.Program, and template type- checking diagnostics are naturally produced for external .html template files. This design isn't optimal for several reasons: Downstream tooling (such as the CLI) must support multiple formats of diagnostics, adding to the maintenance burden. ts.Diagnostics have gotten a lot better in recent releases, with support for suggested changes, highlighting of the code in question, etc. None of these changes have been of any benefit for api.Diagnostics, which have continued to be reported in a very primitive fashion. A future plugin model will not support anything but ts.Diagnostics, so generating api.Diagnostics is a blocker for ngtsc-as-a-plugin. The split complicates both the typings and the testing of ngtsc. To fix this issue, this commit changes template type-checking to produce ts.Diagnostics instead. Instead of reporting a special kind of diagnostic for external template files, errors in a template are always reported in a ts.Diagnostic anchored on the template or templateUrl expression. If necessary, the position of the error in the template is included in the messageText of the ts.Diagnostic. A template error can thus be reported in 3 separate ways, depending on how the template was configured: For inline template strings which can be directly mapped to offsets in the TS code, ts.Diagnostics point to real ranges in the source. This is the case if an inline template is used with a string literal or a "no-substitution" string. For example: @Component({..., template: `

Bar: {{baz}}

`}) export class TestCmp { bar: string; } The above template contains an error (no 'baz' property of TestCmp). The error produced by TS will look like:

Bar: {{baz}}

~~~ Property 'baz' does not exist on type 'TestCmp'. Did you mean 'bar'? For template strings which cannot be directly mapped to offsets in the TS code, a logical offset into the template string will be included in the error message. For example: const SOME_TEMPLATE = '

Bar: {{baz}}

'; @Component({..., template: SOME_TEMPLATE}) export class TestCmp { bar: string; } Because the template is a reference to another variable and is not an inline string constant, the compiler will not be able to use "absolute" positions when parsing the template. As a result, errors will report logical offsets into the template string: @Component({..., template: SOME_TEMPLATE}) ~~~~~~~~~~~~~ (1, 11): Property 'baz' does not exist on type 'TestCmp'. Did you mean 'bar'? This error message states that the error corresponds to line 1, column 11 of the template. For external templates (templateUrl), the error message is anchored on the templateUrl expression and contains the filename as well as the position information. For example, if the above example instead had its template in ./testcmp.html, the error would look like: @Component({..., templateUrl: './testcmp.html'}) ~~~~~~~~~~~~~~~~ ./testcmp.html(1, 11): Property 'baz' does not exist on type 'TestCmp'. Did you mean 'bar'?

Open Graph Description: Historically, the Angular Compiler has produced both native TypeScript diagnostics (called ts.Diagnostics) and its own internal Diagnostic format (called an api.Diagnostic). This was done because T...

X Description: Historically, the Angular Compiler has produced both native TypeScript diagnostics (called ts.Diagnostics) and its own internal Diagnostic format (called an api.Diagnostic). This was done because T...

Opengraph URL: https://github.com/angular/angular/pull/31952

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:a4f68cda-c2b9-b42c-f659-234f2bf52a1a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD22C:65478:1FF05CE:2A54FE9:6B01746F
html-safe-nonce98d3f545c82d50319b8144466fbbf7c315a074125e333fff6ae44958f7926580
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjJDOjY1NDc4OjFGRjA1Q0U6MkE1NEZFOTo2QjAxNzQ2RiIsInZpc2l0b3JfaWQiOiI3NjUwMzc2Mzk1NzU0OTI3MjE1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac94593c20aa590541e56d82b0b872f12968dbf32403cf98dd8df7b5ad6f6dfc98
hovercard-subject-tagpull_request:303597401
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/angular/angular/pull/31952/files
twitter:imagehttps://avatars.githubusercontent.com/u/4175141?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/4175141?s=400&v=4
og:image:altHistorically, the Angular Compiler has produced both native TypeScript diagnostics (called ts.Diagnostics) and its own internal Diagnostic format (called an api.Diagnostic). This was done because T...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular/pull/31952/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fpull%2F31952%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fpull%2F31952%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/pull/31952/files
Reloadhttps://github.com/angular/angular/pull/31952/files
Reloadhttps://github.com/angular/angular/pull/31952/files
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests141 (141)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fangular%2Fangular%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fangular%2Fangular%2Fissues%2Fnew%2Fchoose
alxhubhttps://github.com/alxhub
angular:masterhttps://github.com/angular/angular/tree/master
alxhub:ngtsc/ttc/true-diagnosticshttps://github.com/alxhub/angular/tree/ngtsc/ttc/true-diagnostics
Conversation 37 https://github.com/angular/angular/pull/31952
Commits 2 https://github.com/angular/angular/pull/31952/commits
Checks 0 https://github.com/angular/angular/pull/31952/checks
Files changed https://github.com/angular/angular/pull/31952/files
Please reload this pagehttps://github.com/angular/angular/pull/31952/files
feat(ivy): convert all ngtsc diagnostics to ts.Diagnostics https://github.com/angular/angular/pull/31952/files#top
Show all changes 2 commits https://github.com/angular/angular/pull/31952/files
3a00327 fix(ivy): run template type-checking for all components alxhub Aug 15, 2019 https://github.com/angular/angular/pull/31952/commits/3a003273d7930974eaf91d2ca91b476490b38ff9
df211ba feat(ivy): convert all ngtsc diagnostics to ts.Diagnostics alxhub Aug 1, 2019 https://github.com/angular/angular/pull/31952/commits/df211baba370a7adbcd81b460f8bf1a55187d906
Clear filters https://github.com/angular/angular/pull/31952/files
Please reload this pagehttps://github.com/angular/angular/pull/31952/files
Please reload this pagehttps://github.com/angular/angular/pull/31952/files
component.ts https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
program.ts https://github.com/angular/angular/pull/31952/files#diff-93dbdc32d59a16281adf01949af174d5e2406a4666384825b3b0a35bb8e0893b
api.ts https://github.com/angular/angular/pull/31952/files#diff-9eb22a14bc945542a06c095624ae9a9a2d4470e83888018cbbd05b956d82df81
context.ts https://github.com/angular/angular/pull/31952/files#diff-d81d17371a306c9d905b85553a07ca31e0fea4aee0fd8dcd2f3779cdeb4698dc
diagnostics.ts https://github.com/angular/angular/pull/31952/files#diff-665b728d3d70d8449025a8798ebbdd565358d7a5074c317aaa3920db260e8bc4
type_check_block.ts https://github.com/angular/angular/pull/31952/files#diff-7006c2f80b66b223816fab95fbfd31bc7e096377199ecacb03271860b564586f
diagnostics_spec.ts https://github.com/angular/angular/pull/31952/files#diff-5d0a8394612d2d8f653ea59dfda0c809795c6bc38d2fee638849ea6f4a2fdbfd
test_utils.ts https://github.com/angular/angular/pull/31952/files#diff-2bf4eba9f2fc57abc04d96b11f4d4ecb1c43f1d7dec431226b8fe13fe4dd70c1
env.ts https://github.com/angular/angular/pull/31952/files#diff-eec7f01739be0ed6ee5ce90ac1b910259a171c6437230f7f2ed1e27677920ba4
template_typecheck_spec.ts https://github.com/angular/angular/pull/31952/files#diff-4338bcab035efc17fedac8da7ef2cdfaa3f171d673ed2cd22cbe42641c998fb1
packages/compiler-cli/src/ngtsc/annotations/src/component.tshttps://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
View file https://github.com/alxhub/angular/blob/df211baba370a7adbcd81b460f8bf1a55187d906/packages/compiler-cli/src/ngtsc/annotations/src/component.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/31952/{{ revealButtonHref }}
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
https://github.com/angular/angular/pull/31952/files#diff-f2bb60ef38f35f7d41b0ac0868cc4267738c5e4c78e044336aec52d86a6e2d29
packages/compiler-cli/src/ngtsc/program.tshttps://github.com/angular/angular/pull/31952/files#diff-93dbdc32d59a16281adf01949af174d5e2406a4666384825b3b0a35bb8e0893b
View file https://github.com/alxhub/angular/blob/df211baba370a7adbcd81b460f8bf1a55187d906/packages/compiler-cli/src/ngtsc/program.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/31952/{{ revealButtonHref }}
https://github.com/angular/angular/pull/31952/files#diff-93dbdc32d59a16281adf01949af174d5e2406a4666384825b3b0a35bb8e0893b
https://github.com/angular/angular/pull/31952/files#diff-93dbdc32d59a16281adf01949af174d5e2406a4666384825b3b0a35bb8e0893b
https://github.com/angular/angular/pull/31952/files#diff-93dbdc32d59a16281adf01949af174d5e2406a4666384825b3b0a35bb8e0893b
https://github.com/angular/angular/pull/31952/files#diff-93dbdc32d59a16281adf01949af174d5e2406a4666384825b3b0a35bb8e0893b
https://github.com/angular/angular/pull/31952/files#diff-93dbdc32d59a16281adf01949af174d5e2406a4666384825b3b0a35bb8e0893b
packages/compiler-cli/src/ngtsc/typecheck/src/api.tshttps://github.com/angular/angular/pull/31952/files#diff-9eb22a14bc945542a06c095624ae9a9a2d4470e83888018cbbd05b956d82df81
View file https://github.com/alxhub/angular/blob/df211baba370a7adbcd81b460f8bf1a55187d906/packages/compiler-cli/src/ngtsc/typecheck/src/api.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/31952/{{ revealButtonHref }}
https://github.com/angular/angular/pull/31952/files#diff-9eb22a14bc945542a06c095624ae9a9a2d4470e83888018cbbd05b956d82df81
Please reload this pagehttps://github.com/angular/angular/pull/31952/files
https://github.com/angular/angular/pull/31952/files#diff-9eb22a14bc945542a06c095624ae9a9a2d4470e83888018cbbd05b956d82df81
https://github.com/angular/angular/pull/31952/files#diff-9eb22a14bc945542a06c095624ae9a9a2d4470e83888018cbbd05b956d82df81
Please reload this pagehttps://github.com/angular/angular/pull/31952/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.