cleanup(tooling): move tooling to the browser platform and rename profile into instrumentation

BREAKING CHANGE

Before

import * as p from 'angular2/profile';
import * as t from 'angular2/tools';

After

import * as p from 'angular2/instrumentation';
import * as t from 'angular2/platform/browser';
This commit is contained in:
vsavkin 2015-11-23 10:18:04 -08:00 committed by Victor Savkin
parent 9ae171e0c8
commit 89eefcd7b5
54 changed files with 72 additions and 64 deletions

View File

@ -14,7 +14,7 @@ Ctrl + Shift + j.
By default the debug tools are disabled. You can enable debug tools as follows:
```typescript
import 'angular2/tools';
import {enableDebugTools} 'angular2/platform/browser';
bootstrap(Application).then((appRef) => {
enableDebugTools(appRef);

View File

@ -1,6 +1,6 @@
export * from './common';
export * from './core';
export * from './profile';
export * from './instrumentation';
export * from './platform/browser';
export * from './src/platform/dom/dom_adapter';
export * from './upgrade';

View File

@ -4,7 +4,7 @@
* The http module provides services to perform http requests. To get started, see the {@link Http}
* class.
*/
import {provide, Provider} from 'angular2/angular2';
import {provide, Provider} from 'angular2/core';
import {Http, Jsonp} from './src/http/http';
import {XHRBackend, XHRConnection} from './src/http/backends/xhr_backend';
import {JSONPBackend, JSONPBackend_, JSONPConnection} from './src/http/backends/jsonp_backend';

View File

@ -6,7 +6,9 @@ export {
BrowserDomAdapter,
By,
Title,
DOCUMENT
DOCUMENT,
enableDebugTools,
disableDebugTools
} from 'angular2/src/platform/browser_common';
import {Type, isPresent, CONST_EXPR} from 'angular2/src/facade/lang';

View File

@ -5,7 +5,9 @@ export {
inspectNativeElement,
BrowserDomAdapter,
By,
Title
Title,
enableDebugTools,
disableDebugTools
} from 'angular2/src/platform/browser_common';
import {Type, isPresent, CONST_EXPR} from 'angular2/src/facade/lang';

View File

@ -5,4 +5,6 @@ export {DOM, setRootDomAdapter, DomAdapter} from 'angular2/src/platform/dom/dom_
export {DomRenderer} from 'angular2/src/platform/dom/dom_renderer';
export {DOCUMENT} from 'angular2/src/platform/dom/dom_tokens';
export {SharedStylesHost, DomSharedStylesHost} from 'angular2/src/platform/dom/shared_styles_host';
export {DomEventsPlugin} from 'angular2/src/platform/dom/events/dom_events';
export {DomEventsPlugin} from 'angular2/src/platform/dom/events/dom_events';
export * from 'angular2/src/platform/dom/debug/by';
export * from 'angular2/src/platform/dom/debug/debug_element_view_listener';

View File

@ -18,7 +18,7 @@ export * from './src/router/route_definition';
export {OnActivate, OnDeactivate, OnReuse, CanDeactivate, CanReuse} from './src/router/interfaces';
export {CanActivate} from './src/router/lifecycle_annotations';
export {Instruction, ComponentInstruction} from './src/router/instruction';
export {OpaqueToken} from 'angular2/angular2';
export {OpaqueToken} from 'angular2/core';
import {LocationStrategy} from './src/router/location_strategy';
import {PathLocationStrategy} from './src/router/path_location_strategy';
@ -27,7 +27,7 @@ import {RouterOutlet} from './src/router/router_outlet';
import {RouterLink} from './src/router/router_link';
import {RouteRegistry} from './src/router/route_registry';
import {Location} from './src/router/location';
import {ApplicationRef, provide, OpaqueToken, Provider} from 'angular2/angular2';
import {ApplicationRef, provide, OpaqueToken, Provider} from 'angular2/core';
import {CONST_EXPR} from './src/facade/lang';
import {BaseException} from 'angular2/src/facade/exceptions';

View File

@ -1,4 +1,4 @@
import {Injectable} from 'angular2/angular2';
import {Injectable} from 'angular2/core';
import {global} from 'angular2/src/facade/lang';
let _nextRequestId = 0;

View File

@ -1,4 +1,4 @@
import {Injectable} from 'angular2/angular2';
import {Injectable} from 'angular2/core';
// Make sure not to evaluate this in a non-browser environment!
@Injectable()

View File

@ -3,11 +3,11 @@ import {ReadyStates, RequestMethods, ResponseTypes} from '../enums';
import {Request} from '../static_request';
import {Response} from '../static_response';
import {ResponseOptions, BaseResponseOptions} from '../base_response_options';
import {Injectable} from 'angular2/angular2';
import {Injectable} from 'angular2/core';
import {BrowserJsonp} from './browser_jsonp';
import {makeTypeError} from 'angular2/src/facade/exceptions';
import {StringWrapper, isPresent} from 'angular2/src/facade/lang';
import {Observable} from 'angular2/angular2';
import {Observable} from 'angular2/core';
const JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.';
const JSONP_ERR_WRONG_METHOD = 'JSONP requests must use GET request method.';

View File

@ -1,4 +1,4 @@
import {Injectable} from 'angular2/angular2';
import {Injectable} from 'angular2/core';
import {Request} from '../static_request';
import {Response} from '../static_response';
import {ReadyStates} from '../enums';

View File

@ -4,7 +4,7 @@ import {Request} from '../static_request';
import {Response} from '../static_response';
import {Headers} from '../headers';
import {ResponseOptions, BaseResponseOptions} from '../base_response_options';
import {Injectable} from 'angular2/angular2';
import {Injectable} from 'angular2/core';
import {BrowserXhr} from './browser_xhr';
import {isPresent} from 'angular2/src/facade/lang';
import {Observable} from 'angular2/angular2';

View File

@ -2,7 +2,7 @@ import {isPresent, isString} from 'angular2/src/facade/lang';
import {Headers} from './headers';
import {RequestMethods} from './enums';
import {RequestOptionsArgs} from './interfaces';
import {Injectable} from 'angular2/angular2';
import {Injectable} from 'angular2/core';
import {URLSearchParams} from './url_search_params';
import {normalizeMethodName} from './http_utils';

View File

@ -1,4 +1,4 @@
import {Injectable} from 'angular2/angular2';
import {Injectable} from 'angular2/core';
import {isPresent, isJsObject} from 'angular2/src/facade/lang';
import {Headers} from './headers';
import {ResponseTypes} from './enums';

View File

@ -1,12 +1,12 @@
import {isString, isPresent, isBlank} from 'angular2/src/facade/lang';
import {makeTypeError} from 'angular2/src/facade/exceptions';
import {Injectable} from 'angular2/angular2';
import {Injectable} from 'angular2/core';
import {RequestOptionsArgs, Connection, ConnectionBackend} from './interfaces';
import {Request} from './static_request';
import {Response} from './static_response';
import {BaseRequestOptions, RequestOptions} from './base_request_options';
import {RequestMethods} from './enums';
import {Observable} from 'angular2/angular2';
import {Observable} from 'angular2/core';
function httpRequest(backend: ConnectionBackend, request: Request): Observable<Response> {
return backend.createConnection(request).response;

View File

@ -33,13 +33,14 @@ import {wtfInit} from 'angular2/src/core/profile/wtf_init';
export {DOCUMENT} from 'angular2/src/platform/dom/dom_tokens';
export {Title} from 'angular2/src/platform/browser/title';
export {
// DebugElementViewListener,
DebugElementViewListener,
ELEMENT_PROBE_PROVIDERS,
ELEMENT_PROBE_BINDINGS,
inspectNativeElement
} from 'angular2/src/platform/browser/debug/debug_element_view_listener';
export {By} from 'angular2/src/platform/browser/debug/by';
inspectNativeElement,
By
} from 'angular2/platform/common_dom';
export {BrowserDomAdapter} from './browser/browser_adapter';
export {enableDebugTools, disableDebugTools} from 'angular2/src/platform/browser/tools/tools';
export const BROWSER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
PLATFORM_COMMON_PROVIDERS,

View File

@ -1,5 +1,5 @@
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {Injectable} from 'angular2/angular2';
import {Injectable} from 'angular2/core';
import {LocationStrategy, normalizeQueryParams} from './location_strategy';
import {EventListener, History, Location} from 'angular2/src/facade/browser';

View File

@ -1,6 +1,6 @@
import {LocationStrategy} from './location_strategy';
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
import {Injectable, Inject} from 'angular2/angular2';
import {Injectable, Inject} from 'angular2/core';
/**
* `Location` is a service that applications can use to interact with a browser's URL.

View File

@ -1,5 +1,5 @@
import {CONST_EXPR} from 'angular2/src/facade/lang';
import {OpaqueToken} from 'angular2/angular2';
import {OpaqueToken} from 'angular2/core';
/**
* `LocationStrategy` is responsible for representing and reading route state

View File

@ -1,5 +1,5 @@
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {Injectable, Inject} from 'angular2/angular2';
import {Injectable, Inject} from 'angular2/core';
import {EventListener, History, Location} from 'angular2/src/facade/browser';
import {isBlank} from 'angular2/src/facade/lang';
import {BaseException} from 'angular2/src/facade/exceptions';

View File

@ -1,4 +1,4 @@
import {Directive} from 'angular2/angular2';
import {Directive} from 'angular2/core';
import {isString} from 'angular2/src/facade/lang';
import {Router} from './router';

View File

@ -12,7 +12,7 @@ import {
Injector,
provide,
Dependency
} from 'angular2/angular2';
} from 'angular2/core';
import * as routerMod from './router';
import {ComponentInstruction, RouteParams, RouteData} from './instruction';

View File

@ -31,9 +31,7 @@ import {MockNgZone} from 'angular2/src/mock/ng_zone_mock';
import {TestComponentBuilder} from './test_component_builder';
import {Injector} from 'angular2/src/core/di';
import {
ELEMENT_PROBE_PROVIDERS
} from 'angular2/src/platform/browser/debug/debug_element_view_listener';
import {ELEMENT_PROBE_PROVIDERS} from 'angular2/platform/common_dom';
import {ListWrapper} from 'angular2/src/facade/collection';
import {FunctionWrapper, Type} from 'angular2/src/facade/lang';

View File

@ -15,7 +15,8 @@ import {
xit,
} from 'angular2/testing_internal';
import {ListWrapper, StringMapWrapper, SetWrapper} from 'angular2/src/facade/collection';
import {Component, View, NgFor, provide} from 'angular2/angular2';
import {Component, View, provide} from 'angular2/core';
import {NgFor} from 'angular2/common';
import {NgClass} from 'angular2/src/common/directives/ng_class';
import {APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/linker/view_pool';

View File

@ -14,9 +14,7 @@ import {
} from 'angular2/testing_internal';
import {ListWrapper} from 'angular2/src/facade/collection';
import {Component, View, TemplateRef, ContentChild} from 'angular2/angular2';
import {Component, View, TemplateRef, ContentChild} from 'angular2/core';
import {NgFor} from 'angular2/src/common/directives/ng_for';

View File

@ -16,7 +16,7 @@ import {
import {StringMapWrapper} from 'angular2/src/facade/collection';
import {Component, View} from 'angular2/angular2';
import {Component, View} from 'angular2/core';
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {NgStyle} from 'angular2/src/common/directives/ng_style';

View File

@ -12,7 +12,7 @@ import {
xit,
} from 'angular2/testing_internal';
import {Component, View} from 'angular2/angular2';
import {Component, View} from 'angular2/core';
import {NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/src/common/directives/ng_switch';

View File

@ -1,4 +1,4 @@
import {Component, Directive, View, Output, EventEmitter} from 'angular2/angular2';
import {Component, Directive, View, Output, EventEmitter} from 'angular2/core';
import {
ComponentFixture,
afterEach,
@ -33,7 +33,6 @@ import {
Validators,
Validator
} from 'angular2/common';
import {Input, Provider, forwardRef} from 'angular2/core';
import {By} from 'angular2/platform/browser';
import {ListWrapper} from 'angular2/src/facade/collection';
import {ObservableWrapper} from 'angular2/src/facade/async';

View File

@ -21,7 +21,7 @@ import {PromiseWrapper, EventEmitter, ObservableWrapper} from 'angular2/src/faca
import {Injectable} from 'angular2/core';
import {NgFor, NgIf} from 'angular2/common';
import {Scope} from 'angular2/core';
import {By} from 'angular2/platform/browser';
import {By} from 'angular2/platform/common_dom';
import {
Directive,

View File

@ -19,7 +19,7 @@ import {
import {OnDestroy} from 'angular2/core';
import {Injector, inspectElement} from 'angular2/core';
import {NgIf} from 'angular2/common';
import {By} from 'angular2/platform/browser';
import {By} from 'angular2/platform/common_dom';
import {Component, View, ViewMetadata} from 'angular2/src/core/metadata';
import {DynamicComponentLoader} from 'angular2/src/core/linker/dynamic_component_loader';
import {ElementRef} from 'angular2/src/core/linker/element_ref';

View File

@ -36,7 +36,7 @@ import {
ViewEncapsulation,
ViewMetadata
} from 'angular2/core';
import {By} from 'angular2/platform/browser';
import {By} from 'angular2/platform/common_dom';
export function main() {
describe('projection', () => {

View File

@ -36,10 +36,8 @@ import {
} from 'angular2/core';
import {NgIf, NgFor} from 'angular2/common';
import {asNativeElements} from 'angular2/core';
import {BrowserDomAdapter} from 'angular2/src/platform/browser/browser_adapter';
export function main() {
BrowserDomAdapter.makeCurrent();
describe('Query API', () => {
describe("querying by directive type", () => {
it('should contain all direct child directives in the light dom (constructor)',

View File

@ -10,7 +10,7 @@ import {
xit,
} from 'angular2/testing_internal';
import {Component, View, Directive} from 'angular2/angular2';
import {Component, View, Directive} from 'angular2/core';
import {reflector} from 'angular2/src/core/reflection/reflection';
export function main() {

View File

@ -12,7 +12,7 @@ import {
import {makeDecorator, makeParamDecorator, Class} from 'angular2/src/core/util/decorators';
import {global} from 'angular2/src/facade/lang';
import {Inject} from 'angular2/angular2';
import {Inject} from 'angular2/core';
import {reflector} from 'angular2/src/core/reflection/reflection';
class TestAnnotation {

View File

@ -1,5 +1,5 @@
import {SpyObject} from 'angular2/testing_internal';
import {Injector, provide} from 'angular2/angular2';
import {Injector, provide} from 'angular2/core';
import {ComponentRef} from 'angular2/src/core/linker/dynamic_component_loader';
import {global} from 'angular2/src/facade/lang';
import {ApplicationRef, ApplicationRef_} from 'angular2/src/core/application_ref';

View File

@ -10,7 +10,7 @@ import {
xit
} from 'angular2/testing_internal';
import {enableDebugTools, disableDebugTools} from 'angular2/tools';
import {enableDebugTools, disableDebugTools} from 'angular2/platform/browser';
import {SpyComponentRef, callNgProfilerTimeChangeDetection} from './spies';
export function main() {

View File

@ -596,17 +596,16 @@ var NG_ALL = [
'DirectiveResolver',
'DirectiveResolver.resolve()',
'DynamicComponentLoader',
'DomAdapter',
'DomAdapter.attrToPropMap:dart',
'DomAdapter.attrToPropMap=:dart',
'setRootDomAdapter()',
'DOM',
'DomAdapter:js',
'setRootDomAdapter():js',
'DOM:js',
/*
Abstract methods
'DynamicComponentLoader.loadAsRoot()',
'DynamicComponentLoader.loadIntoLocation()',
'DynamicComponentLoader.loadNextToLocation()',
*/
'enableDebugTools():js',
'ELEMENT_PROBE_PROVIDERS:js',
'ELEMENT_PROBE_BINDINGS:js',
'ElementRef',
@ -1412,6 +1411,7 @@ var NG_ALL = [
'AfterViewInit:dart',
'ControlValueAccessor:dart',
'DoCheck:dart',
'disableDebugTools():js',
'Form:dart',
'HostViewRef:dart',
'HostViewRef.changeDetectorRef',

View File

@ -14,7 +14,7 @@ import {
xit,
} from 'angular2/testing_internal';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {Component, Directive, View} from 'angular2/src/core/metadata';
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {provide, ViewChild, AfterViewInit} from 'angular2/core';

View File

@ -11,7 +11,7 @@ import {
xit,
} from 'angular2/testing_internal';
import {bootstrap} from 'angular2/bootstrap';
import {bootstrap} from 'angular2/platform/browser';
import {Component, Directive, View} from 'angular2/src/core/metadata';
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {provide} from 'angular2/core';

View File

@ -17,7 +17,7 @@ import {
import {SpyRouter, SpyLocation} from './spies';
import {provide, Component, View} from 'angular2/core';
import {By} from 'angular2/platform/browser';
import {By} from 'angular2/platform/common_dom';
import {
Location,

View File

@ -16,7 +16,7 @@ import {
import {Injectable, bind} from 'angular2/core';
import {NgIf} from 'angular2/common';
import {Directive, Component, View, ViewMetadata} from 'angular2/angular2';
import {Directive, Component, View, ViewMetadata} from 'angular2/core';
import {XHR} from 'angular2/src/compiler/xhr';
import {XHRImpl} from 'angular2/src/platform/browser/xhr_impl';

View File

@ -11,7 +11,7 @@ import {
xit,
} from 'angular2/testing_internal';
import {Component, View} from 'angular2/angular2';
import {Component, View} from 'angular2/core';
import {getComponentInfo, parseFields} from 'angular2/src/upgrade/metadata';
import {DOM} from 'angular2/src/platform/dom/dom_adapter';

View File

@ -1,4 +0,0 @@
/*
* Debugging and profiling tools for Angular 2
*/
export {enableDebugTools, disableDebugTools} from 'angular2/src/tools/tools';

View File

@ -39,7 +39,7 @@ export * from '../src/common/forms';
export {DebugElement} from '../src/core/debug/debug_element';
export * from '../src/core/change_detection';
export * from '../profile';
export * from '../instrumentation';
export * from '../src/web_workers/worker/application';
export {
ClientMessageBroker,

View File

@ -25,8 +25,19 @@ module.exports = function makeNodeTree(projects, destinationPath) {
'angular2/test/testing/fake_async_spec.ts',
'angular2/test/testing/testing_public_spec.ts',
'angular2/test/platform/xhr_impl_spec.ts',
'angular2/test/platform/browser/**/*.ts',
'angular2/test/common/forms/**',
'angular2/test/tools/tools_spec.ts',
// we call browser's bootstrap
'angular2/test/router/route_config_spec.ts',
'angular2/test/router/integration/router_integration_spec.ts',
// we check the public api by importing angular2/angular2
'angular2/test/symbol_inspector/**/*.ts',
'angular2/test/public_api_spec.ts',
'angular2/test/upgrade/**/*.ts',
'angular1_router/**',
'angular2/examples/**/!(*_spec.ts)',
]