Skip to content

Commit 933f45e

Browse files
committed
docs(webworkers): add experimental markers for all web worker public apis
1 parent 4fc37ae commit 933f45e

File tree

9 files changed

+55
-0
lines changed

9 files changed

+55
-0
lines changed

modules/@angular/platform-browser/src/browser/title.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import {getDOM} from '../dom/dom_adapter';
66
* it is not possible to bind to the `text` property of the `HTMLTitleElement` elements
77
* (representing the `<title>` tag). Instead, this service can be used to set and get the current
88
* title value.
9+
*
10+
* @experimental
911
*/
1012
export class Title {
1113
/**

modules/@angular/platform-browser/src/web_workers/shared/client_message_broker.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import {DateWrapper, StringWrapper, isPresent, print, stringify} from '../../fac
77
import {MessageBus} from './message_bus';
88
import {Serializer} from './serializer';
99

10+
/**
11+
* @experimental
12+
*/
1013
export abstract class ClientMessageBrokerFactory {
1114
/**
1215
* Initializes the given channel and attaches a new {@link ClientMessageBroker} to it.
@@ -32,6 +35,9 @@ export class ClientMessageBrokerFactory_ extends ClientMessageBrokerFactory {
3235
}
3336
}
3437

38+
/**
39+
* @experimental
40+
*/
3541
export abstract class ClientMessageBroker {
3642
abstract runOnService(args: UiArguments, returnType: Type): Promise<any>;
3743
}
@@ -148,10 +154,16 @@ class MessageData {
148154
}
149155
}
150156

157+
/**
158+
* @experimental
159+
*/
151160
export class FnArg {
152161
constructor(public value: any /** TODO #9100 */, public type: Type) {}
153162
}
154163

164+
/**
165+
* @experimental
166+
*/
155167
export class UiArguments {
156168
constructor(public method: string, public args?: FnArg[]) {}
157169
}

modules/@angular/platform-browser/src/web_workers/shared/message_bus.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {EventEmitter} from '../../facade/async';
88
* Communication is based on a channel abstraction. Messages published in a
99
* given channel to one MessageBusSink are received on the same channel
1010
* by the corresponding MessageBusSource.
11+
* @experimental
1112
*/
1213
export abstract class MessageBus implements MessageBusSource, MessageBusSink {
1314
/**
@@ -41,6 +42,9 @@ export abstract class MessageBus implements MessageBusSource, MessageBusSink {
4142
abstract to(channel: string): EventEmitter<any>;
4243
}
4344

45+
/**
46+
* @experimental
47+
*/
4448
export interface MessageBusSource {
4549
/**
4650
* Sets up a new channel on the MessageBusSource.
@@ -64,6 +68,9 @@ export interface MessageBusSource {
6468
from(channel: string): EventEmitter<any>;
6569
}
6670

71+
/**
72+
* @experimental
73+
*/
6774
export interface MessageBusSink {
6875
/**
6976
* Sets up a new channel on the MessageBusSink.

modules/@angular/platform-browser/src/web_workers/shared/serializer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import {LocationType} from './serialized_types';
1111

1212
// PRIMITIVE is any type that does not need to be serialized (string, number, boolean)
1313
// We set it to String so that it is considered a Type.
14+
/**
15+
* @experimental
16+
*/
1417
export const PRIMITIVE: Type = String;
1518

1619
@Injectable()

modules/@angular/platform-browser/src/web_workers/shared/service_message_broker.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ export class ServiceMessageBrokerFactory_ extends ServiceMessageBrokerFactory {
2929
}
3030
}
3131

32+
/**
33+
* @experimental
34+
*/
3235
export abstract class ServiceMessageBroker {
3336
abstract registerMethod(
3437
methodName: string, signature: Type[], method: Function, returnType?: Type): void;
@@ -88,6 +91,9 @@ export class ServiceMessageBroker_ extends ServiceMessageBroker {
8891
}
8992
}
9093

94+
/**
95+
* @experimental
96+
*/
9197
export class ReceivedMessage {
9298
method: string;
9399
args: any[];

modules/@angular/platform-browser/src/web_workers/ui/location_providers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {MessageBasedPlatformLocation} from './platform_location';
88
/**
99
* A list of {@link Provider}s. To use the router in a Worker enabled application you must
1010
* include these providers when setting up the render thread.
11+
* @experimental
1112
*/
1213
export const WORKER_UI_LOCATION_PROVIDERS = [
1314
MessageBasedPlatformLocation, BrowserPlatformLocation,

modules/@angular/platform-browser/src/web_workers/worker/location_providers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {WebWorkerPlatformLocation} from './platform_location';
77
/**
88
* Those providers should be added when the router is used in a worker context in addition to the
99
* {@link ROUTER_PROVIDERS} and after them.
10+
* @experimental
1011
*/
1112
export const WORKER_APP_LOCATION_PROVIDERS = [
1213
{provide: PlatformLocation, useClass: WebWorkerPlatformLocation}, {

modules/@angular/platform-browser/src/worker_app.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,15 @@ class PrintLogger {
2222

2323
const WORKER_APP_PLATFORM_MARKER = new OpaqueToken('WorkerAppPlatformMarker');
2424

25+
/**
26+
* @experimental
27+
*/
2528
export const WORKER_APP_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
2629
[PLATFORM_COMMON_PROVIDERS, {provide: WORKER_APP_PLATFORM_MARKER, useValue: true}];
2730

31+
/**
32+
* @experimental
33+
*/
2834
export const WORKER_APP_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
2935
APPLICATION_COMMON_PROVIDERS, FORM_PROVIDERS, BROWSER_SANITIZATION_PROVIDERS, Serializer,
3036
{provide: ClientMessageBrokerFactory, useClass: ClientMessageBrokerFactory_},
@@ -36,6 +42,9 @@ export const WORKER_APP_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any
3642
{provide: APP_INITIALIZER, useValue: setupWebWorker, multi: true}
3743
];
3844

45+
/**
46+
* @experimental
47+
*/
3948
export function workerAppPlatform(): PlatformRef {
4049
if (isBlank(getPlatform())) {
4150
createPlatform(ReflectiveInjector.resolveAndCreate(WORKER_APP_PLATFORM_PROVIDERS));

modules/@angular/platform-browser/src/worker_render.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const WORKER_RENDER_PLATFORM_MARKER = new OpaqueToken('WorkerRenderPlatformMarke
2929
/**
3030
* Wrapper class that exposes the Worker
3131
* and underlying {@link MessageBus} for lower level message passing.
32+
* @experimental
3233
*/
3334
@Injectable()
3435
export class WebWorkerInstance {
@@ -42,22 +43,32 @@ export class WebWorkerInstance {
4243
}
4344
}
4445

46+
/**
47+
* @experimental
48+
*/
4549
export const WORKER_SCRIPT: OpaqueToken = new OpaqueToken('WebWorkerScript');
4650

4751
/**
4852
* A multiple providers used to automatically call the `start()` method after the service is
4953
* created.
5054
*
5155
* TODO(vicb): create an interface for startable services to implement
56+
* @experimental
5257
*/
5358
export const WORKER_UI_STARTABLE_MESSAGING_SERVICE =
5459
new OpaqueToken('WorkerRenderStartableMsgService');
5560

61+
/**
62+
* * @experimental
63+
*/
5664
export const WORKER_UI_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
5765
PLATFORM_COMMON_PROVIDERS, {provide: WORKER_RENDER_PLATFORM_MARKER, useValue: true},
5866
{provide: PLATFORM_INITIALIZER, useValue: initWebWorkerRenderPlatform, multi: true}
5967
];
6068

69+
/**
70+
* * @experimental
71+
*/
6172
export const WORKER_UI_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
6273
APPLICATION_COMMON_PROVIDERS,
6374
MessageBasedRenderer,
@@ -108,6 +119,9 @@ function initWebWorkerRenderPlatform(): void {
108119
BrowserGetTestability.init();
109120
}
110121

122+
/**
123+
* * @experimental
124+
*/
111125
export function workerUiPlatform(): PlatformRef {
112126
if (isBlank(getPlatform())) {
113127
createPlatform(ReflectiveInjector.resolveAndCreate(WORKER_UI_PLATFORM_PROVIDERS));

0 commit comments

Comments
 (0)