René's URL Explorer Experiment


Title: feat(compiler-cli): DI mode for ctors with default values by alxhub · Pull Request #48980 · angular/angular · GitHub

Open Graph Title: feat(compiler-cli): DI mode for ctors with default values by alxhub · Pull Request #48980 · angular/angular

X Title: feat(compiler-cli): DI mode for ctors with default values by alxhub · Pull Request #48980 · angular/angular

Description: Previously, the AOT compiler would attempt to generate DI constructor calls for all constructors, and report errors if explicit type annotations or other problems prevented them from being generated. This commit adds a new feature which specially handles constructors that have default values specificed for all parameters. When the compiler encounters such a constructor, it now generates a zero-arg constructor call (new ClassName()) as the factory function instead of a normal DI call. This means that the default values (the initializers) of all parameters will be used. With this feature, the constructor form: constructor(foo = inject(FooService), bar = inject(BarService)) {} now works correctly. Such a constructor can use DI in production, and have these default values overridden for tests. Fixes #47606

Open Graph Description: Previously, the AOT compiler would attempt to generate DI constructor calls for all constructors, and report errors if explicit type annotations or other problems prevented them from being generate...

X Description: Previously, the AOT compiler would attempt to generate DI constructor calls for all constructors, and report errors if explicit type annotations or other problems prevented them from being generate...

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

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:ff81d472-edf5-7d1e-f84f-3053d4c8bda7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCBBE:1BB194:FB658A:1472979:6AED5BCC
html-safe-nonce47b343060e55f855dba62d4dd513bb8d0267b3b43acf2fe2f1fd0194af2685ac
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQkJFOjFCQjE5NDpGQjY1OEE6MTQ3Mjk3OTo2QUVENUJDQyIsInZpc2l0b3JfaWQiOiI4NTU2MzAwNzI2MzczODAwOTA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacbff8b2b3c0813504edcfa9a001d05515f28b07531186dc47aad75f668e2b32c9
hovercard-subject-tagpull_request:1231178984
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/48980/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:altPreviously, the AOT compiler would attempt to generate DI constructor calls for all constructors, and report errors if explicit type annotations or other problems prevented them from being generate...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None56fb42677ae87ed3e64410323d67980aa65d0485568a7858f874e7edfc6d1c11
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
release9c9a37e2423ed382cf39f70b5aa4b4858b40a3b0
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular/pull/48980/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fpull%2F48980%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%2F48980%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/48980/files
Reloadhttps://github.com/angular/angular/pull/48980/files
Reloadhttps://github.com/angular/angular/pull/48980/files
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues847 (847)https://github.com/angular/angular/issues
Pull requests180 (180)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 quality39 (39)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/pulse
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:mainhttps://github.com/angular/angular/tree/main
alxhub:ngtsc/di/inject-ctorhttps://github.com/alxhub/angular/tree/ngtsc/di/inject-ctor
Conversation 10 https://github.com/angular/angular/pull/48980
Commits 1 https://github.com/angular/angular/pull/48980/commits
Checks 0 https://github.com/angular/angular/pull/48980/checks
Files changed https://github.com/angular/angular/pull/48980/files
Please reload this pagehttps://github.com/angular/angular/pull/48980/files
feat(compiler-cli): DI mode for ctors with default values https://github.com/angular/angular/pull/48980/files#top
Show all changes 1 commit https://github.com/angular/angular/pull/48980/files
7d2de3b feat: DI mode for ctors with default values alxhub Feb 6, 2023 https://github.com/angular/angular/pull/48980/commits/7d2de3b5ac859b1c6151ec862ec29054379b2278
Clear filters https://github.com/angular/angular/pull/48980/files
Please reload this pagehttps://github.com/angular/angular/pull/48980/files
Please reload this pagehttps://github.com/angular/angular/pull/48980/files
di.ts https://github.com/angular/angular/pull/48980/files#diff-b09ce15634f94e890247228ddead9926490142f65b0623d3ae19a0941e383012
host.ts https://github.com/angular/angular/pull/48980/files#diff-e7f1562798d174a4ababbfbf02ea86bd4c83efa846959878d56db221cc3dd389
typescript.ts https://github.com/angular/angular/pull/48980/files#diff-f64171de3bc6bd3aca1ecb9a6f9711ee7b5e5e87d8c01bb4759aca4831baa71d
index.ts https://github.com/angular/angular/pull/48980/files#diff-b844d7826ec99eed11ffc27fb0fcb1e8c0340fceea4cd616ed07e717f2997cbc
ngtsc_spec.ts https://github.com/angular/angular/pull/48980/files#diff-9b200a5c9335361ab911b28a6e5baa0a4487cf4f0c2fc5b1c10bc46829426abb
constructor.ts https://github.com/angular/angular/pull/48980/files#diff-23dd8b60338ec29bc99f51835e32b0fb1773cd321f7ccd81531e17a00c9d8e61
util.ts https://github.com/angular/angular/pull/48980/files#diff-c5856bb892b47c551fa485cf2b25b651b3db6bd27eac75a26a179e6d2d500cbc
jit_spec.ts https://github.com/angular/angular/pull/48980/files#diff-03031f63a1e5967132268a6535e9e1f802064d0c9e49bd7ea56e759b942fd543
packages/compiler-cli/src/ngtsc/annotations/common/src/di.tshttps://github.com/angular/angular/pull/48980/files#diff-b09ce15634f94e890247228ddead9926490142f65b0623d3ae19a0941e383012
View file https://github.com/alxhub/angular/blob/7d2de3b5ac859b1c6151ec862ec29054379b2278/packages/compiler-cli/src/ngtsc/annotations/common/src/di.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/48980/{{ revealButtonHref }}
https://github.com/angular/angular/pull/48980/files#diff-b09ce15634f94e890247228ddead9926490142f65b0623d3ae19a0941e383012
https://github.com/angular/angular/pull/48980/files#diff-b09ce15634f94e890247228ddead9926490142f65b0623d3ae19a0941e383012
https://github.com/angular/angular/pull/48980/files#diff-b09ce15634f94e890247228ddead9926490142f65b0623d3ae19a0941e383012
https://github.com/angular/angular/pull/48980/files#diff-b09ce15634f94e890247228ddead9926490142f65b0623d3ae19a0941e383012
https://github.com/angular/angular/pull/48980/files#diff-b09ce15634f94e890247228ddead9926490142f65b0623d3ae19a0941e383012
https://github.com/angular/angular/pull/48980/files#diff-b09ce15634f94e890247228ddead9926490142f65b0623d3ae19a0941e383012
https://github.com/angular/angular/pull/48980/files#diff-b09ce15634f94e890247228ddead9926490142f65b0623d3ae19a0941e383012
https://github.com/angular/angular/pull/48980/files#diff-b09ce15634f94e890247228ddead9926490142f65b0623d3ae19a0941e383012
https://github.com/angular/angular/pull/48980/files#diff-b09ce15634f94e890247228ddead9926490142f65b0623d3ae19a0941e383012
packages/compiler-cli/src/ngtsc/reflection/src/host.tshttps://github.com/angular/angular/pull/48980/files#diff-e7f1562798d174a4ababbfbf02ea86bd4c83efa846959878d56db221cc3dd389
View file https://github.com/alxhub/angular/blob/7d2de3b5ac859b1c6151ec862ec29054379b2278/packages/compiler-cli/src/ngtsc/reflection/src/host.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/48980/{{ revealButtonHref }}
https://github.com/angular/angular/pull/48980/files#diff-e7f1562798d174a4ababbfbf02ea86bd4c83efa846959878d56db221cc3dd389
https://github.com/angular/angular/pull/48980/files#diff-e7f1562798d174a4ababbfbf02ea86bd4c83efa846959878d56db221cc3dd389
packages/compiler-cli/src/ngtsc/reflection/src/typescript.tshttps://github.com/angular/angular/pull/48980/files#diff-f64171de3bc6bd3aca1ecb9a6f9711ee7b5e5e87d8c01bb4759aca4831baa71d
View file https://github.com/alxhub/angular/blob/7d2de3b5ac859b1c6151ec862ec29054379b2278/packages/compiler-cli/src/ngtsc/reflection/src/typescript.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/48980/{{ revealButtonHref }}
https://github.com/angular/angular/pull/48980/files#diff-f64171de3bc6bd3aca1ecb9a6f9711ee7b5e5e87d8c01bb4759aca4831baa71d
https://github.com/angular/angular/pull/48980/files#diff-f64171de3bc6bd3aca1ecb9a6f9711ee7b5e5e87d8c01bb4759aca4831baa71d
packages/compiler-cli/src/ngtsc/testing/fake_core/index.tshttps://github.com/angular/angular/pull/48980/files#diff-b844d7826ec99eed11ffc27fb0fcb1e8c0340fceea4cd616ed07e717f2997cbc
View file https://github.com/alxhub/angular/blob/7d2de3b5ac859b1c6151ec862ec29054379b2278/packages/compiler-cli/src/ngtsc/testing/fake_core/index.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/48980/{{ revealButtonHref }}
https://github.com/angular/angular/pull/48980/files#diff-b844d7826ec99eed11ffc27fb0fcb1e8c0340fceea4cd616ed07e717f2997cbc
https://github.com/angular/angular/pull/48980/files#diff-b844d7826ec99eed11ffc27fb0fcb1e8c0340fceea4cd616ed07e717f2997cbc
packages/compiler-cli/test/ngtsc/ngtsc_spec.tshttps://github.com/angular/angular/pull/48980/files#diff-9b200a5c9335361ab911b28a6e5baa0a4487cf4f0c2fc5b1c10bc46829426abb
View file https://github.com/alxhub/angular/blob/7d2de3b5ac859b1c6151ec862ec29054379b2278/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/48980/{{ revealButtonHref }}
https://github.com/angular/angular/pull/48980/files#diff-9b200a5c9335361ab911b28a6e5baa0a4487cf4f0c2fc5b1c10bc46829426abb
https://github.com/angular/angular/pull/48980/files#diff-9b200a5c9335361ab911b28a6e5baa0a4487cf4f0c2fc5b1c10bc46829426abb
packages/core/src/di/jit/constructor.tshttps://github.com/angular/angular/pull/48980/files#diff-23dd8b60338ec29bc99f51835e32b0fb1773cd321f7ccd81531e17a00c9d8e61
View file https://github.com/alxhub/angular/blob/7d2de3b5ac859b1c6151ec862ec29054379b2278/packages/core/src/di/jit/constructor.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/48980/{{ revealButtonHref }}
Please reload this pagehttps://github.com/angular/angular/pull/48980/files
packages/core/src/di/jit/util.tshttps://github.com/angular/angular/pull/48980/files#diff-c5856bb892b47c551fa485cf2b25b651b3db6bd27eac75a26a179e6d2d500cbc
View file https://github.com/alxhub/angular/blob/7d2de3b5ac859b1c6151ec862ec29054379b2278/packages/core/src/di/jit/util.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/48980/{{ revealButtonHref }}
https://github.com/angular/angular/pull/48980/files#diff-c5856bb892b47c551fa485cf2b25b651b3db6bd27eac75a26a179e6d2d500cbc
https://github.com/angular/angular/pull/48980/files#diff-c5856bb892b47c551fa485cf2b25b651b3db6bd27eac75a26a179e6d2d500cbc
packages/core/test/render3/ivy/jit_spec.tshttps://github.com/angular/angular/pull/48980/files#diff-03031f63a1e5967132268a6535e9e1f802064d0c9e49bd7ea56e759b942fd543
View file https://github.com/alxhub/angular/blob/7d2de3b5ac859b1c6151ec862ec29054379b2278/packages/core/test/render3/ivy/jit_spec.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/48980/{{ revealButtonHref }}
https://github.com/angular/angular/pull/48980/files#diff-03031f63a1e5967132268a6535e9e1f802064d0c9e49bd7ea56e759b942fd543
https://github.com/angular/angular/pull/48980/files#diff-03031f63a1e5967132268a6535e9e1f802064d0c9e49bd7ea56e759b942fd543
https://github.com/angular/angular/pull/48980/files#diff-03031f63a1e5967132268a6535e9e1f802064d0c9e49bd7ea56e759b942fd543
Please reload this pagehttps://github.com/angular/angular/pull/48980/files
https://github.com/angular/angular/pull/48980/files#diff-03031f63a1e5967132268a6535e9e1f802064d0c9e49bd7ea56e759b942fd543
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.