fix(WebWorker): remove the platform-browser dependency on compiler

This commit is contained in:
Victor Berchet
2016-05-13 13:22:29 -07:00
parent a01a54c180
commit 6e62217b78
92 changed files with 1331 additions and 496 deletions

View File

@ -4,25 +4,28 @@ import {
ApplicationRef,
PlatformRef,
ReflectiveInjector,
Provider,
getPlatform,
createPlatform,
assertPlatform
} from '@angular/core';
import {WORKER_RENDER_APPLICATION} from './webworker/worker_render';
import {WORKER_RENDER_APPLICATION_PROVIDERS} from './webworker/worker_render';
import {
WORKER_SCRIPT,
WORKER_RENDER_PLATFORM,
WORKER_RENDER_PLATFORM_PROVIDERS,
WORKER_RENDER_PLATFORM_MARKER
} from './webworker/worker_render_common';
export {
WORKER_SCRIPT,
WORKER_RENDER_PLATFORM,
WORKER_RENDER_PLATFORM_PROVIDERS,
initializeGenericWorkerRenderer,
WORKER_RENDER_APPLICATION_COMMON
WORKER_RENDER_APPLICATION_COMMON_PROVIDERS
} from './webworker/worker_render_common';
export {WORKER_RENDER_APPLICATION, WebWorkerInstance} from './webworker/worker_render';
export {
WORKER_RENDER_APPLICATION_PROVIDERS,
WORKER_RENDER_STARTABLE_MESSAGING_SERVICE,
WebWorkerInstance
} from './webworker/worker_render';
export {
ClientMessageBroker,
ClientMessageBrokerFactory,
@ -37,26 +40,21 @@ export {
export {PRIMITIVE} from './web_workers/shared/serializer';
export * from './web_workers/shared/message_bus';
/**
* @deprecated Use WORKER_RENDER_APPLICATION
*/
export const WORKER_RENDER_APP = WORKER_RENDER_APPLICATION;
export {WORKER_RENDER_ROUTER} from '../src/web_workers/ui/router_providers';
export {WORKER_RENDER_LOCATION_PROVIDERS} from '../src/web_workers/ui/location_providers';
export function workerRenderPlatform(): PlatformRef {
if (isBlank(getPlatform())) {
createPlatform(ReflectiveInjector.resolveAndCreate(WORKER_RENDER_PLATFORM));
createPlatform(ReflectiveInjector.resolveAndCreate(WORKER_RENDER_PLATFORM_PROVIDERS));
}
return assertPlatform(WORKER_RENDER_PLATFORM_MARKER);
}
export function bootstrapRender(
export function bootstrapStaticRender(
workerScriptUri: string,
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ApplicationRef> {
var pf = ReflectiveInjector.resolveAndCreate(WORKER_RENDER_PLATFORM);
var app = ReflectiveInjector.resolveAndCreate(
[
WORKER_RENDER_APPLICATION,
WORKER_RENDER_APPLICATION_PROVIDERS,
/* @ts2dart_Provider */ {provide: WORKER_SCRIPT, useValue: workerScriptUri},
isPresent(customProviders) ? customProviders : []
],