()
| 340 | * Intent to remove in v24. |
| 341 | */ |
| 342 | export function withIncrementalHydration(): Provider[] { |
| 343 | const providers: Provider[] = [ |
| 344 | withEventReplay(), |
| 345 | { |
| 346 | provide: IS_INCREMENTAL_HYDRATION_ENABLED, |
| 347 | useValue: true, |
| 348 | }, |
| 349 | { |
| 350 | provide: DEHYDRATED_BLOCK_REGISTRY, |
| 351 | useFactory: createDehydratedBlockRegistry, |
| 352 | }, |
| 353 | ]; |
| 354 | |
| 355 | if (typeof ngServerMode === 'undefined' || !ngServerMode) { |
| 356 | providers.push({ |
| 357 | provide: APP_BOOTSTRAP_LISTENER, |
| 358 | useFactory: () => { |
| 359 | const injector = inject(Injector); |
| 360 | const doc = inject(DOCUMENT); |
| 361 | |
| 362 | return () => { |
| 363 | // No-op when the incremental-hydration runtime has not been |
| 364 | // activated. When activated, performs defer-block scanning, |
| 365 | // trigger initialization, and jsaction wiring. |
| 366 | runIncrementalHydrationBootstrap(injector, doc); |
| 367 | }; |
| 368 | }, |
| 369 | multi: true, |
| 370 | }); |
| 371 | } |
| 372 | |
| 373 | return providers; |
| 374 | } |
| 375 | |
| 376 | /** |
| 377 | * |
nothing calls this directly
no test coverage detected
searching dependent graphs…