angular-cli: Route extraction shouldnt load the whole app in dev server
I dont want to be that type of guy that just reopens a issue. But i only saw @alan-agius4 answers on that topic and i would kindly ask other angular engineers about their opinion and if its something that can be solved differently. Maybe without @alan-agius4 indirect implication that it would “only” be solveable with file based routing.
There are no docs on route extraction, but my understanding now is that all routes are computed in advance. I’m not deeper into angular code than the public_api, but I can’t imagine that a full application load (full lifecycle or template execution) are necessary to figure this out. What does this have to do with route extraction?
proof of concept
In this example, it would only make sense for SSG if the REQUEST token is not available on the server. (but according to @alan-agius4 its “bad practice” to think that the REQUEST token is available on the server with disabled prerender) - Just think about that for a second.
Sorry if I’m a bit salty, but it took me a really long time to figure out that (imo this bug) is due to the angular dev server.
Related to: https://github.com/angular/angular-cli/issues/28995 https://github.com/angular/angular-cli/issues/28727#issuecomment-2441443287 https://github.com/angular/angular-cli/issues/29084 (my previous ticket) Angular Discord - My thread Angular Discord - Another thread and probably many more
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16
Commits related to this issue
- fix(@angular/ssr): disable component bootstrapping during route extraction This commit disables component bootstrapping during route extraction to prevent invoking the AppComponent and its lifecycle ... — committed to alan-agius4/angular-cli by alan-agius4 2 years ago
- fix(@angular/ssr): disable component bootstrapping during route extraction This commit disables component bootstrapping during route extraction to prevent invoking the AppComponent and its lifecycle ... — committed to alan-agius4/angular-cli by alan-agius4 2 years ago
- fix(@angular/ssr): disable component bootstrapping during route extraction This commit disables component bootstrapping during route extraction to prevent invoking the AppComponent and its lifecycle ... — committed to alan-agius4/angular-cli by alan-agius4 2 years ago
- fix(@angular/ssr): disable component bootstrapping during route extraction This commit disables component bootstrapping during route extraction to prevent invoking the AppComponent and its lifecycle ... — committed to alan-agius4/angular-cli by alan-agius4 2 years ago
- fix(@angular/ssr): disable component bootstrapping during route extraction This commit disables component bootstrapping during route extraction to prevent invoking the AppComponent and its lifecycle ... — committed to alan-agius4/angular-cli by alan-agius4 2 years ago
- fix(@angular/ssr): disable component bootstrapping during route extraction This commit disables component bootstrapping during route extraction to prevent invoking the AppComponent and its lifecycle ... — committed to angular/angular-cli by alan-agius4 2 years ago
- fix(@angular/ssr): disable component bootstrapping during route extraction This commit disables component bootstrapping during route extraction to prevent invoking the AppComponent and its lifecycle ... — committed to angular/angular-cli by alan-agius4 2 years ago
- refactor(core): add `ENABLE_ROOT_COMPONENT_BOOTSTRAP` token Introduced the `ENABLE_ROOT_COMPONENT_BOOTSTRAP` token to control the bootstrapping of components during application initialization. This t... — committed to alan-agius4/angular by alan-agius4 2 years ago
- refactor(core): add `ENABLE_ROOT_COMPONENT_BOOTSTRAP` token Introduced the `ENABLE_ROOT_COMPONENT_BOOTSTRAP` token to control the bootstrapping of components during application initialization. This t... — committed to alan-agius4/angular by alan-agius4 2 years ago
- refactor(core): add `ENABLE_ROOT_COMPONENT_BOOTSTRAP` token (#59133) Introduced the `ENABLE_ROOT_COMPONENT_BOOTSTRAP` token to control the bootstrapping of components during application initializatio... — committed to angular/angular by alan-agius4 2 years ago
- refactor(core): add `ENABLE_ROOT_COMPONENT_BOOTSTRAP` token (#59205) Introduced the `ENABLE_ROOT_COMPONENT_BOOTSTRAP` token to control the bootstrapping of components during application initializatio... — committed to angular/angular by alan-agius4 2 years ago
Yes