angular/packages/platform-server
Krzysztof Platis b40875a2cc fix(platform-server): destroy PlatformRef when error happens during the bootstrap() phase (#58112) (#58135)
The `bootstrap()` phase might fail e.g. due to an rejected promise in some `APP_INIIALIZER`.
If `PlatformRef` is not destroyed, then the main app's injector is not destroyed and therefore `ngOnDestroy` hooks of singleton services is not called on the end (failure) of SSR.

This could lead to possible memory leaks in custom SSR apps, if their singleton services' `ngOnDestroy` hooks contained an important teardown logic (e.g. unsubscribing from RxJS observable).

Note: I needed to fix by the way another thing too: now we destroy `moduleRef` when `platformInjector` is destroyed - by setting a `PLATFORM_DESTROY_LISTENER`

Patch port of #58112

PR Close #58135
2024-10-09 13:50:02 +00:00
..
init refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
src fix(platform-server): destroy PlatformRef when error happens during the bootstrap() phase (#58112) (#58135) 2024-10-09 13:50:02 +00:00
test fix(platform-server): destroy PlatformRef when error happens during the bootstrap() phase (#58112) (#58135) 2024-10-09 13:50:02 +00:00
testing refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
BUILD.bazel refactor(docs-infra): complete removal of aio directory (#56496) 2024-06-18 12:26:00 -07:00
index.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00
package.json build: update Node.js to match Angular CLI engines (#56187) 2024-06-03 18:00:46 +00:00
PACKAGE.md docs: drop glossary links (#55044) 2024-03-28 13:02:50 -07:00
public_api.ts refactor: update license text to point to angular.dev (#57902) 2024-09-24 15:28:46 +02:00