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
This commit is contained in:
Igor Minar 2016-08-30 11:15:25 -07:00 committed by Victor Berchet
parent 0f68351979
commit 71ae2c4525
84 changed files with 561 additions and 305 deletions

View File

@ -64,6 +64,8 @@ for PACKAGE in \
platform-browser \
platform-browser-dynamic \
platform-server \
platform-webworker \
platform-webworker-dynamic \
http \
router \
upgrade \

View File

@ -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',

View File

@ -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'] %>"
}
}

View File

@ -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<PlatformRef> {
// 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 : [];
}

View File

@ -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
};

View File

@ -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",

View File

@ -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(); }

View File

@ -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';

View File

@ -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
};

View File

@ -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;

View File

@ -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 {

View File

@ -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.

View File

@ -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"
}
}

View File

@ -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'
}
}

View File

@ -0,0 +1 @@
../../facade/src

View File

@ -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
}]);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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"
]
}

View File

@ -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.

View File

@ -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"
}
}

View File

@ -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'
}
}

View File

@ -0,0 +1 @@
../../facade/src

View File

@ -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<PlatformRef> {
// For now, just creates the worker ui platform...
return Promise.resolve(platformWorkerUi(([{
provide: WORKER_SCRIPT,
useValue: workerScriptUri,
}] as Provider[])
.concat(customProviders)));
}

View File

@ -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;

View File

@ -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;

View File

@ -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';

View File

@ -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]}
];

View File

@ -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';

View File

@ -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';

View File

@ -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();
}

View File

@ -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,

View File

@ -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';

View File

@ -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';
/*

View File

@ -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', () => {

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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() {

View File

@ -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); }

View File

@ -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
}
}

View File

@ -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'}
}

View File

@ -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);
}
}

View File

@ -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');

View File

@ -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'

View File

@ -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';

View File

@ -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');

View File

@ -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'
}

View File

@ -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';

View File

@ -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');

View File

@ -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'

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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'
},

View File

@ -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';

View File

@ -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);

View File

@ -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';

View File

@ -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'

View File

@ -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';

View File

@ -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');

View File

@ -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'

View File

@ -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'
}
}
});

View File

@ -1,11 +1,5 @@
/** @experimental */
export declare function bootstrapWorkerUi(workerScriptUri: string, customProviders?: Provider[]): Promise<PlatformRef>;
/** @experimental */
export declare const platformBrowserDynamic: (extraProviders?: Provider[]) => PlatformRef;
/** @experimental */
export declare const platformWorkerAppDynamic: (extraProviders?: Provider[]) => PlatformRef;
/** @experimental */
export declare const RESOURCE_CACHE_PROVIDER: Provider[];

View File

@ -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<DebugElement>;
@ -31,16 +16,6 @@ export declare class By {
static directive(type: Type<any>): Predicate<DebugElement>;
}
/** @experimental */
export declare abstract class ClientMessageBroker {
abstract runOnService(args: UiArguments, returnType: Type<any>): Promise<any>;
}
/** @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<any>;
value: any;
constructor(value: any, type: Type<any>);
}
/** @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<any>;
abstract initChannel(channel: string, runInZone?: boolean): void;
abstract to(channel: string): EventEmitter<any>;
}
/** @experimental */
export interface MessageBusSink {
attachToZone(zone: NgZone): void;
initChannel(channel: string, runInZone: boolean): void;
to(channel: string): EventEmitter<any>;
}
/** @experimental */
export interface MessageBusSource {
attachToZone(zone: NgZone): void;
from(channel: string): EventEmitter<any>;
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<any>;
/** @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<any>[], method: Function, returnType?: Type<any>): 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<boolean>;
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 {
}

View File

@ -0,0 +1,2 @@
/** @experimental */
export declare const platformWorkerAppDynamic: (extraProviders?: Provider[]) => PlatformRef;

View File

@ -0,0 +1,96 @@
/** @experimental */
export declare function bootstrapWorkerUi(workerScriptUri: string, customProviders?: Provider[]): Promise<PlatformRef>;
/** @experimental */
export declare abstract class ClientMessageBroker {
abstract runOnService(args: UiArguments, returnType: Type<any>): Promise<any>;
}
/** @experimental */
export declare abstract class ClientMessageBrokerFactory {
abstract createMessageBroker(channel: string, runInZone?: boolean): ClientMessageBroker;
}
/** @experimental */
export declare class FnArg {
type: Type<any>;
value: any;
constructor(value: any, type: Type<any>);
}
/** @experimental */
export declare abstract class MessageBus implements MessageBusSource, MessageBusSink {
abstract attachToZone(zone: NgZone): void;
abstract from(channel: string): EventEmitter<any>;
abstract initChannel(channel: string, runInZone?: boolean): void;
abstract to(channel: string): EventEmitter<any>;
}
/** @experimental */
export interface MessageBusSink {
attachToZone(zone: NgZone): void;
initChannel(channel: string, runInZone: boolean): void;
to(channel: string): EventEmitter<any>;
}
/** @experimental */
export interface MessageBusSource {
attachToZone(zone: NgZone): void;
from(channel: string): EventEmitter<any>;
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<any>;
/** @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<any>[], method: Function, returnType?: Type<any>): 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<boolean>;
multi: boolean;
deps: (typeof NgZone | typeof PlatformLocation)[];
})[];
/** @experimental */
export declare const WORKER_UI_LOCATION_PROVIDERS: Provider[];
/** @experimental */
export declare class WorkerAppModule {
}