From 566d4361e22a3d8a4ce8619a762115abf97aaee2 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Wed, 24 Aug 2016 13:40:10 -0700 Subject: [PATCH] refactor: remove obsolete analyzeAppProvidersForDeprecatedConfiguration closes #11028 --- modules/@angular/compiler/index.ts | 2 +- modules/@angular/compiler/src/compiler.ts | 38 ----------------------- 2 files changed, 1 insertion(+), 39 deletions(-) diff --git a/modules/@angular/compiler/index.ts b/modules/@angular/compiler/index.ts index 8c703f3170..13959624d3 100644 --- a/modules/@angular/compiler/index.ts +++ b/modules/@angular/compiler/index.ts @@ -13,7 +13,7 @@ */ import * as i18n from './src/i18n/index'; -export {COMPILER_PROVIDERS, CompileDiDependencyMetadata, CompileDirectiveMetadata, CompileFactoryMetadata, CompileIdentifierMetadata, CompileMetadataWithIdentifier, CompilePipeMetadata, CompileProviderMetadata, CompileQueryMetadata, CompileTemplateMetadata, CompileTokenMetadata, CompileTypeMetadata, CompilerConfig, DEFAULT_PACKAGE_URL_PROVIDER, DirectiveResolver, NgModuleResolver, OfflineCompiler, PipeResolver, RenderTypes, ResourceLoader, RuntimeCompiler, SourceModule, TEMPLATE_TRANSFORMS, UrlResolver, analyzeAppProvidersForDeprecatedConfiguration, createOfflineCompileUrlResolver, platformCoreDynamic} from './src/compiler'; +export {COMPILER_PROVIDERS, CompileDiDependencyMetadata, CompileDirectiveMetadata, CompileFactoryMetadata, CompileIdentifierMetadata, CompileMetadataWithIdentifier, CompilePipeMetadata, CompileProviderMetadata, CompileQueryMetadata, CompileTemplateMetadata, CompileTokenMetadata, CompileTypeMetadata, CompilerConfig, DEFAULT_PACKAGE_URL_PROVIDER, DirectiveResolver, NgModuleResolver, OfflineCompiler, PipeResolver, RenderTypes, ResourceLoader, RuntimeCompiler, SourceModule, TEMPLATE_TRANSFORMS, UrlResolver, createOfflineCompileUrlResolver, platformCoreDynamic} from './src/compiler'; export {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from './src/ml_parser/interpolation_config'; export {ElementSchemaRegistry} from './src/schema/element_schema_registry'; export {i18n}; diff --git a/modules/@angular/compiler/src/compiler.ts b/modules/@angular/compiler/src/compiler.ts index 28325e1279..307b980196 100644 --- a/modules/@angular/compiler/src/compiler.ts +++ b/modules/@angular/compiler/src/compiler.ts @@ -88,44 +88,6 @@ export const COMPILER_PROVIDERS: Array|{[k: string]: any}|any[]> = NgModuleResolver ]; -export function analyzeAppProvidersForDeprecatedConfiguration(appProviders: any[] = []): { - compilerOptions: CompilerOptions, - moduleDeclarations: Type[], - deprecationMessages: string[] -} { - let compilerProviders: any[] = []; - let useDebug: boolean; - let useJit: boolean; - let defaultEncapsulation: ViewEncapsulation; - const deprecationMessages: string[] = []; - - // Note: This is a hack to still support the old way - // of configuring platform directives / pipes and the compiler resource loader. - // This will soon be deprecated! - const tempInj = ReflectiveInjector.resolveAndCreate(appProviders); - const compilerConfig: CompilerConfig = tempInj.get(CompilerConfig, null); - if (compilerConfig) { - useJit = compilerConfig.useJit; - useDebug = compilerConfig.genDebugInfo; - defaultEncapsulation = compilerConfig.defaultEncapsulation; - deprecationMessages.push( - `Passing CompilerConfig as a regular provider is deprecated. Use "compilerOptions" use a custom "CompilerFactory" platform provider instead.`); - } - const resourceLoader = tempInj.get(ResourceLoader, null); - if (resourceLoader) { - compilerProviders.push([{provide: ResourceLoader, useValue: resourceLoader}]); - deprecationMessages.push( - `Passing ResourceLoader as regular provider is deprecated. Pass the provider via "compilerOptions" instead.`); - } - const compilerOptions: CompilerOptions = { - useJit: useJit, - useDebug: useDebug, - defaultEncapsulation: defaultEncapsulation, - providers: compilerProviders - }; - - return {compilerOptions, moduleDeclarations: [], deprecationMessages: deprecationMessages}; -} @Injectable() export class RuntimeCompilerFactory implements CompilerFactory {