feat(compiler): generate shallow imports compiler generated references (#14388)

This commit is contained in:
Chuck Jazdzewski
2017-02-14 13:33:06 -08:00
committed by Igor Minar
parent e4e9dbe33d
commit 8b81bb1eb6
14 changed files with 378 additions and 343 deletions

View File

@ -0,0 +1,32 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as view_utils from './linker/view_utils';
import * as viewEngine from './view/index';
export {AnimationGroupPlayer as ɵAnimationGroupPlayer} from './animation/animation_group_player';
export {AnimationKeyframe as ɵAnimationKeyframe} from './animation/animation_keyframe';
export {NoOpAnimationPlayer as ɵNoOpAnimationPlayer} from './animation/animation_player';
export {AnimationSequencePlayer as ɵAnimationSequencePlayer} from './animation/animation_sequence_player';
export {balanceAnimationKeyframes as ɵbalanceAnimationKeyframes, clearStyles as ɵclearStyles, collectAndResolveStyles as ɵcollectAndResolveStyles, prepareFinalAnimationStyles as ɵprepareFinalAnimationStyles, renderStyles as ɵrenderStyles} from './animation/animation_style_util';
export {AnimationStyles as ɵAnimationStyles} from './animation/animation_styles';
export {AnimationTransition as ɵAnimationTransition} from './animation/animation_transition';
export {ValueUnwrapper as ɵValueUnwrapper, devModeEqual as ɵdevModeEqual} from './change_detection/change_detection_util';
export {ChangeDetectorStatus as ɵChangeDetectorStatus} from './change_detection/constants';
export {ComponentRef_ as ɵComponentRef_} from './linker/component_factory';
export {CodegenComponentFactoryResolver as ɵCodegenComponentFactoryResolver} from './linker/component_factory_resolver';
export {DebugContext as ɵDebugContext, StaticNodeDebugInfo as ɵStaticNodeDebugInfo} from './linker/debug_context';
export {NgModuleInjector as ɵNgModuleInjector} from './linker/ng_module_factory';
export {registerModuleFactory as ɵregisterModuleFactory} from './linker/ng_module_factory_loader';
export {TemplateRef_ as ɵTemplateRef_} from './linker/template_ref';
export {AppView as ɵAppView, DebugAppView as ɵDebugAppView} from './linker/view';
export {ViewContainer as ɵViewContainer} from './linker/view_container';
export {ViewType as ɵViewType} from './linker/view_type';
export {reflector as ɵreflector} from './reflection/reflection';
export {view_utils as ɵview_utils};
export {viewEngine as ɵviewEngine};

View File

@ -39,3 +39,4 @@ export {AnimationStyles} from './animation/animation_styles';
export {AnimationKeyframe} from './animation/animation_keyframe';
export {Sanitizer, SecurityContext} from './security';
export {TransitionFactory, TransitionInstruction, Trigger} from './triggers';
export * from './codegen_private_exports';

View File

@ -20,6 +20,6 @@ export interface PlatformReflectionCapabilities {
setter(name: string): SetterFn;
method(name: string): MethodFn;
importUri(type: Type<any>): string;
resolveIdentifier(name: string, moduleUrl: string, runtime: any): any;
resolveIdentifier(name: string, moduleUrl: string, members: string[], runtime: any): any;
resolveEnum(enumIdentifier: any, name: string): any;
}

View File

@ -227,7 +227,9 @@ export class ReflectionCapabilities implements PlatformReflectionCapabilities {
return `./${stringify(type)}`;
}
resolveIdentifier(name: string, moduleUrl: string, runtime: any): any { return runtime; }
resolveIdentifier(name: string, moduleUrl: string, members: string[], runtime: any): any {
return runtime;
}
resolveEnum(enumIdentifier: any, name: string): any { return enumIdentifier[name]; }
}

View File

@ -49,8 +49,8 @@ export class Reflector extends ReflectorReader {
importUri(type: any): string { return this.reflectionCapabilities.importUri(type); }
resolveIdentifier(name: string, moduleUrl: string, runtime: any): any {
return this.reflectionCapabilities.resolveIdentifier(name, moduleUrl, runtime);
resolveIdentifier(name: string, moduleUrl: string, members: string[], runtime: any): any {
return this.reflectionCapabilities.resolveIdentifier(name, moduleUrl, members, runtime);
}
resolveEnum(identifier: any, name: string): any {

View File

@ -15,6 +15,6 @@ export abstract class ReflectorReader {
abstract annotations(typeOrFunc: /*Type*/ any): any[];
abstract propMetadata(typeOrFunc: /*Type*/ any): {[key: string]: any[]};
abstract importUri(typeOrFunc: /*Type*/ any): string;
abstract resolveIdentifier(name: string, moduleUrl: string, runtime: any): any;
abstract resolveIdentifier(name: string, moduleUrl: string, members: string[], runtime: any): any;
abstract resolveEnum(identifier: any, name: string): any;
}