From 329a6e00dca792731748f34e6731de14fe85e9cd Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 24 Jul 2015 14:56:57 -0700 Subject: [PATCH] chore(API): cleaned up top level imports (render) --- modules/angular2/angular2.ts | 19 ++------ modules/angular2/angular2_exports.ts | 19 ++------ modules/angular2/bootstrap.ts | 45 +++---------------- modules/angular2/change_detection.ts | 11 +---- modules/angular2/render.ts | 18 +++++--- .../angular2/src/core/application_common.ts | 2 +- modules/angular2/src/render/render.ts | 13 ++++++ modules/angular2/src/test_lib/spies.dart | 4 +- .../src/web-workers/shared/serializer.ts | 2 +- .../src/web-workers/ui/di_bindings.ts | 2 +- .../web-workers/worker/application_common.ts | 2 +- .../compiler/projection_integration_spec.ts | 2 +- .../core/compiler/view_manager_utils_spec.ts | 6 ++- .../dom/dom_renderer_integration_spec.ts | 2 +- .../proto_view_merger_integration_spec.ts | 2 +- 15 files changed, 51 insertions(+), 98 deletions(-) create mode 100644 modules/angular2/src/render/render.ts diff --git a/modules/angular2/angular2.ts b/modules/angular2/angular2.ts index ecac884c6a..08fdd54b1f 100644 --- a/modules/angular2/angular2.ts +++ b/modules/angular2/angular2.ts @@ -8,23 +8,10 @@ export {commonBootstrap as bootstrap} from 'angular2/src/core/application_common // to resolve imports very very very slowly. See also a similar notice in // bootstrap.ts export * from './annotations'; -export * from './core'; export * from './change_detection'; +export * from './core'; export * from './di'; -export * from './forms'; export * from './directives'; export * from './http'; -export { - RenderEventDispatcher, - Renderer, - RenderElementRef, - RenderViewRef, - RenderProtoViewRef, - RenderFragmentRef, - RenderViewWithFragments -} from 'angular2/src/render/api'; -export { - DomRenderer, - DOCUMENT_TOKEN, - DOM_REFLECT_PROPERTIES_AS_ATTRIBUTES -} from 'angular2/src/render/dom/dom_renderer'; +export * from './forms'; +export * from './render'; diff --git a/modules/angular2/angular2_exports.ts b/modules/angular2/angular2_exports.ts index fdc186a947..90609268f3 100644 --- a/modules/angular2/angular2_exports.ts +++ b/modules/angular2/angular2_exports.ts @@ -1,21 +1,8 @@ export * from './annotations'; -export * from './core'; export * from './change_detection'; +export * from './core'; export * from './di'; -export * from './forms'; export * from './directives'; export * from './http'; -export { - RenderEventDispatcher, - Renderer, - RenderElementRef, - RenderViewRef, - RenderProtoViewRef, - RenderFragmentRef, - RenderViewWithFragments -} from 'angular2/src/render/api'; -export { - DomRenderer, - DOCUMENT_TOKEN, - DOM_REFLECT_PROPERTIES_AS_ATTRIBUTES -} from 'angular2/src/render/dom/dom_renderer'; +export * from './forms'; +export * from './render'; diff --git a/modules/angular2/bootstrap.ts b/modules/angular2/bootstrap.ts index 8aaae9ba47..1c378b2e72 100644 --- a/modules/angular2/bootstrap.ts +++ b/modules/angular2/bootstrap.ts @@ -7,46 +7,11 @@ export {bootstrap} from 'angular2/src/core/application'; // angular2_exports.ts. Re-exporting from angular2_exports.ts causes systemjs // to resolve imports very very very slowly. See also a similar notice in // angular2.ts -export * from 'angular2/annotations'; -export * from 'angular2/core'; - -export { - DehydratedException, - ExpressionChangedAfterItHasBeenChecked, - ChangeDetectionError, - - ON_PUSH, - DEFAULT, - - ChangeDetectorRef, - - Pipes, - WrappedValue, - Pipe, - PipeFactory, - NullPipe, - NullPipeFactory, - defaultPipes, - BasePipe, - - Locals -} from './change_detection'; - +export * from './annotations'; +export * from './change_detection'; +export * from './core'; export * from './di'; -export * from './forms'; export * from './directives'; export * from './http'; -export { - RenderEventDispatcher, - Renderer, - RenderElementRef, - RenderViewRef, - RenderProtoViewRef, - RenderFragmentRef, - RenderViewWithFragments -} from 'angular2/src/render/api'; -export { - DomRenderer, - DOCUMENT_TOKEN, - DOM_REFLECT_PROPERTIES_AS_ATTRIBUTES -} from 'angular2/src/render/dom/dom_renderer'; +export * from './forms'; +export * from './render'; diff --git a/modules/angular2/change_detection.ts b/modules/angular2/change_detection.ts index d79b7c8dda..0ee9ed98f4 100644 --- a/modules/angular2/change_detection.ts +++ b/modules/angular2/change_detection.ts @@ -23,14 +23,5 @@ export { PipeFactory, BasePipe, NullPipe, - NullPipeFactory, - - ChangeDetector, - ChangeDispatcher, - ChangeDetection, - ChangeDetectorDefinition, - DynamicChangeDetection, - JitChangeDetection, - PreGeneratedChangeDetection, - preGeneratedProtoDetectors + NullPipeFactory } from 'angular2/src/change_detection/change_detection'; diff --git a/modules/angular2/render.ts b/modules/angular2/render.ts index 1737f2bf8a..67e883f667 100644 --- a/modules/angular2/render.ts +++ b/modules/angular2/render.ts @@ -4,9 +4,15 @@ * This module provides advanced support for extending dom strategy. */ -export * from './src/render/dom/compiler/view_loader'; -export * from './src/render/dom/shadow_dom/shadow_dom_strategy'; -export * from './src/render/dom/shadow_dom/native_shadow_dom_strategy'; -export * from './src/render/dom/shadow_dom/emulated_scoped_shadow_dom_strategy'; -export * from './src/render/dom/shadow_dom/emulated_unscoped_shadow_dom_strategy'; -export * from './src/render/api'; +export { + RenderEventDispatcher, + Renderer, + RenderElementRef, + RenderViewRef, + RenderProtoViewRef, + RenderFragmentRef, + RenderViewWithFragments, + DomRenderer, + DOCUMENT_TOKEN, + DOM_REFLECT_PROPERTIES_AS_ATTRIBUTES +} from './src/render/render'; diff --git a/modules/angular2/src/core/application_common.ts b/modules/angular2/src/core/application_common.ts index d9870b5985..8b4b396346 100644 --- a/modules/angular2/src/core/application_common.ts +++ b/modules/angular2/src/core/application_common.ts @@ -22,7 +22,7 @@ import { PreGeneratedChangeDetection, Pipes, defaultPipes -} from 'angular2/change_detection'; +} from 'angular2/src/change_detection/change_detection'; import {ExceptionHandler} from './exception_handler'; import {ViewLoader} from 'angular2/src/render/dom/compiler/view_loader'; import {StyleUrlResolver} from 'angular2/src/render/dom/compiler/style_url_resolver'; diff --git a/modules/angular2/src/render/render.ts b/modules/angular2/src/render/render.ts new file mode 100644 index 0000000000..83409e3910 --- /dev/null +++ b/modules/angular2/src/render/render.ts @@ -0,0 +1,13 @@ +/** + * @module + * @description + * This module provides advanced support for extending dom strategy. + */ + +export * from './dom/compiler/view_loader'; +export * from './dom/dom_renderer'; +export * from './dom/shadow_dom/shadow_dom_strategy'; +export * from './dom/shadow_dom/native_shadow_dom_strategy'; +export * from './dom/shadow_dom/emulated_scoped_shadow_dom_strategy'; +export * from './dom/shadow_dom/emulated_unscoped_shadow_dom_strategy'; +export * from './api'; diff --git a/modules/angular2/src/test_lib/spies.dart b/modules/angular2/src/test_lib/spies.dart index e31f2ed501..a287e3b5f5 100644 --- a/modules/angular2/src/test_lib/spies.dart +++ b/modules/angular2/src/test_lib/spies.dart @@ -1,6 +1,6 @@ library test_lib.spies; -import 'package:angular2/change_detection.dart'; +import 'package:angular2/src/change_detection/change_detection.dart'; import 'package:angular2/di.dart'; import './test_lib.dart'; @@ -32,4 +32,4 @@ class SpyDependencyProvider extends SpyObject implements DependencyProvider { @proxy class SpyChangeDetectorRef extends SpyObject implements ChangeDetectorRef { noSuchMethod(m) => super.noSuchMethod(m); -} \ No newline at end of file +} diff --git a/modules/angular2/src/web-workers/shared/serializer.ts b/modules/angular2/src/web-workers/shared/serializer.ts index 1fb9b0d24d..8a84ad6886 100644 --- a/modules/angular2/src/web-workers/shared/serializer.ts +++ b/modules/angular2/src/web-workers/shared/serializer.ts @@ -16,7 +16,7 @@ import { ViewType } from "angular2/src/render/api"; import {WorkerElementRef} from 'angular2/src/web-workers/shared/api'; -import {AST, ASTWithSource} from "angular2/change_detection"; +import {AST, ASTWithSource} from 'angular2/src/change_detection/change_detection'; import {Parser} from "angular2/src/change_detection/parser/parser"; import {Injectable} from "angular2/di"; import {RenderProtoViewRefStore} from 'angular2/src/web-workers/shared/render_proto_view_ref_store'; diff --git a/modules/angular2/src/web-workers/ui/di_bindings.ts b/modules/angular2/src/web-workers/ui/di_bindings.ts index dd4b364f46..f137278784 100644 --- a/modules/angular2/src/web-workers/ui/di_bindings.ts +++ b/modules/angular2/src/web-workers/ui/di_bindings.ts @@ -13,7 +13,7 @@ import { PreGeneratedChangeDetection, Pipes, defaultPipes -} from 'angular2/change_detection'; +} from 'angular2/src/change_detection/change_detection'; import {EventManager, DomEventsPlugin} from 'angular2/src/render/dom/events/event_manager'; import {Compiler, CompilerCache} from 'angular2/src/core/compiler/compiler'; import {BrowserDomAdapter} from 'angular2/src/dom/browser_adapter'; diff --git a/modules/angular2/src/web-workers/worker/application_common.ts b/modules/angular2/src/web-workers/worker/application_common.ts index 89c96189be..a1000fe181 100644 --- a/modules/angular2/src/web-workers/worker/application_common.ts +++ b/modules/angular2/src/web-workers/worker/application_common.ts @@ -20,7 +20,7 @@ import { Pipes, defaultPipes, PreGeneratedChangeDetection -} from 'angular2/change_detection'; +} from 'angular2/src/change_detection/change_detection'; import {StyleUrlResolver} from 'angular2/src/render/dom/compiler/style_url_resolver'; import {ExceptionHandler} from 'angular2/src/core/exception_handler'; import {DirectiveResolver} from 'angular2/src/core/compiler/directive_resolver'; diff --git a/modules/angular2/test/core/compiler/projection_integration_spec.ts b/modules/angular2/test/core/compiler/projection_integration_spec.ts index aeafe43460..186f2b8460 100644 --- a/modules/angular2/test/core/compiler/projection_integration_spec.ts +++ b/modules/angular2/test/core/compiler/projection_integration_spec.ts @@ -36,7 +36,7 @@ import { TemplateRef, bind } from 'angular2/angular2'; -import {ShadowDomStrategy, NativeShadowDomStrategy} from 'angular2/render'; +import {ShadowDomStrategy, NativeShadowDomStrategy} from 'angular2/src/render/render'; export function main() { describe('projection', () => { diff --git a/modules/angular2/test/core/compiler/view_manager_utils_spec.ts b/modules/angular2/test/core/compiler/view_manager_utils_spec.ts index 57bfc53a7a..4e9530e989 100644 --- a/modules/angular2/test/core/compiler/view_manager_utils_spec.ts +++ b/modules/angular2/test/core/compiler/view_manager_utils_spec.ts @@ -34,7 +34,11 @@ import { import {DirectiveResolver} from 'angular2/src/core/compiler/directive_resolver'; import {Component} from 'angular2/annotations'; import {AppViewManagerUtils} from 'angular2/src/core/compiler/view_manager_utils'; -import {RenderProtoViewMergeMapping, ViewType, RenderViewWithFragments} from 'angular2/render'; +import { + RenderProtoViewMergeMapping, + ViewType, + RenderViewWithFragments +} from 'angular2/src/render/render'; export function main() { // TODO(tbosch): add more tests here! diff --git a/modules/angular2/test/render/dom/dom_renderer_integration_spec.ts b/modules/angular2/test/render/dom/dom_renderer_integration_spec.ts index 0faef271da..b6c2f0c957 100644 --- a/modules/angular2/test/render/dom/dom_renderer_integration_spec.ts +++ b/modules/angular2/test/render/dom/dom_renderer_integration_spec.ts @@ -20,7 +20,7 @@ import {DomTestbed, TestRootView, elRef} from './dom_testbed'; import {ViewDefinition, DirectiveMetadata, RenderViewRef} from 'angular2/src/render/api'; import {DOM_REFLECT_PROPERTIES_AS_ATTRIBUTES} from 'angular2/src/render/dom/dom_renderer'; -import {ShadowDomStrategy, NativeShadowDomStrategy} from 'angular2/render'; +import {ShadowDomStrategy, NativeShadowDomStrategy} from 'angular2/src/render/render'; import {bind} from 'angular2/di'; export function main() { diff --git a/modules/angular2/test/render/dom/view/proto_view_merger_integration_spec.ts b/modules/angular2/test/render/dom/view/proto_view_merger_integration_spec.ts index 952f7bd3e8..74791b7256 100644 --- a/modules/angular2/test/render/dom/view/proto_view_merger_integration_spec.ts +++ b/modules/angular2/test/render/dom/view/proto_view_merger_integration_spec.ts @@ -29,7 +29,7 @@ import {DOM} from 'angular2/src/dom/dom_adapter'; import {cloneAndQueryProtoView} from 'angular2/src/render/dom/util'; import {resolveInternalDomProtoView} from 'angular2/src/render/dom/view/proto_view'; -import {ShadowDomStrategy, NativeShadowDomStrategy} from 'angular2/render'; +import {ShadowDomStrategy, NativeShadowDomStrategy} from 'angular2/src/render/render'; export function main() { describe('ProtoViewMerger integration test', () => {