diff --git a/CHANGELOG.md b/CHANGELOG.md index eaa1cdc72..b5aa67a6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,137 @@ + +# [5.3.0](https://github.com/NativeScript/nativescript-angular/compare/5.2.0...v5.3.0) (2018-04-10) + +> This version requires NativeScript 4.0. + +### Bug Fixes + +* **animations:** provide fake document object in both AoT and JiT mode ([#1164](https://github.com/NativeScript/nativescript-angular/issues/1164)) ([040e0e3](https://github.com/NativeScript/nativescript-angular/commit/040e0e3)), closes [#1163](https://github.com/NativeScript/nativescript-angular/issues/1163) +* App crashes on restart in android ([#1261](https://github.com/NativeScript/nativescript-angular/issues/1261)) ([331b878](https://github.com/NativeScript/nativescript-angular/commit/331b878)) + + +### Features + +* NS 4.0 Integration ([#1250](https://github.com/NativeScript/nativescript-angular/issues/1250)) ([f84fbdc](https://github.com/NativeScript/nativescript-angular/commit/f84fbdc)) +* prevent core modules from getting loaded multiple times ([#1196](https://github.com/NativeScript/nativescript-angular/issues/1196)) ([010fed7](https://github.com/NativeScript/nativescript-angular/commit/010fed7)) + + +### BREAKING CHANGES + +#### Importing `NativeScriptModule` and `NativeScriptAnimationsModule` in multiple ngModules is no longer allowed. + +To migrate: + * in `AppModule`: + * import `NativeScriptModule` + * import`NativeScriptAnimationsModule` - only if you are planning to use Angular Animations + * in the remaining modules: + * remove `NativeScriptModule` imports and replace with `NativeScriptCommonModule` import + * remove `NativeScriptAnimationsModule` imports + +BEFORE: + +app.module.ts: +``` +import { NativeScriptModule } from 'nativescript-angular/nativescript.module'; +import { NativeScriptAnimationsModule } from 'nativescript-angular/animations'; +... +@NgModule({ + imports: [ + NativeScriptModule, + NativeScriptAnimationsModule + ], +... +}) +``` + +another.module.ts: +``` +import { NativeScriptModule } from 'nativescript-angular/nativescript.module'; +import { NativeScriptAnimationsModule } from 'nativescript-angular/animations'; +... +@NgModule({ + imports: [ + NativeScriptModule, + NativeScriptAnimationsModule + ], +... +}) +``` + +AFTER: + +app.module.ts: +``` +import { NativeScriptModule } from 'nativescript-angular/nativescript.module'; +import { NativeScriptAnimationsModule } from 'nativescript-angular/animations'; +... +@NgModule({ + imports: [ + NativeScriptModule, + NativeScriptAnimationsModule + ], +... +}) +``` + +another.module.ts: +``` +import { NativeScriptCommonModule } from 'nativescript-angular/common'; +... +@NgModule({ + imports: [ + NativeScriptCommonModule + ], +... +}) +``` + +#### NativeScript 4.0 Compatible Bootstrap and Navigation +NativeScript 4.0 allows you to put any view as the root (not only Frame) of the application. To support in angular projects we had to introduce some changes in how A{N}gular apps are bootstrapped. + +PREVIOUS BEHAVIOR + +Bootstrap creates a root `Frame` and initial `Page`. Then it bootstraps the angular application inside this page. Navigation with `` will always navigate in the `Frame` created by the bootstrap. + +Limitations: +- You cannot change the root view of the app (to `RadSideDrawer` for example). It is always the `Frame` created by the bootstrap. +- You can have only one `` as there is only one `Frame`. +- You always have a `Page` view wrapping your components. Because the `ActionBar` is part of that `Page` you can always change it with the `` component. + +NEW BEHAVIOR + +Bootstrap will **not** create root view by default. It will use the root view of your main application component as the root view of the application. The `` component will create its own `Frame` and will use it for navigation. It will also wrap the components you navigate to in a `Page` and will navigate to it as it did before. + +Which means: + +- You can use any view for application root. Finally, you can have application-wide `RadSideDrawer`. + +- You have more flexibility over where to place the ``, you can even have more than one for more advanced scenarios. + +- If you **don't use ``** in your app you will not get the default `Page` and `Frame`, which means you will not be able to inject them in you components or show the `ActionBar`. There is special `createFrameOnBootstrap` option you can pass on bootstrap to make things as _before_: +``` +platformNativeScript({ createFrameOnBootstrap: true }) + .bootstrapModuleFactory(AppModuleNgFactory); +``` + +- If you **are using ``** you probably don't have to do any changes. Bootstrap will not create `Frame` and `Page`, but the outlet will do that. It will also take care of providing `Page` and so the `ActionBar` should work as _before_. + + +WORKING WITH FRAMES + +There might be multiple frames (if you have multiple ``'s). Angular DI works with singletons, so it will always return one instance of `Frame`. We have introduced `FrameService` (still experimental) which has a `getFrame()` method. It will return the current frame (the one you have navigated last). + +#### Signature of `onAfterLivesync` changed + +The signature `onAfterLivesync` observable changed from: +``` +export const onAfterLivesync = new EventEmitter>(); +``` +to: +``` +export const onAfterLivesync = new EventEmitter<{ moduleRef?: NgModuleRef; error?: Error }>(); +``` + + # [5.2.0](https://github.com/NativeScript/nativescript-angular/compare/5.0.0...5.2.0) (2018-01-17) diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index 3eb35f4db..c4ce22a52 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "nativescript-angular", - "version": "5.2.0", + "version": "5.3.0", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues",