From 125fa3885ec7f3ccfbc75849071eb88a9d663a14 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Thu, 19 Nov 2015 17:30:02 -0800 Subject: [PATCH] cleanup: removes the render and lifecycle_hooks modules BREAKING CHANGE Before import {Renderer} from 'angular2/render'; After import {Renderer} form 'angular2/core'; Closes #5367 --- modules/angular2/angular2.dart | 1 - modules/angular2/angular2.ts | 1 - modules/angular2/lifecycle_hooks.ts | 17 ----------------- modules/angular2/render.ts | 4 ---- modules/angular2/src/platform/browser_common.ts | 6 +++--- .../directive_lifecycle_integration_spec.ts | 2 +- .../linker/dynamic_component_loader_spec.ts | 2 +- .../test/core/linker/element_injector_spec.ts | 2 +- .../test/core/linker/view_manager_utils_spec.ts | 2 +- modules/angular2/web_worker/worker.ts | 2 +- modules/playground/src/hello_world/index.ts | 3 +-- .../web_workers/kitchen_sink/index_common.ts | 3 +-- 12 files changed, 10 insertions(+), 35 deletions(-) delete mode 100644 modules/angular2/lifecycle_hooks.ts delete mode 100644 modules/angular2/render.ts diff --git a/modules/angular2/angular2.dart b/modules/angular2/angular2.dart index 469828e2d6..729ba6b662 100644 --- a/modules/angular2/angular2.dart +++ b/modules/angular2/angular2.dart @@ -9,7 +9,6 @@ export 'package:angular2/core.dart' hide forwardRef, resolveForwardRef, ForwardRefFn; export 'package:angular2/common.dart'; export 'package:angular2/profile.dart'; -export 'package:angular2/lifecycle_hooks.dart'; export 'package:angular2/src/core/application_tokens.dart' hide APP_COMPONENT_REF_PROMISE, APP_ID_RANDOM_PROVIDER; export 'package:angular2/src/platform/dom/dom_tokens.dart'; diff --git a/modules/angular2/angular2.ts b/modules/angular2/angular2.ts index 94ceafaa51..11af515512 100644 --- a/modules/angular2/angular2.ts +++ b/modules/angular2/angular2.ts @@ -1,7 +1,6 @@ export * from './common'; export * from './core'; export * from './profile'; -export * from './lifecycle_hooks'; export * from './platform/browser'; export * from './src/platform/dom/dom_adapter'; export * from './upgrade'; diff --git a/modules/angular2/lifecycle_hooks.ts b/modules/angular2/lifecycle_hooks.ts deleted file mode 100644 index b6e3636171..0000000000 --- a/modules/angular2/lifecycle_hooks.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @module - * @description - * Defines interfaces to be implemented by directives when they need to hook into the change - * detection mechanism. - */ - -export { - AfterContentInit, - AfterContentChecked, - AfterViewInit, - AfterViewChecked, - OnChanges, - OnDestroy, - OnInit, - DoCheck -} from './src/core/linker/interfaces'; diff --git a/modules/angular2/render.ts b/modules/angular2/render.ts deleted file mode 100644 index 1a6446d565..0000000000 --- a/modules/angular2/render.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * @deprecated import angular2/render/dom instead - */ -export * from './src/core/render'; diff --git a/modules/angular2/src/platform/browser_common.ts b/modules/angular2/src/platform/browser_common.ts index 7a8919e6d9..f869ba084b 100644 --- a/modules/angular2/src/platform/browser_common.ts +++ b/modules/angular2/src/platform/browser_common.ts @@ -2,20 +2,20 @@ import {CONST_EXPR} from 'angular2/src/facade/lang'; import {provide, Provider, Injector, OpaqueToken} from 'angular2/src/core/di'; import { + PLATFORM_INITIALIZER, PLATFORM_DIRECTIVES, PLATFORM_PIPES, ComponentRef, platform, ExceptionHandler, Reflector, + Renderer, reflector, APPLICATION_COMMON_PROVIDERS, PLATFORM_COMMON_PROVIDERS, - EVENT_MANAGER_PLUGINS, - PLATFORM_INITIALIZER + EVENT_MANAGER_PLUGINS } from "angular2/core"; import {COMMON_DIRECTIVES, COMMON_PIPES, FORM_PROVIDERS} from "angular2/common"; -import {Renderer} from 'angular2/render'; import {Testability} from 'angular2/src/core/testability/testability'; import {DOM} from 'angular2/src/platform/dom/dom_adapter'; import {DomEventsPlugin} from 'angular2/src/platform/dom/events/dom_events'; diff --git a/modules/angular2/test/core/directive_lifecycle_integration_spec.ts b/modules/angular2/test/core/directive_lifecycle_integration_spec.ts index 6ba548e383..59987339fb 100644 --- a/modules/angular2/test/core/directive_lifecycle_integration_spec.ts +++ b/modules/angular2/test/core/directive_lifecycle_integration_spec.ts @@ -21,7 +21,7 @@ import { AfterContentChecked, AfterViewInit, AfterViewChecked -} from 'angular2/lifecycle_hooks'; +} from 'angular2/core'; import {Directive, Component, View, ViewMetadata} from 'angular2/src/core/metadata'; export function main() { diff --git a/modules/angular2/test/core/linker/dynamic_component_loader_spec.ts b/modules/angular2/test/core/linker/dynamic_component_loader_spec.ts index e58c9538c0..4845cb64ad 100644 --- a/modules/angular2/test/core/linker/dynamic_component_loader_spec.ts +++ b/modules/angular2/test/core/linker/dynamic_component_loader_spec.ts @@ -16,7 +16,7 @@ import { ComponentFixture } from 'angular2/testing_internal'; -import {OnDestroy} from 'angular2/lifecycle_hooks'; +import {OnDestroy} from 'angular2/core'; import {Injector, inspectElement} from 'angular2/core'; import {NgIf} from 'angular2/common'; import {By} from 'angular2/platform/browser'; diff --git a/modules/angular2/test/core/linker/element_injector_spec.ts b/modules/angular2/test/core/linker/element_injector_spec.ts index fbd2b4fd8b..06199aee85 100644 --- a/modules/angular2/test/core/linker/element_injector_spec.ts +++ b/modules/angular2/test/core/linker/element_injector_spec.ts @@ -37,7 +37,7 @@ import { ComponentMetadata, DirectiveMetadata } from 'angular2/src/core/metadata'; -import {OnDestroy} from 'angular2/lifecycle_hooks'; +import {OnDestroy} from 'angular2/core'; import {provide, Injector, Provider, Optional, Inject, Injectable, Self, SkipSelf, InjectMetadata, Host, HostMetadata, SkipSelfMetadata} from 'angular2/core'; import {ViewContainerRef, ViewContainerRef_} from 'angular2/src/core/linker/view_container_ref'; import {TemplateRef, TemplateRef_} from 'angular2/src/core/linker/template_ref'; diff --git a/modules/angular2/test/core/linker/view_manager_utils_spec.ts b/modules/angular2/test/core/linker/view_manager_utils_spec.ts index 23c9182ff2..4147e5531b 100644 --- a/modules/angular2/test/core/linker/view_manager_utils_spec.ts +++ b/modules/angular2/test/core/linker/view_manager_utils_spec.ts @@ -42,7 +42,7 @@ import { import {DirectiveResolver} from 'angular2/src/core/linker/directive_resolver'; import {Component} from 'angular2/src/core/metadata'; import {AppViewManagerUtils} from 'angular2/src/core/linker/view_manager_utils'; -import {RenderViewWithFragments} from 'angular2/render'; +import {RenderViewWithFragments} from 'angular2/core'; export function main() { // TODO(tbosch): add more tests here! diff --git a/modules/angular2/web_worker/worker.ts b/modules/angular2/web_worker/worker.ts index 4850b68b65..75c3e1def4 100644 --- a/modules/angular2/web_worker/worker.ts +++ b/modules/angular2/web_worker/worker.ts @@ -1,4 +1,4 @@ -export * from '../lifecycle_hooks'; +export * from '../src/core/linker/interfaces'; export * from '../src/core/metadata'; export * from '../src/core/util'; export * from '../src/core/di'; diff --git a/modules/playground/src/hello_world/index.ts b/modules/playground/src/hello_world/index.ts index e7e1c7a9f0..ccf53386a2 100644 --- a/modules/playground/src/hello_world/index.ts +++ b/modules/playground/src/hello_world/index.ts @@ -1,6 +1,5 @@ import {bootstrap} from 'angular2/bootstrap'; -import {ElementRef, Component, Directive, Injectable} from 'angular2/core'; -import {Renderer} from 'angular2/render'; +import {Renderer, ElementRef, Component, Directive, Injectable} from 'angular2/core'; export function main() { // Bootstrapping only requires specifying a root component. diff --git a/modules/playground/src/web_workers/kitchen_sink/index_common.ts b/modules/playground/src/web_workers/kitchen_sink/index_common.ts index 9a91ca70fa..3c8f1319b1 100644 --- a/modules/playground/src/web_workers/kitchen_sink/index_common.ts +++ b/modules/playground/src/web_workers/kitchen_sink/index_common.ts @@ -1,5 +1,4 @@ -import {ElementRef, Component, Directive, View, Injectable} from 'angular2/core'; -import {Renderer} from 'angular2/render'; +import {Renderer, ElementRef, Component, Directive, View, Injectable} from 'angular2/core'; import {StringWrapper} from 'angular2/src/facade/lang'; // A service available to the Injector, used by the HelloCmp component.