René's URL Explorer Experiment


Title: JIT (TestBed) still defaults changeDetection to Eager, AOT correctly defaults to OnPush · Issue #70262 · angular/angular · GitHub

Open Graph Title: JIT (TestBed) still defaults changeDetection to Eager, AOT correctly defaults to OnPush · Issue #70262 · angular/angular

X Title: JIT (TestBed) still defaults changeDetection to Eager, AOT correctly defaults to OnPush · Issue #70262 · angular/angular

Description: Description @Component() without an explicit changeDetection behaves differently depending on how it's compiled: AOT (production build) → OnPush (the documented default since v22, #67687) JIT (TestBed, Jest, etc.) → still Eager So the ex...

Open Graph Description: Description @Component() without an explicit changeDetection behaves differently depending on how it's compiled: AOT (production build) → OnPush (the documented default since v22, #67687) JIT (Test...

X Description: Description @Component() without an explicit changeDetection behaves differently depending on how it's compiled: AOT (production build) → OnPush (the documented default since v22, #67687) JIT (...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"JIT (TestBed) still defaults changeDetection to Eager, AOT correctly defaults to OnPush","articleBody":"## Description\n\n`@Component()` without an explicit `changeDetection` behaves differently depending on how it's compiled:\n\n- **AOT** (production build) → `OnPush` (the documented default since v22, #67687)\n- **JIT** (TestBed, Jest, etc.) → still `Eager`\n\nSo the exact same component can pass its tests and then behave differently in prod, or vice versa.\n\n## Reproduction\n\n```ts\n@Component({\n  selector: 'my-comp',\n  template: '',\n})\nclass MyComponent {}\n```\n\nCompile this with `ngc`/a normal `ng build` → `OnPush`.\nRun it through `TestBed.createComponent(MyComponent)` in a spec → `Eager`.\n\nWe hit this for real: after upgrading to v22, we removed an explicit `changeDetection: ChangeDetectionStrategy.OnPush` from a component (reasoning: it's the default now, why write it). One TestBed spec started failing (`signal read during notification phase`) — only under Jest, not in the actual app.\n\n## Root cause\n\n`packages/core/src/metadata/directives.ts` still hardcodes the JIT decorator's own default:\n\n```ts\n(c: Component = {}) => ({changeDetection: ChangeDetectionStrategy.Eager, ...c}),\n```\n\nThis line wasn't touched by #67687, which only updated the AOT compiler and the JIT \"declare component\" linking path (`convertDeclareComponentFacadeToMetadata` in `jit_compiler_facade.ts`), not the plain decorator that TestBed/Jest actually exercise.\n\nThere's even a TODO for this exact spot, removed the same day #67687 merged, without the value being updated:\n\n```diff\n-  // TODO(jeanmeche): remove the ts-ignore when OnPush is the default\n-  // @ts-ignore\n   (c: Component = {}) => ({changeDetection: ChangeDetectionStrategy.Eager, ...c}),\n```\n(commit `cf3b7fe489`)\n\nStill reproduces on `main` and on the latest published `22.1.2`.\n\n## Fix\n\nPR: #70261 — one-line default flip + a regression test. Couldn't run the full internal test suite locally, so CI may turn up other spec files relying on the old JIT default.\n\n## Environment\n\nAngular: 22.1.2 (also reproduces on `main`)","author":{"url":"https://github.com/ValeraGin","@type":"Person","name":"ValeraGin"},"datePublished":"2026-08-18T23:18:04Z","url":"https://github.com/angular/angular/issues/70262"}

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:9742cea6-b6ef-9a10-0285-132b38aa3843
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA7C0:399E4B:15443AF:1C3D96F:6B012EAD
html-safe-noncea89aa276345bae80f04ca44b2e8b3c095efcbc8e6b469445dd0ced133d408079
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBN0MwOjM5OUU0QjoxNTQ0M0FGOjFDM0Q5NkY6NkIwMTJFQUQiLCJ2aXNpdG9yX2lkIjoiMzY2NTU1Nzc4MDY0NDgzNDk4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac68a44d47215bb1422b2e21b4e4c1e6fd113ec398609607a4578782937a21c18f
hovercard-subject-tagissue:5187253400
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/70262/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1827dda0a28e794ce8031a344af37cf3fef027df29e0026ba3d4cd2d9578f5f3/angular/angular/issues/70262
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1827dda0a28e794ce8031a344af37cf3fef027df29e0026ba3d4cd2d9578f5f3/angular/angular/issues/70262
og:image:altDescription @Component() without an explicit changeDetection behaves differently depending on how it's compiled: AOT (production build) → OnPush (the documented default since v22, #67687) JIT (Test...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameValeraGin
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/70262#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F70262
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%2F70262
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/70262
Reloadhttps://github.com/angular/angular/issues/70262
Reloadhttps://github.com/angular/angular/issues/70262
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
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/70262
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/70262
#69898https://github.com/angular/angular/pull/69898
JIT (TestBed) still defaults changeDetection to Eager, AOT correctly defaults to OnPushhttps://github.com/angular/angular/issues/70262#top
#69898https://github.com/angular/angular/pull/69898
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
breaking changeshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22breaking%20changes%22
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
needsTriagehttps://github.com/angular/angular/milestone/83
https://github.com/ValeraGin
ValeraGinhttps://github.com/ValeraGin
on Aug 18, 2026https://github.com/angular/angular/issues/70262#issue-5187253400
feat(core): Set default Component changeDetection strategy to OnPush #67687https://github.com/angular/angular/pull/67687
#67687https://github.com/angular/angular/pull/67687
#67687https://github.com/angular/angular/pull/67687
#70261https://github.com/angular/angular/pull/70261
angular-robothttps://github.com/apps/angular-robot
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
gemini-triagedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22gemini-triaged%22
on Aug 18, 2026https://github.com/angular/angular/issues/70262#event-29651299398
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Aug 18, 2026https://github.com/angular/angular/issues/70262#event-29651300127
angular-robothttps://github.com/apps/angular-robot
needsTriagehttps://github.com/angular/angular/milestone/83
on Aug 18, 2026https://github.com/angular/angular/issues/70262#event-29651300246
https://github.com/JeanMeche
JeanMechehttps://github.com/JeanMeche
on Aug 19, 2026https://github.com/angular/angular/issues/70262#issuecomment-5337532129
#69898https://github.com/angular/angular/pull/69898
JeanMechehttps://github.com/JeanMeche
breaking changeshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22breaking%20changes%22
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
gemini-triagedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22gemini-triaged%22
on Aug 20, 2026https://github.com/angular/angular/issues/70262#event-29753007980
JeanMechehttps://github.com/JeanMeche
fix(core): Ensure JIT components also use `OnPush` by default. #69898https://github.com/angular/angular/pull/69898
on Aug 20, 2026https://github.com/angular/angular/issues/70262#event-29753020526
JeanMechehttps://github.com/JeanMeche
TestBed.overrideComponent incorrectly overrides changeDetection to eager when not explicitly provided #70323https://github.com/angular/angular/issues/70323
on Aug 20, 2026https://github.com/angular/angular/issues/70262#event-29763893634
https://github.com/JeanMeche
JeanMechehttps://github.com/JeanMeche
on Sep 10, 2026https://github.com/angular/angular/issues/70262#issuecomment-5626921876
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/70262
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/70262
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
breaking changeshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22breaking%20changes%22
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
needsTriageNo due datehttps://github.com/angular/angular/milestone/83
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.