René's URL Explorer Experiment


Title: fix(@angular/build): preserve component initialization in Karma test bundles by nagahara-naoki · Pull Request #34668 · angular/angular-cli · GitHub

Open Graph Title: fix(@angular/build): preserve component initialization in Karma test bundles by nagahara-naoki · Pull Request #34668 · angular/angular-cli

X Title: fix(@angular/build): preserve component initialization in Karma test bundles by nagahara-naoki · Pull Request #34668 · angular/angular-cli

Description: PR Checklist The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (not applicable: internal Karma bundling fix; no new options or public API) PR Type Bugfix What is the current behavior? Fixes #34250. With @angular/build:karma, a component imported through a barrel can be captured as undefined in another component's imports array. This depends on the combination of spec entry points: an async spec importing the component directly can cause lazy module initialization to cross shared-chunk boundaries. The consuming decorator can run before the component is initialized. The regression fixture includes: A standalone layout component re-exported by a barrel. A dialog importing that barrel and used by two specs. A page importing the barrel and used by another spec. An async spec importing the layout directly. Against main (2c6e8b970), the browser reports 2 failed, 2 successful. Both dialog specs throw Cannot read properties of undefined (reading 'ɵcmp'). What is the new behavior? The Karma build routes the discovered spec entry points through a shared virtual module that imports all selected specs. This keeps spec initialization in one module graph, avoiding the problematic partitioning across independent spec entry points. Preserve the existing spec-* entry names, including basename-collision handling. Keep code splitting enabled so Angular and its testing environment remain shared with the setup entry point. Include the original spec files as TypeScript root files, since the build entry points now refer to the virtual module. Preserve include/exclude selection: the virtual module only imports the specs collected by the existing discovery logic. The same four browser specs now all pass. The added integration test exercises real Karma/Chrome execution rather than only checking generated bundle text. Does this PR introduce a breaking change? Yes No Other information Simply setting disableCodeSplitting: true, as suggested by the earlier Vitest fix in #33729, was insufficient for Karma in this reproduction: it produced testing-environment initialization errors. This change retains shared framework chunks instead. Validation on macOS arm64, Node.js 24.22.2, pnpm 12.16.1, and Chrome Headless 159: pnpm bazel test //packages/angular/build:karma_integration_tests --config=no-sharding --test_output=errors: 42 integration specs, 0 failures. ESLint for the changed implementation passes. The repository ESLint configuration excludes builder integration fixtures. Prettier checks for both changed files and git diff --check pass. The full repository and E2E suites were not run. Large-suite build size/performance and dynamic addition of spec files during watch mode were not separately benchmarked or validated.

