Skip to content

release: cut the 8.0.1 release #1861

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 11 commits into from
Jun 13, 2019
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
<a name="8.0.1"></a>
## [8.0.1](https://github.com/NativeScript/nativescript-angular/compare/8.0.0...8.0.1) (2019-06-12)


### Bug Fixes

* do not throw if element already registered ([#1838](https://github.com/NativeScript/nativescript-angular/issues/1838)) ([e90f8b5](https://github.com/NativeScript/nativescript-angular/commit/e90f8b5))
* **1845:** CSS special selector ":host" only work first time ([#1852](https://github.com/NativeScript/nativescript-angular/issues/1852)) ([59a5bd8](https://github.com/NativeScript/nativescript-angular/commit/59a5bd8))



<a name="8.0.0"></a>
# [8.0.0](https://github.com/NativeScript/nativescript-angular/compare/7.2.4...8.0.0) (2019-05-29)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions e2e/config/appium.capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@
"noReset": true,
"fullReset": false
},
"sim.iPhone7.ios12": {
"platformName": "iOS",
"platformVersion": "12.0",
"deviceName": "iPhone 7",
"noReset": true,
"fullReset": false
},
"sim.iPhone8.iOS112": {
"platformName": "iOS",
"platformVersion": "11.2",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions e2e/routable-animations/e2e/setup.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { startServer, stopServer } from "nativescript-dev-appium";

before("start server", async () => {
before("start server", async function () {
await startServer();
});

after("stop server", async () => {
after("stop server", async function () {
await stopServer();
});
8 changes: 4 additions & 4 deletions e2e/routable-animations/e2e/tests.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ describe("sample scenario", () => {
const defaultWaitTime = 5000;
let driver: AppiumDriver;

before(async () => {
before(async function () {
driver = await createDriver();
});

after(async () => {
after(async function () {
await driver.quit();
console.log("Quit driver!");
});
Expand All @@ -20,7 +20,7 @@ describe("sample scenario", () => {
}
});

it("should go to support page", async () => {
it("should go to support page", async function () {
const btnGoToSupportPage = await driver.findElementByAutomationText("go to support page");
const homeImage = await driver.compareScreen("home");
assert.isTrue(homeImage);
Expand All @@ -29,7 +29,7 @@ describe("sample scenario", () => {
console.log(await titleSupportPage.text());
});

it("should go back to home page", async () => {
it("should go back to home page", async function () {
const btnGoBackToHomePage = await driver.findElementByAutomationText("go back to home page");
const supportImage = await driver.compareScreen("support");
assert.isTrue(supportImage);
Expand Down
4 changes: 2 additions & 2 deletions e2e/router-tab-view/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"@angular/common": "8.0.0",
"@angular/compiler": "8.0.0",
"@angular/core": "8.0.0",
"@angular/forms": "8.0.0-beta.10",
"@angular/http": "8.0.0",
"@angular/forms": "8.0.0",
"@angular/http": "8.0.0-beta.10",
"@angular/platform-browser": "8.0.0",
"@angular/platform-browser-dynamic": "8.0.0",
"@angular/router": "8.0.0",
Expand Down
12 changes: 6 additions & 6 deletions e2e/router/e2e/router.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ describe("Simple navigate and back should trigger only one CD on FirstComponent"
describe("Simple navigate and back should trigger only one CD on FirstComponent even with 3 changes in service", () => {
let driver: AppiumDriver;

before(async () => {
before(async function () {
driver = await createDriver();
await driver.resetApp();
});
Expand All @@ -529,30 +529,30 @@ describe("Simple navigate and back should trigger only one CD on FirstComponent
}
});

it("should find First", async () => {
it("should find First", async function () {
await assureFirstComponent(driver);
});

it("should reset counter", async () => {
it("should reset counter", async function () {
await findAndClick(driver, "RESET");
await driver.waitForElement("CHECK: 1");
await driver.waitForElement("COUNTER: 0");
});

it("should navigate to Second(1)/master", async () => {
it("should navigate to Second(1)/master", async function () {
await findAndClick(driver, "GO TO SECOND");

await assureSecondComponent(driver, 1);
await assureNestedMasterComponent(driver);
});

it("should increase counter", async () => {
it("should increase counter", async function () {
await findAndClick(driver, "TICK");
await findAndClick(driver, "TICK");
await findAndClick(driver, "TICK");
});

it("should navigate back to First", async () => {
it("should navigate back to First", async function () {
await goBack(driver);
await assureFirstComponent(driver);
await driver.waitForElement("CHECK: 2");
Expand Down
14 changes: 5 additions & 9 deletions nativescript-angular/element-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface ViewExtensions {
}

export interface ViewClass {
new (): View;
new(): View;
}

export abstract class InvisibleNode extends View implements NgView {
Expand Down Expand Up @@ -101,14 +101,10 @@ export function registerElement(
resolver: ViewResolver,
meta?: ViewClassMeta
): void {
if (elementMap.has(elementName)) {
throw new Error(`Element for ${elementName} already registered.`);
} else {
const entry = { resolver: resolver, meta: meta };
elementMap.set(elementName, entry);
elementMap.set(elementName.toLowerCase(), entry);
elementMap.set(elementName.replace(camelCaseSplit, "$1-$2").toLowerCase(), entry);
}
const entry = { resolver: resolver, meta: meta };
elementMap.set(elementName, entry);
elementMap.set(elementName.toLowerCase(), entry);
elementMap.set(elementName.replace(camelCaseSplit, "$1-$2").toLowerCase(), entry);
}

export function getViewClass(elementName: string): ViewClass {
Expand Down
3 changes: 2 additions & 1 deletion nativescript-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-angular",
"version": "8.0.0",
"version": "8.0.1",
"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 Expand Up @@ -70,6 +70,7 @@
"@angular/platform-browser-dynamic": "8.0.0",
"@angular/router": "8.0.0",
"codelyzer": "^4.5.0",
"conventional-changelog-cli": "^1.3.22",
"rxjs": "~6.3.3",
"tns-core-modules": "next",
"tslint": "^5.5.0",
Expand Down
6 changes: 5 additions & 1 deletion nativescript-angular/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ export class NativeScriptRendererFactory implements RendererFactory2 {
return this.defaultRenderer;
}

let renderer: NativeScriptRenderer = this.componentRenderers.get(type.id);
let renderer = this.componentRenderers.get(type.id);
if (renderer) {
if (renderer instanceof EmulatedRenderer) {
renderer.applyToHost(element);
}

return renderer;
}

Expand Down
45 changes: 45 additions & 0 deletions tests/app/tests/renderer-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { View, fontInternalProperty, backgroundInternalProperty } from "tns-core
import { nsTestBedAfterEach, nsTestBedBeforeEach, nsTestBedRender } from "nativescript-angular/testing";
import { ComponentFixture, TestBed, async } from "@angular/core/testing";
import { Observable, ReplaySubject } from "rxjs";
import { Label } from "tns-core-modules/ui/label/label";

@Component({
template: `<StackLayout><Label text="Layout"></Label></StackLayout>`
Expand Down Expand Up @@ -97,6 +98,37 @@ export class StyledLabelCmp2 {
}
}

@Component({
selector: "host-styled",
styles: [`
Label {
color: blue;
}

:host Label {
color: red;
}
`
],
template: `<Label text="Styled!"></Label>`
})
export class HostStyledCmp {
constructor(public elementRef: ElementRef<ProxyViewContainer>) {
}
}

@Component({
selector: "host-styled-parent",
template: `
<host-styled></host-styled>
<host-styled></host-styled>
`
})
export class HostStyledParentCmp {
constructor(public elementRef: ElementRef<ProxyViewContainer>) {
}
}

@Component({
selector: "ng-if-label",
template: `<Label *ngIf="show" text="iffed"></Label>`
Expand Down Expand Up @@ -251,6 +283,7 @@ describe("Renderer E2E", () => {
LayoutWithLabel, LabelCmp, LabelContainer,
ProjectableCmp, ProjectionContainer,
StyledLabelCmp, StyledLabelCmp2,
HostStyledCmp, HostStyledParentCmp,
NgIfLabel, NgIfThenElseComponent, NgIfMultiple,
NgIfTwoElements, NgIfMultiple,
NgIfElseComponent, NgIfThenElseComponent,
Expand Down Expand Up @@ -293,6 +326,18 @@ describe("Renderer E2E", () => {
});
});

it("applies component :host styles", () => {
return nsTestBedRender(HostStyledParentCmp).then((fixture) => {
const proxyView = fixture.componentRef.instance.elementRef.nativeElement;

for (let i = 0; i < 2; i += 1) {
const child = proxyView.getChildAt(i) as ProxyViewContainer;
const label = child.getChildAt(0) as Label;
assert.equal(Red, label.style.color.hex);
}
});
});

it("applies component styles from multiple sources", () => {
return nsTestBedRender(StyledLabelCmp2).then((fixture) => {
const componentRef: ComponentRef<StyledLabelCmp2> = fixture.componentRef;
Expand Down