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:

committed by
Jason Aden

parent
f310a5960e
commit
ccc76f7498
@ -24,6 +24,7 @@ export {platformWorkerUi} from './worker_render';
|
||||
* Bootstraps the worker ui.
|
||||
*
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
export function bootstrapWorkerUi(
|
||||
workerScriptUri: string, customProviders: StaticProvider[] = []): Promise<PlatformRef> {
|
||||
|
@ -16,5 +16,6 @@ import {Version} from '@angular/core';
|
||||
|
||||
/**
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
export const VERSION = new Version('0.0.0-PLACEHOLDER');
|
||||
|
@ -12,6 +12,7 @@ import {Serializer, SerializerTypes} from './serializer';
|
||||
|
||||
/**
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
@Injectable()
|
||||
export class ClientMessageBrokerFactory {
|
||||
@ -39,6 +40,7 @@ interface PromiseCompleter {
|
||||
|
||||
/**
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
export class ClientMessageBroker {
|
||||
private _pending = new Map<string, PromiseCompleter>();
|
||||
|
@ -17,6 +17,7 @@ import {EventEmitter, NgZone} from '@angular/core';
|
||||
* by the corresponding MessageBusSource.
|
||||
*
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
export abstract class MessageBus implements MessageBusSource, MessageBusSink {
|
||||
/**
|
||||
|
@ -12,6 +12,7 @@ import {RenderStore} from './render_store';
|
||||
|
||||
/**
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
export const enum SerializerTypes {
|
||||
// RendererType2
|
||||
|
@ -13,6 +13,7 @@ import {Serializer, SerializerTypes} from '../shared/serializer';
|
||||
|
||||
/**
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
@Injectable()
|
||||
export class ServiceMessageBrokerFactory {
|
||||
@ -40,6 +41,7 @@ export class ServiceMessageBrokerFactory {
|
||||
* If that method returns a promise, the UIMessageBroker returns the result to the worker.
|
||||
*
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
export class ServiceMessageBroker {
|
||||
private _sink: EventEmitter<any>;
|
||||
@ -91,6 +93,7 @@ export class ServiceMessageBroker {
|
||||
|
||||
/**
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
export interface ReceivedMessage {
|
||||
method: string;
|
||||
|
@ -22,6 +22,7 @@ import {MessageBasedPlatformLocation} from './platform_location';
|
||||
* A list of {@link Provider}s. To use the router in a Worker enabled application you must
|
||||
* include these providers when setting up the render thread.
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
export const WORKER_UI_LOCATION_PROVIDERS = <StaticProvider[]>[
|
||||
{provide: MessageBasedPlatformLocation, deps: [ServiceMessageBrokerFactory,
|
||||
|
@ -17,6 +17,7 @@ import {WebWorkerPlatformLocation} from './platform_location';
|
||||
* a worker context.
|
||||
*
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
export const WORKER_APP_LOCATION_PROVIDERS = [
|
||||
{provide: PlatformLocation, useClass: WebWorkerPlatformLocation}, {
|
||||
|
@ -24,6 +24,7 @@ import {WorkerDomAdapter} from './web_workers/worker/worker_adapter';
|
||||
|
||||
/**
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
export const platformWorkerApp = createPlatformFactory(
|
||||
platformCore, 'workerApp', [{provide: PLATFORM_ID, useValue: PLATFORM_WORKER_APP_ID}]);
|
||||
@ -56,6 +57,7 @@ export function setupWebWorker(): void {
|
||||
* The ng module for the worker app side.
|
||||
*
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
@NgModule({
|
||||
providers: [
|
||||
|
@ -26,6 +26,7 @@ import {MessageBasedRenderer2} from './web_workers/ui/renderer';
|
||||
* and underlying {@link MessageBus} for lower level message passing.
|
||||
*
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
@Injectable()
|
||||
export class WebWorkerInstance {
|
||||
@ -43,6 +44,7 @@ export class WebWorkerInstance {
|
||||
|
||||
/**
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
export const WORKER_SCRIPT = new InjectionToken<string>('WebWorkerScript');
|
||||
|
||||
@ -51,6 +53,7 @@ export const WORKER_SCRIPT = new InjectionToken<string>('WebWorkerScript');
|
||||
* created.
|
||||
*
|
||||
* @publicApi
|
||||
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
||||
*/
|
||||
export const WORKER_UI_STARTABLE_MESSAGING_SERVICE =
|
||||
new InjectionToken<({start: () => void})[]>('WorkerRenderStartableMsgService');
|
||||
|
Reference in New Issue
Block a user