From b42411ba1f6d0f989e5fa846524d3d9e2425e834 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Mon, 25 Jul 2016 05:47:16 -0700 Subject: [PATCH] chore: update public api - `precompile` -> `entryComponents` - introduce `ModuleWithProviders` - introduce `@NgModule.schema` - update to bootstrap Closes #10268 --- modules/@angular/platform-browser/index.ts | 2 +- modules/@angular/platform-server/index.ts | 2 +- tools/public_api_guard/core/index.d.ts | 57 ++++++++++++------- tools/public_api_guard/core/testing.d.ts | 13 +++-- .../platform-browser-dynamic/index.d.ts | 8 ++- .../platform-browser-dynamic/testing.d.ts | 5 +- .../platform-browser/index.d.ts | 15 ++++- .../platform-browser/testing.d.ts | 5 +- .../platform-server/index.d.ts | 10 +++- .../platform-server/testing.d.ts | 5 +- 10 files changed, 85 insertions(+), 37 deletions(-) diff --git a/modules/@angular/platform-browser/index.ts b/modules/@angular/platform-browser/index.ts index 7fc895c3d0..9281511207 100644 --- a/modules/@angular/platform-browser/index.ts +++ b/modules/@angular/platform-browser/index.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -export {BROWSER_APP_PROVIDERS, BROWSER_PLATFORM_PROVIDERS, BROWSER_SANITIZATION_PROVIDERS, BrowserModule, platformBrowser} from './src/browser'; +export {BROWSER_APP_PROVIDERS, BROWSER_PLATFORM_PROVIDERS, BROWSER_SANITIZATION_PROVIDERS, BrowserModule, browserPlatform, platformBrowser} from './src/browser'; export {BrowserPlatformLocation} from './src/browser/location/browser_platform_location'; export {Title} from './src/browser/title'; export {disableDebugTools, enableDebugTools} from './src/browser/tools/tools'; diff --git a/modules/@angular/platform-server/index.ts b/modules/@angular/platform-server/index.ts index cc416e9e61..fbd3baf782 100644 --- a/modules/@angular/platform-server/index.ts +++ b/modules/@angular/platform-server/index.ts @@ -6,4 +6,4 @@ * found in the LICENSE file at https://angular.io/license */ -export {SERVER_PLATFORM_PROVIDERS, platformDynamicServer, platformServer, serverBootstrap} from './src/server'; +export {SERVER_PLATFORM_PROVIDERS, platformDynamicServer, platformServer, serverBootstrap, serverDynamicPlatform, serverPlatform} from './src/server'; diff --git a/tools/public_api_guard/core/index.d.ts b/tools/public_api_guard/core/index.d.ts index 725dfb9415..d5c8be1aca 100644 --- a/tools/public_api_guard/core/index.d.ts +++ b/tools/public_api_guard/core/index.d.ts @@ -26,7 +26,7 @@ export declare abstract class AfterViewInit { } /** @experimental */ -export declare const ANALYZE_FOR_PRECOMPILE: OpaqueToken; +export declare const ANALYZE_FOR_ENTRY_COMPONENTS: OpaqueToken; /** @experimental */ export declare function animate(timing: string | number, styles?: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata): AnimationAnimateMetadata; @@ -200,12 +200,6 @@ export declare class Binding extends Provider { }); } -/** @stable */ -export declare function bootstrapModule(moduleType: ConcreteType, platform: PlatformRef, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise>; - -/** @experimental */ -export declare function bootstrapModuleFactory(moduleFactory: NgModuleFactory, platform: PlatformRef): NgModuleRef; - /** @stable */ export declare enum ChangeDetectionStrategy { OnPush = 0, @@ -297,16 +291,16 @@ export declare class ComponentMetadata extends DirectiveMetadata { changeDetection: ChangeDetectionStrategy; directives: Array; encapsulation: ViewEncapsulation; + entryComponents: Array; interpolation: [string, string]; moduleId: string; pipes: Array; - precompile: Array; styleUrls: string[]; styles: string[]; template: string; templateUrl: string; viewProviders: any[]; - constructor({selector, inputs, outputs, properties, events, host, exportAs, moduleId, providers, viewProviders, changeDetection, queries, templateUrl, template, styleUrls, styles, animations, directives, pipes, encapsulation, interpolation, precompile}?: { + constructor({selector, inputs, outputs, properties, events, host, exportAs, moduleId, providers, viewProviders, changeDetection, queries, templateUrl, template, styleUrls, styles, animations, directives, pipes, encapsulation, interpolation, precompile, entryComponents}?: { selector?: string; inputs?: string[]; outputs?: string[]; properties?: string[]; events?: string[]; @@ -331,6 +325,7 @@ export declare class ComponentMetadata extends DirectiveMetadata { encapsulation?: ViewEncapsulation; interpolation?: [string, string]; precompile?: Array; + entryComponents?: Array; }); } @@ -362,7 +357,7 @@ export interface ComponentMetadataFactory { pipes?: Array; encapsulation?: ViewEncapsulation; interpolation?: [string, string]; - precompile?: Array; + entryComponents?: Array; }): ComponentDecorator; new (obj: { selector?: string; @@ -390,7 +385,7 @@ export interface ComponentMetadataFactory { pipes?: Array; encapsulation?: ViewEncapsulation; interpolation?: [string, string]; - precompile?: Array; + entryComponents?: Array; }): ComponentMetadata; } @@ -469,15 +464,15 @@ export declare function coreBootstrap(componentFactory: ComponentFactory, /** @deprecated */ export declare function coreLoadAndBootstrap(componentType: Type, injector: Injector): Promise>; -/** @experimental */ -export declare const corePlatform: (extraProviders?: any[]) => PlatformRef; - /** @experimental */ export declare function createPlatform(injector: Injector): PlatformRef; /** @experimental */ export declare function createPlatformFactory(parentPlaformFactory: PlatformFactory, name: string, providers?: any[]): PlatformFactory; +/** @experimental */ +export declare const CUSTOM_ELEMENTS_SCHEMA: SchemaMetadata; + /** @stable */ export declare class CyclicDependencyError extends AbstractProviderError { constructor(injector: ReflectiveInjector, key: ReflectiveKey); @@ -863,6 +858,12 @@ export declare class KeyValueDiffers { /** @deprecated */ export declare function lockRunMode(): void; +/** @experimental */ +export interface ModuleWithProviders { + ngModule: Type; + providers?: any[]; +} + /** @experimental */ export declare var NgModule: NgModuleMetadataFactory; @@ -887,16 +888,18 @@ export declare abstract class NgModuleFactoryLoader { /** @experimental */ export declare class NgModuleMetadata extends InjectableMetadata { declarations: Array; + entryComponents: Array; exports: Array; - imports: Array; - precompile: Array; + imports: Array; providers: any[]; - constructor({providers, declarations, imports, exports, precompile}?: { + schemas: Array; + constructor({providers, declarations, imports, exports, entryComponents, schemas}?: { providers?: any[]; declarations?: Array; imports?: Array; exports?: Array; - precompile?: Array; + entryComponents?: Array; + schemas?: Array; }); } @@ -905,16 +908,18 @@ export interface NgModuleMetadataFactory { (obj?: { providers?: any[]; declarations?: Array; - imports?: Array; + imports?: Array; exports?: Array; - precompile?: Array; + entryComponents?: Array; + schemas?: Array; }): NgModuleDecorator; new (obj?: { providers?: any[]; declarations?: Array; imports?: Array; exports?: Array; - precompile?: Array; + entryComponents?: Array; + schemas?: Array; }): NgModuleMetadata; } @@ -1068,10 +1073,15 @@ export declare const PLATFORM_INITIALIZER: any; /** @deprecated */ export declare const PLATFORM_PIPES: OpaqueToken; +/** @experimental */ +export declare const platformCore: (extraProviders?: any[]) => PlatformRef; + /** @experimental */ export declare abstract class PlatformRef { disposed: boolean; injector: Injector; + /** @stable */ bootstrapModule(moduleType: ConcreteType, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise>; + /** @experimental */ bootstrapModuleFactory(moduleFactory: NgModuleFactory): NgModuleRef; abstract dispose(): void; abstract registerDisposeListener(dispose: () => void): void; } @@ -1267,6 +1277,11 @@ export declare abstract class SanitizationService { abstract sanitize(context: SecurityContext, value: string): string; } +/** @experimental */ +export interface SchemaMetadata { + name: string; +} + /** @stable */ export declare enum SecurityContext { NONE = 0, diff --git a/tools/public_api_guard/core/testing.d.ts b/tools/public_api_guard/core/testing.d.ts index 95a6aaf5c4..df73a33362 100644 --- a/tools/public_api_guard/core/testing.d.ts +++ b/tools/public_api_guard/core/testing.d.ts @@ -39,14 +39,15 @@ export declare function configureModule(moduleDef: { providers?: any[]; declarations?: any[]; imports?: any[]; - precompile?: any[]; + entryComponents?: any[]; + schemas?: Array; }): void; /** @experimental */ export declare function discardPeriodicTasks(): void; /** @experimental */ -export declare function doAsyncPrecompilation(): Promise; +export declare function doAsyncEntryPointCompilation(): Promise; /** @experimental */ export declare function fakeAsync(fn: Function): (...args: any[]) => any; @@ -72,7 +73,7 @@ export declare class InjectSetupWrapper { providers?: any[]; declarations?: any[]; imports?: any[]; - precompile?: any[]; + entryComponents?: any[]; }); inject(tokens: any[], fn: Function): () => any; } @@ -98,7 +99,8 @@ export declare class TestBed implements Injector { providers?: any[]; declarations?: any[]; imports?: any[]; - precompile?: any[]; + entryComponents?: any[]; + schemas?: Array; }): void; createModuleFactory(): Promise>; execute(tokens: any[], fn: Function): any; @@ -136,7 +138,8 @@ export declare function withModule(moduleDef: () => { providers?: any[]; declarations?: any[]; imports?: any[]; - precompile?: any[]; + entryComponents?: any[]; + schemas?: Array; }): InjectSetupWrapper; /** @experimental */ diff --git a/tools/public_api_guard/platform-browser-dynamic/index.d.ts b/tools/public_api_guard/platform-browser-dynamic/index.d.ts index eeadf90c2c..ea303c131c 100644 --- a/tools/public_api_guard/platform-browser-dynamic/index.d.ts +++ b/tools/public_api_guard/platform-browser-dynamic/index.d.ts @@ -10,11 +10,17 @@ export declare function bootstrapWorkerUi(workerScriptUri: string, customProvide /** @deprecated */ export declare const BROWSER_APP_COMPILER_PROVIDERS: Array; -/** @experimental */ +/** @deprecated */ export declare const browserDynamicPlatform: (extraProviders?: any[]) => PlatformRef; /** @experimental */ export declare const CACHED_TEMPLATE_PROVIDER: Array; /** @experimental */ +export declare const platformBrowserDynamic: (extraProviders?: any[]) => PlatformRef; + +/** @experimental */ +export declare const platformWorkerAppDynamic: (extraProviders?: any[]) => PlatformRef; + +/** @deprecated */ export declare const workerAppDynamicPlatform: (extraProviders?: any[]) => PlatformRef; diff --git a/tools/public_api_guard/platform-browser-dynamic/testing.d.ts b/tools/public_api_guard/platform-browser-dynamic/testing.d.ts index e014304869..5f4d631e96 100644 --- a/tools/public_api_guard/platform-browser-dynamic/testing.d.ts +++ b/tools/public_api_guard/platform-browser-dynamic/testing.d.ts @@ -2,9 +2,12 @@ export declare class BrowserDynamicTestingModule { } -/** @experimental */ +/** @deprecated */ export declare const browserDynamicTestingPlatform: (extraProviders?: any[]) => PlatformRef; +/** @experimental */ +export declare const platformBrowserDynamicTesting: (extraProviders?: any[]) => PlatformRef; + /** @deprecated */ export declare const TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS: Array; diff --git a/tools/public_api_guard/platform-browser/index.d.ts b/tools/public_api_guard/platform-browser/index.d.ts index bb67ee79a0..7db6beb322 100644 --- a/tools/public_api_guard/platform-browser/index.d.ts +++ b/tools/public_api_guard/platform-browser/index.d.ts @@ -20,7 +20,7 @@ export declare const BROWSER_SANITIZATION_PROVIDERS: Array; export declare class BrowserModule { } -/** @experimental */ +/** @deprecated */ export declare const browserPlatform: (extraProviders?: any[]) => PlatformRef; /** @stable */ @@ -126,6 +126,15 @@ export interface MessageBusSource { initChannel(channel: string, runInZone: boolean): void; } +/** @experimental */ +export declare const platformBrowser: (extraProviders?: any[]) => PlatformRef; + +/** @experimental */ +export declare const platformWorkerApp: (extraProviders?: any[]) => PlatformRef; + +/** @experimental */ +export declare const platformWorkerUi: (extraProviders?: any[]) => PlatformRef; + /** @experimental */ export declare const PRIMITIVE: Type; @@ -230,8 +239,8 @@ export declare const WORKER_UI_STARTABLE_MESSAGING_SERVICE: OpaqueToken; export declare class WorkerAppModule { } -/** @experimental */ +/** @deprecated */ export declare const workerAppPlatform: (extraProviders?: any[]) => PlatformRef; -/** @experimental */ +/** @deprecated */ export declare const workerUiPlatform: (extraProviders?: any[]) => PlatformRef; diff --git a/tools/public_api_guard/platform-browser/testing.d.ts b/tools/public_api_guard/platform-browser/testing.d.ts index dbcf77ad21..571c2400d1 100644 --- a/tools/public_api_guard/platform-browser/testing.d.ts +++ b/tools/public_api_guard/platform-browser/testing.d.ts @@ -2,9 +2,12 @@ export declare class BrowserTestingModule { } -/** @experimental */ +/** @deprecated */ export declare const browserTestingPlatform: (extraProviders?: any[]) => PlatformRef; +/** @experimental */ +export declare const platformBrowserTesting: (extraProviders?: any[]) => PlatformRef; + /** @deprecated */ export declare const TEST_BROWSER_APPLICATION_PROVIDERS: Array; diff --git a/tools/public_api_guard/platform-server/index.d.ts b/tools/public_api_guard/platform-server/index.d.ts index a8a6d5c59c..63dd758320 100644 --- a/tools/public_api_guard/platform-server/index.d.ts +++ b/tools/public_api_guard/platform-server/index.d.ts @@ -1,11 +1,17 @@ +/** @experimental */ +export declare const platformDynamicServer: (extraProviders?: any[]) => PlatformRef; + +/** @experimental */ +export declare const platformServer: (extraProviders?: any[]) => PlatformRef; + /** @deprecated */ export declare const SERVER_PLATFORM_PROVIDERS: Array; /** @deprecated */ export declare function serverBootstrap(appComponentType: ConcreteType, customProviders: Array): Promise>; -/** @experimental */ +/** @deprecated */ export declare const serverDynamicPlatform: (extraProviders?: any[]) => PlatformRef; -/** @experimental */ +/** @deprecated */ export declare const serverPlatform: (extraProviders?: any[]) => PlatformRef; diff --git a/tools/public_api_guard/platform-server/testing.d.ts b/tools/public_api_guard/platform-server/testing.d.ts index 6c956e992c..19cdee2f78 100644 --- a/tools/public_api_guard/platform-server/testing.d.ts +++ b/tools/public_api_guard/platform-server/testing.d.ts @@ -1,8 +1,11 @@ +/** @experimental */ +export declare const platformServerTesting: (extraProviders?: any[]) => PlatformRef; + /** @experimental */ export declare class ServerTestingModule { } -/** @experimental */ +/** @deprecated */ export declare const serverTestingPlatform: (extraProviders?: any[]) => PlatformRef; /** @deprecated */