feat(platform-webworker): deprecate platform-webworker (#30642)

DEPRECATION:

platform-webworker has been around since the initial release of Angular
version 2. It began as an experiment to leverage Angular's rendering
architecture and try something different: to run an entire web application
in a web worker.

We've learned a lot from this experiment, and have come to the conclusion
that pushing entire applications to run in a web worker is not a recipe for
success for most applications. This is due to a number of unresolved issues,
including:

* Poor or non-existent support for web worker APIs in web crawlers/indexers.
* Poor support in build and bundling tooling.

As a result, as of Angular version 8, we are deprecating the
`platform-webworker` APIs in Angular. This consists of both NPM packages,
`@angular/platform-webworker` and `@angular/platform-webworker-dynamic`.

Going forward, we will focus our efforts related to web workers around their
primary use case of offloading CPU-intensive but not critical work.

FW-1339 #resolve

PR Close #30642
This commit is contained in:
Alex Rickabaugh
2019-05-23 12:39:20 -07:00
committed by Jason Aden
parent f310a5960e
commit ccc76f7498
15 changed files with 61 additions and 0 deletions

View File

@ -1,3 +1,5 @@
/** @deprecated */
export declare const platformWorkerAppDynamic: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
/** @deprecated */
export declare const VERSION: Version;

View File

@ -1,9 +1,12 @@
/** @deprecated */
export declare function bootstrapWorkerUi(workerScriptUri: string, customProviders?: StaticProvider[]): Promise<PlatformRef>;
/** @deprecated */
export declare class ClientMessageBroker {
runOnService(args: UiArguments, returnType: Type<any> | SerializerTypes | null): Promise<any> | null;
}
/** @deprecated */
export declare class ClientMessageBrokerFactory {
createMessageBroker(channel: string, runInZone?: boolean): ClientMessageBroker;
}
@ -14,6 +17,7 @@ export declare class FnArg {
constructor(value: any, type?: Type<any> | SerializerTypes);
}
/** @deprecated */
export declare abstract class MessageBus implements MessageBusSource, MessageBusSink {
abstract attachToZone(zone: NgZone): void;
abstract from(channel: string): EventEmitter<any>;
@ -33,10 +37,12 @@ export interface MessageBusSource {
initChannel(channel: string, runInZone: boolean): void;
}
/** @deprecated */
export declare const platformWorkerApp: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
export declare const platformWorkerUi: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;
/** @deprecated */
export interface ReceivedMessage {
args: any[];
id: string;
@ -44,16 +50,19 @@ export interface ReceivedMessage {
type: string;
}
/** @deprecated */
export declare const enum SerializerTypes {
RENDERER_TYPE_2 = 0,
PRIMITIVE = 1,
RENDER_STORE_OBJECT = 2
}
/** @deprecated */
export declare class ServiceMessageBroker {
registerMethod(methodName: string, signature: Array<Type<any> | SerializerTypes> | null, method: (..._: any[]) => Promise<any> | void, returnType?: Type<any> | SerializerTypes): void;
}
/** @deprecated */
export declare class ServiceMessageBrokerFactory {
createMessageBroker(channel: string, runInZone?: boolean): ServiceMessageBroker;
}
@ -64,8 +73,10 @@ export declare class UiArguments {
constructor(method: string, args?: FnArg[] | undefined);
}
/** @deprecated */
export declare const VERSION: Version;
/** @deprecated */
export declare const WORKER_APP_LOCATION_PROVIDERS: ({
provide: typeof PlatformLocation;
useClass: typeof WebWorkerPlatformLocation;
@ -86,7 +97,9 @@ export declare const WORKER_APP_LOCATION_PROVIDERS: ({
multi?: undefined;
})[];
/** @deprecated */
export declare const WORKER_UI_LOCATION_PROVIDERS: StaticProvider[];
/** @deprecated */
export declare class WorkerAppModule {
}