refactor(core): deprecate `coreBootstrap`, `PLATFORM_PIPES/DIRECTIVES` providers and `ComponentResolver`
BREAKING CHANGE (deprecations) - Instead of `coreBootstrap`, create an `@AppModule` and use `bootstrapModule`. - Instead of `coreLoadAndBootstarp`, create an `@AppModule` and use `bootstrapModuleFactory`. - Instead of `bootstrapWorkerApp`, create an `@AppModule` that includes the `WorkerAppModule` and use `bootstrapModule` with the `workerAppPlatform()`. - Instead of `bootstrapWorkerUi`, create an @AppModule that includes the `WorkerUiModule` and use `bootstrapModule` with the `workerUiPlatform()` instead. - Instead of `serverBootstrap`, create an @AppModule and use `bootstrapModule` with the `serverDynamicPlatform()` instead. - Instead of `PLATFORM_PIPES` and `PLATFORM_DIRECTIVES`, provide platform directives/pipes via an `@AppModule`. - Instead of `ComponentResolver`: - use `ComponentFactoryResolver` together with `@AppModule.precompile`/`@Component.precompile` or `ANALYZE_FOR_PRECOMPILE` provider for dynamic component creation. - use `AppModuleFactoryLoader` for lazy loading. - Instead of `SystemJsComponentResolver`, create an `@AppModule` and use `SystemJsAppModuleLoader`. - Instead of `SystemJsCmpFactoryResolver`, create an `@AppModule` and use `SystemJsAppModuleFactoryLoader` Closes #9726
This commit is contained in:
parent
245b0910ed
commit
daa9da4047
|
@ -132,9 +132,7 @@ export class CodeGenerator {
|
||||||
genDebugInfo: options.debug === true,
|
genDebugInfo: options.debug === true,
|
||||||
defaultEncapsulation: ViewEncapsulation.Emulated,
|
defaultEncapsulation: ViewEncapsulation.Emulated,
|
||||||
logBindingUpdate: false,
|
logBindingUpdate: false,
|
||||||
useJit: false,
|
useJit: false
|
||||||
platformDirectives: [],
|
|
||||||
platformPipes: []
|
|
||||||
});
|
});
|
||||||
const normalizer = new DirectiveNormalizer(xhr, urlResolver, htmlParser, config);
|
const normalizer = new DirectiveNormalizer(xhr, urlResolver, htmlParser, config);
|
||||||
const parser = new Parser(new Lexer());
|
const parser = new Parser(new Lexer());
|
||||||
|
|
|
@ -142,9 +142,7 @@ class Extractor {
|
||||||
genDebugInfo: true,
|
genDebugInfo: true,
|
||||||
defaultEncapsulation: ViewEncapsulation.Emulated,
|
defaultEncapsulation: ViewEncapsulation.Emulated,
|
||||||
logBindingUpdate: false,
|
logBindingUpdate: false,
|
||||||
useJit: false,
|
useJit: false
|
||||||
platformDirectives: [],
|
|
||||||
platformPipes: []
|
|
||||||
});
|
});
|
||||||
const normalizer = new DirectiveNormalizer(xhr, urlResolver, htmlParser, config);
|
const normalizer = new DirectiveNormalizer(xhr, urlResolver, htmlParser, config);
|
||||||
const parser = new Parser(new Lexer());
|
const parser = new Parser(new Lexer());
|
||||||
|
|
|
@ -92,8 +92,8 @@ export class _RuntimeCompilerFactory extends CompilerFactory {
|
||||||
const inj = ReflectiveInjector.resolveAndCreate(options.deprecatedAppProviders);
|
const inj = ReflectiveInjector.resolveAndCreate(options.deprecatedAppProviders);
|
||||||
const compilerConfig: CompilerConfig = inj.get(CompilerConfig, null);
|
const compilerConfig: CompilerConfig = inj.get(CompilerConfig, null);
|
||||||
if (compilerConfig) {
|
if (compilerConfig) {
|
||||||
platformDirectivesFromAppProviders = compilerConfig.platformDirectives;
|
platformDirectivesFromAppProviders = compilerConfig.deprecatedPlatformDirectives;
|
||||||
platformPipesFromAppProviders = compilerConfig.platformPipes;
|
platformPipesFromAppProviders = compilerConfig.deprecatedPlatformPipes;
|
||||||
useJitFromAppProviders = compilerConfig.useJit;
|
useJitFromAppProviders = compilerConfig.useJit;
|
||||||
useDebugFromAppProviders = compilerConfig.genDebugInfo;
|
useDebugFromAppProviders = compilerConfig.genDebugInfo;
|
||||||
defaultEncapsulationFromAppProviders = compilerConfig.defaultEncapsulation;
|
defaultEncapsulationFromAppProviders = compilerConfig.defaultEncapsulation;
|
||||||
|
@ -133,9 +133,9 @@ export class _RuntimeCompilerFactory extends CompilerFactory {
|
||||||
provide: CompilerConfig,
|
provide: CompilerConfig,
|
||||||
useFactory: (platformDirectives: any[], platformPipes: any[]) => {
|
useFactory: (platformDirectives: any[], platformPipes: any[]) => {
|
||||||
return new CompilerConfig({
|
return new CompilerConfig({
|
||||||
platformDirectives:
|
deprecatedPlatformDirectives:
|
||||||
_mergeArrays(platformDirectivesFromAppProviders, platformDirectives),
|
_mergeArrays(platformDirectivesFromAppProviders, platformDirectives),
|
||||||
platformPipes: _mergeArrays(platformPipesFromAppProviders, platformPipes),
|
deprecatedPlatformPipes: _mergeArrays(platformPipesFromAppProviders, platformPipes),
|
||||||
// let explicit values from the compiler options overwrite options
|
// let explicit values from the compiler options overwrite options
|
||||||
// from the app providers. E.g. important for the testing platform.
|
// from the app providers. E.g. important for the testing platform.
|
||||||
genDebugInfo: _firstDefined(options.useDebug, useDebugFromAppProviders, isDevMode()),
|
genDebugInfo: _firstDefined(options.useDebug, useDebugFromAppProviders, isDevMode()),
|
||||||
|
|
|
@ -19,28 +19,38 @@ export class CompilerConfig {
|
||||||
private _genDebugInfo: boolean;
|
private _genDebugInfo: boolean;
|
||||||
private _logBindingUpdate: boolean;
|
private _logBindingUpdate: boolean;
|
||||||
public useJit: boolean;
|
public useJit: boolean;
|
||||||
public platformDirectives: any[];
|
/**
|
||||||
public platformPipes: any[];
|
* @deprecated Providing platform directives via the {@link CompilerConfig} deprecated. Provide
|
||||||
|
* platform
|
||||||
|
* directives via an {@link AppModule} instead.
|
||||||
|
*/
|
||||||
|
public deprecatedPlatformDirectives: any[];
|
||||||
|
/**
|
||||||
|
* @deprecated Providing platform pipes via the {@link CompilerConfig} deprecated. Provide
|
||||||
|
* platform pipes
|
||||||
|
* via an {@link AppModule} instead.
|
||||||
|
*/
|
||||||
|
public deprecatedPlatformPipes: any[];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
{renderTypes = new DefaultRenderTypes(), defaultEncapsulation = ViewEncapsulation.Emulated,
|
{renderTypes = new DefaultRenderTypes(), defaultEncapsulation = ViewEncapsulation.Emulated,
|
||||||
genDebugInfo, logBindingUpdate, useJit = true, platformDirectives = [],
|
genDebugInfo, logBindingUpdate, useJit = true, deprecatedPlatformDirectives = [],
|
||||||
platformPipes = []}: {
|
deprecatedPlatformPipes = []}: {
|
||||||
renderTypes?: RenderTypes,
|
renderTypes?: RenderTypes,
|
||||||
defaultEncapsulation?: ViewEncapsulation,
|
defaultEncapsulation?: ViewEncapsulation,
|
||||||
genDebugInfo?: boolean,
|
genDebugInfo?: boolean,
|
||||||
logBindingUpdate?: boolean,
|
logBindingUpdate?: boolean,
|
||||||
useJit?: boolean,
|
useJit?: boolean,
|
||||||
platformDirectives?: any[],
|
deprecatedPlatformDirectives?: any[],
|
||||||
platformPipes?: any[]
|
deprecatedPlatformPipes?: any[]
|
||||||
} = {}) {
|
} = {}) {
|
||||||
this.renderTypes = renderTypes;
|
this.renderTypes = renderTypes;
|
||||||
this.defaultEncapsulation = defaultEncapsulation;
|
this.defaultEncapsulation = defaultEncapsulation;
|
||||||
this._genDebugInfo = genDebugInfo;
|
this._genDebugInfo = genDebugInfo;
|
||||||
this._logBindingUpdate = logBindingUpdate;
|
this._logBindingUpdate = logBindingUpdate;
|
||||||
this.useJit = useJit;
|
this.useJit = useJit;
|
||||||
this.platformDirectives = platformDirectives;
|
this.deprecatedPlatformDirectives = deprecatedPlatformDirectives;
|
||||||
this.platformPipes = platformPipes;
|
this.deprecatedPlatformPipes = deprecatedPlatformPipes;
|
||||||
}
|
}
|
||||||
|
|
||||||
get genDebugInfo(): boolean {
|
get genDebugInfo(): boolean {
|
||||||
|
|
|
@ -301,7 +301,7 @@ export class CompileMetadataResolver {
|
||||||
|
|
||||||
getViewDirectivesMetadata(component: Type): cpl.CompileDirectiveMetadata[] {
|
getViewDirectivesMetadata(component: Type): cpl.CompileDirectiveMetadata[] {
|
||||||
var view = this._viewResolver.resolve(component);
|
var view = this._viewResolver.resolve(component);
|
||||||
var directives = flattenDirectives(view, this._config.platformDirectives);
|
var directives = flattenDirectives(view, this._config.deprecatedPlatformDirectives);
|
||||||
for (var i = 0; i < directives.length; i++) {
|
for (var i = 0; i < directives.length; i++) {
|
||||||
if (!isValidType(directives[i])) {
|
if (!isValidType(directives[i])) {
|
||||||
throw new BaseException(
|
throw new BaseException(
|
||||||
|
@ -313,7 +313,7 @@ export class CompileMetadataResolver {
|
||||||
|
|
||||||
getViewPipesMetadata(component: Type): cpl.CompilePipeMetadata[] {
|
getViewPipesMetadata(component: Type): cpl.CompilePipeMetadata[] {
|
||||||
var view = this._viewResolver.resolve(component);
|
var view = this._viewResolver.resolve(component);
|
||||||
var pipes = flattenPipes(view, this._config.platformPipes);
|
var pipes = flattenPipes(view, this._config.deprecatedPlatformPipes);
|
||||||
for (var i = 0; i < pipes.length; i++) {
|
for (var i = 0; i < pipes.length; i++) {
|
||||||
if (!isValidType(pipes[i])) {
|
if (!isValidType(pipes[i])) {
|
||||||
throw new BaseException(
|
throw new BaseException(
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {AppModuleFactory, AppModuleMetadata, Compiler, ComponentFactory, ComponentResolver, ComponentStillLoadingError, Injectable, Injector, OptionalMetadata, Provider, SkipSelfMetadata} from '@angular/core';
|
import {AppModuleFactory, AppModuleMetadata, Compiler, ComponentFactory, ComponentResolver, ComponentStillLoadingError, Injectable, Injector, OptionalMetadata, Provider, SkipSelfMetadata} from '@angular/core';
|
||||||
|
import {Console} from '../core_private';
|
||||||
|
|
||||||
import {BaseException} from '../src/facade/exceptions';
|
import {BaseException} from '../src/facade/exceptions';
|
||||||
import {ConcreteType, IS_DART, Type, isBlank, isString, stringify} from '../src/facade/lang';
|
import {ConcreteType, IS_DART, Type, isBlank, isString, stringify} from '../src/facade/lang';
|
||||||
|
@ -42,11 +43,28 @@ export class RuntimeCompiler implements ComponentResolver, Compiler {
|
||||||
private _compiledHostTemplateCache = new Map<Type, CompiledTemplate>();
|
private _compiledHostTemplateCache = new Map<Type, CompiledTemplate>();
|
||||||
private _compiledAppModuleCache = new Map<Type, AppModuleFactory<any>>();
|
private _compiledAppModuleCache = new Map<Type, AppModuleFactory<any>>();
|
||||||
|
|
||||||
|
private _warnOnComponentResolver = true;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private _injector: Injector, private _metadataResolver: CompileMetadataResolver,
|
private _injector: Injector, private _metadataResolver: CompileMetadataResolver,
|
||||||
private _templateNormalizer: DirectiveNormalizer, private _templateParser: TemplateParser,
|
private _templateNormalizer: DirectiveNormalizer, private _templateParser: TemplateParser,
|
||||||
private _styleCompiler: StyleCompiler, private _viewCompiler: ViewCompiler,
|
private _styleCompiler: StyleCompiler, private _viewCompiler: ViewCompiler,
|
||||||
private _appModuleCompiler: AppModuleCompiler, private _genConfig: CompilerConfig) {}
|
private _appModuleCompiler: AppModuleCompiler, private _genConfig: CompilerConfig,
|
||||||
|
private _console: Console) {
|
||||||
|
const flatDeprecatedPlatformDirectives =
|
||||||
|
ListWrapper.flatten(_genConfig.deprecatedPlatformDirectives);
|
||||||
|
if (flatDeprecatedPlatformDirectives.length > 0) {
|
||||||
|
this._console.warn(
|
||||||
|
`Providing platform directives via the PLATFORM_DIRECTIVES provider or the "CompilerConfig" is deprecated. Provide platform directives via an @AppModule instead. Directives: ` +
|
||||||
|
flatDeprecatedPlatformDirectives.map(stringify));
|
||||||
|
}
|
||||||
|
const flatDeprecatedPlatformPipes = ListWrapper.flatten(_genConfig.deprecatedPlatformPipes);
|
||||||
|
if (flatDeprecatedPlatformPipes.length > 0) {
|
||||||
|
this._console.warn(
|
||||||
|
`Providing platform pipes via the PLATFORM_PIPES provider or the "CompilerConfig" is deprecated. Provide platform pipes via an @AppModule instead. Pipes: ` +
|
||||||
|
flatDeprecatedPlatformPipes.map(stringify));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
get injector(): Injector { return this._injector; }
|
get injector(): Injector { return this._injector; }
|
||||||
|
|
||||||
|
@ -55,6 +73,10 @@ export class RuntimeCompiler implements ComponentResolver, Compiler {
|
||||||
return PromiseWrapper.reject(
|
return PromiseWrapper.reject(
|
||||||
new BaseException(`Cannot resolve component using '${component}'.`), null);
|
new BaseException(`Cannot resolve component using '${component}'.`), null);
|
||||||
}
|
}
|
||||||
|
if (this._warnOnComponentResolver) {
|
||||||
|
this._console.warn(ComponentResolver.DynamicCompilationDeprecationMsg);
|
||||||
|
this._warnOnComponentResolver = false;
|
||||||
|
}
|
||||||
return this.compileComponentAsync(<ConcreteType<any>>component);
|
return this.compileComponentAsync(<ConcreteType<any>>component);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -115,8 +115,8 @@ export function main() {
|
||||||
configureCompiler({
|
configureCompiler({
|
||||||
providers: [{
|
providers: [{
|
||||||
provide: CompilerConfig,
|
provide: CompilerConfig,
|
||||||
useValue:
|
useValue: new CompilerConfig(
|
||||||
new CompilerConfig({genDebugInfo: true, platformDirectives: [ADirective]})
|
{genDebugInfo: true, deprecatedPlatformDirectives: [ADirective]})
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -235,10 +235,12 @@ export function bootstrapModule<M>(
|
||||||
* Shortcut for ApplicationRef.bootstrap.
|
* Shortcut for ApplicationRef.bootstrap.
|
||||||
* Requires a platform to be created first.
|
* Requires a platform to be created first.
|
||||||
*
|
*
|
||||||
* @experimental APIs related to application bootstrap are currently under review.
|
* @deprecated Use {@link bootstrapModuleFactory} instead.
|
||||||
*/
|
*/
|
||||||
export function coreBootstrap<C>(
|
export function coreBootstrap<C>(
|
||||||
componentFactory: ComponentFactory<C>, injector: Injector): ComponentRef<C> {
|
componentFactory: ComponentFactory<C>, injector: Injector): ComponentRef<C> {
|
||||||
|
let console = injector.get(Console);
|
||||||
|
console.warn('coreBootstrap is deprecated. Use bootstrapModuleFactory instead.');
|
||||||
var appRef: ApplicationRef = injector.get(ApplicationRef);
|
var appRef: ApplicationRef = injector.get(ApplicationRef);
|
||||||
return appRef.bootstrap(componentFactory);
|
return appRef.bootstrap(componentFactory);
|
||||||
}
|
}
|
||||||
|
@ -248,10 +250,12 @@ export function coreBootstrap<C>(
|
||||||
* waits for asynchronous initializers and bootstraps the component.
|
* waits for asynchronous initializers and bootstraps the component.
|
||||||
* Requires a platform to be created first.
|
* Requires a platform to be created first.
|
||||||
*
|
*
|
||||||
* @experimental APIs related to application bootstrap are currently under review.
|
* @deprecated Use {@link bootstrapModule} instead.
|
||||||
*/
|
*/
|
||||||
export function coreLoadAndBootstrap(
|
export function coreLoadAndBootstrap(
|
||||||
componentType: Type, injector: Injector): Promise<ComponentRef<any>> {
|
componentType: Type, injector: Injector): Promise<ComponentRef<any>> {
|
||||||
|
let console = injector.get(Console);
|
||||||
|
console.warn('coreLoadAndBootstrap is deprecated. Use bootstrapModule instead.');
|
||||||
var appRef: ApplicationRef = injector.get(ApplicationRef);
|
var appRef: ApplicationRef = injector.get(ApplicationRef);
|
||||||
return appRef.run(() => {
|
return appRef.run(() => {
|
||||||
var componentResolver: ComponentResolver = injector.get(ComponentResolver);
|
var componentResolver: ComponentResolver = injector.get(ComponentResolver);
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import {Console} from '../console';
|
||||||
import {Injectable} from '../di/decorators';
|
import {Injectable} from '../di/decorators';
|
||||||
import {PromiseWrapper} from '../facade/async';
|
import {PromiseWrapper} from '../facade/async';
|
||||||
import {BaseException} from '../facade/exceptions';
|
import {BaseException} from '../facade/exceptions';
|
||||||
|
@ -18,9 +19,19 @@ import {ComponentFactory} from './component_factory';
|
||||||
/**
|
/**
|
||||||
* Low-level service for loading {@link ComponentFactory}s, which
|
* Low-level service for loading {@link ComponentFactory}s, which
|
||||||
* can later be used to create and render a Component instance.
|
* can later be used to create and render a Component instance.
|
||||||
* @experimental
|
*
|
||||||
|
* @deprecated Use {@link ComponentFactoryResolver} together with {@link
|
||||||
|
* AppModule}.precompile}/{@link Component}.precompile or
|
||||||
|
* {@link ANALYZE_FOR_PRECOMPILE} provider for dynamic component creation.
|
||||||
|
* Use {@link AppModuleFactoryLoader} for lazy loading.
|
||||||
*/
|
*/
|
||||||
export abstract class ComponentResolver {
|
export abstract class ComponentResolver {
|
||||||
|
static DynamicCompilationDeprecationMsg =
|
||||||
|
'ComponentResolver is deprecated for dynamic compilation. Use ComponentFactoryResolver together with @AppModule/@Component.precompile or ANALYZE_FOR_PRECOMPILE provider instead.';
|
||||||
|
static LazyLoadingDeprecationMsg =
|
||||||
|
'ComponentResolver is deprecated for lazy loading. Use AppModuleFactoryLoader instead.';
|
||||||
|
|
||||||
|
|
||||||
abstract resolveComponent(component: Type|string): Promise<ComponentFactory<any>>;
|
abstract resolveComponent(component: Type|string): Promise<ComponentFactory<any>>;
|
||||||
abstract clearCache(): void;
|
abstract clearCache(): void;
|
||||||
}
|
}
|
||||||
|
@ -31,11 +42,13 @@ function _isComponentFactory(type: any): boolean {
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ReflectorComponentResolver extends ComponentResolver {
|
export class ReflectorComponentResolver extends ComponentResolver {
|
||||||
|
constructor(private _console: Console) { super(); }
|
||||||
resolveComponent(component: Type|string): Promise<ComponentFactory<any>> {
|
resolveComponent(component: Type|string): Promise<ComponentFactory<any>> {
|
||||||
if (isString(component)) {
|
if (isString(component)) {
|
||||||
return PromiseWrapper.reject(
|
return PromiseWrapper.reject(
|
||||||
new BaseException(`Cannot resolve component using '${component}'.`), null);
|
new BaseException(`Cannot resolve component using '${component}'.`), null);
|
||||||
}
|
}
|
||||||
|
this._console.warn(ComponentResolver.DynamicCompilationDeprecationMsg);
|
||||||
|
|
||||||
var metadatas = reflector.annotations(<Type>component);
|
var metadatas = reflector.annotations(<Type>component);
|
||||||
var componentFactory = metadatas.find(_isComponentFactory);
|
var componentFactory = metadatas.find(_isComponentFactory);
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import {Console} from '../console';
|
||||||
|
import {Injectable} from '../di';
|
||||||
import {Type, global, isString} from '../facade/lang';
|
import {Type, global, isString} from '../facade/lang';
|
||||||
|
|
||||||
import {ComponentFactory} from './component_factory';
|
import {ComponentFactory} from './component_factory';
|
||||||
|
@ -15,13 +17,18 @@ const _SEPARATOR = '#';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component resolver that can load components lazily
|
* Component resolver that can load components lazily
|
||||||
* @experimental
|
*
|
||||||
|
* @deprecated Lazy loading of components is deprecated. Use {@link SystemJsAppModuleLoader} to lazy
|
||||||
|
* load
|
||||||
|
* {@link AppModuleFactory}s instead.
|
||||||
*/
|
*/
|
||||||
|
@Injectable()
|
||||||
export class SystemJsComponentResolver implements ComponentResolver {
|
export class SystemJsComponentResolver implements ComponentResolver {
|
||||||
constructor(private _resolver: ComponentResolver) {}
|
constructor(private _resolver: ComponentResolver, private _console: Console) {}
|
||||||
|
|
||||||
resolveComponent(componentType: string|Type): Promise<ComponentFactory<any>> {
|
resolveComponent(componentType: string|Type): Promise<ComponentFactory<any>> {
|
||||||
if (isString(componentType)) {
|
if (isString(componentType)) {
|
||||||
|
this._console.warn(ComponentResolver.LazyLoadingDeprecationMsg);
|
||||||
let [module, component] = componentType.split(_SEPARATOR);
|
let [module, component] = componentType.split(_SEPARATOR);
|
||||||
|
|
||||||
if (component === void(0)) {
|
if (component === void(0)) {
|
||||||
|
@ -45,11 +52,17 @@ const FACTORY_CLASS_SUFFIX = 'NgFactory';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component resolver that can load component factories lazily
|
* Component resolver that can load component factories lazily
|
||||||
* @experimental
|
*
|
||||||
|
* @deprecated Lazy loading of components is deprecated. Use {@link SystemJsAppModuleFactoryLoader}
|
||||||
|
* to lazy
|
||||||
|
* load {@link AppModuleFactory}s instead.
|
||||||
*/
|
*/
|
||||||
|
@Injectable()
|
||||||
export class SystemJsCmpFactoryResolver implements ComponentResolver {
|
export class SystemJsCmpFactoryResolver implements ComponentResolver {
|
||||||
|
constructor(private _console: Console) {}
|
||||||
resolveComponent(componentType: string|Type): Promise<ComponentFactory<any>> {
|
resolveComponent(componentType: string|Type): Promise<ComponentFactory<any>> {
|
||||||
if (isString(componentType)) {
|
if (isString(componentType)) {
|
||||||
|
this._console.warn(ComponentResolver.LazyLoadingDeprecationMsg);
|
||||||
let [module, factory] = componentType.split(_SEPARATOR);
|
let [module, factory] = componentType.split(_SEPARATOR);
|
||||||
return (<any>global)
|
return (<any>global)
|
||||||
.System.import(module + FACTORY_MODULE_SUFFIX)
|
.System.import(module + FACTORY_MODULE_SUFFIX)
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
import {OpaqueToken} from './di';
|
import {OpaqueToken} from './di';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
A token that can be provided when bootstrapping an application to make an array of directives
|
* A token that can be provided when bootstrapping an application to make an array of directives
|
||||||
* available in every component of the application.
|
* available in every component of the application.
|
||||||
*
|
*
|
||||||
* ### Example
|
* ### Example
|
||||||
|
@ -32,9 +32,10 @@ import {OpaqueToken} from './di';
|
||||||
* bootstrap(MyComponent, [{provide: PLATFORM_DIRECTIVES, useValue: [OtherDirective],
|
* bootstrap(MyComponent, [{provide: PLATFORM_DIRECTIVES, useValue: [OtherDirective],
|
||||||
multi:true}]);
|
multi:true}]);
|
||||||
* ```
|
* ```
|
||||||
* @stable
|
*
|
||||||
|
* @deprecated Providing platform directives via a provider is deprecated. Provide platform
|
||||||
|
* directives via an {@link AppModule} instead.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const PLATFORM_DIRECTIVES: OpaqueToken =
|
export const PLATFORM_DIRECTIVES: OpaqueToken =
|
||||||
/*@ts2dart_const*/ new OpaqueToken('Platform Directives');
|
/*@ts2dart_const*/ new OpaqueToken('Platform Directives');
|
||||||
|
|
||||||
|
@ -60,7 +61,8 @@ export const PLATFORM_DIRECTIVES: OpaqueToken =
|
||||||
*
|
*
|
||||||
* bootstrap(MyComponent, [{provide: PLATFORM_PIPES, useValue: [OtherPipe], multi:true}]);
|
* bootstrap(MyComponent, [{provide: PLATFORM_PIPES, useValue: [OtherPipe], multi:true}]);
|
||||||
* ```
|
* ```
|
||||||
* @stable
|
*
|
||||||
|
* @deprecated Providing platform pipes via a provider is deprecated. Provide platform pipes via an
|
||||||
|
* {@link AppModule} instead.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const PLATFORM_PIPES: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('Platform Pipes');
|
export const PLATFORM_PIPES: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('Platform Pipes');
|
|
@ -12,6 +12,12 @@ import {ComponentResolver, ReflectorComponentResolver} from '@angular/core/src/l
|
||||||
import {ReflectionInfo, reflector} from '@angular/core/src/reflection/reflection';
|
import {ReflectionInfo, reflector} from '@angular/core/src/reflection/reflection';
|
||||||
import {afterEach, beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
import {afterEach, beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||||
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
|
import {Console} from '../../src/console';
|
||||||
|
|
||||||
|
class DummyConsole implements Console {
|
||||||
|
log(message: string) {}
|
||||||
|
warn(message: string) {}
|
||||||
|
}
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('Compiler', () => {
|
describe('Compiler', () => {
|
||||||
|
@ -21,7 +27,7 @@ export function main() {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
someCompFactory = new ComponentFactory(null, null, null);
|
someCompFactory = new ComponentFactory(null, null, null);
|
||||||
reflector.registerType(SomeComponent, new ReflectionInfo([someCompFactory]));
|
reflector.registerType(SomeComponent, new ReflectionInfo([someCompFactory]));
|
||||||
compiler = new ReflectorComponentResolver();
|
compiler = new ReflectorComponentResolver(new DummyConsole());
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should read the template from an annotation',
|
it('should read the template from an annotation',
|
||||||
|
|
|
@ -19,13 +19,17 @@ import {CachedXHR} from './src/xhr/xhr_cache';
|
||||||
import {XHRImpl} from './src/xhr/xhr_impl';
|
import {XHRImpl} from './src/xhr/xhr_impl';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @experimental
|
* @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[]*/> = [
|
export const BROWSER_APP_COMPILER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
||||||
COMPILER_PROVIDERS, {
|
COMPILER_PROVIDERS, {
|
||||||
provide: CompilerConfig,
|
provide: CompilerConfig,
|
||||||
useFactory: (platformDirectives: any[], platformPipes: any[]) => {
|
useFactory: (platformDirectives: any[], platformPipes: any[]) => {
|
||||||
return new CompilerConfig({platformDirectives, platformPipes});
|
return new CompilerConfig({
|
||||||
|
deprecatedPlatformDirectives: platformDirectives,
|
||||||
|
deprecatedPlatformPipes: platformPipes
|
||||||
|
});
|
||||||
},
|
},
|
||||||
deps: [PLATFORM_DIRECTIVES, PLATFORM_PIPES]
|
deps: [PLATFORM_DIRECTIVES, PLATFORM_PIPES]
|
||||||
},
|
},
|
||||||
|
@ -208,11 +212,15 @@ export function bootstrap<C>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @experimental
|
* @deprecated Create an {@link AppModule} that includes the {@link WorkerUiModule} and use {@link
|
||||||
|
* bootstrapModule}
|
||||||
|
* with the {@link workerUiPlatform}() instead.
|
||||||
*/
|
*/
|
||||||
export function bootstrapWorkerUi(
|
export function bootstrapWorkerUi(
|
||||||
workerScriptUri: string,
|
workerScriptUri: string,
|
||||||
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ApplicationRef> {
|
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ApplicationRef> {
|
||||||
|
console.warn(
|
||||||
|
'bootstrapWorkerUi is deprecated. Create an @AppModule that includes the `WorkerUiModule` and use `bootstrapModule` with the `workerUiPlatform()` instead.');
|
||||||
var app = ReflectiveInjector.resolveAndCreate(
|
var app = ReflectiveInjector.resolveAndCreate(
|
||||||
[
|
[
|
||||||
WORKER_UI_APPLICATION_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS,
|
WORKER_UI_APPLICATION_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS,
|
||||||
|
@ -227,13 +235,17 @@ export function bootstrapWorkerUi(
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @experimental
|
* @deprecated The compiler providers are already included in the {@link CompilerFactory} that is
|
||||||
|
* contained the {@link workerAppPlatform}().
|
||||||
*/
|
*/
|
||||||
const WORKER_APP_COMPILER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
const WORKER_APP_COMPILER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
||||||
COMPILER_PROVIDERS, {
|
COMPILER_PROVIDERS, {
|
||||||
provide: CompilerConfig,
|
provide: CompilerConfig,
|
||||||
useFactory: (platformDirectives: any[], platformPipes: any[]) => {
|
useFactory: (platformDirectives: any[], platformPipes: any[]) => {
|
||||||
return new CompilerConfig({platformDirectives, platformPipes});
|
return new CompilerConfig({
|
||||||
|
deprecatedPlatformDirectives: platformDirectives,
|
||||||
|
deprecatedPlatformPipes: platformPipes
|
||||||
|
});
|
||||||
},
|
},
|
||||||
deps: [PLATFORM_DIRECTIVES, PLATFORM_PIPES]
|
deps: [PLATFORM_DIRECTIVES, PLATFORM_PIPES]
|
||||||
},
|
},
|
||||||
|
@ -244,11 +256,15 @@ const WORKER_APP_COMPILER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @experimental
|
* @deprecated Create an {@link AppModule} that includes the {@link WorkerAppModule} and use {@link
|
||||||
|
* bootstrapModule}
|
||||||
|
* with the {@link workerAppPlatform}() instead.
|
||||||
*/
|
*/
|
||||||
export function bootstrapWorkerApp(
|
export function bootstrapWorkerApp(
|
||||||
appComponentType: Type,
|
appComponentType: Type,
|
||||||
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
|
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
|
||||||
|
console.warn(
|
||||||
|
'bootstrapWorkerApp is deprecated. Create an @AppModule that includes the `WorkerAppModule` and use `bootstrapModule` with the `workerAppPlatform()` instead.');
|
||||||
var appInjector = ReflectiveInjector.resolveAndCreate(
|
var appInjector = ReflectiveInjector.resolveAndCreate(
|
||||||
[
|
[
|
||||||
WORKER_APP_APPLICATION_PROVIDERS, WORKER_APP_COMPILER_PROVIDERS,
|
WORKER_APP_APPLICATION_PROVIDERS, WORKER_APP_COMPILER_PROVIDERS,
|
||||||
|
|
|
@ -325,7 +325,9 @@ export function main() {
|
||||||
|
|
||||||
expect(compilerConsole.warnings).toEqual([
|
expect(compilerConsole.warnings).toEqual([
|
||||||
'Passing PLATFORM_DIRECTIVES to "bootstrap()" as provider is deprecated. Use the new parameter "directives" of "bootstrap()" instead.',
|
'Passing PLATFORM_DIRECTIVES to "bootstrap()" as provider is deprecated. Use the new parameter "directives" of "bootstrap()" instead.',
|
||||||
'Passing PLATFORM_PIPES to "bootstrap()" as provider is deprecated. Use the new parameter "pipes" of "bootstrap()" instead.'
|
'Passing PLATFORM_PIPES to "bootstrap()" as provider is deprecated. Use the new parameter "pipes" of "bootstrap()" instead.',
|
||||||
|
`Providing platform directives via the PLATFORM_DIRECTIVES provider or the "CompilerConfig" is deprecated. Provide platform directives via an @AppModule instead. Directives: ${stringify(SomeDirective)}`,
|
||||||
|
`Providing platform pipes via the PLATFORM_PIPES provider or the "CompilerConfig" is deprecated. Provide platform pipes via an @AppModule instead. Pipes: ${stringify(SomePipe)}`
|
||||||
]);
|
]);
|
||||||
async.done();
|
async.done();
|
||||||
});
|
});
|
||||||
|
|
|
@ -81,11 +81,15 @@ export const serverDynamicPlatform =
|
||||||
* serverBootstrap(..., [BROWSER_APP_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS])
|
* serverBootstrap(..., [BROWSER_APP_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS])
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @experimental
|
* @deprecated create an {@link AppModule} and use {@link bootstrapModule} with the {@link
|
||||||
|
* serverDynamicPlatform}()
|
||||||
|
* instead.
|
||||||
*/
|
*/
|
||||||
export function serverBootstrap(
|
export function serverBootstrap(
|
||||||
appComponentType: Type,
|
appComponentType: Type,
|
||||||
providers: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
|
providers: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
|
||||||
|
console.warn(
|
||||||
|
'serverBootstrap is deprecated. Create an @AppModule and use `bootstrapModule` with the `serverDynamicPlatform()` instead.');
|
||||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||||
var appInjector = ReflectiveInjector.resolveAndCreate(providers, serverPlatform().injector);
|
var appInjector = ReflectiveInjector.resolveAndCreate(providers, serverPlatform().injector);
|
||||||
return coreLoadAndBootstrap(appComponentType, appInjector);
|
return coreLoadAndBootstrap(appComponentType, appInjector);
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {ApplicationRef, ComponentFactory, ComponentResolver, Injector, NgZone, PlatformRef, Provider, ReflectiveInjector, Testability, Type, provide} from '@angular/core';
|
import {AppModule, ApplicationRef, Compiler, CompilerFactory, ComponentFactory, ComponentResolver, Injector, NgZone, PlatformRef, Provider, ReflectiveInjector, Testability, Type, bootstrapModuleFactory, provide} from '@angular/core';
|
||||||
import {BROWSER_APP_PROVIDERS, browserPlatform} from '@angular/platform-browser';
|
import {BrowserModule} from '@angular/platform-browser';
|
||||||
import {BROWSER_APP_COMPILER_PROVIDERS} from '@angular/platform-browser-dynamic';
|
import {browserDynamicPlatform} from '@angular/platform-browser-dynamic';
|
||||||
|
|
||||||
import * as angular from './angular_js';
|
import * as angular from './angular_js';
|
||||||
import {NG1_COMPILE, NG1_INJECTOR, NG1_PARSE, NG1_ROOT_SCOPE, NG1_TESTABILITY, NG2_COMPILER, NG2_COMPONENT_FACTORY_REF_MAP, NG2_INJECTOR, NG2_ZONE, REQUIRE_INJECTOR} from './constants';
|
import {NG1_COMPILE, NG1_INJECTOR, NG1_PARSE, NG1_ROOT_SCOPE, NG1_TESTABILITY, NG2_COMPILER, NG2_COMPONENT_FACTORY_REF_MAP, NG2_INJECTOR, NG2_ZONE, REQUIRE_INJECTOR} from './constants';
|
||||||
|
@ -278,21 +278,22 @@ export class UpgradeAdapter {
|
||||||
UpgradeAdapterRef {
|
UpgradeAdapterRef {
|
||||||
var upgrade = new UpgradeAdapterRef();
|
var upgrade = new UpgradeAdapterRef();
|
||||||
var ng1Injector: angular.IInjectorService = null;
|
var ng1Injector: angular.IInjectorService = null;
|
||||||
var platformRef: PlatformRef = browserPlatform();
|
var platformRef: PlatformRef = browserDynamicPlatform();
|
||||||
var applicationRef: ApplicationRef =
|
var compiler: Compiler = platformRef.injector.get(CompilerFactory).createCompiler();
|
||||||
ReflectiveInjector
|
var providers = [
|
||||||
.resolveAndCreate(
|
|
||||||
[
|
|
||||||
BROWSER_APP_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS,
|
|
||||||
{provide: NG1_INJECTOR, useFactory: () => ng1Injector},
|
{provide: NG1_INJECTOR, useFactory: () => ng1Injector},
|
||||||
{provide: NG1_COMPILE, useFactory: () => ng1Injector.get(NG1_COMPILE)},
|
{provide: NG1_COMPILE, useFactory: () => ng1Injector.get(NG1_COMPILE)}, this.providers
|
||||||
this.providers
|
];
|
||||||
],
|
|
||||||
platformRef.injector)
|
@AppModule({providers: providers, modules: [BrowserModule]})
|
||||||
.get(ApplicationRef);
|
class DynamicModule {
|
||||||
|
}
|
||||||
|
|
||||||
|
var moduleRef =
|
||||||
|
bootstrapModuleFactory(compiler.compileAppModuleSync(DynamicModule), platformRef);
|
||||||
|
var applicationRef: ApplicationRef = moduleRef.injector.get(ApplicationRef);
|
||||||
var injector: Injector = applicationRef.injector;
|
var injector: Injector = applicationRef.injector;
|
||||||
var ngZone: NgZone = injector.get(NgZone);
|
var ngZone: NgZone = injector.get(NgZone);
|
||||||
var compiler: ComponentResolver = injector.get(ComponentResolver);
|
|
||||||
var delayApplyExps: Function[] = [];
|
var delayApplyExps: Function[] = [];
|
||||||
var original$applyFn: Function;
|
var original$applyFn: Function;
|
||||||
var rootScopePrototype: any;
|
var rootScopePrototype: any;
|
||||||
|
@ -510,13 +511,12 @@ export class UpgradeAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* @internal */
|
/* @internal */
|
||||||
private compileNg2Components(
|
private compileNg2Components(compiler: Compiler, componentFactoryRefMap: ComponentFactoryRefMap):
|
||||||
compiler: ComponentResolver,
|
Promise<ComponentFactoryRefMap> {
|
||||||
componentFactoryRefMap: ComponentFactoryRefMap): Promise<ComponentFactoryRefMap> {
|
|
||||||
var promises: Array<Promise<ComponentFactory<any>>> = [];
|
var promises: Array<Promise<ComponentFactory<any>>> = [];
|
||||||
var types = this.upgradedComponents;
|
var types = this.upgradedComponents;
|
||||||
for (var i = 0; i < types.length; i++) {
|
for (var i = 0; i < types.length; i++) {
|
||||||
promises.push(compiler.resolveComponent(types[i]));
|
promises.push(compiler.compileComponentAsync(<any>types[i]));
|
||||||
}
|
}
|
||||||
return Promise.all(promises).then((componentFactories: Array<ComponentFactory<any>>) => {
|
return Promise.all(promises).then((componentFactories: Array<ComponentFactory<any>>) => {
|
||||||
var types = this.upgradedComponents;
|
var types = this.upgradedComponents;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {Class, Component, EventEmitter, Testability, disposePlatform, provide} from '@angular/core';
|
import {Class, Component, EventEmitter, Testability, disposePlatform, provide} from '@angular/core';
|
||||||
import {AsyncTestCompleter, describe, expect, iit, inject, it} from '@angular/core/testing/testing_internal';
|
import {AsyncTestCompleter, ddescribe, describe, expect, iit, inject, it} from '@angular/core/testing/testing_internal';
|
||||||
import {UpgradeAdapter} from '@angular/upgrade';
|
import {UpgradeAdapter} from '@angular/upgrade';
|
||||||
import * as angular from '@angular/upgrade/src/angular_js';
|
import * as angular from '@angular/upgrade/src/angular_js';
|
||||||
|
|
||||||
|
|
|
@ -471,10 +471,12 @@ export declare abstract class ComponentRef<C> {
|
||||||
abstract onDestroy(callback: Function): void;
|
abstract onDestroy(callback: Function): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare abstract class ComponentResolver {
|
export declare abstract class ComponentResolver {
|
||||||
abstract clearCache(): void;
|
abstract clearCache(): void;
|
||||||
abstract resolveComponent(component: Type | string): Promise<ComponentFactory<any>>;
|
abstract resolveComponent(component: Type | string): Promise<ComponentFactory<any>>;
|
||||||
|
static DynamicCompilationDeprecationMsg: string;
|
||||||
|
static LazyLoadingDeprecationMsg: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @stable */
|
/** @stable */
|
||||||
|
@ -526,10 +528,10 @@ export interface ContentChildrenMetadataFactory {
|
||||||
}): ContentChildrenMetadata;
|
}): ContentChildrenMetadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare function coreBootstrap<C>(componentFactory: ComponentFactory<C>, injector: Injector): ComponentRef<C>;
|
export declare function coreBootstrap<C>(componentFactory: ComponentFactory<C>, injector: Injector): ComponentRef<C>;
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare function coreLoadAndBootstrap(componentType: Type, injector: Injector): Promise<ComponentRef<any>>;
|
export declare function coreLoadAndBootstrap(componentType: Type, injector: Injector): Promise<ComponentRef<any>>;
|
||||||
|
|
||||||
/** @experimental */
|
/** @experimental */
|
||||||
|
@ -1057,13 +1059,13 @@ export interface PipeTransform {
|
||||||
/** @experimental */
|
/** @experimental */
|
||||||
export declare const PLATFORM_COMMON_PROVIDERS: Array<any | Type | Provider | any[]>;
|
export declare const PLATFORM_COMMON_PROVIDERS: Array<any | Type | Provider | any[]>;
|
||||||
|
|
||||||
/** @stable */
|
/** @deprecated */
|
||||||
export declare const PLATFORM_DIRECTIVES: OpaqueToken;
|
export declare const PLATFORM_DIRECTIVES: OpaqueToken;
|
||||||
|
|
||||||
/** @experimental */
|
/** @experimental */
|
||||||
export declare const PLATFORM_INITIALIZER: any;
|
export declare const PLATFORM_INITIALIZER: any;
|
||||||
|
|
||||||
/** @stable */
|
/** @deprecated */
|
||||||
export declare const PLATFORM_PIPES: OpaqueToken;
|
export declare const PLATFORM_PIPES: OpaqueToken;
|
||||||
|
|
||||||
/** @experimental */
|
/** @experimental */
|
||||||
|
@ -1338,15 +1340,16 @@ export declare class SystemJsAppModuleLoader implements AppModuleFactoryLoader {
|
||||||
load(path: string): Promise<AppModuleFactory<any>>;
|
load(path: string): Promise<AppModuleFactory<any>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class SystemJsCmpFactoryResolver implements ComponentResolver {
|
export declare class SystemJsCmpFactoryResolver implements ComponentResolver {
|
||||||
|
constructor(_console: Console);
|
||||||
clearCache(): void;
|
clearCache(): void;
|
||||||
resolveComponent(componentType: string | Type): Promise<ComponentFactory<any>>;
|
resolveComponent(componentType: string | Type): Promise<ComponentFactory<any>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare class SystemJsComponentResolver implements ComponentResolver {
|
export declare class SystemJsComponentResolver implements ComponentResolver {
|
||||||
constructor(_resolver: ComponentResolver);
|
constructor(_resolver: ComponentResolver, _console: Console);
|
||||||
clearCache(): void;
|
clearCache(): void;
|
||||||
resolveComponent(componentType: string | Type): Promise<ComponentFactory<any>>;
|
resolveComponent(componentType: string | Type): Promise<ComponentFactory<any>>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
/** @experimental */
|
/** @experimental */
|
||||||
export declare function bootstrap<C>(appComponentType: ConcreteType<C>, customProviders?: Array<any>): Promise<ComponentRef<C>>;
|
export declare function bootstrap<C>(appComponentType: ConcreteType<C>, customProviders?: Array<any>): Promise<ComponentRef<C>>;
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare function bootstrapWorkerApp(appComponentType: Type, customProviders?: Array<any>): Promise<ComponentRef<any>>;
|
export declare function bootstrapWorkerApp(appComponentType: Type, customProviders?: Array<any>): Promise<ComponentRef<any>>;
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare function bootstrapWorkerUi(workerScriptUri: string, customProviders?: Array<any>): Promise<ApplicationRef>;
|
export declare function bootstrapWorkerUi(workerScriptUri: string, customProviders?: Array<any>): Promise<ApplicationRef>;
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare const BROWSER_APP_COMPILER_PROVIDERS: Array<any>;
|
export declare const BROWSER_APP_COMPILER_PROVIDERS: Array<any>;
|
||||||
|
|
||||||
/** @experimental */
|
/** @experimental */
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @experimental */
|
/** @experimental */
|
||||||
export declare const SERVER_PLATFORM_PROVIDERS: Array<any>;
|
export declare const SERVER_PLATFORM_PROVIDERS: Array<any>;
|
||||||
|
|
||||||
/** @experimental */
|
/** @deprecated */
|
||||||
export declare function serverBootstrap(appComponentType: Type, providers: Array<any>): Promise<ComponentRef<any>>;
|
export declare function serverBootstrap(appComponentType: Type, providers: Array<any>): Promise<ComponentRef<any>>;
|
||||||
|
|
||||||
/** @experimental */
|
/** @experimental */
|
||||||
|
|
Loading…
Reference in New Issue