diff --git a/modules/angular2/src/compiler/anchor_based_app_root_url.ts b/modules/angular2/src/compiler/anchor_based_app_root_url.ts deleted file mode 100644 index c0a347de99..0000000000 --- a/modules/angular2/src/compiler/anchor_based_app_root_url.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {DOM} from "angular2/src/platform/dom/dom_adapter"; -import {Injectable} from "angular2/src/core/di"; - -/** - * Set the root url to the current page's url. - */ -@Injectable() -export class AnchorBasedAppRootUrl { - value: string; - constructor() { - // compute the root url - var a = DOM.createElement('a'); - DOM.resolveAndSetHref(a, './', null); - this.value = DOM.getHref(a); - } -} diff --git a/modules/angular2/src/compiler/compiler.ts b/modules/angular2/src/compiler/compiler.ts index 4ca4311835..76a112f879 100644 --- a/modules/angular2/src/compiler/compiler.ts +++ b/modules/angular2/src/compiler/compiler.ts @@ -25,7 +25,6 @@ import {RuntimeCompiler} from 'angular2/src/compiler/runtime_compiler'; import {ElementSchemaRegistry} from 'angular2/src/compiler/schema/element_schema_registry'; import {DomElementSchemaRegistry} from 'angular2/src/compiler/schema/dom_element_schema_registry'; import {UrlResolver, DEFAULT_PACKAGE_URL_PROVIDER} from 'angular2/src/compiler/url_resolver'; -import {AnchorBasedAppRootUrl} from 'angular2/src/compiler/anchor_based_app_root_url'; import {Parser, Lexer} from 'angular2/src/core/change_detection/change_detection'; function _createChangeDetectorGenConfig() { @@ -49,6 +48,5 @@ export const COMPILER_PROVIDERS: Array = CONST_EXPR([ new Provider(Compiler, {useExisting: RuntimeCompiler}), DomElementSchemaRegistry, new Provider(ElementSchemaRegistry, {useExisting: DomElementSchemaRegistry}), - AnchorBasedAppRootUrl, UrlResolver ]); diff --git a/modules/angular2/src/platform/worker_app_common.ts b/modules/angular2/src/platform/worker_app_common.ts index fef90aaf1d..c924180fac 100644 --- a/modules/angular2/src/platform/worker_app_common.ts +++ b/modules/angular2/src/platform/worker_app_common.ts @@ -31,9 +31,7 @@ import { } from 'angular2/src/web_workers/shared/render_view_with_fragments_store'; import {WebWorkerEventDispatcher} from 'angular2/src/web_workers/worker/event_dispatcher'; import {NgZone} from 'angular2/src/core/zone/ng_zone'; -import {Promise, PromiseWrapper, PromiseCompleter} from 'angular2/src/facade/async'; -import {SETUP_CHANNEL} from 'angular2/src/web_workers/shared/messaging_api'; -import {ObservableWrapper} from 'angular2/src/facade/async'; +import {Promise, PromiseWrapper} from 'angular2/src/facade/async'; class PrintLogger { log = print; @@ -76,20 +74,9 @@ function _exceptionHandler(): ExceptionHandler { */ export function genericWorkerAppProviders(bus: MessageBus, zone: NgZone): Promise> { - var bootstrapProcess: PromiseCompleter = PromiseWrapper.completer(); bus.attachToZone(zone); - bus.initChannel(SETUP_CHANNEL, false); - - var subscription: any; - var emitter = bus.from(SETUP_CHANNEL); - subscription = ObservableWrapper.subscribe(emitter, (initData: {[key: string]: any}) => { - var bindings = ListWrapper.concat(WORKER_APP_COMMON_PROVIDERS, [ - new Provider(MessageBus, {useValue: bus}), - ]); - bootstrapProcess.resolve(bindings); - ObservableWrapper.dispose(subscription); - }); - - ObservableWrapper.callNext(bus.to(SETUP_CHANNEL), "ready"); - return bootstrapProcess.promise; + var bindings = ListWrapper.concat(WORKER_APP_COMMON_PROVIDERS, [ + new Provider(MessageBus, {useValue: bus}), + ]); + return PromiseWrapper.resolve(bindings); } diff --git a/modules/angular2/src/platform/worker_render.ts b/modules/angular2/src/platform/worker_render.ts index c80bd35fb1..858ee860fa 100644 --- a/modules/angular2/src/platform/worker_render.ts +++ b/modules/angular2/src/platform/worker_render.ts @@ -6,7 +6,6 @@ import { import {MessageBus} from 'angular2/src/web_workers/shared/message_bus'; import {APP_INITIALIZER} from 'angular2/core'; import {Injector, Injectable, Provider} from 'angular2/src/core/di'; -import {WebWorkerSetup} from 'angular2/src/web_workers/ui/setup'; import {MessageBasedRenderer} from 'angular2/src/web_workers/ui/renderer'; import {MessageBasedXHRImpl} from 'angular2/src/web_workers/ui/xhr_impl'; import { diff --git a/modules/angular2/src/platform/worker_render_common.ts b/modules/angular2/src/platform/worker_render_common.ts index 288c071363..cf5c965d92 100644 --- a/modules/angular2/src/platform/worker_render_common.ts +++ b/modules/angular2/src/platform/worker_render_common.ts @@ -1,7 +1,6 @@ import {CONST_EXPR, IS_DART} from 'angular2/src/facade/lang'; import {MessageBus} from 'angular2/src/web_workers/shared/message_bus'; import {NgZone} from 'angular2/src/core/zone/ng_zone'; -import {AnchorBasedAppRootUrl} from 'angular2/src/compiler/anchor_based_app_root_url'; import { PLATFORM_DIRECTIVES, PLATFORM_PIPES, @@ -35,7 +34,6 @@ import {Testability} from 'angular2/src/core/testability/testability'; import {BrowserGetTestability} from 'angular2/src/platform/browser/testability'; import {BrowserDomAdapter} from './browser/browser_adapter'; import {wtfInit} from 'angular2/src/core/profile/wtf_init'; -import {WebWorkerSetup} from 'angular2/src/web_workers/ui/setup'; import {MessageBasedRenderer} from 'angular2/src/web_workers/ui/renderer'; import {MessageBasedXHRImpl} from 'angular2/src/web_workers/ui/xhr_impl'; import { @@ -57,7 +55,7 @@ export const WORKER_SCRIPT: OpaqueToken = CONST_EXPR(new OpaqueToken("WebWorkerS // Message based Worker classes that listen on the MessageBus export const WORKER_RENDER_MESSAGING_PROVIDERS: Array = - CONST_EXPR([MessageBasedRenderer, MessageBasedXHRImpl, WebWorkerSetup]); + CONST_EXPR([MessageBasedRenderer, MessageBasedXHRImpl]); export const WORKER_RENDER_PLATFORM: Array = CONST_EXPR([ PLATFORM_COMMON_PROVIDERS, @@ -81,7 +79,6 @@ export const WORKER_RENDER_APP_COMMON: Array = MessageBasedXHRImpl, new Provider(ServiceMessageBrokerFactory, {useClass: ServiceMessageBrokerFactory_}), new Provider(ClientMessageBrokerFactory, {useClass: ClientMessageBrokerFactory_}), - AnchorBasedAppRootUrl, Serializer, new Provider(ON_WEB_WORKER, {useValue: false}), RenderViewWithFragmentsStore, diff --git a/modules/angular2/src/web_workers/shared/messaging_api.ts b/modules/angular2/src/web_workers/shared/messaging_api.ts index 8f12ea3b07..e84a6b03e1 100644 --- a/modules/angular2/src/web_workers/shared/messaging_api.ts +++ b/modules/angular2/src/web_workers/shared/messaging_api.ts @@ -2,7 +2,6 @@ * All channels used by angular's WebWorker components are listed here. * You should not use these channels in your application code. */ -export const SETUP_CHANNEL = "ng-WebWorkerSetup"; export const RENDERER_CHANNEL = "ng-Renderer"; export const XHR_CHANNEL = "ng-XHR"; export const EVENT_CHANNEL = "ng-events"; diff --git a/modules/angular2/src/web_workers/ui/setup.ts b/modules/angular2/src/web_workers/ui/setup.ts deleted file mode 100644 index 3381e897f8..0000000000 --- a/modules/angular2/src/web_workers/ui/setup.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {SETUP_CHANNEL} from 'angular2/src/web_workers/shared/messaging_api'; -import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async'; -import {MessageBus} from 'angular2/src/web_workers/shared/message_bus'; -import {AnchorBasedAppRootUrl} from 'angular2/src/compiler/anchor_based_app_root_url'; -import {StringWrapper} from 'angular2/src/facade/lang'; -import {Injectable} from 'angular2/src/core/di'; - -@Injectable() -export class WebWorkerSetup { - rootUrl: string; - - constructor(private _bus: MessageBus, anchorBasedAppRootUrl: AnchorBasedAppRootUrl) { - this.rootUrl = anchorBasedAppRootUrl.value; - } - - start(): void { - this._bus.initChannel(SETUP_CHANNEL, false); - var sink = this._bus.to(SETUP_CHANNEL); - var source = this._bus.from(SETUP_CHANNEL); - - ObservableWrapper.subscribe(source, (message: string) => { - if (StringWrapper.equals(message, "ready")) { - ObservableWrapper.callEmit(sink, {"rootUrl": this.rootUrl}); - } - }); - } -} diff --git a/modules/angular2/test/public_api_spec.ts b/modules/angular2/test/public_api_spec.ts index 4177ee25bb..74023fa563 100644 --- a/modules/angular2/test/public_api_spec.ts +++ b/modules/angular2/test/public_api_spec.ts @@ -614,9 +614,6 @@ var NG_COMPILER = [ "VariableAst.sourceSpan=", "VariableAst.value", "VariableAst.value=", - "AppRootUrl", - "AppRootUrl.value", - "AppRootUrl.value=", "DEFAULT_PACKAGE_URL_PROVIDER", "UrlResolver", "UrlResolver.resolve()",