cleanup(platform): removed webworker and server deprecated apis (#10745)
This commit is contained in:
@ -15,14 +15,6 @@ import {INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS} from './src/platform_provid
|
||||
import {CachedXHR} from './src/xhr/xhr_cache';
|
||||
import {XHRImpl} from './src/xhr/xhr_impl';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated The compiler providers are already included in the {@link CompilerFactory} that is
|
||||
* contained the {@link browserDynamicPlatform}()`.
|
||||
*/
|
||||
export const BROWSER_APP_COMPILER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [];
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
@ -35,11 +27,6 @@ export const CACHED_TEMPLATE_PROVIDER: Array<any /*Type | Provider | any[]*/> =
|
||||
export const platformBrowserDynamic = createPlatformFactory(
|
||||
platformCoreDynamic, 'browserDynamic', INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS);
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link platformBrowserDynamic} instead
|
||||
*/
|
||||
export const browserDynamicPlatform = platformBrowserDynamic;
|
||||
|
||||
/**
|
||||
* Bootstrapping for Angular applications.
|
||||
*
|
||||
@ -177,44 +164,6 @@ export const platformWorkerAppDynamic =
|
||||
multi: true
|
||||
}]);
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link platformWorkerAppDynamic} instead
|
||||
*/
|
||||
export const workerAppDynamicPlatform = platformWorkerAppDynamic;
|
||||
|
||||
/**
|
||||
* @deprecated Create an {@link NgModule} that includes the {@link WorkerAppModule} and use {@link
|
||||
* bootstrapModule}
|
||||
* with the {@link workerAppDynamicPlatform}() instead.
|
||||
*/
|
||||
export function bootstrapWorkerApp<T>(
|
||||
appComponentType: Type<T>,
|
||||
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<T>> {
|
||||
console.warn(
|
||||
'bootstrapWorkerApp is deprecated. Create an @NgModule that includes the `WorkerAppModule` and use `bootstrapModule` with the `workerAppDynamicPlatform()` instead.');
|
||||
|
||||
const deprecatedConfiguration = analyzeAppProvidersForDeprecatedConfiguration(customProviders);
|
||||
const declarations = [deprecatedConfiguration.moduleDeclarations.concat([appComponentType])];
|
||||
|
||||
@NgModule({
|
||||
providers: customProviders,
|
||||
declarations: declarations,
|
||||
imports: [WorkerAppModule],
|
||||
bootstrap: [appComponentType]
|
||||
})
|
||||
class DynamicModule {
|
||||
}
|
||||
|
||||
return platformWorkerAppDynamic()
|
||||
.bootstrapModule(DynamicModule, deprecatedConfiguration.compilerOptions)
|
||||
.then((moduleRef) => {
|
||||
const console = moduleRef.injector.get(Console);
|
||||
deprecatedConfiguration.deprecationMessages.forEach((msg) => console.warn(msg));
|
||||
const appRef: ApplicationRef = moduleRef.injector.get(ApplicationRef);
|
||||
return appRef.components[0];
|
||||
});
|
||||
}
|
||||
|
||||
function normalizeArray(arr: any[]): any[] {
|
||||
return arr ? arr : [];
|
||||
}
|
||||
|
Reference in New Issue
Block a user