Title: fix(compiler-cli): avoid handling functions in loadChildren as lazy load routes paths by Meligy · Pull Request #13676 · angular/angular · GitHub
Open Graph Title: fix(compiler-cli): avoid handling functions in loadChildren as lazy load routes paths by Meligy · Pull Request #13676 · angular/angular
X Title: fix(compiler-cli): avoid handling functions in loadChildren as lazy load routes paths by Meligy · Pull Request #13676 · angular/angular
Description: Please check if the PR fulfills these 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) N/A for the private API // CC @hansl Docs have been added / updated (for bug fixes / features) N/A What kind of change does this PR introduce? (check one with "x") [x] Bugfix [ ] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [ ] Build related changes [ ] CI related changes [ ] Other... Please describe: What is the current behavior? (You can also link to an open issue here) If you use an official tool that uses the Angular Compiler CLI private API, like Angular CLI (or @ng-tools Webpack plugin), and you have some route code like: import { NonLazyLoadedModule } from './non-lazy-loaded/non-lazy-loaded.module'; export function getNonLazyLoadedModule() { return NonLazyLoadedModule; } export const routes = [ { path: '/some-path', loadChildren: getNonLazyLoadedModule } ]; Building this (for example ng build using Angular CLI beta.24) shows a build error: ERROR in entry.split is not a function And it also shows in the browser. What is the new behavior? No build error in console or browser in that case. Build just succeeds and browser functionality shows no error. Loading modules (lazy or not) works as expected. Does this PR introduce a breaking change? (check one with "x") [ ] Yes [x] No If this PR contains a breaking change, please describe the impact and migration path for existing applications: ... Other information: The core problem in the previous case is that the compiler CLI internal API treats the function getNonLazyLoadedModule() as a lazy loading string (like './non-lazy-loaded/non-lazy-loaded.module#NonLazyLoadedModule'). It passes the output as the entry argument to RouteDef.fromString(entry: string), where the error entry.split is not a function happens. @hansl would be an ideal reviewer for this, having created the private API. Fixes angular/angular-cli#3204
Open Graph Description: Please check if the PR fulfills these requirements The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit Tests for the changes have bee...
X Description: Please check if the PR fulfills these requirements The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit Tests for the changes have bee...
Opengraph URL: https://github.com/angular/angular/pull/13676
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:8b7f032d-1dae-b507-08be-279c16473ebf |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | ABA6:2DBB21:1983B8E:21FA08C:6B0153F2 |
| html-safe-nonce | ce9b8632ca28a76efe152949cfe9a999f751d2c69e9cd9513487552a12a2d129 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkE2OjJEQkIyMToxOTgzQjhFOjIxRkEwOEM6NkIwMTUzRjIiLCJ2aXNpdG9yX2lkIjoiODQyMjE3MzU1MzQ2NTU3ODQ4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b7a03ce4a9628cf287d7532f6041e471340c1bf9be19d7d92e8e4c1489b0f6dc |
| hovercard-subject-tag | pull_request:99446764 |
| 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/13676/files |
| twitter:image | https://avatars.githubusercontent.com/u/171637?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/171637?s=400&v=4 |
| og:image:alt | Please check if the PR fulfills these requirements The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit Tests for the changes have bee... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width