diff --git a/modules/@angular/core/src/debug/debug_renderer.ts b/modules/@angular/core/src/debug/debug_renderer.ts index 0d751ee3a0..730cb1539c 100644 --- a/modules/@angular/core/src/debug/debug_renderer.ts +++ b/modules/@angular/core/src/debug/debug_renderer.ts @@ -15,7 +15,10 @@ import {RenderComponentType, RenderDebugInfo, Renderer, RootRenderer} from '../r import {DebugElement, DebugNode, EventListener, getDebugNode, indexDebugNode, removeDebugNodeFromIndex} from './debug_node'; export class DebugDomRootRenderer implements RootRenderer { - constructor(private _delegate: RootRenderer) {} + constructor(private _delegate: RootRenderer) { + throw new Error( + 'RootRenderer is no longer supported. Please use the `RendererFactoryV2` instead!'); + } renderComponent(componentProto: RenderComponentType): Renderer { return new DebugDomRenderer(this._delegate.renderComponent(componentProto)); diff --git a/modules/@angular/core/src/render/api.ts b/modules/@angular/core/src/render/api.ts index 32028f46a8..562faa713e 100644 --- a/modules/@angular/core/src/render/api.ts +++ b/modules/@angular/core/src/render/api.ts @@ -13,9 +13,8 @@ import {InjectionToken, Injector} from '../di'; import {ViewEncapsulation} from '../metadata/view'; /** - * @experimental + * @deprecated Use `RendererTypeV2` (and `RendererV2`) instead. */ -// TODO (matsko): add typing for the animation function export class RenderComponentType { constructor( public id: string, public templateUrl: string, public slotCount: number, @@ -23,6 +22,9 @@ export class RenderComponentType { public animations: any) {} } +/** + * @deprecated Debug info is handeled internally in the view engine now. + */ export abstract class RenderDebugInfo { abstract get injector(): Injector; abstract get component(): any; @@ -32,6 +34,9 @@ export abstract class RenderDebugInfo { abstract get source(): string; } +/** + * @deprecated Use the `RendererV2` instead. + */ export interface DirectRenderer { remove(node: any): void; appendChild(node: any, parent: any): void; @@ -41,7 +46,7 @@ export interface DirectRenderer { } /** - * @experimental + * @deprecated Use the `RendererV2` instead. */ export abstract class Renderer { abstract selectRootElement(selectorOrNode: string|any, debugInfo?: RenderDebugInfo): any; @@ -104,7 +109,8 @@ export const RendererV2Interceptor = new InjectionToken('RendererV * If you are implementing a custom renderer, you must implement this interface. * * The default Renderer implementation is `DomRenderer`. Also available is `WebWorkerRenderer`. - * @experimental + * + * @deprecated Use `RendererFactoryV2` instead. */ export abstract class RootRenderer { abstract renderComponent(componentType: RenderComponentType): Renderer; diff --git a/modules/@angular/core/test/linker/direct_rendering_integration_spec.ts b/modules/@angular/core/test/linker/direct_rendering_integration_spec.ts index 00199d496c..cc77aa303e 100644 --- a/modules/@angular/core/test/linker/direct_rendering_integration_spec.ts +++ b/modules/@angular/core/test/linker/direct_rendering_integration_spec.ts @@ -20,7 +20,8 @@ let destroyViewLogs: any[]; export function main() { // Don't run on server... if (!getDOM().supportsDOMEvents()) return; - describe('direct dom integration tests', function() { + // TODO(tbosch): delete the tests here as they use the old renderer. + xdescribe('direct dom integration tests', function() { beforeEach(() => { directRenderer = DIRECT_DOM_RENDERER; diff --git a/modules/@angular/platform-browser/src/dom/dom_renderer.ts b/modules/@angular/platform-browser/src/dom/dom_renderer.ts index 85693cbad4..58b946b136 100644 --- a/modules/@angular/platform-browser/src/dom/dom_renderer.ts +++ b/modules/@angular/platform-browser/src/dom/dom_renderer.ts @@ -50,6 +50,8 @@ export class DomRootRenderer_ extends DomRootRenderer { sharedStylesHost: DomSharedStylesHost, animationDriver: AnimationDriver, @Inject(APP_ID) appId: string) { super(_document, _eventManager, sharedStylesHost, animationDriver, appId); + throw new Error( + 'RootRenderer is no longer supported. Please use the `RendererFactoryV2` instead!'); } } diff --git a/modules/@angular/platform-server/src/server_renderer.ts b/modules/@angular/platform-server/src/server_renderer.ts index 43e19a6684..7a456f5540 100644 --- a/modules/@angular/platform-server/src/server_renderer.ts +++ b/modules/@angular/platform-server/src/server_renderer.ts @@ -25,7 +25,11 @@ export class ServerRootRenderer implements RootRenderer { constructor( @Inject(DOCUMENT) public document: any, public sharedStylesHost: SharedStylesHost, public animationDriver: AnimationDriver, @Inject(APP_ID) public appId: string, - private _zone: NgZone) {} + private _zone: NgZone) { + throw new Error( + 'RootRenderer is no longer supported. Please use the `RendererFactoryV2` instead!'); + } + renderComponent(componentProto: RenderComponentType): Renderer { let renderer = this.registeredComponents.get(componentProto.id); if (!renderer) { diff --git a/modules/@angular/platform-webworker/src/web_workers/worker/renderer.ts b/modules/@angular/platform-webworker/src/web_workers/worker/renderer.ts index 38a33e6f7e..2e7c6a7051 100644 --- a/modules/@angular/platform-webworker/src/web_workers/worker/renderer.ts +++ b/modules/@angular/platform-webworker/src/web_workers/worker/renderer.ts @@ -63,6 +63,8 @@ export class WebWorkerRootRenderer implements RootRenderer { bus.initChannel(EVENT_CHANNEL); const source = bus.from(EVENT_CHANNEL); source.subscribe({next: (message: any) => this._dispatchEvent(message)}); + throw new Error( + 'RootRenderer is no longer supported. Please use the `RendererFactoryV2` instead!'); } private _dispatchEvent(message: {[key: string]: any}): void { diff --git a/modules/@angular/platform-webworker/src/worker_render.ts b/modules/@angular/platform-webworker/src/worker_render.ts index 08c538d221..499f458f81 100644 --- a/modules/@angular/platform-webworker/src/worker_render.ts +++ b/modules/@angular/platform-webworker/src/worker_render.ts @@ -17,7 +17,7 @@ import {PostMessageBus, PostMessageBusSink, PostMessageBusSource} from './web_wo import {RenderStore} from './web_workers/shared/render_store'; import {Serializer} from './web_workers/shared/serializer'; import {ServiceMessageBrokerFactory, ServiceMessageBrokerFactory_} from './web_workers/shared/service_message_broker'; -import {MessageBasedRenderer} from './web_workers/ui/renderer'; +import {MessageBasedRenderer, MessageBasedRendererV2} from './web_workers/ui/renderer'; /** @@ -47,16 +47,20 @@ export const WORKER_SCRIPT = new InjectionToken('WebWorkerScript'); * A multi-provider used to automatically call the `start()` method after the service is * created. * - * TODO(vicb): create an interface for startable services to implement * @experimental WebWorker support is currently experimental. */ export const WORKER_UI_STARTABLE_MESSAGING_SERVICE = - new InjectionToken('WorkerRenderStartableMsgService'); + new InjectionToken<({start: () => void})[]>('WorkerRenderStartableMsgService'); export const _WORKER_UI_PLATFORM_PROVIDERS: Provider[] = [ {provide: NgZone, useFactory: createNgZone, deps: []}, MessageBasedRenderer, - {provide: WORKER_UI_STARTABLE_MESSAGING_SERVICE, useExisting: MessageBasedRenderer, multi: true}, + MessageBasedRendererV2, + { + provide: WORKER_UI_STARTABLE_MESSAGING_SERVICE, + useExisting: MessageBasedRendererV2, + multi: true + }, BROWSER_SANITIZATION_PROVIDERS, {provide: ErrorHandler, useFactory: _exceptionHandler, deps: []}, {provide: DOCUMENT, useFactory: _document, deps: []}, diff --git a/modules/@angular/platform-webworker/test/web_workers/worker/renderer_integration_spec.ts b/modules/@angular/platform-webworker/test/web_workers/worker/renderer_integration_spec.ts index bfe03783c7..56f5c3efe0 100644 --- a/modules/@angular/platform-webworker/test/web_workers/worker/renderer_integration_spec.ts +++ b/modules/@angular/platform-webworker/test/web_workers/worker/renderer_integration_spec.ts @@ -56,7 +56,8 @@ export function main() { return new DebugDomRootRenderer(workerRootRenderer); } - describe('Web Worker Renderer', () => { + // TODO(tbosch): delete the tests here as they use the old renderer. + xdescribe('Web Worker Renderer', () => { // Don't run on server... if (!getDOM().supportsDOMEvents()) return; diff --git a/modules/benchmarks/e2e_test/tree_perf.ts b/modules/benchmarks/e2e_test/tree_perf.ts index d261881ddb..eb9b430359 100644 --- a/modules/benchmarks/e2e_test/tree_perf.ts +++ b/modules/benchmarks/e2e_test/tree_perf.ts @@ -62,7 +62,8 @@ describe('tree benchmark perf', () => { }).then(done, done.fail); }); - it('should run for ng2 ftl', (done) => { + // TODO(tbosch): delete ftl benchmarks as they use the old renderer / view engine. + xit('should run for ng2 ftl', (done) => { runTreeBenchmark({ id: `deepTree.ng2.ftl.${worker.id}`, url: 'all/benchmarks/src/tree/ng2_ftl/index.html', @@ -83,7 +84,8 @@ describe('tree benchmark perf', () => { }).then(done, done.fail); }); - it('should run for ng2 static ftl', (done) => { + // TODO(tbosch): delete ftl benchmarks as they use the old renderer / view engine. + xit('should run for ng2 static ftl', (done) => { runTreeBenchmark({ id: `deepTree.ng2.ftl.${worker.id}`, url: 'all/benchmarks/src/tree/ng2_static_ftl/index.html', diff --git a/modules/benchmarks/e2e_test/tree_spec.ts b/modules/benchmarks/e2e_test/tree_spec.ts index 483dfc8c6e..5deef4bce3 100644 --- a/modules/benchmarks/e2e_test/tree_spec.ts +++ b/modules/benchmarks/e2e_test/tree_spec.ts @@ -49,7 +49,8 @@ describe('tree benchmark spec', () => { expect($('#numberOfChecks').getText()).toContain('10'); }); - it('should work for ng2 ftl', () => { + // TODO: delete ftl benchmarks + xit('should work for ng2 ftl', () => { testTreeBenchmark({ url: 'all/benchmarks/src/tree/ng2_ftl/index.html', // Can't use bundles as we use AoT generated code @@ -64,7 +65,8 @@ describe('tree benchmark spec', () => { }); }); - it('should work for ng2 static ftl', () => { + // TODO: delete ftl benchmarks + xit('should work for ng2 static ftl', () => { testTreeBenchmark({ url: 'all/benchmarks/src/tree/ng2_static_ftl/index.html', // Can't use bundles as we use AoT generated code diff --git a/tools/public_api_guard/core/typings/core.d.ts b/tools/public_api_guard/core/typings/core.d.ts index 387f58b25d..65fa71b7a9 100644 --- a/tools/public_api_guard/core/typings/core.d.ts +++ b/tools/public_api_guard/core/typings/core.d.ts @@ -812,7 +812,7 @@ export declare class ReflectiveKey { static get(token: Object): ReflectiveKey; } -/** @experimental */ +/** @deprecated */ export declare class RenderComponentType { animations: any; encapsulation: ViewEncapsulation; @@ -823,7 +823,7 @@ export declare class RenderComponentType { constructor(id: string, templateUrl: string, slotCount: number, encapsulation: ViewEncapsulation, styles: Array, animations: any); } -/** @experimental */ +/** @deprecated */ export declare abstract class Renderer { abstract animate(element: any, startingStyles: AnimationStyles, keyframes: AnimationKeyframe[], duration: number, delay: number, easing: string, previousPlayers?: AnimationPlayer[]): AnimationPlayer; abstract attachViewAfter(node: any, viewRootNodes: any[]): void; @@ -904,7 +904,7 @@ export interface ResolvedReflectiveProvider { /** @experimental */ export declare function resolveForwardRef(type: any): any; -/** @experimental */ +/** @deprecated */ export declare abstract class RootRenderer { abstract renderComponent(componentType: RenderComponentType): Renderer; }