refactor: core, http & platform-webworker to remove public private class separation (#19143)

The private classes `ApplicationRef_`, `PlatformRef_`, `JSONPConnection_`, `JSONPBackend_`, `ClientMessageBrokerFactory_`, `ServiceMessageBroker_`, `ClientMessageBroker_` and `ServiceMessageBrokerFactory_` have been removed and merged into their public equivalents.

The size of the minified umd bundles have been slightly decreased:
| package            | before     | after      |
| -------------------|------------|------------|
| core               | 217.791 kb | 217.144 kb |
| http               | 33.260 kb  | 32.838 kb  | 
| platform-webworker | 56.015 kb  | 54.933 kb  |
PR Close #19143
This commit is contained in:
Olivier Combe
2017-09-12 20:45:02 +02:00
committed by Matias Niemelä
parent 0c44e733ad
commit b6431c60e6
19 changed files with 252 additions and 326 deletions

View File

@ -125,15 +125,15 @@ export declare class ApplicationModule {
}
/** @stable */
export declare abstract class ApplicationRef {
readonly abstract componentTypes: Type<any>[];
readonly abstract components: ComponentRef<any>[];
readonly abstract isStable: Observable<boolean>;
readonly abstract viewCount: number;
abstract attachView(view: ViewRef): void;
abstract bootstrap<C>(componentFactory: ComponentFactory<C> | Type<C>, rootSelectorOrNode?: string | any): ComponentRef<C>;
abstract detachView(view: ViewRef): void;
abstract tick(): void;
export declare class ApplicationRef {
readonly componentTypes: Type<any>[];
readonly components: ComponentRef<any>[];
readonly isStable: Observable<boolean>;
readonly viewCount: number;
attachView(viewRef: ViewRef): void;
bootstrap<C>(componentOrFactory: ComponentFactory<C> | Type<C>, rootSelectorOrNode?: string | any): ComponentRef<C>;
detachView(viewRef: ViewRef): void;
tick(): void;
}
/** @experimental */
@ -695,13 +695,13 @@ export declare const PLATFORM_INITIALIZER: InjectionToken<(() => void)[]>;
export declare const platformCore: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
/** @stable */
export declare abstract class PlatformRef {
readonly abstract destroyed: boolean;
readonly abstract injector: Injector;
/** @stable */ abstract bootstrapModule<M>(moduleType: Type<M>, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise<NgModuleRef<M>>;
/** @experimental */ abstract bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>): Promise<NgModuleRef<M>>;
abstract destroy(): void;
abstract onDestroy(callback: () => void): void;
export declare class PlatformRef {
readonly destroyed: boolean;
readonly injector: Injector;
/** @stable */ bootstrapModule<M>(moduleType: Type<M>, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise<NgModuleRef<M>>;
/** @experimental */ bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>): Promise<NgModuleRef<M>>;
destroy(): void;
onDestroy(callback: () => void): void;
}
/** @experimental */

View File

@ -79,15 +79,16 @@ export declare class Jsonp extends Http {
}
/** @deprecated */
export declare abstract class JSONPBackend extends ConnectionBackend {
export declare class JSONPBackend extends ConnectionBackend {
createConnection(request: Request): JSONPConnection;
}
/** @deprecated */
export declare abstract class JSONPConnection implements Connection {
export declare class JSONPConnection implements Connection {
readyState: ReadyState;
request: Request;
response: Observable<Response>;
abstract finished(data?: any): void;
finished(data?: any): void;
}
/** @deprecated */

View File

@ -2,13 +2,13 @@
export declare function bootstrapWorkerUi(workerScriptUri: string, customProviders?: StaticProvider[]): Promise<PlatformRef>;
/** @experimental */
export declare abstract class ClientMessageBroker {
abstract runOnService(args: UiArguments, returnType: Type<any> | SerializerTypes | null): Promise<any> | null;
export declare class ClientMessageBroker {
runOnService(args: UiArguments, returnType: Type<any> | SerializerTypes | null): Promise<any> | null;
}
/** @experimental */
export declare abstract class ClientMessageBrokerFactory {
abstract createMessageBroker(channel: string, runInZone?: boolean): ClientMessageBroker;
export declare class ClientMessageBrokerFactory {
createMessageBroker(channel: string, runInZone?: boolean): ClientMessageBroker;
}
/** @experimental */
@ -62,13 +62,13 @@ export declare const enum SerializerTypes {
}
/** @experimental */
export declare abstract class ServiceMessageBroker {
abstract registerMethod(methodName: string, signature: Array<Type<any> | SerializerTypes> | null, method: Function, returnType?: Type<any> | SerializerTypes): void;
export declare class ServiceMessageBroker {
registerMethod(methodName: string, signature: Array<Type<any> | SerializerTypes> | null, method: (..._: any[]) => Promise<any> | void, returnType?: Type<any> | SerializerTypes): void;
}
/** @experimental */
export declare abstract class ServiceMessageBrokerFactory {
abstract createMessageBroker(channel: string, runInZone?: boolean): ServiceMessageBroker;
export declare class ServiceMessageBrokerFactory {
createMessageBroker(channel: string, runInZone?: boolean): ServiceMessageBroker;
}
/** @experimental */