fix(service-worker): don't block initialization on registration (#19936)
fix(service-worker): don't block initialization on registration (#19936)

Importing ServiceWorkerModule.register() will schedule registration of
the Service Worker inside an APP_INITIALIZER. Previously, the Promise
returned by navigator.serviceWorker.register() was returned from the
initializer function. This has the unwanted side effect of blocking
initialization until the SW is registered. Even worse, if the SW script
fails to load, this can cause the app initialization to fail.

The solution is to not return the registration promise from the
initializer function, essentially decoupling registration from the rest
of the initialization flow.

This change is not unit testable as there are no mocks/adapters yet for
navigator.serviceWorker. A future integration test should cover this case
with better fidelity.

PR Close #19936

IgorMinar/angular,robwormald/angular,ocombe/angular,mgechev/angular,angular/angular,kara/angular,mzgol/angular,kara/angular,alxhub/angular,matsko/angular,chuckjaz/angular,shairez/angular,rkirov/angular,heathkit/angular,vikerman/angular,ValtoFrameworks/Angular-2,filipesilva/angular,robwormald/angular,jasonaden/angular,mgechev/angular,meeroslav/angular,ValtoFrameworks/Angular-2,blesh/angular,alxhub/angular,trshafer/angular,alxhub/angular,vicb/angular,gkalpak/angular,NathanWalker/angular,gkalpak/angular,angular-indonesia/angular,kegluneq/angular,hansl/angular,snaptech/angular,blesh/angular,mhevery/angular,gkalpak/angular,gkalpak/angular,mprobst/angular,blesh/angular,StephenFluin/angular,mgiambalvo/angular,mprobst/angular,pk-karthik/framework-js-angular,gnomeontherun/angular,juristr/angular,JiaLiPassion/angular,LucasSloan/angular,aboveyou00/angular,petebacondarwin/angular,jasonaden/angular,mlaval/angular,mprobst/angular,JiaLiPassion/angular,gjungb/angular,mgechev/angular,kegluneq/angular,petebacondarwin/angular,cironunes/angular,brandonroberts/angular,rkirov/angular,gdi2290/angular,Toxicable/angular,kara/angular,gdi2290/angular,sarunint/angular,shairez/angular,wKoza/angular,Brocco/angular,blesh/angular,matsko/angular,ocombe/angular,LucasSloan/angular,rkirov/angular,matsko/angular,mzgol/angular,gjungb/angular,Brocco/angular,mgiambalvo/angular,StephenFluin/angular,IgorMinar/angular,LucasSloan/angular,meeroslav/angular,angular-indonesia/angular,kara/angular,gdi2290/angular,heathkit/angular,ghetolay/angular,brandonroberts/angular,petebacondarwin/angular,petebacondarwin/angular,manekinekko/angular,sarunint/angular,Toxicable/angular,aboveyou00/angular,filipesilva/angular,mgiambalvo/angular,LucasSloan/angular,jasonaden/angular,vsavkin/angular,NathanWalker/angular,snaptech/angular,angular-indonesia/angular,juristr/angular,vicb/angular,wKoza/angular,chuckjaz/angular,snaptech/angular,brandonroberts/angular,dsebastien/angular,ultrasonicsoft/angular,Toxicable/angular,juristr/angular,gjungb/angular,juristr/angular,gjungb/angular,pk-karthik/framework-js-angular,ultrasonicsoft/angular,mgol/angular,mgol/angular,ultrasonicsoft/angular,gdi2290/angular,brandonroberts/angular,robwormald/angular,manekinekko/angular,Toxicable/angular,aboveyou00/angular,kegluneq/angular,hansl/angular,alexeagle/angular,brandonroberts/angular,mzgol/angular,chuckjaz/angular,cironunes/angular,StephenFluin/angular,angular/angular,manekinekko/angular,LucasSloan/angular,mhevery/angular,chuckjaz/angular,mprobst/angular,hansl/angular,vikerman/angular,jasonaden/angular,alexeagle/angular,chuckjaz/angular,IdeaBlade/angular,filipesilva/angular,trshafer/angular,juristr/angular,NathanWalker/angular,gnomeontherun/angular,IgorMinar/angular,vsavkin/angular,jasonaden/angular,jasonaden/angular,alexeagle/angular,Brocco/angular,StephenFluin/angular,Brocco/angular,Brocco/angular,kara/angular,ghetolay/angular,mzgol/angular,gjungb/angular,angular/angular,dsebastien/angular,mlaval/angular,brandonroberts/angular,mhevery/angular,jonrimmer/angular,heathkit/angular,meeroslav/angular,IgorMinar/angular,wKoza/angular,alexeagle/angular,ocombe/angular,vsavkin/angular,manekinekko/angular,hansl/angular,dsebastien/angular,sarunint/angular,alxhub/angular,snaptech/angular,dsebastien/angular,alexeagle/angular,kegluneq/angular,dsebastien/angular,hansl/angular,vikerman/angular,kegluneq/angular,NathanWalker/angular,JiaLiPassion/angular,kara/angular,pk-karthik/framework-js-angular,mgol/angular,ultrasonicsoft/angular,mlaval/angular,trshafer/angular,sarunint/angular,mhevery/angular,JiaLiPassion/angular,mgiambalvo/angular,StephenFluin/angular,jonrimmer/angular,mgiambalvo/angular,sarunint/angular,angular/angular,IdeaBlade/angular,mgechev/angular,filipesilva/angular,IdeaBlade/angular,IdeaBlade/angular,sarunint/angular,vikerman/angular,rkirov/angular,gnomeontherun/angular,mprobst/angular,mhevery/angular,ghetolay/angular,ocombe/angular,cironunes/angular,mzgol/angular,NathanWalker/angular,mgol/angular,ultrasonicsoft/angular,heathkit/angular,dsebastien/angular,rkirov/angular,mlaval/angular,meeroslav/angular,mprobst/angular,aboveyou00/angular,chuckjaz/angular,gnomeontherun/angular,mgol/angular,jonrimmer/angular,rkirov/angular,ocombe/angular,IgorMinar/angular,petebacondarwin/angular,jonrimmer/angular,vikerman/angular,mzgol/angular,jonrimmer/angular,wKoza/angular,cironunes/angular,vikerman/angular,mgol/angular,Toxicable/angular,robwormald/angular,ghetolay/angular,NathanWalker/angular,pk-karthik/framework-js-angular,matsko/angular,blesh/angular,manekinekko/angular,Brocco/angular,robwormald/angular,jonrimmer/angular,IgorMinar/angular,LucasSloan/angular,filipesilva/angular,aboveyou00/angular,vicb/angular,heathkit/angular,snaptech/angular,manekinekko/angular,shairez/angular,IdeaBlade/angular,ValtoFrameworks/Angular-2,hansl/angular,trshafer/angular,alexeagle/angular,mgechev/angular,gdi2290/angular,Toxicable/angular,cironunes/angular,alxhub/angular,vsavkin/angular,mlaval/angular,matsko/angular,ValtoFrameworks/Angular-2,ValtoFrameworks/Angular-2,shairez/angular,aboveyou00/angular,vsavkin/angular,heathkit/angular,snaptech/angular,trshafer/angular,trshafer/angular,ghetolay/angular,wKoza/angular,vicb/angular,gdi2290/angular,kegluneq/angular,angular-indonesia/angular,wKoza/angular,juristr/angular,ocombe/angular,vicb/angular,shairez/angular,mhevery/angular,cironunes/angular,ultrasonicsoft/angular,pk-karthik/framework-js-angular,petebacondarwin/angular,vicb/angular,meeroslav/angular,robwormald/angular