Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions aio/content/guide/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ Tip: In the [API reference section](api) of this doc site, deprecated APIs are i
| [`Renderer`](api/core/Renderer) | [`Renderer2`](api/core/Renderer2) | v4 | none |
| [`RootRenderer`](api/core/RootRenderer) | [`RendererFactory2`](api/core/RendererFactory2) | v4 | none |
| [`ViewEncapsulation.Native`](api/core/ViewEncapsulation#Native) | [`ViewEncapsulation.ShadowDom`](api/core/ViewEncapsulation#ShadowDom) | v6 | Use the native encapsulation mechanism of the renderer. See [view.ts](https://github.com/angular/angular/blob/3e992e18ebf51d6036818f26c3d77b52d3ec48eb/packages/core/src/metadata/view.ts#L32).
| [`WtfScopeFn`](api/core/WtfScopeFn) | none | v8 | See [Web Tracing Framework](#wtf) |
| [`wtfCreateScope`](api/core/wtfCreateScope) | none | v8 | See [Web Tracing Framework](#wtf) |
| [`wtfStartTimeRange`](api/core/wtfStartTimeRange) | none | v8 | See [Web Tracing Framework](#wtf) |
| [`wtfEndTimeRange`](api/core/wtfEndTimeRange) | none | v8 | See [Web Tracing Framework](#wtf) |
| [`wtfLeave`](api/core/wtfLeave) | none | v8 | See [Web Tracing Framework](#wtf) |


{@a forms}
Expand All @@ -117,6 +122,19 @@ Tip: In the [API reference section](api) of this doc site, deprecated APIs are i
| --- | ----------- | --------------------- | ----- |
| [`preserveQueryParams`](api/router/NavigationExtras#preserveQueryParams) | [`queryParamsHandling`](api/router/NavigationExtras#queryParamsHandling) | v4 | none |

{@a platform-webworker}
### @angular/platform-webworker

| API | Replacement | Deprecation announced | Notes |
| --- | ----------- | --------------------- | ----- |
| [All entry points](api/platform-webworker) | none | v8 | See [platform-webworker](#webworker-apps). |

{@a platform-webworker-dynamic}
### @angular/platform-webworker-dynamic

| API | Replacement | Deprecation announced | Notes |
| --- | ----------- | --------------------- | ----- |
| [All entry points](api/platform-webworker-dynamic) | none | v8 | See [platform-webworker](#webworker-apps). |

{@a upgrade}
### @angular/upgrade
Expand All @@ -142,6 +160,12 @@ This section lists all of the currently-deprecated features, which includes temp



{@a wtf}
### Web Tracing Framework integration

Angular previously has supported an integration with the Web Tracing Framework (WTF) for performance testing of Angular applications. This integration has not been maintained and likely does not work for the majority of Angular applications today. As a result, we are deprecating the integration in Angular version 8.


{@a deep-component-style-selector}
### `/deep/`, `>>>` and `:ng-deep` component style selectors

Expand Down Expand Up @@ -291,6 +315,21 @@ In typical Angular project, the polyfill is not used in production builds, so de
We expect to remove the polyfill from most if not all CLI projects via an `ng upgrade` migration from version 8 to 9.


{@a webworker-apps}
### platform-webworker Angular applications


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.

{@a removed}
## Removed APIs

Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/profile/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function noopScope(arg0?: any, arg1?: any): any {
* an exception is expected during normal execution while profiling.
*
* @publicApi
* @deprecated the Web Tracing Framework is no longer supported in Angular
*/
export const wtfCreateScope: (signature: string, flags?: any) => WtfScopeFn =
wtfEnabled ? createScope : (signature: string, flags?: any) => noopScope;
Expand All @@ -61,6 +62,7 @@ export const wtfCreateScope: (signature: string, flags?: any) => WtfScopeFn =
*
* Returns the `returnValue for easy chaining.
* @publicApi
* @deprecated the Web Tracing Framework is no longer supported in Angular
*/
export const wtfLeave: <T>(scope: any, returnValue?: T) => T =
wtfEnabled ? leave : (s: any, r?: any) => r;
Expand All @@ -77,6 +79,7 @@ export const wtfLeave: <T>(scope: any, returnValue?: T) => T =
* });
* }
* @publicApi
* @deprecated the Web Tracing Framework is no longer supported in Angular
*/
export const wtfStartTimeRange: (rangeType: string, action: string) => any =
wtfEnabled ? startTimeRange : (rangeType: string, action: string) => null;
Expand All @@ -86,5 +89,6 @@ export const wtfStartTimeRange: (rangeType: string, action: string) => any =
* [range] is the return value from [wtfStartTimeRange] Async ranges only work if WTF has been
* enabled.
* @publicApi
* @deprecated the Web Tracing Framework is no longer supported in Angular
*/
export const wtfEndTimeRange: (range: any) => void = wtfEnabled ? endTimeRange : (r: any) => null;
1 change: 1 addition & 0 deletions packages/core/src/profile/wtf_impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {global} from '../util/global';
* A scope function for the Web Tracing Framework (WTF).
*
* @publicApi
* @deprecated the Web Tracing Framework is no longer supported in Angular
*/
export interface WtfScopeFn { (arg0?: any, arg1?: any): any; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ 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', [
Expand Down
1 change: 1 addition & 0 deletions packages/platform-webworker-dynamic/src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
1 change: 1 addition & 0 deletions packages/platform-webworker/src/platform-webworker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
1 change: 1 addition & 0 deletions packages/platform-webworker/src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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>;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}, {
Expand Down
2 changes: 2 additions & 0 deletions packages/platform-webworker/src/worker_app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}]);
Expand Down Expand Up @@ -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: [
Expand Down
3 changes: 3 additions & 0 deletions packages/platform-webworker/src/worker_render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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');

Expand All @@ -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');
Expand Down
5 changes: 5 additions & 0 deletions tools/public_api_guard/core/core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1440,14 +1440,19 @@ export declare class WrappedValue {
static wrap(value: any): WrappedValue;
}

/** @deprecated */
export declare const wtfCreateScope: (signature: string, flags?: any) => WtfScopeFn;

/** @deprecated */
export declare const wtfEndTimeRange: (range: any) => void;

/** @deprecated */
export declare const wtfLeave: <T>(scope: any, returnValue?: T) => T;

/** @deprecated */
export interface WtfScopeFn {
(arg0?: any, arg1?: any): any;
}

/** @deprecated */
export declare const wtfStartTimeRange: (rangeType: string, action: string) => any;
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/** @deprecated */
export declare const platformWorkerAppDynamic: (extraProviders?: StaticProvider[] | undefined) => PlatformRef;

/** @deprecated */
export declare const VERSION: Version;
13 changes: 13 additions & 0 deletions tools/public_api_guard/platform-webworker/platform-webworker.d.ts
Original file line number Diff line number Diff line change
@@ -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;
}
Expand All @@ -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>;
Expand All @@ -33,27 +37,32 @@ 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;
method: string;
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;
}
Expand All @@ -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;
Expand All @@ -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 {
}