fix(compiler): remove AppRootUrl

Related to #5815

This should not break anything because AppRootUrl wasn't actually
being used by the compiler anymore.
This commit is contained in:
Jeff Cross 2015-12-10 16:11:53 -08:00
parent b1b0593ddf
commit ed2c25eb2f
8 changed files with 6 additions and 32 deletions

View File

@ -16,4 +16,3 @@ export 'package:angular2/src/platform/dom/dom_tokens.dart';
export 'package:angular2/src/platform/dom/dom_adapter.dart';
export 'package:angular2/src/platform/dom/events/event_manager.dart';
export 'package:angular2/src/compiler/url_resolver.dart';
export 'package:angular2/src/compiler/app_root_url.dart';

View File

@ -6,4 +6,3 @@
export * from './src/compiler/url_resolver';
export * from './src/compiler/xhr';
export * from './src/compiler/compiler';
export * from './src/compiler/app_root_url';

View File

@ -1,16 +1,14 @@
import {AppRootUrl} from "angular2/src/compiler/app_root_url";
import {DOM} from "angular2/src/platform/dom/dom_adapter";
import {Injectable} from "angular2/src/core/di";
/**
* Extension of {@link AppRootUrl} that uses a DOM anchor tag to set the root url to
* the current page's url.
* Set the root url to the current page's url.
*/
@Injectable()
export class AnchorBasedAppRootUrl extends AppRootUrl {
export class AnchorBasedAppRootUrl {
value: string;
constructor() {
super("");
// compute the root url to pass to AppRootUrl
// compute the root url
var a = DOM.createElement('a');
DOM.resolveAndSetHref(a, './', null);
this.value = DOM.getHref(a);

View File

@ -1,16 +0,0 @@
import {Injectable} from 'angular2/src/core/di';
import {isBlank} from 'angular2/src/facade/lang';
/**
* Specifies app root url for the application.
*
* Used by the {@link Compiler} when resolving HTML and CSS template URLs.
*
* This interface can be overridden by the application developer to create custom behavior.
*
* See {@link Compiler}
*/
@Injectable()
export class AppRootUrl {
constructor(public value: string) {}
}

View File

@ -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 {AppRootUrl} from 'angular2/src/compiler/app_root_url';
import {AnchorBasedAppRootUrl} from 'angular2/src/compiler/anchor_based_app_root_url';
import {Parser, Lexer} from 'angular2/src/core/change_detection/change_detection';
@ -51,6 +50,5 @@ export const COMPILER_PROVIDERS: Array<Type | Provider | any[]> = CONST_EXPR([
DomElementSchemaRegistry,
new Provider(ElementSchemaRegistry, {useExisting: DomElementSchemaRegistry}),
AnchorBasedAppRootUrl,
new Provider(AppRootUrl, {useExisting: AnchorBasedAppRootUrl}),
UrlResolver
]);

View File

@ -1,7 +1,6 @@
import {XHR} from 'angular2/src/compiler/xhr';
import {WebWorkerXHRImpl} from 'angular2/src/web_workers/worker/xhr_impl';
import {ListWrapper} from 'angular2/src/facade/collection';
import {AppRootUrl} from 'angular2/src/compiler/app_root_url';
import {WebWorkerRenderer} from 'angular2/src/web_workers/worker/renderer';
import {print, Type, CONST_EXPR, isPresent} from 'angular2/src/facade/lang';
import {MessageBus} from 'angular2/src/web_workers/shared/message_bus';
@ -86,7 +85,6 @@ export function genericWorkerAppProviders(bus: MessageBus,
subscription = ObservableWrapper.subscribe(emitter, (initData: {[key: string]: any}) => {
var bindings = ListWrapper.concat(WORKER_APP_COMMON_PROVIDERS, [
new Provider(MessageBus, {useValue: bus}),
new Provider(AppRootUrl, {useValue: new AppRootUrl(initData['rootUrl'])}),
]);
bootstrapProcess.resolve(bindings);
ObservableWrapper.dispose(subscription);

View File

@ -2,7 +2,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 {AppRootUrl} from 'angular2/src/compiler/app_root_url';
import {
PLATFORM_DIRECTIVES,
PLATFORM_PIPES,
@ -83,7 +82,6 @@ export const WORKER_RENDER_APP_COMMON: Array<any /*Type | Provider | any[]*/> =
new Provider(ServiceMessageBrokerFactory, {useClass: ServiceMessageBrokerFactory_}),
new Provider(ClientMessageBrokerFactory, {useClass: ClientMessageBrokerFactory_}),
AnchorBasedAppRootUrl,
new Provider(AppRootUrl, {useExisting: AnchorBasedAppRootUrl}),
Serializer,
new Provider(ON_WEB_WORKER, {useValue: false}),
RenderViewWithFragmentsStore,

View File

@ -1,6 +1,6 @@
export * from '../common';
export * from '../core';
export * from '../platform/worker_app';
export {UrlResolver, AppRootUrl} from '../compiler';
export {UrlResolver} from '../compiler';
export * from '../instrumentation';
export * from 'angular2/src/platform/worker_app';