Skip to content

docs: version bumped to 5.3.0 #1267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 10, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,137 @@
<a name="5.3.0"></a>
# [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 `<page-router-outlet>` 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 `<page-router-outlet>` as there is only one `Frame`.
- You always have a `Page` view wrapping your components and you can always. Because the `ActionBar` is part of that `Page` you can always change it with the `<ActionBar>` component.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something is missing here.


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 `<page-router-outlet>` 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 `<page-router-outlet>`, you can even have more than one for more advanced scenarios.

- If you **don't use `<page-router-outlet>`** 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 `<page-router-outlet>`** 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 `<page-router-outlet>`'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 form:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

form -> from

```
export const onAfterLivesync = new EventEmitter<NgModuleRef<any>>();
```
to:
```
export const onAfterLivesync = new EventEmitter<{ moduleRef?: NgModuleRef<any>; error?: Error }>();
```


<a name="5.2.0"></a>
# [5.2.0](https://github.com/NativeScript/nativescript-angular/compare/5.0.0...5.2.0) (2018-01-17)

Expand Down
2 changes: 1 addition & 1 deletion nativescript-angular/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down