Title: fix(core): mark NgModule as not the root if APP_ROOT is set to false by vikerman · Pull Request #24814 · angular/angular · GitHub
Open Graph Title: fix(core): mark NgModule as not the root if APP_ROOT is set to false by vikerman · Pull Request #24814 · angular/angular
X Title: fix(core): mark NgModule as not the root if APP_ROOT is set to false by vikerman · Pull Request #24814 · angular/angular
Description: Tree shakable providers use the APP_ROOT token to determine where to attach themselves. APP_ROOT gets set on NgModule with BrowserModule irrespective of whether it is actually the root(Ex. in case of SSR app where the shell app is first bootstrapped without BrowserModule being the root module). This change allows a NgModule with BrowserModule to explicitly mark itself as not the root by setting APP_ROOT token to false. This allows tree shakable providers to be attached to the right root module. PR Checklist Please check if your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (for bug fixes / features) PR Type What kind of change does this PR introduce? [x] Bugfix [ ] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [ ] Build related changes [ ] CI related changes [ ] Documentation content changes [ ] angular.io application / infrastructure changes [ ] Other... Please describe: What is the current behavior? NgModule with BrowserModule is always set as the root module. For a SSR app that is progressively bootstrapped the root module doesn't define the BrowserModule while the module with BrowserModule is loaded later. However tree shakable injectors always attach themselves to the NgModule with BrowserModule and not it's parent. What is the new behavior? This change allows a NgModule that imports BrowserModule to explicitly mark itself as not the root. Does this PR introduce a breaking change? [ ] Yes [x] No
Open Graph Description: Tree shakable providers use the APP_ROOT token to determine where to attach themselves. APP_ROOT gets set on NgModule with BrowserModule irrespective of whether it is actually the root(Ex. in case ...
X Description: Tree shakable providers use the APP_ROOT token to determine where to attach themselves. APP_ROOT gets set on NgModule with BrowserModule irrespective of whether it is actually the root(Ex. in case ...
Opengraph URL: https://github.com/angular/angular/pull/24814
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,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-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f5094ce9-f08c-cbe4-a345-a409704de3ea |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E2B8:A99C2:E45331:125C109:6B00F689 |
| html-safe-nonce | 548732167620b76c1fee81ab2b0ea79aad76e3581328b73a40a9eb6e0f1f8931 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkI4OkE5OUMyOkU0NTMzMToxMjVDMTA5OjZCMDBGNjg5IiwidmlzaXRvcl9pZCI6IjI4MzQ4OTk4OTE0Mzg4MTA3NjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 56b5770339b9c2365a36bdf810debcf2ddd72e23bc807d3e3500aa2a51e5a89c |
| hovercard-subject-tag | pull_request:200434883 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/angular/angular/pull/24814/files |
| twitter:image | https://avatars.githubusercontent.com/u/85066?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/85066?s=400&v=4 |
| og:image:alt | Tree shakable providers use the APP_ROOT token to determine where to attach themselves. APP_ROOT gets set on NgModule with BrowserModule irrespective of whether it is actually the root(Ex. in case ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width