Open Graph Description: PR Checklist The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines Tests for the changes have been added (for bug...

X Description: PR Checklist The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines Tests for the changes have been added (for bug...

Opengraph URL: https://github.com/angular/angular-cli/pull/34668

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:c11d05e4-09e7-eef3-0cb3-08a90e144458
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA9C0:240CD1:361E231:44D38BB:6B01E9A4
html-safe-nonce3bfb98fd53f406963d15cc9fdbc958ed9a9008c51569960cf1773d0dcf73ae3a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOUMwOjI0MENEMTozNjFFMjMxOjQ0RDM4QkI6NkIwMUU5QTQiLCJ2aXNpdG9yX2lkIjoiMTYyMTM0MjMxMzQyNTAwNDk2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac34cb0c3068eb2dde18f22cb19accfb4385240a2fec9d3e8daffb2aa2a296c426
hovercard-subject-tagpull_request:5202659777
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-cli/pull/34668/files
twitter:imagehttps://avatars.githubusercontent.com/u/118710021?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/118710021?s=400&v=4
og:image:altPR Checklist The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines Tests for the changes have been added (for bug...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular-cli/pull/34668/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fpull%2F34668%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-cli%2Fpull%2F34668%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-cli
Reloadhttps://github.com/angular/angular-cli/pull/34668/files
Reloadhttps://github.com/angular/angular-cli/pull/34668/files
Reloadhttps://github.com/angular/angular-cli/pull/34668/files
angularhttps://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Codehttps://github.com/angular/angular-cli
Issues198 (198)https://github.com/angular/angular-cli/issues
Pull requests23 (23)https://github.com/angular/angular-cli/pulls
Actionshttps://github.com/angular/angular-cli/actions
Security and quality8 (8)https://github.com/angular/angular-cli/security
Insightshttps://github.com/angular/angular-cli/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fangular%2Fangular-cli%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-cli%2Fissues%2Fnew%2Fchoose
nagahara-naokihttps://github.com/nagahara-naoki
angular:mainhttps://github.com/angular/angular-cli/tree/main
nagahara-naoki:fix-karma-barrel-initializationhttps://github.com/nagahara-naoki/angular-cli/tree/fix-karma-barrel-initialization
Conversation 4 https://github.com/angular/angular-cli/pull/34668
Commits 2 https://github.com/angular/angular-cli/pull/34668/commits
Checks 10 https://github.com/angular/angular-cli/pull/34668/checks
Files changed https://github.com/angular/angular-cli/pull/34668/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/34668/files
fix(@angular/build): preserve component initialization in Karma test bundles https://github.com/angular/angular-cli/pull/34668/files#top
Show all changes 2 commits https://github.com/angular/angular-cli/pull/34668/files
d277ee9 fix(@angular/build): preserve component initialization in Karma test … nagahara-naoki Nov 7, 2026 https://github.com/angular/angular-cli/pull/34668/commits/d277ee9ae914c3a33c5354c2df4c707f321e2a4f
bbcf1b7 fixup! fix(@angular/build): preserve component initialization in Karm… nagahara-naoki Nov 7, 2026 https://github.com/angular/angular-cli/pull/34668/commits/bbcf1b76c0f70a812cdd250b780f492e74e8a92e
Clear filters https://github.com/angular/angular-cli/pull/34668/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/34668/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/34668/files
application_builder.ts https://github.com/angular/angular-cli/pull/34668/files#diff-75a914a39cc232da8420c43c75b0d66628d4bdf46e64a7d38244037eb301da80
barrel-import_spec.ts https://github.com/angular/angular-cli/pull/34668/files#diff-8b15a56cac0c1eb0e998e4be35b3ca7e9bfc89938ceaa1fc2215946260d465ab
packages/angular/build/src/builders/karma/application_builder.tshttps://github.com/angular/angular-cli/pull/34668/files#diff-75a914a39cc232da8420c43c75b0d66628d4bdf46e64a7d38244037eb301da80
View file https://github.com/nagahara-naoki/angular-cli/blob/bbcf1b76c0f70a812cdd250b780f492e74e8a92e/packages/angular/build/src/builders/karma/application_builder.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/34668/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/34668/files#diff-75a914a39cc232da8420c43c75b0d66628d4bdf46e64a7d38244037eb301da80
https://github.com/angular/angular-cli/pull/34668/files#diff-75a914a39cc232da8420c43c75b0d66628d4bdf46e64a7d38244037eb301da80
https://github.com/angular/angular-cli/pull/34668/files#diff-75a914a39cc232da8420c43c75b0d66628d4bdf46e64a7d38244037eb301da80
https://github.com/angular/angular-cli/pull/34668/files#diff-75a914a39cc232da8420c43c75b0d66628d4bdf46e64a7d38244037eb301da80
https://github.com/angular/angular-cli/pull/34668/files#diff-75a914a39cc232da8420c43c75b0d66628d4bdf46e64a7d38244037eb301da80
https://github.com/angular/angular-cli/pull/34668/files#diff-75a914a39cc232da8420c43c75b0d66628d4bdf46e64a7d38244037eb301da80
packages/angular/build/src/builders/karma/tests/behavior/barrel-import_spec.tshttps://github.com/angular/angular-cli/pull/34668/files#diff-8b15a56cac0c1eb0e998e4be35b3ca7e9bfc89938ceaa1fc2215946260d465ab
View file https://github.com/nagahara-naoki/angular-cli/blob/bbcf1b76c0f70a812cdd250b780f492e74e8a92e/packages/angular/build/src/builders/karma/tests/behavior/barrel-import_spec.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/34668/{{ revealButtonHref }}
Please reload this pagehttps://github.com/angular/angular-cli/pull/34668/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.