
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
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
import {ɵPLATFORM_WORKER_UI_ID as PLATFORM_WORKER_UI_ID} from '@angular/common';
|
|
import {ResourceLoader} from '@angular/compiler';
|
|
import {COMPILER_OPTIONS, PLATFORM_ID, PlatformRef, StaticProvider, createPlatformFactory} from '@angular/core';
|
|
import {ɵResourceLoaderImpl as ResourceLoaderImpl, ɵplatformCoreDynamic as platformCoreDynamic} from '@angular/platform-browser-dynamic';
|
|
|
|
export {VERSION} from './version';
|
|
|
|
|
|
/**
|
|
* @publicApi
|
|
* @deprecated platform-webworker is deprecated in Angular and will be removed in version 10
|
|
*/
|
|
export const platformWorkerAppDynamic =
|
|
createPlatformFactory(platformCoreDynamic, 'workerAppDynamic', [
|
|
{
|
|
provide: COMPILER_OPTIONS,
|
|
useValue: {providers: [{provide: ResourceLoader, useClass: ResourceLoaderImpl, deps: []}]},
|
|
multi: true
|
|
},
|
|
{provide: PLATFORM_ID, useValue: PLATFORM_WORKER_UI_ID}
|
|
]);
|