From 71ae2c4525dbe2daf43028074d9904c14924c9ab Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 30 Aug 2016 11:15:25 -0700 Subject: [PATCH] refactor(webworkers): move webworkers to separate @angular/platform-webworker and @angular/platform-webworker-dynamic packages BREAKING CHANGE: web worker platform is now exported via separate packages. Please use @angular/platform-webworker and @angular/platform-webworker-dynamic --- build.sh | 2 + gulpfile.js | 2 + modules/@angular/http/src/package.json | 15 --- .../src/platform-browser-dynamic.ts | 33 +---- .../src/private_export.ts | 8 +- .../@angular/platform-browser/package.json | 3 +- .../location/browser_platform_location.ts | 3 - .../platform-browser/src/platform-browser.ts | 13 +- .../platform-browser/src/private_export.ts | 56 +++++--- .../src/private_import_core.ts | 3 + .../@angular/platform-server/src/server.ts | 1 + .../platform-webworker-dynamic/index.ts | 16 +++ .../platform-webworker-dynamic/package.json | 20 +++ .../rollup.config.js | 17 +++ .../platform-webworker-dynamic/src/facade | 1 + .../src/platform-webworker-dynamic.ts | 22 +++ .../src/private_import_core.ts | 13 ++ ...private_import_platform-browser-dynamic.ts | 11 ++ .../src/private_import_platform-browser.ts | 13 ++ .../platform-webworker-dynamic/tsconfig.json | 29 ++++ modules/@angular/platform-webworker/index.ts | 16 +++ .../@angular/platform-webworker/package.json | 18 +++ .../platform-webworker/rollup.config.js | 16 +++ .../@angular/platform-webworker/src/facade | 1 + .../src/platform-webworker.ts | 36 +++++ .../src/private_import_core.ts | 40 ++++++ .../src/private_import_platform-browser.ts | 26 ++++ .../src/web_workers/shared/api.ts | 0 .../shared/client_message_broker.ts | 0 .../src/web_workers/shared/message_bus.ts | 0 .../src/web_workers/shared/messaging_api.ts | 0 .../web_workers/shared/post_message_bus.ts | 0 .../src/web_workers/shared/render_store.ts | 0 .../web_workers/shared/serialized_types.ts | 0 .../src/web_workers/shared/serializer.ts | 1 - .../shared/service_message_broker.ts | 0 .../src/web_workers/ui/event_dispatcher.ts | 0 .../src/web_workers/ui/event_serializer.ts | 0 .../src/web_workers/ui/location_providers.ts | 7 +- .../src/web_workers/ui/platform_location.ts | 2 +- .../src/web_workers/ui/renderer.ts | 0 .../web_workers/worker/event_deserializer.ts | 0 .../web_workers/worker/location_providers.ts | 0 .../web_workers/worker/platform_location.ts | 0 .../src/web_workers/worker/renderer.ts | 0 .../src/web_workers/worker/worker_adapter.ts | 4 +- .../src/worker_app.ts | 21 +-- .../src/worker_render.ts | 19 +-- .../web_workers/shared/message_bus_spec.ts | 2 +- .../web_workers/shared/message_bus_util.ts | 4 +- .../web_workers/shared/mock_event_emitter.ts | 0 .../web_workers/shared/render_store_spec.ts | 3 +- .../shared/service_message_broker_spec.ts | 10 +- .../shared/web_worker_test_util.ts | 4 +- .../worker/platform_location_spec.ts | 8 +- .../worker/renderer_integration_spec.ts | 14 +- .../test/web_workers/worker/spies.ts | 2 +- .../@angular/platform-webworker/tsconfig.json | 29 ++++ modules/playground/src/bootstrap.ts | 6 + .../web_workers/images/background_index.ts | 6 +- .../src/web_workers/images/index.ts | 2 +- .../src/web_workers/images/loader.js | 2 + .../src/web_workers/input/background_index.ts | 4 +- .../playground/src/web_workers/input/index.ts | 2 +- .../src/web_workers/input/loader.js | 2 + .../kitchen_sink/background_index.ts | 4 +- .../src/web_workers/kitchen_sink/index.ts | 2 +- .../src/web_workers/kitchen_sink/loader.js | 2 + .../message_broker/background_index.ts | 4 +- .../src/web_workers/message_broker/index.ts | 4 +- .../message_broker/index_common.ts | 2 +- .../src/web_workers/message_broker/loader.js | 2 + .../web_workers/router/background_index.ts | 2 +- .../src/web_workers/router/index.ts | 3 +- .../src/web_workers/router/index_common.ts | 5 +- .../src/web_workers/router/loader.js | 2 + .../src/web_workers/todo/background_index.ts | 4 +- .../playground/src/web_workers/todo/index.ts | 2 +- .../playground/src/web_workers/todo/loader.js | 2 + test-main.js | 8 ++ .../platform-browser-dynamic/index.d.ts | 6 - .../platform-browser/index.d.ts | 126 ------------------ .../platform-webworker-dynamic/index.d.ts | 2 + .../platform-webworker/index.d.ts | 96 +++++++++++++ 84 files changed, 561 insertions(+), 305 deletions(-) delete mode 100644 modules/@angular/http/src/package.json create mode 100644 modules/@angular/platform-webworker-dynamic/index.ts create mode 100644 modules/@angular/platform-webworker-dynamic/package.json create mode 100644 modules/@angular/platform-webworker-dynamic/rollup.config.js create mode 120000 modules/@angular/platform-webworker-dynamic/src/facade create mode 100644 modules/@angular/platform-webworker-dynamic/src/platform-webworker-dynamic.ts create mode 100644 modules/@angular/platform-webworker-dynamic/src/private_import_core.ts create mode 100644 modules/@angular/platform-webworker-dynamic/src/private_import_platform-browser-dynamic.ts create mode 100644 modules/@angular/platform-webworker-dynamic/src/private_import_platform-browser.ts create mode 100644 modules/@angular/platform-webworker-dynamic/tsconfig.json create mode 100644 modules/@angular/platform-webworker/index.ts create mode 100644 modules/@angular/platform-webworker/package.json create mode 100644 modules/@angular/platform-webworker/rollup.config.js create mode 120000 modules/@angular/platform-webworker/src/facade create mode 100644 modules/@angular/platform-webworker/src/platform-webworker.ts create mode 100644 modules/@angular/platform-webworker/src/private_import_core.ts create mode 100644 modules/@angular/platform-webworker/src/private_import_platform-browser.ts rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/shared/api.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/shared/client_message_broker.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/shared/message_bus.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/shared/messaging_api.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/shared/post_message_bus.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/shared/render_store.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/shared/serialized_types.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/shared/serializer.ts (97%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/shared/service_message_broker.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/ui/event_dispatcher.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/ui/event_serializer.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/ui/location_providers.ts (78%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/ui/platform_location.ts (96%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/ui/renderer.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/worker/event_deserializer.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/worker/location_providers.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/worker/platform_location.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/worker/renderer.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/src/web_workers/worker/worker_adapter.ts (99%) rename modules/@angular/{platform-browser => platform-webworker}/src/worker_app.ts (90%) rename modules/@angular/{platform-browser => platform-webworker}/src/worker_render.ts (85%) rename modules/@angular/{platform-browser => platform-webworker}/test/web_workers/shared/message_bus_spec.ts (98%) rename modules/@angular/{platform-browser => platform-webworker}/test/web_workers/shared/message_bus_util.ts (85%) rename modules/@angular/{platform-browser => platform-webworker}/test/web_workers/shared/mock_event_emitter.ts (100%) rename modules/@angular/{platform-browser => platform-webworker}/test/web_workers/shared/render_store_spec.ts (81%) rename modules/@angular/{platform-browser => platform-webworker}/test/web_workers/shared/service_message_broker_spec.ts (83%) rename modules/@angular/{platform-browser => platform-webworker}/test/web_workers/shared/web_worker_test_util.ts (97%) rename modules/@angular/{platform-browser => platform-webworker}/test/web_workers/worker/platform_location_spec.ts (89%) rename modules/@angular/{platform-browser => platform-webworker}/test/web_workers/worker/renderer_integration_spec.ts (92%) rename modules/@angular/{platform-browser => platform-webworker}/test/web_workers/worker/spies.ts (77%) create mode 100644 modules/@angular/platform-webworker/tsconfig.json create mode 100644 tools/public_api_guard/platform-webworker-dynamic/index.d.ts create mode 100644 tools/public_api_guard/platform-webworker/index.d.ts diff --git a/build.sh b/build.sh index 6ac5fcfa31..a6c78bb385 100755 --- a/build.sh +++ b/build.sh @@ -64,6 +64,8 @@ for PACKAGE in \ platform-browser \ platform-browser-dynamic \ platform-server \ + platform-webworker \ + platform-webworker-dynamic \ http \ router \ upgrade \ diff --git a/gulpfile.js b/gulpfile.js index cec7181c79..477446f430 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -42,6 +42,8 @@ const entrypoints = [ 'dist/packages-dist/platform-browser/testing/index.d.ts', 'dist/packages-dist/platform-browser-dynamic/index.d.ts', 'dist/packages-dist/platform-browser-dynamic/testing/index.d.ts', + 'dist/packages-dist/platform-webworker/index.d.ts', + 'dist/packages-dist/platform-webworker-dynamic/index.d.ts', 'dist/packages-dist/platform-server/index.d.ts', 'dist/packages-dist/platform-server/testing/index.d.ts', 'dist/packages-dist/http/index.d.ts', diff --git a/modules/@angular/http/src/package.json b/modules/@angular/http/src/package.json deleted file mode 100644 index 1288378fc8..0000000000 --- a/modules/@angular/http/src/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "ngHttp", - "version": "<%= packageJson.version %>", - "description": "Http module for Angular 2", - "homepage": "<%= packageJson.homepage %>", - "bugs": "<%= packageJson.bugs %>", - "contributors": <%= JSON.stringify(packageJson.contributors) %>, - "license": "<%= packageJson.license %>", - "repository": <%= JSON.stringify(packageJson.repository) %>, - "devDependencies": <%= JSON.stringify(packageJson.defaultDevDependencies) %>, - "peerDependencies": { - "@angular/core": "<%= packageJson.version %>", - "rxjs": "<%= packageJson.dependencies['rxjs'] %>" - } -} diff --git a/modules/@angular/platform-browser-dynamic/src/platform-browser-dynamic.ts b/modules/@angular/platform-browser-dynamic/src/platform-browser-dynamic.ts index 9a882c9d54..69950907b0 100644 --- a/modules/@angular/platform-browser-dynamic/src/platform-browser-dynamic.ts +++ b/modules/@angular/platform-browser-dynamic/src/platform-browser-dynamic.ts @@ -7,13 +7,11 @@ */ import {ResourceLoader, platformCoreDynamic} from '@angular/compiler'; -import {ApplicationRef, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ClassProvider, CompilerFactory, CompilerOptions, ComponentRef, ExistingProvider, FactoryProvider, NgModule, PlatformRef, Provider, Type, TypeProvider, ValueProvider, createPlatformFactory} from '@angular/core'; -import {BrowserModule, WORKER_SCRIPT, WorkerAppModule, platformWorkerUi} from '@angular/platform-browser'; +import {ClassProvider, ExistingProvider, FactoryProvider, PlatformRef, Provider, TypeProvider, ValueProvider, createPlatformFactory} from '@angular/core'; import {INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS} from './platform_providers'; import {Console} from './private_import_core'; import {CachedResourceLoader} from './resource_loader/resource_loader_cache'; -import {ResourceLoaderImpl} from './resource_loader/resource_loader_impl'; export * from './private_export'; @@ -28,32 +26,3 @@ export const RESOURCE_CACHE_PROVIDER: Provider[] = */ export const platformBrowserDynamic = createPlatformFactory( platformCoreDynamic, 'browserDynamic', INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS); - -/** - * Bootstraps the worker ui. - * - * @experimental - */ -export function bootstrapWorkerUi( - workerScriptUri: string, customProviders: Provider[] = []): Promise { - // For now, just creates the worker ui platform... - return Promise.resolve(platformWorkerUi(([{ - provide: WORKER_SCRIPT, - useValue: workerScriptUri, - }] as Provider[]) - .concat(customProviders))); -} - -/** - * @experimental API related to bootstrapping are still under review. - */ -export const platformWorkerAppDynamic = createPlatformFactory( - platformCoreDynamic, 'workerAppDynamic', [{ - provide: COMPILER_OPTIONS, - useValue: {providers: [{provide: ResourceLoader, useClass: ResourceLoaderImpl}]}, - multi: true - }]); - -function normalizeArray(arr: any[]): any[] { - return arr ? arr : []; -} diff --git a/modules/@angular/platform-browser-dynamic/src/private_export.ts b/modules/@angular/platform-browser-dynamic/src/private_export.ts index 561e481536..712b0fd73a 100644 --- a/modules/@angular/platform-browser-dynamic/src/private_export.ts +++ b/modules/@angular/platform-browser-dynamic/src/private_export.ts @@ -7,9 +7,13 @@ */ import {ClassProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ValueProvider} from '@angular/core'; import {INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS} from './platform_providers'; +import * as resource_loader from './resource_loader/resource_loader_impl'; export var __platform_browser_dynamic_private__: { - INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: typeof INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS; + INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: typeof INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, + _ResourceLoaderImpl?: resource_loader.ResourceLoaderImpl, + ResourceLoaderImpl: typeof resource_loader.ResourceLoaderImpl } = { - INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS + INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, + ResourceLoaderImpl: resource_loader.ResourceLoaderImpl }; diff --git a/modules/@angular/platform-browser/package.json b/modules/@angular/platform-browser/package.json index 87f2c29999..9fdeb455b2 100644 --- a/modules/@angular/platform-browser/package.json +++ b/modules/@angular/platform-browser/package.json @@ -9,8 +9,7 @@ "license": "MIT", "peerDependencies": { "@angular/core": "0.0.0-PLACEHOLDER", - "@angular/common": "0.0.0-PLACEHOLDER", - "@angular/compiler": "0.0.0-PLACEHOLDER" + "@angular/common": "0.0.0-PLACEHOLDER" }, "repository": { "type": "git", diff --git a/modules/@angular/platform-browser/src/browser/location/browser_platform_location.ts b/modules/@angular/platform-browser/src/browser/location/browser_platform_location.ts index 62ecd061ca..5766f230b8 100644 --- a/modules/@angular/platform-browser/src/browser/location/browser_platform_location.ts +++ b/modules/@angular/platform-browser/src/browser/location/browser_platform_location.ts @@ -20,8 +20,6 @@ import {supportsState} from './history'; * `PlatformLocation` encapsulates all of the direct calls to platform APIs. * This class should not be used directly by an application developer. Instead, use * {@link Location}. - * - * @stable */ @Injectable() export class BrowserPlatformLocation extends PlatformLocation { @@ -40,7 +38,6 @@ export class BrowserPlatformLocation extends PlatformLocation { this._history = getDOM().getHistory(); } - /** @internal */ get location(): Location { return this._location; } getBaseHrefFromDOM(): string { return getDOM().getBaseHref(); } diff --git a/modules/@angular/platform-browser/src/platform-browser.ts b/modules/@angular/platform-browser/src/platform-browser.ts index 752772f501..047f01be6b 100644 --- a/modules/@angular/platform-browser/src/platform-browser.ts +++ b/modules/@angular/platform-browser/src/platform-browser.ts @@ -7,25 +7,14 @@ */ export {BrowserModule, platformBrowser} from './browser'; -export {BrowserPlatformLocation} from './browser/location/browser_platform_location'; export {Title} from './browser/title'; export {disableDebugTools, enableDebugTools} from './browser/tools/tools'; export {AnimationDriver} from './dom/animation_driver'; export {By} from './dom/debug/by'; +export {NgProbeToken} from './dom/debug/ng_probe'; export {DOCUMENT} from './dom/dom_tokens'; export {EVENT_MANAGER_PLUGINS, EventManager} from './dom/events/event_manager'; export {HAMMER_GESTURE_CONFIG, HammerGestureConfig} from './dom/events/hammer_gestures'; export {DomSanitizer, SafeHtml, SafeResourceUrl, SafeScript, SafeStyle, SafeUrl} from './security/dom_sanitization_service'; -// Web Workers -export {ClientMessageBroker, ClientMessageBrokerFactory, FnArg, UiArguments} from './web_workers/shared/client_message_broker'; -export {PRIMITIVE} from './web_workers/shared/serializer'; -export {ReceivedMessage, ServiceMessageBroker, ServiceMessageBrokerFactory} from './web_workers/shared/service_message_broker'; -export * from './web_workers/shared/message_bus'; -export {WORKER_APP_LOCATION_PROVIDERS} from './web_workers/worker/location_providers'; -export {WORKER_UI_LOCATION_PROVIDERS} from './web_workers/ui/location_providers'; - -export {NgProbeToken} from './dom/debug/ng_probe'; -export {platformWorkerUi, WebWorkerInstance, WORKER_SCRIPT, WORKER_UI_STARTABLE_MESSAGING_SERVICE} from './worker_render'; -export {platformWorkerApp, WorkerAppModule} from './worker_app'; export * from './private_export'; diff --git a/modules/@angular/platform-browser/src/private_export.ts b/modules/@angular/platform-browser/src/private_export.ts index e88073203e..f555fbad7a 100644 --- a/modules/@angular/platform-browser/src/private_export.ts +++ b/modules/@angular/platform-browser/src/private_export.ts @@ -9,40 +9,62 @@ import {ClassProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider import * as browser from './browser'; import * as browserDomAdapter from './browser/browser_adapter'; +import * as location from './browser/location/browser_platform_location'; +import * as testability from './browser/testability'; import * as ng_probe from './dom/debug/ng_probe'; import * as dom_adapter from './dom/dom_adapter'; import * as dom_renderer from './dom/dom_renderer'; import * as dom_events from './dom/events/dom_events'; +import * as hammer_gesture from './dom/events/hammer_gestures'; +import * as key_events from './dom/events/key_events'; import * as shared_styles_host from './dom/shared_styles_host'; + + export var __platform_browser_private__: { - _DomAdapter?: typeof dom_adapter.DomAdapter; DomAdapter: typeof dom_adapter.DomAdapter; - _BrowserDomAdapter?: typeof browserDomAdapter.BrowserDomAdapter; - BrowserDomAdapter: typeof browserDomAdapter.BrowserDomAdapter; - getDOM: typeof dom_adapter.getDOM; - setRootDomAdapter: typeof dom_adapter.setRootDomAdapter; - _DomRootRenderer_?: typeof dom_renderer.DomRootRenderer; - DomRootRenderer_: typeof dom_renderer.DomRootRenderer_; - _DomSharedStylesHost?: typeof shared_styles_host.DomSharedStylesHost; - DomSharedStylesHost: typeof shared_styles_host.DomSharedStylesHost; - _SharedStylesHost?: typeof shared_styles_host.SharedStylesHost; - SharedStylesHost: typeof shared_styles_host.SharedStylesHost; - ELEMENT_PROBE_PROVIDERS: typeof ng_probe.ELEMENT_PROBE_PROVIDERS; - _DomEventsPlugin?: typeof dom_events.DomEventsPlugin; - DomEventsPlugin: typeof dom_events.DomEventsPlugin; - _initDomAdapter?: typeof browser.initDomAdapter, + _BrowserPlatformLocation?: location.BrowserPlatformLocation, + BrowserPlatformLocation: typeof location.BrowserPlatformLocation, + _DomAdapter?: dom_adapter.DomAdapter, + DomAdapter: typeof dom_adapter.DomAdapter, + _BrowserDomAdapter?: browserDomAdapter.BrowserDomAdapter, + BrowserDomAdapter: typeof browserDomAdapter.BrowserDomAdapter, + _BrowserGetTestability?: testability.BrowserGetTestability, + BrowserGetTestability: typeof testability.BrowserGetTestability, + getDOM: typeof dom_adapter.getDOM, + setRootDomAdapter: typeof dom_adapter.setRootDomAdapter, + _DomRootRenderer?: dom_renderer.DomRootRenderer, + DomRootRenderer: typeof dom_renderer.DomRootRenderer, + _DomRootRenderer_?: dom_renderer.DomRootRenderer, + DomRootRenderer_: typeof dom_renderer.DomRootRenderer_, + _DomSharedStylesHost?: shared_styles_host.DomSharedStylesHost, + DomSharedStylesHost: typeof shared_styles_host.DomSharedStylesHost, + _SharedStylesHost?: shared_styles_host.SharedStylesHost, + SharedStylesHost: typeof shared_styles_host.SharedStylesHost, + ELEMENT_PROBE_PROVIDERS: typeof ng_probe.ELEMENT_PROBE_PROVIDERS, + _DomEventsPlugin?: dom_events.DomEventsPlugin, + DomEventsPlugin: typeof dom_events.DomEventsPlugin, _KeyEventsPlugin?: key_events.KeyEventsPlugin, + KeyEventsPlugin: typeof key_events.KeyEventsPlugin, + _HammerGesturesPlugin?: hammer_gesture.HammerGesturesPlugin, + HammerGesturesPlugin: typeof hammer_gesture.HammerGesturesPlugin, initDomAdapter: typeof browser.initDomAdapter, - INTERNAL_BROWSER_PLATFORM_PROVIDERS: typeof browser.INTERNAL_BROWSER_PLATFORM_PROVIDERS; + INTERNAL_BROWSER_PLATFORM_PROVIDERS: typeof browser.INTERNAL_BROWSER_PLATFORM_PROVIDERS, + BROWSER_SANITIZATION_PROVIDERS: typeof browser.BROWSER_SANITIZATION_PROVIDERS } = { + BrowserPlatformLocation: location.BrowserPlatformLocation, DomAdapter: dom_adapter.DomAdapter, BrowserDomAdapter: browserDomAdapter.BrowserDomAdapter, + BrowserGetTestability: testability.BrowserGetTestability, getDOM: dom_adapter.getDOM, setRootDomAdapter: dom_adapter.setRootDomAdapter, DomRootRenderer_: dom_renderer.DomRootRenderer_, + DomRootRenderer: dom_renderer.DomRootRenderer, DomSharedStylesHost: shared_styles_host.DomSharedStylesHost, SharedStylesHost: shared_styles_host.SharedStylesHost, ELEMENT_PROBE_PROVIDERS: ng_probe.ELEMENT_PROBE_PROVIDERS, DomEventsPlugin: dom_events.DomEventsPlugin, + KeyEventsPlugin: key_events.KeyEventsPlugin, + HammerGesturesPlugin: hammer_gesture.HammerGesturesPlugin, initDomAdapter: browser.initDomAdapter, - INTERNAL_BROWSER_PLATFORM_PROVIDERS: browser.INTERNAL_BROWSER_PLATFORM_PROVIDERS + INTERNAL_BROWSER_PLATFORM_PROVIDERS: browser.INTERNAL_BROWSER_PLATFORM_PROVIDERS, + BROWSER_SANITIZATION_PROVIDERS: browser.BROWSER_SANITIZATION_PROVIDERS }; diff --git a/modules/@angular/platform-browser/src/private_import_core.ts b/modules/@angular/platform-browser/src/private_import_core.ts index 8bdf1e573e..9bd81b4360 100644 --- a/modules/@angular/platform-browser/src/private_import_core.ts +++ b/modules/@angular/platform-browser/src/private_import_core.ts @@ -10,12 +10,15 @@ import {__core_private__ as r} from '@angular/core'; export type RenderDebugInfo = typeof r._RenderDebugInfo; export var RenderDebugInfo: typeof r.RenderDebugInfo = r.RenderDebugInfo; + export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities; export var VIEW_ENCAPSULATION_VALUES: typeof r.VIEW_ENCAPSULATION_VALUES = r.VIEW_ENCAPSULATION_VALUES; + export type DebugDomRootRenderer = typeof r._DebugDomRootRenderer; export var DebugDomRootRenderer: typeof r.DebugDomRootRenderer = r.DebugDomRootRenderer; export var reflector: typeof r.reflector = r.reflector; + export type NoOpAnimationPlayer = typeof r._NoOpAnimationPlayer; export var NoOpAnimationPlayer: typeof r.NoOpAnimationPlayer = r.NoOpAnimationPlayer; export type AnimationPlayer = typeof r._AnimationPlayer; diff --git a/modules/@angular/platform-server/src/server.ts b/modules/@angular/platform-server/src/server.ts index 12fea48505..e351ad5c70 100644 --- a/modules/@angular/platform-server/src/server.ts +++ b/modules/@angular/platform-server/src/server.ts @@ -10,6 +10,7 @@ import {PlatformLocation} from '@angular/common'; import {platformCoreDynamic} from '@angular/compiler'; import {ClassProvider, ExistingProvider, FactoryProvider, NgModule, PLATFORM_INITIALIZER, PlatformRef, Provider, TypeProvider, ValueProvider, createPlatformFactory, platformCore} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; + import {Parse5DomAdapter} from './parse5_adapter'; function notSupported(feature: string): Error { diff --git a/modules/@angular/platform-webworker-dynamic/index.ts b/modules/@angular/platform-webworker-dynamic/index.ts new file mode 100644 index 0000000000..d470e489e3 --- /dev/null +++ b/modules/@angular/platform-webworker-dynamic/index.ts @@ -0,0 +1,16 @@ +/** + * @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 + */ + +/** + * @module + * @description + * Entry point for all public APIs of the platform-browser-dynamic package. + */ +export * from './src/platform-webworker-dynamic'; + +// This file only reexports content of the `src` folder. Keep it that way. diff --git a/modules/@angular/platform-webworker-dynamic/package.json b/modules/@angular/platform-webworker-dynamic/package.json new file mode 100644 index 0000000000..6d11ae695c --- /dev/null +++ b/modules/@angular/platform-webworker-dynamic/package.json @@ -0,0 +1,20 @@ +{ + "name": "@angular/platform-webworker-dynamic", + "version": "0.0.0-PLACEHOLDER", + "description": "Angular 2 platform-webworker-dynamic", + "main": "bundles/platform-webworker-dynamic.umd.js", + "module": "index.js", + "typings": "index.d.ts", + "author": "angular", + "license": "MIT", + "peerDependencies": { + "@angular/core": "0.0.0-PLACEHOLDER", + "@angular/compiler": "0.0.0-PLACEHOLDER", + "@angular/platform-browser": "0.0.0-PLACEHOLDER", + "@angular/platform-webworker": "0.0.0-PLACEHOLDER" + }, + "repository": { + "type": "git", + "url": "https://github.com/angular/angular.git" + } +} diff --git a/modules/@angular/platform-webworker-dynamic/rollup.config.js b/modules/@angular/platform-webworker-dynamic/rollup.config.js new file mode 100644 index 0000000000..9f7839a3b3 --- /dev/null +++ b/modules/@angular/platform-webworker-dynamic/rollup.config.js @@ -0,0 +1,17 @@ +export default { + entry: '../../../dist/packages-dist/platform-webworker-dynamic/index.js', + dest: '../../../dist/packages-dist/platform-webworker-dynamic/bundles/platform-webworker-dynamic.umd.js', + format: 'umd', + moduleName: 'ng.platformWebworkerDynamic', + globals: { + '@angular/core': 'ng.core', + '@angular/common': 'ng.common', + '@angular/compiler': 'ng.compiler', + '@angular/platform-browser': 'ng.platformBrowser', + '@angular/platform-webworker': 'ng.platformWebworker', + 'rxjs/Subject': 'Rx', + 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. + 'rxjs/operator/toPromise': 'Rx.Observable.prototype', + 'rxjs/Observable': 'Rx' + } +} diff --git a/modules/@angular/platform-webworker-dynamic/src/facade b/modules/@angular/platform-webworker-dynamic/src/facade new file mode 120000 index 0000000000..e084c803c6 --- /dev/null +++ b/modules/@angular/platform-webworker-dynamic/src/facade @@ -0,0 +1 @@ +../../facade/src \ No newline at end of file diff --git a/modules/@angular/platform-webworker-dynamic/src/platform-webworker-dynamic.ts b/modules/@angular/platform-webworker-dynamic/src/platform-webworker-dynamic.ts new file mode 100644 index 0000000000..d7cecba930 --- /dev/null +++ b/modules/@angular/platform-webworker-dynamic/src/platform-webworker-dynamic.ts @@ -0,0 +1,22 @@ +/** + * @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 {ResourceLoader, platformCoreDynamic} from '@angular/compiler'; +import {COMPILER_OPTIONS, ClassProvider, ExistingProvider, FactoryProvider, PlatformRef, Provider, TypeProvider, ValueProvider, createPlatformFactory} from '@angular/core'; +import {ResourceLoaderImpl} from './private_import_platform-browser-dynamic'; + + +/** + * @experimental API related to bootstrapping are still under review. + */ +export const platformWorkerAppDynamic = createPlatformFactory( + platformCoreDynamic, 'workerAppDynamic', [{ + provide: COMPILER_OPTIONS, + useValue: {providers: [{provide: ResourceLoader, useClass: ResourceLoaderImpl}]}, + multi: true + }]); diff --git a/modules/@angular/platform-webworker-dynamic/src/private_import_core.ts b/modules/@angular/platform-webworker-dynamic/src/private_import_core.ts new file mode 100644 index 0000000000..c6560ea960 --- /dev/null +++ b/modules/@angular/platform-webworker-dynamic/src/private_import_core.ts @@ -0,0 +1,13 @@ +/** + * @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 {__core_private__ as r} from '@angular/core'; + +export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities; +export var reflector: typeof r.reflector = r.reflector; +export var Console: typeof r.Console = r.Console; diff --git a/modules/@angular/platform-webworker-dynamic/src/private_import_platform-browser-dynamic.ts b/modules/@angular/platform-webworker-dynamic/src/private_import_platform-browser-dynamic.ts new file mode 100644 index 0000000000..22076a1098 --- /dev/null +++ b/modules/@angular/platform-webworker-dynamic/src/private_import_platform-browser-dynamic.ts @@ -0,0 +1,11 @@ +/** + * @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_browser_dynamic_private__ as _} from '@angular/platform-browser-dynamic'; + +export var ResourceLoaderImpl: typeof _.ResourceLoaderImpl = _.ResourceLoaderImpl; diff --git a/modules/@angular/platform-webworker-dynamic/src/private_import_platform-browser.ts b/modules/@angular/platform-webworker-dynamic/src/private_import_platform-browser.ts new file mode 100644 index 0000000000..3a1c7a5265 --- /dev/null +++ b/modules/@angular/platform-webworker-dynamic/src/private_import_platform-browser.ts @@ -0,0 +1,13 @@ +/** + * @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_browser_private__ as _} from '@angular/platform-browser'; + +export var INTERNAL_BROWSER_PLATFORM_PROVIDERS: typeof _.INTERNAL_BROWSER_PLATFORM_PROVIDERS = + _.INTERNAL_BROWSER_PLATFORM_PROVIDERS; +export var getDOM: typeof _.getDOM = _.getDOM; diff --git a/modules/@angular/platform-webworker-dynamic/tsconfig.json b/modules/@angular/platform-webworker-dynamic/tsconfig.json new file mode 100644 index 0000000000..2e70a54865 --- /dev/null +++ b/modules/@angular/platform-webworker-dynamic/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "declaration": true, + "stripInternal": true, + "experimentalDecorators": true, + "module": "es2015", + "moduleResolution": "node", + "outDir": "../../../dist/packages-dist/platform-webworker-dynamic", + "paths": { + "@angular/core": ["../../../dist/packages-dist/core"], + "@angular/common": ["../../../dist/packages-dist/common"], + "@angular/compiler": ["../../../dist/packages-dist/compiler"], + "@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"], + "@angular/platform-browser-dynamic": ["../../../dist/packages-dist/platform-browser-dynamic"], + "@angular/platform-webworker": ["../../../dist/packages-dist/platform-webworker"] + }, + "rootDir": ".", + "sourceMap": true, + "inlineSources": true, + "target": "es5", + "skipLibCheck": true, + "lib": ["es2015", "dom"] + }, + "files": [ + "index.ts", + "../../../node_modules/zone.js/dist/zone.js.d.ts" + ] +} diff --git a/modules/@angular/platform-webworker/index.ts b/modules/@angular/platform-webworker/index.ts new file mode 100644 index 0000000000..398b8da2bd --- /dev/null +++ b/modules/@angular/platform-webworker/index.ts @@ -0,0 +1,16 @@ +/** + * @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 + */ + +/** + * @module + * @description + * Entry point for all public APIs of the platform-webworker package. + */ +export * from './src/platform-webworker'; + +// This file only reexports content of the `src` folder. Keep it that way. diff --git a/modules/@angular/platform-webworker/package.json b/modules/@angular/platform-webworker/package.json new file mode 100644 index 0000000000..5ff8dd2773 --- /dev/null +++ b/modules/@angular/platform-webworker/package.json @@ -0,0 +1,18 @@ +{ + "name": "@angular/platform-webworker", + "version": "0.0.0-PLACEHOLDER", + "description": "Angular 2 platform-webworker", + "main": "bundles/platform-webworker.umd.js", + "module": "index.js", + "typings": "index.d.ts", + "author": "angular", + "license": "MIT", + "peerDependencies": { + "@angular/core": "0.0.0-PLACEHOLDER", + "@angular/platform-browser": "0.0.0-PLACEHOLDER", + }, + "repository": { + "type": "git", + "url": "https://github.com/angular/angular.git" + } +} diff --git a/modules/@angular/platform-webworker/rollup.config.js b/modules/@angular/platform-webworker/rollup.config.js new file mode 100644 index 0000000000..7b76392be7 --- /dev/null +++ b/modules/@angular/platform-webworker/rollup.config.js @@ -0,0 +1,16 @@ + +export default { + entry: '../../../dist/packages-dist/platform-webworker/index.js', + dest: '../../../dist/packages-dist/platform-webworker/bundles/platform-webworker.umd.js', + format: 'umd', + moduleName: 'ng.platformWebworker', + globals: { + '@angular/core': 'ng.core', + '@angular/common': 'ng.common', + '@angular/platform-browser': 'ng.platformBrowser', + 'rxjs/Subject': 'Rx', + 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. + 'rxjs/operator/toPromise': 'Rx.Observable.prototype', + 'rxjs/Observable': 'Rx' + } +} diff --git a/modules/@angular/platform-webworker/src/facade b/modules/@angular/platform-webworker/src/facade new file mode 120000 index 0000000000..e084c803c6 --- /dev/null +++ b/modules/@angular/platform-webworker/src/facade @@ -0,0 +1 @@ +../../facade/src \ No newline at end of file diff --git a/modules/@angular/platform-webworker/src/platform-webworker.ts b/modules/@angular/platform-webworker/src/platform-webworker.ts new file mode 100644 index 0000000000..3b69848572 --- /dev/null +++ b/modules/@angular/platform-webworker/src/platform-webworker.ts @@ -0,0 +1,36 @@ +/** + * @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 {PlatformRef, Provider} from '@angular/core'; + +import {WORKER_SCRIPT, platformWorkerUi} from './worker_render'; + +export {ClientMessageBroker, ClientMessageBrokerFactory, FnArg, UiArguments} from './web_workers/shared/client_message_broker'; +export {MessageBus, MessageBusSink, MessageBusSource} from './web_workers/shared/message_bus'; +export {PRIMITIVE} from './web_workers/shared/serializer'; +export {ReceivedMessage, ServiceMessageBroker, ServiceMessageBrokerFactory} from './web_workers/shared/service_message_broker'; +export {WORKER_UI_LOCATION_PROVIDERS} from './web_workers/ui/location_providers'; +export {WORKER_APP_LOCATION_PROVIDERS} from './web_workers/worker/location_providers'; +export {WorkerAppModule, platformWorkerApp} from './worker_app'; +export {platformWorkerUi} from './worker_render'; + + +/** + * Bootstraps the worker ui. + * + * @experimental + */ +export function bootstrapWorkerUi( + workerScriptUri: string, customProviders: Provider[] = []): Promise { + // For now, just creates the worker ui platform... + return Promise.resolve(platformWorkerUi(([{ + provide: WORKER_SCRIPT, + useValue: workerScriptUri, + }] as Provider[]) + .concat(customProviders))); +} diff --git a/modules/@angular/platform-webworker/src/private_import_core.ts b/modules/@angular/platform-webworker/src/private_import_core.ts new file mode 100644 index 0000000000..48a3322b5d --- /dev/null +++ b/modules/@angular/platform-webworker/src/private_import_core.ts @@ -0,0 +1,40 @@ +/** + * @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 {__core_private__ as r} from '@angular/core'; + +export type RenderDebugInfo = typeof r._RenderDebugInfo; +export var RenderDebugInfo: typeof r.RenderDebugInfo = r.RenderDebugInfo; + +export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities; + +export var VIEW_ENCAPSULATION_VALUES: typeof r.VIEW_ENCAPSULATION_VALUES = + r.VIEW_ENCAPSULATION_VALUES; + +export type DebugDomRootRenderer = typeof r._DebugDomRootRenderer; +export var DebugDomRootRenderer: typeof r.DebugDomRootRenderer = r.DebugDomRootRenderer; +export var reflector: typeof r.reflector = r.reflector; + +export type NoOpAnimationPlayer = typeof r._NoOpAnimationPlayer; +export var NoOpAnimationPlayer: typeof r.NoOpAnimationPlayer = r.NoOpAnimationPlayer; +export type AnimationPlayer = typeof r._AnimationPlayer; +export var AnimationPlayer: typeof r.AnimationPlayer = r.AnimationPlayer; +export type AnimationSequencePlayer = typeof r._AnimationSequencePlayer; +export var AnimationSequencePlayer: typeof r.AnimationSequencePlayer = r.AnimationSequencePlayer; +export type AnimationGroupPlayer = typeof r._AnimationGroupPlayer; +export var AnimationGroupPlayer: typeof r.AnimationGroupPlayer = r.AnimationGroupPlayer; +export type AnimationKeyframe = typeof r._AnimationKeyframe; +export var AnimationKeyframe: typeof r.AnimationKeyframe = r.AnimationKeyframe; +export type AnimationStyles = typeof r._AnimationStyles; +export var AnimationStyles: typeof r.AnimationStyles = r.AnimationStyles; +export var prepareFinalAnimationStyles: typeof r.prepareFinalAnimationStyles = + r.prepareFinalAnimationStyles; +export var balanceAnimationKeyframes: typeof r.balanceAnimationKeyframes = + r.balanceAnimationKeyframes; +export var clearStyles: typeof r.clearStyles = r.clearStyles; +export var collectAndResolveStyles: typeof r.collectAndResolveStyles = r.collectAndResolveStyles; diff --git a/modules/@angular/platform-webworker/src/private_import_platform-browser.ts b/modules/@angular/platform-webworker/src/private_import_platform-browser.ts new file mode 100644 index 0000000000..91f95dfff6 --- /dev/null +++ b/modules/@angular/platform-webworker/src/private_import_platform-browser.ts @@ -0,0 +1,26 @@ +/** + * @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_browser_private__ as _} from '@angular/platform-browser'; + +export const BROWSER_SANITIZATION_PROVIDERS: typeof _.BROWSER_SANITIZATION_PROVIDERS = + _.BROWSER_SANITIZATION_PROVIDERS; +export type BrowserPlatformLocation = typeof _._BrowserPlatformLocation; +export const BrowserPlatformLocation: typeof _.BrowserPlatformLocation = _.BrowserPlatformLocation; +export const getDOM: typeof _.getDOM = _.getDOM; +export const BrowserDomAdapter: typeof _.BrowserDomAdapter = _.BrowserDomAdapter; +export const BrowserGetTestability: typeof _.BrowserGetTestability = _.BrowserGetTestability; +export const DomRootRenderer: typeof _.DomRootRenderer = _.DomRootRenderer; +export const DomRootRenderer_: typeof _.DomRootRenderer_ = _.DomRootRenderer_; +export const DomEventsPlugin: typeof _.DomEventsPlugin = _.DomEventsPlugin; +export const DomSharedStylesHost: typeof _.DomSharedStylesHost = _.DomSharedStylesHost; +export const SharedStylesHost: typeof _.SharedStylesHost = _.SharedStylesHost; +export const KeyEventsPlugin: typeof _.KeyEventsPlugin = _.KeyEventsPlugin; +export const HammerGesturesPlugin: typeof _.HammerGesturesPlugin = _.HammerGesturesPlugin; +export const DomAdapter: typeof _.DomAdapter = _.DomAdapter; +export const setRootDomAdapter: typeof _.setRootDomAdapter = _.setRootDomAdapter; diff --git a/modules/@angular/platform-browser/src/web_workers/shared/api.ts b/modules/@angular/platform-webworker/src/web_workers/shared/api.ts similarity index 100% rename from modules/@angular/platform-browser/src/web_workers/shared/api.ts rename to modules/@angular/platform-webworker/src/web_workers/shared/api.ts diff --git a/modules/@angular/platform-browser/src/web_workers/shared/client_message_broker.ts b/modules/@angular/platform-webworker/src/web_workers/shared/client_message_broker.ts similarity index 100% rename from modules/@angular/platform-browser/src/web_workers/shared/client_message_broker.ts rename to modules/@angular/platform-webworker/src/web_workers/shared/client_message_broker.ts diff --git a/modules/@angular/platform-browser/src/web_workers/shared/message_bus.ts b/modules/@angular/platform-webworker/src/web_workers/shared/message_bus.ts similarity index 100% rename from modules/@angular/platform-browser/src/web_workers/shared/message_bus.ts rename to modules/@angular/platform-webworker/src/web_workers/shared/message_bus.ts diff --git a/modules/@angular/platform-browser/src/web_workers/shared/messaging_api.ts b/modules/@angular/platform-webworker/src/web_workers/shared/messaging_api.ts similarity index 100% rename from modules/@angular/platform-browser/src/web_workers/shared/messaging_api.ts rename to modules/@angular/platform-webworker/src/web_workers/shared/messaging_api.ts diff --git a/modules/@angular/platform-browser/src/web_workers/shared/post_message_bus.ts b/modules/@angular/platform-webworker/src/web_workers/shared/post_message_bus.ts similarity index 100% rename from modules/@angular/platform-browser/src/web_workers/shared/post_message_bus.ts rename to modules/@angular/platform-webworker/src/web_workers/shared/post_message_bus.ts diff --git a/modules/@angular/platform-browser/src/web_workers/shared/render_store.ts b/modules/@angular/platform-webworker/src/web_workers/shared/render_store.ts similarity index 100% rename from modules/@angular/platform-browser/src/web_workers/shared/render_store.ts rename to modules/@angular/platform-webworker/src/web_workers/shared/render_store.ts diff --git a/modules/@angular/platform-browser/src/web_workers/shared/serialized_types.ts b/modules/@angular/platform-webworker/src/web_workers/shared/serialized_types.ts similarity index 100% rename from modules/@angular/platform-browser/src/web_workers/shared/serialized_types.ts rename to modules/@angular/platform-webworker/src/web_workers/shared/serialized_types.ts diff --git a/modules/@angular/platform-browser/src/web_workers/shared/serializer.ts b/modules/@angular/platform-webworker/src/web_workers/shared/serializer.ts similarity index 97% rename from modules/@angular/platform-browser/src/web_workers/shared/serializer.ts rename to modules/@angular/platform-webworker/src/web_workers/shared/serializer.ts index a1a2227aeb..783cdc96b4 100644 --- a/modules/@angular/platform-browser/src/web_workers/shared/serializer.ts +++ b/modules/@angular/platform-webworker/src/web_workers/shared/serializer.ts @@ -8,7 +8,6 @@ import {Injectable, RenderComponentType, Type, ViewEncapsulation} from '@angular/core'; -import {Map, MapWrapper, StringMapWrapper} from '../../facade/collection'; import {isArray, isPresent, serializeEnum} from '../../facade/lang'; import {VIEW_ENCAPSULATION_VALUES} from '../../private_import_core'; diff --git a/modules/@angular/platform-browser/src/web_workers/shared/service_message_broker.ts b/modules/@angular/platform-webworker/src/web_workers/shared/service_message_broker.ts similarity index 100% rename from modules/@angular/platform-browser/src/web_workers/shared/service_message_broker.ts rename to modules/@angular/platform-webworker/src/web_workers/shared/service_message_broker.ts diff --git a/modules/@angular/platform-browser/src/web_workers/ui/event_dispatcher.ts b/modules/@angular/platform-webworker/src/web_workers/ui/event_dispatcher.ts similarity index 100% rename from modules/@angular/platform-browser/src/web_workers/ui/event_dispatcher.ts rename to modules/@angular/platform-webworker/src/web_workers/ui/event_dispatcher.ts diff --git a/modules/@angular/platform-browser/src/web_workers/ui/event_serializer.ts b/modules/@angular/platform-webworker/src/web_workers/ui/event_serializer.ts similarity index 100% rename from modules/@angular/platform-browser/src/web_workers/ui/event_serializer.ts rename to modules/@angular/platform-webworker/src/web_workers/ui/event_serializer.ts diff --git a/modules/@angular/platform-browser/src/web_workers/ui/location_providers.ts b/modules/@angular/platform-webworker/src/web_workers/ui/location_providers.ts similarity index 78% rename from modules/@angular/platform-browser/src/web_workers/ui/location_providers.ts rename to modules/@angular/platform-webworker/src/web_workers/ui/location_providers.ts index 60414107b1..8e5facedc6 100644 --- a/modules/@angular/platform-browser/src/web_workers/ui/location_providers.ts +++ b/modules/@angular/platform-webworker/src/web_workers/ui/location_providers.ts @@ -6,10 +6,9 @@ * found in the LICENSE file at https://angular.io/license */ -import {Injector, NgZone, PLATFORM_INITIALIZER} from '@angular/core'; - -import {BrowserPlatformLocation} from '../../browser/location/browser_platform_location'; +import {Injector, NgZone, PLATFORM_INITIALIZER, Provider} from '@angular/core'; +import {BrowserPlatformLocation} from '../../private_import_platform-browser'; import {MessageBasedPlatformLocation} from './platform_location'; @@ -19,7 +18,7 @@ import {MessageBasedPlatformLocation} from './platform_location'; * include these providers when setting up the render thread. * @experimental */ -export const WORKER_UI_LOCATION_PROVIDERS = [ +export const WORKER_UI_LOCATION_PROVIDERS: Provider[] = [ MessageBasedPlatformLocation, BrowserPlatformLocation, {provide: PLATFORM_INITIALIZER, useFactory: initUiLocation, multi: true, deps: [Injector]} ]; diff --git a/modules/@angular/platform-browser/src/web_workers/ui/platform_location.ts b/modules/@angular/platform-webworker/src/web_workers/ui/platform_location.ts similarity index 96% rename from modules/@angular/platform-browser/src/web_workers/ui/platform_location.ts rename to modules/@angular/platform-webworker/src/web_workers/ui/platform_location.ts index e9abf43ca0..dcc64f7e2e 100644 --- a/modules/@angular/platform-browser/src/web_workers/ui/platform_location.ts +++ b/modules/@angular/platform-webworker/src/web_workers/ui/platform_location.ts @@ -9,9 +9,9 @@ import {LocationChangeListener} from '@angular/common'; import {Injectable} from '@angular/core'; -import {BrowserPlatformLocation} from '../../browser/location/browser_platform_location'; import {EventEmitter} from '../../facade/async'; import {FunctionWrapper} from '../../facade/lang'; +import {BrowserPlatformLocation} from '../../private_import_platform-browser'; import {MessageBus} from '../shared/message_bus'; import {ROUTER_CHANNEL} from '../shared/messaging_api'; import {LocationType} from '../shared/serialized_types'; diff --git a/modules/@angular/platform-browser/src/web_workers/ui/renderer.ts b/modules/@angular/platform-webworker/src/web_workers/ui/renderer.ts similarity index 100% rename from modules/@angular/platform-browser/src/web_workers/ui/renderer.ts rename to modules/@angular/platform-webworker/src/web_workers/ui/renderer.ts diff --git a/modules/@angular/platform-browser/src/web_workers/worker/event_deserializer.ts b/modules/@angular/platform-webworker/src/web_workers/worker/event_deserializer.ts similarity index 100% rename from modules/@angular/platform-browser/src/web_workers/worker/event_deserializer.ts rename to modules/@angular/platform-webworker/src/web_workers/worker/event_deserializer.ts diff --git a/modules/@angular/platform-browser/src/web_workers/worker/location_providers.ts b/modules/@angular/platform-webworker/src/web_workers/worker/location_providers.ts similarity index 100% rename from modules/@angular/platform-browser/src/web_workers/worker/location_providers.ts rename to modules/@angular/platform-webworker/src/web_workers/worker/location_providers.ts diff --git a/modules/@angular/platform-browser/src/web_workers/worker/platform_location.ts b/modules/@angular/platform-webworker/src/web_workers/worker/platform_location.ts similarity index 100% rename from modules/@angular/platform-browser/src/web_workers/worker/platform_location.ts rename to modules/@angular/platform-webworker/src/web_workers/worker/platform_location.ts diff --git a/modules/@angular/platform-browser/src/web_workers/worker/renderer.ts b/modules/@angular/platform-webworker/src/web_workers/worker/renderer.ts similarity index 100% rename from modules/@angular/platform-browser/src/web_workers/worker/renderer.ts rename to modules/@angular/platform-webworker/src/web_workers/worker/renderer.ts diff --git a/modules/@angular/platform-browser/src/web_workers/worker/worker_adapter.ts b/modules/@angular/platform-webworker/src/web_workers/worker/worker_adapter.ts similarity index 99% rename from modules/@angular/platform-browser/src/web_workers/worker/worker_adapter.ts rename to modules/@angular/platform-webworker/src/web_workers/worker/worker_adapter.ts index c444c5615a..4635efccb6 100644 --- a/modules/@angular/platform-browser/src/web_workers/worker/worker_adapter.ts +++ b/modules/@angular/platform-webworker/src/web_workers/worker/worker_adapter.ts @@ -6,9 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {Type} from '@angular/core'; - -import {DomAdapter, setRootDomAdapter} from '../../dom/dom_adapter'; +import {DomAdapter, setRootDomAdapter} from '../../private_import_platform-browser'; diff --git a/modules/@angular/platform-browser/src/worker_app.ts b/modules/@angular/platform-webworker/src/worker_app.ts similarity index 90% rename from modules/@angular/platform-browser/src/worker_app.ts rename to modules/@angular/platform-webworker/src/worker_app.ts index 30d5ab6291..76d6788527 100644 --- a/modules/@angular/platform-browser/src/worker_app.ts +++ b/modules/@angular/platform-webworker/src/worker_app.ts @@ -9,8 +9,7 @@ import {CommonModule} from '@angular/common'; import {APP_INITIALIZER, ApplicationModule, ClassProvider, ErrorHandler, ExistingProvider, FactoryProvider, NgModule, NgZone, PlatformRef, Provider, RootRenderer, TypeProvider, ValueProvider, createPlatformFactory, platformCore} from '@angular/core'; -import {BROWSER_SANITIZATION_PROVIDERS} from './browser'; -import {print} from './facade/lang'; +import {BROWSER_SANITIZATION_PROVIDERS} from './private_import_platform-browser'; import {ON_WEB_WORKER} from './web_workers/shared/api'; import {ClientMessageBrokerFactory, ClientMessageBrokerFactory_} from './web_workers/shared/client_message_broker'; import {MessageBus} from './web_workers/shared/message_bus'; @@ -28,15 +27,11 @@ import {WorkerDomAdapter} from './web_workers/worker/worker_adapter'; */ export const platformWorkerApp = createPlatformFactory(platformCore, 'workerApp'); -/** - * Exception handler factory function. - * - * @experimental - */ export function errorHandler(): ErrorHandler { return new ErrorHandler(); } + // TODO(jteplitz602) remove this and compile with lib.webworker.d.ts (#3492) let _postMessage = { postMessage: (message: any, transferrables?: [ArrayBuffer]) => { @@ -44,11 +39,7 @@ let _postMessage = { } }; -/** - * MessageBus factory function. - * - * @experimental - */ + export function createMessageBus(zone: NgZone): MessageBus { let sink = new PostMessageBusSink(_postMessage); let source = new PostMessageBusSource(); @@ -57,11 +48,7 @@ export function createMessageBus(zone: NgZone): MessageBus { return bus; } -/** - * Application initializer for web workers. - * - * @experimental - */ + export function setupWebWorker(): void { WorkerDomAdapter.makeCurrent(); } diff --git a/modules/@angular/platform-browser/src/worker_render.ts b/modules/@angular/platform-webworker/src/worker_render.ts similarity index 85% rename from modules/@angular/platform-browser/src/worker_render.ts rename to modules/@angular/platform-webworker/src/worker_render.ts index bc1879284e..f1bd38877a 100644 --- a/modules/@angular/platform-browser/src/worker_render.ts +++ b/modules/@angular/platform-webworker/src/worker_render.ts @@ -7,19 +7,9 @@ */ import {ClassProvider, ErrorHandler, ExistingProvider, FactoryProvider, Injectable, Injector, NgZone, OpaqueToken, PLATFORM_INITIALIZER, PlatformRef, Provider, RootRenderer, Testability, TypeProvider, ValueProvider, createPlatformFactory, isDevMode, platformCore} from '@angular/core'; +import {AnimationDriver, DOCUMENT, EVENT_MANAGER_PLUGINS, EventManager, HAMMER_GESTURE_CONFIG, HammerGestureConfig} from '@angular/platform-browser'; -import {BROWSER_SANITIZATION_PROVIDERS} from './browser'; -import {BrowserDomAdapter} from './browser/browser_adapter'; -import {BrowserGetTestability} from './browser/testability'; -import {AnimationDriver} from './dom/animation_driver'; -import {getDOM} from './dom/dom_adapter'; -import {DomRootRenderer, DomRootRenderer_} from './dom/dom_renderer'; -import {DOCUMENT} from './dom/dom_tokens'; -import {DomEventsPlugin} from './dom/events/dom_events'; -import {EVENT_MANAGER_PLUGINS, EventManager} from './dom/events/event_manager'; -import {HAMMER_GESTURE_CONFIG, HammerGestureConfig, HammerGesturesPlugin} from './dom/events/hammer_gestures'; -import {KeyEventsPlugin} from './dom/events/key_events'; -import {DomSharedStylesHost, SharedStylesHost} from './dom/shared_styles_host'; +import {BROWSER_SANITIZATION_PROVIDERS, BrowserDomAdapter, BrowserGetTestability, DomEventsPlugin, DomRootRenderer, DomRootRenderer_, DomSharedStylesHost, HammerGesturesPlugin, KeyEventsPlugin, SharedStylesHost, getDOM} from './private_import_platform-browser'; import {ON_WEB_WORKER} from './web_workers/shared/api'; import {ClientMessageBrokerFactory, ClientMessageBrokerFactory_} from './web_workers/shared/client_message_broker'; import {MessageBus} from './web_workers/shared/message_bus'; @@ -55,7 +45,7 @@ export class WebWorkerInstance { export const WORKER_SCRIPT: OpaqueToken = new OpaqueToken('WebWorkerScript'); /** - * A multiple providers used to automatically call the `start()` method after the service is + * A multi-provider used to automatically call the `start()` method after the service is * created. * * TODO(vicb): create an interface for startable services to implement @@ -64,9 +54,6 @@ export const WORKER_SCRIPT: OpaqueToken = new OpaqueToken('WebWorkerScript'); export const WORKER_UI_STARTABLE_MESSAGING_SERVICE = new OpaqueToken('WorkerRenderStartableMsgService'); -/** - * @experimental WebWorker support is currently experimental. - */ export const _WORKER_UI_PLATFORM_PROVIDERS: Provider[] = [ {provide: NgZone, useFactory: createNgZone, deps: []}, MessageBasedRenderer, diff --git a/modules/@angular/platform-browser/test/web_workers/shared/message_bus_spec.ts b/modules/@angular/platform-webworker/test/web_workers/shared/message_bus_spec.ts similarity index 98% rename from modules/@angular/platform-browser/test/web_workers/shared/message_bus_spec.ts rename to modules/@angular/platform-webworker/test/web_workers/shared/message_bus_spec.ts index 667c49218b..3e014d196d 100644 --- a/modules/@angular/platform-browser/test/web_workers/shared/message_bus_spec.ts +++ b/modules/@angular/platform-webworker/test/web_workers/shared/message_bus_spec.ts @@ -9,7 +9,7 @@ import {NgZone} from '@angular/core'; import {withModule} from '@angular/core/testing/test_bed'; import {AsyncTestCompleter, MockNgZone, beforeEach, beforeEachProviders, describe, expect, inject, it} from '@angular/core/testing/testing_internal'; -import {MessageBus} from '@angular/platform-browser/src/web_workers/shared/message_bus'; +import {MessageBus} from '@angular/platform-webworker/src/web_workers/shared/message_bus'; import {createConnectedMessageBus} from './message_bus_util'; diff --git a/modules/@angular/platform-browser/test/web_workers/shared/message_bus_util.ts b/modules/@angular/platform-webworker/test/web_workers/shared/message_bus_util.ts similarity index 85% rename from modules/@angular/platform-browser/test/web_workers/shared/message_bus_util.ts rename to modules/@angular/platform-webworker/test/web_workers/shared/message_bus_util.ts index 64135278fb..eff922edbe 100644 --- a/modules/@angular/platform-browser/test/web_workers/shared/message_bus_util.ts +++ b/modules/@angular/platform-webworker/test/web_workers/shared/message_bus_util.ts @@ -6,8 +6,8 @@ * found in the LICENSE file at https://angular.io/license */ -import {MessageBus} from '@angular/platform-browser/src/web_workers/shared/message_bus'; -import {PostMessageBus, PostMessageBusSink, PostMessageBusSource} from '@angular/platform-browser/src/web_workers/shared/post_message_bus'; +import {MessageBus} from '@angular/platform-webworker/src/web_workers/shared/message_bus'; +import {PostMessageBus, PostMessageBusSink, PostMessageBusSource} from '@angular/platform-webworker/src/web_workers/shared/post_message_bus'; /* diff --git a/modules/@angular/platform-browser/test/web_workers/shared/mock_event_emitter.ts b/modules/@angular/platform-webworker/test/web_workers/shared/mock_event_emitter.ts similarity index 100% rename from modules/@angular/platform-browser/test/web_workers/shared/mock_event_emitter.ts rename to modules/@angular/platform-webworker/test/web_workers/shared/mock_event_emitter.ts diff --git a/modules/@angular/platform-browser/test/web_workers/shared/render_store_spec.ts b/modules/@angular/platform-webworker/test/web_workers/shared/render_store_spec.ts similarity index 81% rename from modules/@angular/platform-browser/test/web_workers/shared/render_store_spec.ts rename to modules/@angular/platform-webworker/test/web_workers/shared/render_store_spec.ts index e475a49c41..5f707c6d29 100644 --- a/modules/@angular/platform-browser/test/web_workers/shared/render_store_spec.ts +++ b/modules/@angular/platform-webworker/test/web_workers/shared/render_store_spec.ts @@ -6,8 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {beforeEach, ddescribe, describe, expect, inject, it} from '@angular/core/testing/testing_internal'; -import {RenderStore} from '@angular/platform-browser/src/web_workers/shared/render_store'; +import {RenderStore} from '@angular/platform-webworker/src/web_workers/shared/render_store'; export function main() { describe('RenderStoreSpec', () => { diff --git a/modules/@angular/platform-browser/test/web_workers/shared/service_message_broker_spec.ts b/modules/@angular/platform-webworker/test/web_workers/shared/service_message_broker_spec.ts similarity index 83% rename from modules/@angular/platform-browser/test/web_workers/shared/service_message_broker_spec.ts rename to modules/@angular/platform-webworker/test/web_workers/shared/service_message_broker_spec.ts index cd14b60d7c..1af1629669 100644 --- a/modules/@angular/platform-browser/test/web_workers/shared/service_message_broker_spec.ts +++ b/modules/@angular/platform-webworker/test/web_workers/shared/service_message_broker_spec.ts @@ -7,11 +7,11 @@ */ import {beforeEach, beforeEachProviders, describe, expect, iit, inject, it} from '@angular/core/testing/testing_internal'; -import {ON_WEB_WORKER} from '@angular/platform-browser/src/web_workers/shared/api'; -import {RenderStore} from '@angular/platform-browser/src/web_workers/shared/render_store'; -import {PRIMITIVE, Serializer} from '@angular/platform-browser/src/web_workers/shared/serializer'; -import {ServiceMessageBroker, ServiceMessageBroker_} from '@angular/platform-browser/src/web_workers/shared/service_message_broker'; -import {browserDetection} from '@angular/platform-browser/testing/browser_util'; +import {ON_WEB_WORKER} from '@angular/platform-webworker/src/web_workers/shared/api'; +import {RenderStore} from '@angular/platform-webworker/src/web_workers/shared/render_store'; +import {PRIMITIVE, Serializer} from '@angular/platform-webworker/src/web_workers/shared/serializer'; +import {ServiceMessageBroker_} from '@angular/platform-webworker/src/web_workers/shared/service_message_broker'; + import {createPairedMessageBuses} from './web_worker_test_util'; diff --git a/modules/@angular/platform-browser/test/web_workers/shared/web_worker_test_util.ts b/modules/@angular/platform-webworker/test/web_workers/shared/web_worker_test_util.ts similarity index 97% rename from modules/@angular/platform-browser/test/web_workers/shared/web_worker_test_util.ts rename to modules/@angular/platform-webworker/test/web_workers/shared/web_worker_test_util.ts index 9ad23e3287..eef048e5f9 100644 --- a/modules/@angular/platform-browser/test/web_workers/shared/web_worker_test_util.ts +++ b/modules/@angular/platform-webworker/test/web_workers/shared/web_worker_test_util.ts @@ -8,8 +8,8 @@ import {Type} from '@angular/core'; import {NgZone} from '@angular/core/src/zone/ng_zone'; -import {ClientMessageBroker, ClientMessageBrokerFactory_, UiArguments} from '@angular/platform-browser/src/web_workers/shared/client_message_broker'; -import {MessageBus, MessageBusSink, MessageBusSource} from '@angular/platform-browser/src/web_workers/shared/message_bus'; +import {ClientMessageBroker, ClientMessageBrokerFactory_, UiArguments} from '@angular/platform-webworker/src/web_workers/shared/client_message_broker'; +import {MessageBus, MessageBusSink, MessageBusSource} from '@angular/platform-webworker/src/web_workers/shared/message_bus'; import {ListWrapper, StringMapWrapper} from '../../../src/facade/collection'; import {isPresent} from '../../../src/facade/lang'; import {SpyMessageBroker} from '../worker/spies'; diff --git a/modules/@angular/platform-browser/test/web_workers/worker/platform_location_spec.ts b/modules/@angular/platform-webworker/test/web_workers/worker/platform_location_spec.ts similarity index 89% rename from modules/@angular/platform-browser/test/web_workers/worker/platform_location_spec.ts rename to modules/@angular/platform-webworker/test/web_workers/worker/platform_location_spec.ts index 1ff867fccc..2c2376b3f7 100644 --- a/modules/@angular/platform-browser/test/web_workers/worker/platform_location_spec.ts +++ b/modules/@angular/platform-webworker/test/web_workers/worker/platform_location_spec.ts @@ -8,10 +8,10 @@ import {Type} from '@angular/core'; import {AsyncTestCompleter, beforeEach, beforeEachProviders, describe, expect, inject, it} from '@angular/core/testing/testing_internal'; -import {UiArguments} from '@angular/platform-browser/src/web_workers/shared/client_message_broker'; -import {MessageBus} from '@angular/platform-browser/src/web_workers/shared/message_bus'; -import {LocationType} from '@angular/platform-browser/src/web_workers/shared/serialized_types'; -import {WebWorkerPlatformLocation} from '@angular/platform-browser/src/web_workers/worker/platform_location'; +import {UiArguments} from '@angular/platform-webworker/src/web_workers/shared/client_message_broker'; +import {MessageBus} from '@angular/platform-webworker/src/web_workers/shared/message_bus'; +import {LocationType} from '@angular/platform-webworker/src/web_workers/shared/serialized_types'; +import {WebWorkerPlatformLocation} from '@angular/platform-webworker/src/web_workers/worker/platform_location'; import {MockMessageBrokerFactory, createPairedMessageBuses, expectBrokerCall} from '../shared/web_worker_test_util'; diff --git a/modules/@angular/platform-browser/test/web_workers/worker/renderer_integration_spec.ts b/modules/@angular/platform-webworker/test/web_workers/worker/renderer_integration_spec.ts similarity index 92% rename from modules/@angular/platform-browser/test/web_workers/worker/renderer_integration_spec.ts rename to modules/@angular/platform-webworker/test/web_workers/worker/renderer_integration_spec.ts index 2aeb8515ae..beec1b58cf 100644 --- a/modules/@angular/platform-browser/test/web_workers/worker/renderer_integration_spec.ts +++ b/modules/@angular/platform-webworker/test/web_workers/worker/renderer_integration_spec.ts @@ -12,17 +12,17 @@ import {RootRenderer} from '@angular/core/src/render/api'; import {TestBed} from '@angular/core/testing'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; import {DomRootRenderer, DomRootRenderer_} from '@angular/platform-browser/src/dom/dom_renderer'; -import {ClientMessageBrokerFactory, ClientMessageBrokerFactory_} from '@angular/platform-browser/src/web_workers/shared/client_message_broker'; -import {RenderStore} from '@angular/platform-browser/src/web_workers/shared/render_store'; -import {Serializer} from '@angular/platform-browser/src/web_workers/shared/serializer'; -import {ServiceMessageBrokerFactory_} from '@angular/platform-browser/src/web_workers/shared/service_message_broker'; -import {MessageBasedRenderer} from '@angular/platform-browser/src/web_workers/ui/renderer'; -import {WebWorkerRootRenderer} from '@angular/platform-browser/src/web_workers/worker/renderer'; +import {BrowserTestingModule} from '@angular/platform-browser/testing'; import {expect} from '@angular/platform-browser/testing/matchers'; +import {ClientMessageBrokerFactory, ClientMessageBrokerFactory_} from '@angular/platform-webworker/src/web_workers/shared/client_message_broker'; +import {RenderStore} from '@angular/platform-webworker/src/web_workers/shared/render_store'; +import {Serializer} from '@angular/platform-webworker/src/web_workers/shared/serializer'; +import {ServiceMessageBrokerFactory_} from '@angular/platform-webworker/src/web_workers/shared/service_message_broker'; +import {MessageBasedRenderer} from '@angular/platform-webworker/src/web_workers/ui/renderer'; +import {WebWorkerRootRenderer} from '@angular/platform-webworker/src/web_workers/worker/renderer'; import {platformBrowserDynamicTesting} from '../../../../platform-browser-dynamic/testing'; import {dispatchEvent} from '../../../../platform-browser/testing/browser_util'; -import {BrowserTestingModule} from '../../../testing'; import {PairedMessageBuses, createPairedMessageBuses} from '../shared/web_worker_test_util'; export function main() { diff --git a/modules/@angular/platform-browser/test/web_workers/worker/spies.ts b/modules/@angular/platform-webworker/test/web_workers/worker/spies.ts similarity index 77% rename from modules/@angular/platform-browser/test/web_workers/worker/spies.ts rename to modules/@angular/platform-webworker/test/web_workers/worker/spies.ts index d82e773aa8..22d498f13a 100644 --- a/modules/@angular/platform-browser/test/web_workers/worker/spies.ts +++ b/modules/@angular/platform-webworker/test/web_workers/worker/spies.ts @@ -7,7 +7,7 @@ */ import {SpyObject, proxy} from '@angular/core/testing/testing_internal'; -import {ClientMessageBroker} from '@angular/platform-browser/src/web_workers/shared/client_message_broker'; +import {ClientMessageBroker} from '@angular/platform-webworker/src/web_workers/shared/client_message_broker'; export class SpyMessageBroker extends SpyObject { constructor() { super(ClientMessageBroker); } diff --git a/modules/@angular/platform-webworker/tsconfig.json b/modules/@angular/platform-webworker/tsconfig.json new file mode 100644 index 0000000000..7f7900083c --- /dev/null +++ b/modules/@angular/platform-webworker/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "declaration": true, + "stripInternal": true, + "experimentalDecorators": true, + "module": "es2015", + "moduleResolution": "node", + "outDir": "../../../dist/packages-dist/platform-webworker", + "paths": { + "@angular/core": ["../../../dist/packages-dist/core"], + "@angular/common": ["../../../dist/packages-dist/common"], + "@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"] + }, + "rootDir": ".", + "sourceMap": true, + "inlineSources": true, + "target": "es5", + "skipLibCheck": true, + "lib": ["es2015", "dom"] + }, + "files": [ + "index.ts", + "../../../node_modules/zone.js/dist/zone.js.d.ts" + ], + "angularCompilerOptions": { + "strictMetadataEmit": true + } +} diff --git a/modules/playground/src/bootstrap.ts b/modules/playground/src/bootstrap.ts index bd93217245..6ac0f18382 100644 --- a/modules/playground/src/bootstrap.ts +++ b/modules/playground/src/bootstrap.ts @@ -32,6 +32,10 @@ '/packages-dist/platform-browser/bundles/platform-browser.umd.js', '@angular/platform-browser-dynamic': '/packages-dist/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', + '@angular/platform-webworker': + '/packages-dist/platform-webworker/bundles/platform-webworker.umd.js', + '@angular/platform-webworker-dynamic': + '/packages-dist/platform-webworker-dynamic/bundles/platform-webworker-dynamic.umd.js', '@angular/http': '/packages-dist/http/bundles/http.umd.js', '@angular/upgrade': '/packages-dist/upgrade/bundles/upgrade.umd.js', '@angular/router': '/packages-dist/router/bundles/router.umd.js', @@ -63,6 +67,8 @@ '@angular/forms': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'}, + '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, + '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/upgrade': {main: 'index.js', defaultExtension: 'js'}, 'rxjs': {defaultExtension: 'js'} } diff --git a/modules/playground/src/web_workers/images/background_index.ts b/modules/playground/src/web_workers/images/background_index.ts index 51dcd5e9af..8f9459e418 100644 --- a/modules/playground/src/web_workers/images/background_index.ts +++ b/modules/playground/src/web_workers/images/background_index.ts @@ -7,8 +7,8 @@ */ import {NgModule} from '@angular/core'; -import {WorkerAppModule} from '@angular/platform-browser'; -import {platformWorkerAppDynamic} from '@angular/platform-browser-dynamic'; +import {WorkerAppModule} from '@angular/platform-webworker'; +import {platformWorkerAppDynamic} from '@angular/platform-webworker-dynamic'; import {ImageDemo} from './index_common'; @@ -18,4 +18,4 @@ class ExampleModule { export function main() { platformWorkerAppDynamic().bootstrapModule(ExampleModule); -} \ No newline at end of file +} diff --git a/modules/playground/src/web_workers/images/index.ts b/modules/playground/src/web_workers/images/index.ts index 0d0d52559c..b45021b6fc 100644 --- a/modules/playground/src/web_workers/images/index.ts +++ b/modules/playground/src/web_workers/images/index.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {bootstrapWorkerUi} from '@angular/platform-browser-dynamic'; +import {bootstrapWorkerUi} from '@angular/platform-webworker'; export function main() { bootstrapWorkerUi('loader.js'); diff --git a/modules/playground/src/web_workers/images/loader.js b/modules/playground/src/web_workers/images/loader.js index aaba7f956d..57d3e706b6 100644 --- a/modules/playground/src/web_workers/images/loader.js +++ b/modules/playground/src/web_workers/images/loader.js @@ -16,6 +16,8 @@ System.config({ '@angular/compiler': {main: 'index.js', defaultExtension: 'js'}, '@angular/common': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'}, + '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, + '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/router': {main: 'index.js', defaultExtension: 'js'}, 'rxjs': { defaultExtension: 'js' diff --git a/modules/playground/src/web_workers/input/background_index.ts b/modules/playground/src/web_workers/input/background_index.ts index 55f4af4200..d05ec70439 100644 --- a/modules/playground/src/web_workers/input/background_index.ts +++ b/modules/playground/src/web_workers/input/background_index.ts @@ -7,8 +7,8 @@ */ import {NgModule} from '@angular/core'; -import {WorkerAppModule} from '@angular/platform-browser'; -import {platformWorkerAppDynamic} from '@angular/platform-browser-dynamic'; +import {WorkerAppModule} from '@angular/platform-webworker'; +import {platformWorkerAppDynamic} from '@angular/platform-webworker-dynamic'; import {InputCmp} from './index_common'; diff --git a/modules/playground/src/web_workers/input/index.ts b/modules/playground/src/web_workers/input/index.ts index 0d0d52559c..b45021b6fc 100644 --- a/modules/playground/src/web_workers/input/index.ts +++ b/modules/playground/src/web_workers/input/index.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {bootstrapWorkerUi} from '@angular/platform-browser-dynamic'; +import {bootstrapWorkerUi} from '@angular/platform-webworker'; export function main() { bootstrapWorkerUi('loader.js'); diff --git a/modules/playground/src/web_workers/input/loader.js b/modules/playground/src/web_workers/input/loader.js index 844ad55f44..da3d48480f 100644 --- a/modules/playground/src/web_workers/input/loader.js +++ b/modules/playground/src/web_workers/input/loader.js @@ -16,6 +16,8 @@ System.config({ '@angular/common': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'}, + '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, + '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, 'rxjs': { defaultExtension: 'js' } diff --git a/modules/playground/src/web_workers/kitchen_sink/background_index.ts b/modules/playground/src/web_workers/kitchen_sink/background_index.ts index 88fa3117ab..a2ea51650c 100644 --- a/modules/playground/src/web_workers/kitchen_sink/background_index.ts +++ b/modules/playground/src/web_workers/kitchen_sink/background_index.ts @@ -7,8 +7,8 @@ */ import {NgModule} from '@angular/core'; -import {WorkerAppModule} from '@angular/platform-browser'; -import {platformWorkerAppDynamic} from '@angular/platform-browser-dynamic'; +import {WorkerAppModule} from '@angular/platform-webworker'; +import {platformWorkerAppDynamic} from '@angular/platform-webworker-dynamic'; import {HelloCmp} from './index_common'; diff --git a/modules/playground/src/web_workers/kitchen_sink/index.ts b/modules/playground/src/web_workers/kitchen_sink/index.ts index 0d0d52559c..b45021b6fc 100644 --- a/modules/playground/src/web_workers/kitchen_sink/index.ts +++ b/modules/playground/src/web_workers/kitchen_sink/index.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {bootstrapWorkerUi} from '@angular/platform-browser-dynamic'; +import {bootstrapWorkerUi} from '@angular/platform-webworker'; export function main() { bootstrapWorkerUi('loader.js'); diff --git a/modules/playground/src/web_workers/kitchen_sink/loader.js b/modules/playground/src/web_workers/kitchen_sink/loader.js index 42679fbad9..8d6ab0ca00 100644 --- a/modules/playground/src/web_workers/kitchen_sink/loader.js +++ b/modules/playground/src/web_workers/kitchen_sink/loader.js @@ -16,6 +16,8 @@ System.config({ '@angular/common': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'}, + '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, + '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/router': {main: 'index.js', defaultExtension: 'js'}, 'rxjs': { defaultExtension: 'js' diff --git a/modules/playground/src/web_workers/message_broker/background_index.ts b/modules/playground/src/web_workers/message_broker/background_index.ts index 41368a231d..df555d60a3 100644 --- a/modules/playground/src/web_workers/message_broker/background_index.ts +++ b/modules/playground/src/web_workers/message_broker/background_index.ts @@ -7,8 +7,8 @@ */ import {NgModule} from '@angular/core'; -import {WorkerAppModule} from '@angular/platform-browser'; -import {platformWorkerAppDynamic} from '@angular/platform-browser-dynamic'; +import {WorkerAppModule} from '@angular/platform-webworker'; +import {platformWorkerAppDynamic} from '@angular/platform-webworker-dynamic'; import {App} from './index_common'; diff --git a/modules/playground/src/web_workers/message_broker/index.ts b/modules/playground/src/web_workers/message_broker/index.ts index 955ee9409a..4ec0994a58 100644 --- a/modules/playground/src/web_workers/message_broker/index.ts +++ b/modules/playground/src/web_workers/message_broker/index.ts @@ -7,8 +7,8 @@ */ import {PlatformRef} from '@angular/core'; -import {ClientMessageBrokerFactory, FnArg, PRIMITIVE, UiArguments} from '@angular/platform-browser'; -import {bootstrapWorkerUi} from '@angular/platform-browser-dynamic'; +import {ClientMessageBrokerFactory, FnArg, PRIMITIVE, UiArguments} from '@angular/platform-webworker'; +import {bootstrapWorkerUi} from '@angular/platform-webworker'; const ECHO_CHANNEL = 'ECHO'; diff --git a/modules/playground/src/web_workers/message_broker/index_common.ts b/modules/playground/src/web_workers/message_broker/index_common.ts index d726a24f32..0eb521b361 100644 --- a/modules/playground/src/web_workers/message_broker/index_common.ts +++ b/modules/playground/src/web_workers/message_broker/index_common.ts @@ -7,7 +7,7 @@ */ import {Component} from '@angular/core'; -import {PRIMITIVE, ServiceMessageBrokerFactory} from '@angular/platform-browser'; +import {PRIMITIVE, ServiceMessageBrokerFactory} from '@angular/platform-webworker'; const ECHO_CHANNEL = 'ECHO'; diff --git a/modules/playground/src/web_workers/message_broker/loader.js b/modules/playground/src/web_workers/message_broker/loader.js index 157f06b0fd..b2bccbc7db 100644 --- a/modules/playground/src/web_workers/message_broker/loader.js +++ b/modules/playground/src/web_workers/message_broker/loader.js @@ -17,6 +17,8 @@ System.config({ '@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/router': {main: 'index.js', defaultExtension: 'js'}, + '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, + '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, 'rxjs': { defaultExtension: 'js' }, diff --git a/modules/playground/src/web_workers/router/background_index.ts b/modules/playground/src/web_workers/router/background_index.ts index a7616d67fe..c60355187d 100644 --- a/modules/playground/src/web_workers/router/background_index.ts +++ b/modules/playground/src/web_workers/router/background_index.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {platformWorkerAppDynamic} from '@angular/platform-browser-dynamic'; +import {platformWorkerAppDynamic} from '@angular/platform-webworker-dynamic'; import {AppModule} from './index_common'; diff --git a/modules/playground/src/web_workers/router/index.ts b/modules/playground/src/web_workers/router/index.ts index f1fc2963ea..bc138f7a99 100644 --- a/modules/playground/src/web_workers/router/index.ts +++ b/modules/playground/src/web_workers/router/index.ts @@ -6,8 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {WORKER_UI_LOCATION_PROVIDERS} from '@angular/platform-browser'; -import {bootstrapWorkerUi} from '@angular/platform-browser-dynamic'; +import {WORKER_UI_LOCATION_PROVIDERS, bootstrapWorkerUi} from '@angular/platform-webworker'; export function main() { bootstrapWorkerUi('loader.js', WORKER_UI_LOCATION_PROVIDERS); diff --git a/modules/playground/src/web_workers/router/index_common.ts b/modules/playground/src/web_workers/router/index_common.ts index 0ad63c47ed..0311bf5f17 100644 --- a/modules/playground/src/web_workers/router/index_common.ts +++ b/modules/playground/src/web_workers/router/index_common.ts @@ -6,10 +6,9 @@ * found in the LICENSE file at https://angular.io/license */ -import {HashLocationStrategy, LocationStrategy} from '@angular/common'; import {Component, NgModule} from '@angular/core'; -import {WORKER_APP_LOCATION_PROVIDERS, WorkerAppModule} from '@angular/platform-browser'; -import {Router, RouterModule, provideRoutes} from '@angular/router'; +import {WORKER_APP_LOCATION_PROVIDERS, WorkerAppModule} from '@angular/platform-webworker'; +import {RouterModule} from '@angular/router'; import {About} from './components/about'; import {Contact} from './components/contact'; diff --git a/modules/playground/src/web_workers/router/loader.js b/modules/playground/src/web_workers/router/loader.js index 1e7197a200..7f812c68e1 100644 --- a/modules/playground/src/web_workers/router/loader.js +++ b/modules/playground/src/web_workers/router/loader.js @@ -16,6 +16,8 @@ System.config({ '@angular/common': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'}, + '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, + '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/router': {main: 'index.js', defaultExtension: 'js'}, 'rxjs': { defaultExtension: 'js' diff --git a/modules/playground/src/web_workers/todo/background_index.ts b/modules/playground/src/web_workers/todo/background_index.ts index ab1bf02e71..190431081a 100644 --- a/modules/playground/src/web_workers/todo/background_index.ts +++ b/modules/playground/src/web_workers/todo/background_index.ts @@ -8,8 +8,8 @@ import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; -import {WorkerAppModule} from '@angular/platform-browser'; -import {platformWorkerAppDynamic} from '@angular/platform-browser-dynamic'; +import {WorkerAppModule} from '@angular/platform-webworker'; +import {platformWorkerAppDynamic} from '@angular/platform-webworker-dynamic'; import {TodoApp} from './index_common'; diff --git a/modules/playground/src/web_workers/todo/index.ts b/modules/playground/src/web_workers/todo/index.ts index 0d0d52559c..b45021b6fc 100644 --- a/modules/playground/src/web_workers/todo/index.ts +++ b/modules/playground/src/web_workers/todo/index.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {bootstrapWorkerUi} from '@angular/platform-browser-dynamic'; +import {bootstrapWorkerUi} from '@angular/platform-webworker'; export function main() { bootstrapWorkerUi('loader.js'); diff --git a/modules/playground/src/web_workers/todo/loader.js b/modules/playground/src/web_workers/todo/loader.js index 4f9fabc6c3..b658b5f2af 100644 --- a/modules/playground/src/web_workers/todo/loader.js +++ b/modules/playground/src/web_workers/todo/loader.js @@ -17,6 +17,8 @@ System.config({ '@angular/forms': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'}, + '@angular/platform-webworker': {main: 'index.js', defaultExtension: 'js'}, + '@angular/platform-webworker-dynamic': {main: 'index.js', defaultExtension: 'js'}, '@angular/router': {main: 'index.js', defaultExtension: 'js'}, 'rxjs': { defaultExtension: 'js' diff --git a/test-main.js b/test-main.js index ca17387577..da89e18871 100644 --- a/test-main.js +++ b/test-main.js @@ -96,6 +96,14 @@ System.config({ '@angular/platform-server': { main: 'index.js', defaultExtension: 'js' + }, + '@angular/platform-webworker': { + main: 'index.js', + defaultExtension: 'js' + }, + '@angular/platform-webworker-dynamic': { + main: 'index.js', + defaultExtension: 'js' } } }); diff --git a/tools/public_api_guard/platform-browser-dynamic/index.d.ts b/tools/public_api_guard/platform-browser-dynamic/index.d.ts index c3f0d5c890..5d643f1921 100644 --- a/tools/public_api_guard/platform-browser-dynamic/index.d.ts +++ b/tools/public_api_guard/platform-browser-dynamic/index.d.ts @@ -1,11 +1,5 @@ -/** @experimental */ -export declare function bootstrapWorkerUi(workerScriptUri: string, customProviders?: Provider[]): Promise; - /** @experimental */ export declare const platformBrowserDynamic: (extraProviders?: Provider[]) => PlatformRef; -/** @experimental */ -export declare const platformWorkerAppDynamic: (extraProviders?: Provider[]) => PlatformRef; - /** @experimental */ export declare const RESOURCE_CACHE_PROVIDER: Provider[]; diff --git a/tools/public_api_guard/platform-browser/index.d.ts b/tools/public_api_guard/platform-browser/index.d.ts index 3e3744e8d7..b7a9642cb6 100644 --- a/tools/public_api_guard/platform-browser/index.d.ts +++ b/tools/public_api_guard/platform-browser/index.d.ts @@ -9,21 +9,6 @@ export declare class BrowserModule { constructor(parentModule: BrowserModule); } -/** @stable */ -export declare class BrowserPlatformLocation extends PlatformLocation { - hash: string; - pathname: string; - search: string; - constructor(); - back(): void; - forward(): void; - getBaseHrefFromDOM(): string; - onHashChange(fn: LocationChangeListener): void; - onPopState(fn: LocationChangeListener): void; - pushState(state: any, title: string, url: string): void; - replaceState(state: any, title: string, url: string): void; -} - /** @experimental */ export declare class By { static all(): Predicate; @@ -31,16 +16,6 @@ export declare class By { static directive(type: Type): Predicate; } -/** @experimental */ -export declare abstract class ClientMessageBroker { - abstract runOnService(args: UiArguments, returnType: Type): Promise; -} - -/** @experimental */ -export declare abstract class ClientMessageBrokerFactory { - abstract createMessageBroker(channel: string, runInZone?: boolean): ClientMessageBroker; -} - /** @experimental */ export declare function disableDebugTools(): void; @@ -71,13 +46,6 @@ export declare class EventManager { getZone(): NgZone; } -/** @experimental */ -export declare class FnArg { - type: Type; - value: any; - constructor(value: any, type: Type); -} - /** @experimental */ export declare const HAMMER_GESTURE_CONFIG: OpaqueToken; @@ -90,28 +58,6 @@ export declare class HammerGestureConfig { buildHammer(element: HTMLElement): HammerInstance; } -/** @experimental */ -export declare abstract class MessageBus implements MessageBusSource, MessageBusSink { - abstract attachToZone(zone: NgZone): void; - abstract from(channel: string): EventEmitter; - abstract initChannel(channel: string, runInZone?: boolean): void; - abstract to(channel: string): EventEmitter; -} - -/** @experimental */ -export interface MessageBusSink { - attachToZone(zone: NgZone): void; - initChannel(channel: string, runInZone: boolean): void; - to(channel: string): EventEmitter; -} - -/** @experimental */ -export interface MessageBusSource { - attachToZone(zone: NgZone): void; - from(channel: string): EventEmitter; - initChannel(channel: string, runInZone: boolean): void; -} - /** @experimental */ export declare class NgProbeToken { constructor(name: string, token: any); @@ -120,26 +66,6 @@ export declare class NgProbeToken { /** @stable */ export declare const platformBrowser: (extraProviders?: Provider[]) => PlatformRef; -/** @experimental */ -export declare const platformWorkerApp: (extraProviders?: Provider[]) => PlatformRef; - -/** @experimental */ -export declare const platformWorkerUi: (extraProviders?: Provider[]) => PlatformRef; - -/** @experimental */ -export declare const PRIMITIVE: Type; - -/** @experimental */ -export declare class ReceivedMessage { - args: any[]; - id: string; - method: string; - type: string; - constructor(data: { - [key: string]: any; - }); -} - /** @stable */ export interface SafeHtml extends SafeValue { } @@ -160,60 +86,8 @@ export interface SafeStyle extends SafeValue { export interface SafeUrl extends SafeValue { } -/** @experimental */ -export declare abstract class ServiceMessageBroker { - abstract registerMethod(methodName: string, signature: Type[], method: Function, returnType?: Type): void; -} - -/** @experimental */ -export declare abstract class ServiceMessageBrokerFactory { - abstract createMessageBroker(channel: string, runInZone?: boolean): ServiceMessageBroker; -} - /** @experimental */ export declare class Title { getTitle(): string; setTitle(newTitle: string): void; } - -/** @experimental */ -export declare class UiArguments { - args: FnArg[]; - method: string; - constructor(method: string, args?: FnArg[]); -} - -/** @experimental */ -export declare class WebWorkerInstance { - bus: MessageBus; - worker: Worker; -} - -/** @experimental */ -export declare const WORKER_APP_LOCATION_PROVIDERS: ({ - provide: typeof PlatformLocation; - useClass: typeof WebWorkerPlatformLocation; -} | { - provide: any; - useFactory: (platformLocation: WebWorkerPlatformLocation, zone: NgZone) => () => Promise; - multi: boolean; - deps: (typeof PlatformLocation | typeof NgZone)[]; -})[]; - -/** @experimental */ -export declare const WORKER_SCRIPT: OpaqueToken; - -/** @experimental */ -export declare const WORKER_UI_LOCATION_PROVIDERS: (typeof BrowserPlatformLocation | typeof MessageBasedPlatformLocation | { - provide: any; - useFactory: (injector: Injector) => () => void; - multi: boolean; - deps: typeof Injector[]; -})[]; - -/** @experimental */ -export declare const WORKER_UI_STARTABLE_MESSAGING_SERVICE: OpaqueToken; - -/** @experimental */ -export declare class WorkerAppModule { -} diff --git a/tools/public_api_guard/platform-webworker-dynamic/index.d.ts b/tools/public_api_guard/platform-webworker-dynamic/index.d.ts new file mode 100644 index 0000000000..5f68576982 --- /dev/null +++ b/tools/public_api_guard/platform-webworker-dynamic/index.d.ts @@ -0,0 +1,2 @@ +/** @experimental */ +export declare const platformWorkerAppDynamic: (extraProviders?: Provider[]) => PlatformRef; diff --git a/tools/public_api_guard/platform-webworker/index.d.ts b/tools/public_api_guard/platform-webworker/index.d.ts new file mode 100644 index 0000000000..78c75656d1 --- /dev/null +++ b/tools/public_api_guard/platform-webworker/index.d.ts @@ -0,0 +1,96 @@ +/** @experimental */ +export declare function bootstrapWorkerUi(workerScriptUri: string, customProviders?: Provider[]): Promise; + +/** @experimental */ +export declare abstract class ClientMessageBroker { + abstract runOnService(args: UiArguments, returnType: Type): Promise; +} + +/** @experimental */ +export declare abstract class ClientMessageBrokerFactory { + abstract createMessageBroker(channel: string, runInZone?: boolean): ClientMessageBroker; +} + +/** @experimental */ +export declare class FnArg { + type: Type; + value: any; + constructor(value: any, type: Type); +} + +/** @experimental */ +export declare abstract class MessageBus implements MessageBusSource, MessageBusSink { + abstract attachToZone(zone: NgZone): void; + abstract from(channel: string): EventEmitter; + abstract initChannel(channel: string, runInZone?: boolean): void; + abstract to(channel: string): EventEmitter; +} + +/** @experimental */ +export interface MessageBusSink { + attachToZone(zone: NgZone): void; + initChannel(channel: string, runInZone: boolean): void; + to(channel: string): EventEmitter; +} + +/** @experimental */ +export interface MessageBusSource { + attachToZone(zone: NgZone): void; + from(channel: string): EventEmitter; + initChannel(channel: string, runInZone: boolean): void; +} + +/** @experimental */ +export declare const platformWorkerApp: (extraProviders?: Provider[]) => PlatformRef; + +/** @experimental */ +export declare const platformWorkerUi: (extraProviders?: Provider[]) => PlatformRef; + +/** @experimental */ +export declare const PRIMITIVE: Type; + +/** @experimental */ +export declare class ReceivedMessage { + args: any[]; + id: string; + method: string; + type: string; + constructor(data: { + [key: string]: any; + }); +} + +/** @experimental */ +export declare abstract class ServiceMessageBroker { + abstract registerMethod(methodName: string, signature: Type[], method: Function, returnType?: Type): void; +} + +/** @experimental */ +export declare abstract class ServiceMessageBrokerFactory { + abstract createMessageBroker(channel: string, runInZone?: boolean): ServiceMessageBroker; +} + +/** @experimental */ +export declare class UiArguments { + args: FnArg[]; + method: string; + constructor(method: string, args?: FnArg[]); +} + +/** @experimental */ +export declare const WORKER_APP_LOCATION_PROVIDERS: ({ + provide: typeof PlatformLocation; + useClass: typeof WebWorkerPlatformLocation; +} | { + provide: any; + useFactory: (platformLocation: WebWorkerPlatformLocation, zone: NgZone) => () => Promise; + multi: boolean; + deps: (typeof NgZone | typeof PlatformLocation)[]; +})[]; + +/** @experimental */ +export declare const WORKER_UI_LOCATION_PROVIDERS: Provider[]; + +/** @experimental */ +export declare class WorkerAppModule { +}