René's URL Explorer Experiment


Title: DEV mode change detection - Show warning if object reference changes in subsequent check · Issue #27804 · angular/angular · GitHub

Open Graph Title: DEV mode change detection - Show warning if object reference changes in subsequent check · Issue #27804 · angular/angular

X Title: DEV mode change detection - Show warning if object reference changes in subsequent check · Issue #27804 · angular/angular

Description: 🚀 feature request Relevant Package This feature request is for @angular/core Description When Angular does change detection, it will re-render the view whenever a property binding changes. There is a slight issue with what Angular consid...

Open Graph Description: 🚀 feature request Relevant Package This feature request is for @angular/core Description When Angular does change detection, it will re-render the view whenever a property binding changes. There is...

X Description: 🚀 feature request Relevant Package This feature request is for @angular/core Description When Angular does change detection, it will re-render the view whenever a property binding changes. There is...

Opengraph URL: https://github.com/angular/angular/issues/27804

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"DEV mode change detection - Show warning if object reference changes in subsequent check","articleBody":"# 🚀 feature request\r\n\r\n### Relevant Package\r\nThis feature request is for `@angular/core`\r\n\r\n### Description\r\nWhen Angular does change detection, it will re-render the view whenever a property binding changes. There is a slight issue with _what_ Angular considers a \"change\". If an object reference changes to an object identical to the first one, Angular will update the view with this new object, even if the view ends up being identical to the previous one. This situation is easy for new developers to fall into, as it very easy to write a function like:\r\n```\r\ndivClasses() {\r\n  return {\r\n    red: this.isRed\r\n  };\r\n}\r\n```\r\nand then bind it to an `[ngClass]` directive, which will remove and re-apply the `red` class every change detection call, because `divClasses()` returns a new object every time it is run.\r\n```\r\n\u003cdiv [ngClass]=\"divClasses()\">\u003c/div>\u003c!-- This div will be updated every time change detection is ran. -->\r\n```\r\n\r\nThis causes two big problems, the first being inefficient view rendering. Change detection only needs to update the view whenever the component's `isRed` value changes, but it ends up updating the view every single time change detection is run. This would slow down the page and negatively impact the end user's experience.\r\n\r\nThe less obvious problem is the possibility of change detection recursion. If the application has a `MutationObserver` somewhere, watching for DOM changes, the above function will cause it to run every time change detection is ran. If this `MutationObserver` also triggers a change detection check, the page will hang as the `divClasses()` function updates the view, triggering the `MutationObserver`, which triggers change detection again. This might not even directly be the developer's fault, as the `MutationObserver` could be from a 3rd party library.\r\n\r\nI recently spent a day and a half attempting to debug an application hanging in this way. Funnily enough, the problem was made worse by a 3rd party library which modified `console.log` to run change detection - which caused recursion to happen again. Ultimately, I suspect this scenario might be the cause of issues like https://github.com/valor-software/ngx-bootstrap/issues/3047, https://github.com/angular/angular/issues/20450, or https://github.com/angular/angular/issues/24614.\r\n\r\n### Describe the solution you'd like\r\nTo be clear, my proposed \"fix\" does *NOT* involve modifying Angular's change detection to deeply compare object references. Discussion on this bug: https://github.com/angular/angular/issues/24614 was ultimately tabled because the proposed fix involved deep equality checks, which would be inefficient and very time consuming to check larger objects.\r\n\r\nUltimately, the issue here seems to be with functions like my example `divClasses()`, which inadvertently abuse change detection to unnecessarily update the view. If there was some way to alert the developer that a function they've written was possibly faulty, that would probably be the way to go.\r\n\r\nCurrently, Angular displays warnings for change detection when the application is running in dev mode for a similar scenario. If change detection itself causes a property/function to change its output, Angular currently displays a warning about what happened. Could it be possible to display a similar warning for whenever a function returns a different object reference on subsequent change detection calls? A reference check would not be very expensive, and this may end up helping the application developer optimize their program.","author":{"url":"https://github.com/ibedard16","@type":"Person","name":"ibedard16"},"datePublished":"2018-12-21T19:04:20Z","url":"https://github.com/angular/angular/issues/27804"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f4c7f470-1e24-33d1-b418-fff80b85d2a9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAA14:666CF:5122B:6EF97:6B045408
html-safe-nonceb4457e57cda1ce5c0d191830f11b04861e959508a21451ba5b9db2a186caa592
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTE0OjY2NkNGOjUxMjJCOjZFRjk3OjZCMDQ1NDA4IiwidmlzaXRvcl9pZCI6IjgxNDkwMTI1OTgzNTMwNTY3NzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc9bcf1b3f3cfc2938b88249bafb9af5d96212fb7926d4595dc1fd48a50c69ba6
hovercard-subject-tagissue:393560545
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/27804/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2430936502a1f45b05e07a4f8a543c8c9b51cab343b126f8fb3a22920d4c3ad3/angular/angular/issues/27804
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2430936502a1f45b05e07a4f8a543c8c9b51cab343b126f8fb3a22920d4c3ad3/angular/angular/issues/27804
og:image:alt🚀 feature request Relevant Package This feature request is for @angular/core Description When Angular does change detection, it will re-render the view whenever a property binding changes. There is...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameibedard16
hostnamegithub.com
expected-hostnamegithub.com
None910ca0e260cfec6aff11407d8dc6a0d3a4cd381a2ec9ada56627b063426892a0
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee086f9b7e88322eb2b41885a6ad425b215737fa5
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/27804#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F27804
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%2Fissues%2F27804
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/27804
Reloadhttps://github.com/angular/angular/issues/27804
Reloadhttps://github.com/angular/angular/issues/27804
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues841 (841)https://github.com/angular/angular/issues
Pull requests149 (149)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
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/27804
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/27804
DEV mode change detection - Show warning if object reference changes in subsequent checkhttps://github.com/angular/angular/issues/27804#top
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
core: change detectionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20change%20detection%22
core: debug toolshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20debug%20tools%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
feature: under considerationFeature request for which voting has completed and the request is now under considerationhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%3A%20under%20consideration%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/ibedard16
ibedard16https://github.com/ibedard16
on Dec 21, 2018https://github.com/angular/angular/issues/27804#issue-393560545
valor-software/ngx-bootstrap#3047https://github.com/valor-software/ngx-bootstrap/issues/3047
#20450https://github.com/angular/angular/issues/20450
#24614https://github.com/angular/angular/issues/24614
#24614https://github.com/angular/angular/issues/24614
benleshhttps://github.com/benlesh
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
on Dec 26, 2018https://github.com/angular/angular/issues/27804#event-2044926629
ngbothttps://github.com/apps/ngbot
Backloghttps://github.com/angular/angular/milestone/82
on Dec 26, 2018https://github.com/angular/angular/issues/27804#event-2044926668
https://github.com/un33k
un33khttps://github.com/un33k
on Mar 21, 2019https://github.com/angular/angular/issues/27804#issuecomment-475366733
@ibedard16https://github.com/ibedard16
#24614https://github.com/angular/angular/issues/24614
pkozlowski-opensourcehttps://github.com/pkozlowski-opensource
core: change detectionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20change%20detection%22
core: debug toolshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20debug%20tools%22
on Mar 15, 2020https://github.com/angular/angular/issues/27804#event-3131051990
angular-robothttps://github.com/apps/angular-robot
votes requiredhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22votes%20required%22
on Jun 4, 2021https://github.com/angular/angular/issues/27804#event-4843617695
https://github.com/apps/angular-robot
angular-robothttps://github.com/apps/angular-robot
on Jun 4, 2021https://github.com/angular/angular/issues/27804#issuecomment-854785171
documentationhttps://github.com/angular/angular/blob/e29eb8abfbfdfb793e08ac88e14b7ba6d2ff2136/docs/GITHUB_PROCESS.md#feature-request-process
https://github.com/ibedard16
ibedard16https://github.com/ibedard16
on Jun 7, 2021https://github.com/angular/angular/issues/27804#issuecomment-856075213
@un33khttps://github.com/un33k
#24614https://github.com/angular/angular/issues/24614
#24614https://github.com/angular/angular/issues/24614
Expression has changed after it was checkedhttps://angular.io/errors/NG0100
https://github.com/apps/angular-robot
angular-robothttps://github.com/apps/angular-robot
on Jun 27, 2021https://github.com/angular/angular/issues/27804#issuecomment-869168781
communityhttps://angular.io/resources?category=community
packagehttps://angular.io/guide/creating-libraries
documentationhttps://github.com/angular/angular/blob/e29eb8abfbfdfb793e08ac88e14b7ba6d2ff2136/docs/GITHUB_PROCESS.md#feature-request-process
angular-robothttps://github.com/apps/angular-robot
insufficient voteshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22insufficient%20votes%22
on Jun 27, 2021https://github.com/angular/angular/issues/27804#event-4943966032
jessicajaniukhttps://github.com/jessicajaniuk
feature: under considerationFeature request for which voting has completed and the request is now under considerationhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%3A%20under%20consideration%22
insufficient voteshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22insufficient%20votes%22
votes requiredhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22votes%20required%22
on Jul 18, 2022https://github.com/angular/angular/issues/27804#event-7016383657
https://github.com/pkozlowski-opensource
pkozlowski-opensourcehttps://github.com/pkozlowski-opensource
on Dec 13, 2022https://github.com/angular/angular/issues/27804#issuecomment-1348471494
#25518https://github.com/angular/angular/issues/25518
https://github.com/arturovt
arturovthttps://github.com/arturovt
on Sep 29, 2026https://github.com/angular/angular/issues/27804#issuecomment-5899233611
@JeanMechehttps://github.com/JeanMeche
https://github.com/JeanMeche
JeanMechehttps://github.com/JeanMeche
on Sep 29, 2026https://github.com/angular/angular/issues/27804#issuecomment-5899283661
JeanMechehttps://github.com/JeanMeche
not plannedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Sep 29, 2026https://github.com/angular/angular/issues/27804#event-32115847110
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Oct 30, 2026https://github.com/angular/angular/issues/27804#issuecomment-6511661745
automatic conversation locking policyhttps://github.com/angular/angular/blob/f0fbced1c55bc8b8ed9df01cea99df42f3e7eae3/contributing-docs/auto-issue-locking.md
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Oct 30, 2026https://github.com/angular/angular/issues/27804#event-34644996462
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/27804
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/27804
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
core: change detectionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20change%20detection%22
core: debug toolshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20debug%20tools%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
feature: under considerationFeature request for which voting has completed and the request is now under considerationhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%3A%20under%20consideration%22
BacklogNo due datehttps://github.com/angular/angular/milestone/82
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.