From 409e717940ed9c8432e31a06c55bfdbe87c76529 Mon Sep 17 00:00:00 2001 From: Stanimira Vlaeva Date: Tue, 14 Mar 2017 10:48:21 +0200 Subject: [PATCH] refactor: stop exporting NativeScriptModule from platform (#701) Importing NativeScriptModule from "nativescript-angular/platform" leads to including @angular/compiler in the bundle when doing AoT compilation with webpack. Import from "nativescript-angular/nativescript.module" should be used instead. BREAKING CHANGE: User applications cannot import NativeScriptModule from "nativescript-angular/platform" anymore. Migration: Before: ``` import { NativeScriptModule } from "nativescript-angular/platform"; ``` After ``` import { NativeScriptModule } from "nativescript-angular/nativescript.module"; ``` --- nativescript-angular/platform.ts | 2 -- tests/app/snippets/navigation/page-outlet.ts | 2 +- tests/app/tests/test-app.ts | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/nativescript-angular/platform.ts b/nativescript-angular/platform.ts index 756d8e52b..76a512663 100644 --- a/nativescript-angular/platform.ts +++ b/nativescript-angular/platform.ts @@ -37,8 +37,6 @@ import "./dom-adapter"; import { NativeScriptElementSchemaRegistry } from "./schema-registry"; import { FileSystemResourceLoader } from "./resource-loader"; -export { NativeScriptModule } from "./nativescript.module"; - export const NS_COMPILER_PROVIDERS = [ COMPILER_PROVIDERS, { diff --git a/tests/app/snippets/navigation/page-outlet.ts b/tests/app/snippets/navigation/page-outlet.ts index 75354b5f6..6db841994 100644 --- a/tests/app/snippets/navigation/page-outlet.ts +++ b/tests/app/snippets/navigation/page-outlet.ts @@ -2,9 +2,9 @@ import { TestApp, registerTestApp } from "../../tests/test-app"; import { ApplicationRef } from "@angular/core"; import { Router, NavigationStart, NavigationEnd } from "@angular/router"; // >> page-outlet-example -import { Component, NgModule } from "@angular/core"; import { platformNativeScriptDynamic } from "nativescript-angular/platform"; import { NativeScriptModule } from "nativescript-angular/nativescript.module"; +import { Component, NgModule } from '@angular/core'; import { NativeScriptRouterModule } from "nativescript-angular/router"; import { routes } from "./app.routes"; diff --git a/tests/app/tests/test-app.ts b/tests/app/tests/test-app.ts index ca13b12eb..39e9a100b 100644 --- a/tests/app/tests/test-app.ts +++ b/tests/app/tests/test-app.ts @@ -1,4 +1,5 @@ -import { NativeScriptModule, platformNativeScriptDynamic } from "nativescript-angular/platform"; +import { platformNativeScriptDynamic } from "nativescript-angular/platform"; +import { NativeScriptModule } from "nativescript-angular/nativescript.module"; import { NativeScriptRouterModule } from "nativescript-angular/router"; import { Type, Component, ComponentRef,