Skip to content

Commit ca442ff

Browse files
author
Vladimir Amiorkov
authored
Merge pull request #1861 from NativeScript/release-8.0.1
release: cut the 8.0.1 release
2 parents 99d699c + 0111ded commit ca442ff

File tree

28 files changed

+89
-25
lines changed

28 files changed

+89
-25
lines changed

Diff for: CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
<a name="8.0.1"></a>
2+
## [8.0.1](https://github.com/NativeScript/nativescript-angular/compare/8.0.0...8.0.1) (2019-06-12)
3+
4+
5+
### Bug Fixes
6+
7+
* 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))
8+
* **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))
9+
10+
11+
112
<a name="8.0.0"></a>
213
# [8.0.0](https://github.com/NativeScript/nativescript-angular/compare/7.2.4...8.0.0) (2019-05-29)
314

Loading
Loading
Loading
Loading

Diff for: e2e/config/appium.capabilities.json

+7
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@
120120
"noReset": true,
121121
"fullReset": false
122122
},
123+
"sim.iPhone7.ios12": {
124+
"platformName": "iOS",
125+
"platformVersion": "12.0",
126+
"deviceName": "iPhone 7",
127+
"noReset": true,
128+
"fullReset": false
129+
},
123130
"sim.iPhone8.iOS112": {
124131
"platformName": "iOS",
125132
"platformVersion": "11.2",
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

Diff for: e2e/routable-animations/e2e/setup.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { startServer, stopServer } from "nativescript-dev-appium";
22

3-
before("start server", async () => {
3+
before("start server", async function () {
44
await startServer();
55
});
66

7-
after("stop server", async () => {
7+
after("stop server", async function () {
88
await stopServer();
99
});

Diff for: e2e/routable-animations/e2e/tests.e2e.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ describe("sample scenario", () => {
55
const defaultWaitTime = 5000;
66
let driver: AppiumDriver;
77

8-
before(async () => {
8+
before(async function () {
99
driver = await createDriver();
1010
});
1111

12-
after(async () => {
12+
after(async function () {
1313
await driver.quit();
1414
console.log("Quit driver!");
1515
});
@@ -20,7 +20,7 @@ describe("sample scenario", () => {
2020
}
2121
});
2222

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

32-
it("should go back to home page", async () => {
32+
it("should go back to home page", async function () {
3333
const btnGoBackToHomePage = await driver.findElementByAutomationText("go back to home page");
3434
const supportImage = await driver.compareScreen("support");
3535
assert.isTrue(supportImage);

Diff for: e2e/router-tab-view/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"@angular/common": "8.0.0",
1818
"@angular/compiler": "8.0.0",
1919
"@angular/core": "8.0.0",
20-
"@angular/forms": "8.0.0-beta.10",
21-
"@angular/http": "8.0.0",
20+
"@angular/forms": "8.0.0",
21+
"@angular/http": "8.0.0-beta.10",
2222
"@angular/platform-browser": "8.0.0",
2323
"@angular/platform-browser-dynamic": "8.0.0",
2424
"@angular/router": "8.0.0",

Diff for: e2e/router/e2e/router.e2e-spec.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ describe("Simple navigate and back should trigger only one CD on FirstComponent"
518518
describe("Simple navigate and back should trigger only one CD on FirstComponent even with 3 changes in service", () => {
519519
let driver: AppiumDriver;
520520

521-
before(async () => {
521+
before(async function () {
522522
driver = await createDriver();
523523
await driver.resetApp();
524524
});
@@ -529,30 +529,30 @@ describe("Simple navigate and back should trigger only one CD on FirstComponent
529529
}
530530
});
531531

532-
it("should find First", async () => {
532+
it("should find First", async function () {
533533
await assureFirstComponent(driver);
534534
});
535535

536-
it("should reset counter", async () => {
536+
it("should reset counter", async function () {
537537
await findAndClick(driver, "RESET");
538538
await driver.waitForElement("CHECK: 1");
539539
await driver.waitForElement("COUNTER: 0");
540540
});
541541

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

545545
await assureSecondComponent(driver, 1);
546546
await assureNestedMasterComponent(driver);
547547
});
548548

549-
it("should increase counter", async () => {
549+
it("should increase counter", async function () {
550550
await findAndClick(driver, "TICK");
551551
await findAndClick(driver, "TICK");
552552
await findAndClick(driver, "TICK");
553553
});
554554

555-
it("should navigate back to First", async () => {
555+
it("should navigate back to First", async function () {
556556
await goBack(driver);
557557
await assureFirstComponent(driver);
558558
await driver.waitForElement("CHECK: 2");

Diff for: nativescript-angular/element-registry.ts

+5-9
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface ViewExtensions {
1717
}
1818

1919
export interface ViewClass {
20-
new (): View;
20+
new(): View;
2121
}
2222

2323
export abstract class InvisibleNode extends View implements NgView {
@@ -101,14 +101,10 @@ export function registerElement(
101101
resolver: ViewResolver,
102102
meta?: ViewClassMeta
103103
): void {
104-
if (elementMap.has(elementName)) {
105-
throw new Error(`Element for ${elementName} already registered.`);
106-
} else {
107-
const entry = { resolver: resolver, meta: meta };
108-
elementMap.set(elementName, entry);
109-
elementMap.set(elementName.toLowerCase(), entry);
110-
elementMap.set(elementName.replace(camelCaseSplit, "$1-$2").toLowerCase(), entry);
111-
}
104+
const entry = { resolver: resolver, meta: meta };
105+
elementMap.set(elementName, entry);
106+
elementMap.set(elementName.toLowerCase(), entry);
107+
elementMap.set(elementName.replace(camelCaseSplit, "$1-$2").toLowerCase(), entry);
112108
}
113109

114110
export function getViewClass(elementName: string): ViewClass {

Diff for: nativescript-angular/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-angular",
3-
"version": "8.0.0",
3+
"version": "8.0.1",
44
"description": "An Angular renderer that lets you build mobile apps with NativeScript.",
55
"homepage": "https://www.nativescript.org/",
66
"bugs": "https://github.com/NativeScript/nativescript-angular/issues",
@@ -70,6 +70,7 @@
7070
"@angular/platform-browser-dynamic": "8.0.0",
7171
"@angular/router": "8.0.0",
7272
"codelyzer": "^4.5.0",
73+
"conventional-changelog-cli": "^1.3.22",
7374
"rxjs": "~6.3.3",
7475
"tns-core-modules": "next",
7576
"tslint": "^5.5.0",

Diff for: nativescript-angular/renderer.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ export class NativeScriptRendererFactory implements RendererFactory2 {
5757
return this.defaultRenderer;
5858
}
5959

60-
let renderer: NativeScriptRenderer = this.componentRenderers.get(type.id);
60+
let renderer = this.componentRenderers.get(type.id);
6161
if (renderer) {
62+
if (renderer instanceof EmulatedRenderer) {
63+
renderer.applyToHost(element);
64+
}
65+
6266
return renderer;
6367
}
6468

Diff for: tests/app/tests/renderer-tests.ts

+45
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { View, fontInternalProperty, backgroundInternalProperty } from "tns-core
1616
import { nsTestBedAfterEach, nsTestBedBeforeEach, nsTestBedRender } from "nativescript-angular/testing";
1717
import { ComponentFixture, TestBed, async } from "@angular/core/testing";
1818
import { Observable, ReplaySubject } from "rxjs";
19+
import { Label } from "tns-core-modules/ui/label/label";
1920

2021
@Component({
2122
template: `<StackLayout><Label text="Layout"></Label></StackLayout>`
@@ -97,6 +98,37 @@ export class StyledLabelCmp2 {
9798
}
9899
}
99100

101+
@Component({
102+
selector: "host-styled",
103+
styles: [`
104+
Label {
105+
color: blue;
106+
}
107+
108+
:host Label {
109+
color: red;
110+
}
111+
`
112+
],
113+
template: `<Label text="Styled!"></Label>`
114+
})
115+
export class HostStyledCmp {
116+
constructor(public elementRef: ElementRef<ProxyViewContainer>) {
117+
}
118+
}
119+
120+
@Component({
121+
selector: "host-styled-parent",
122+
template: `
123+
<host-styled></host-styled>
124+
<host-styled></host-styled>
125+
`
126+
})
127+
export class HostStyledParentCmp {
128+
constructor(public elementRef: ElementRef<ProxyViewContainer>) {
129+
}
130+
}
131+
100132
@Component({
101133
selector: "ng-if-label",
102134
template: `<Label *ngIf="show" text="iffed"></Label>`
@@ -251,6 +283,7 @@ describe("Renderer E2E", () => {
251283
LayoutWithLabel, LabelCmp, LabelContainer,
252284
ProjectableCmp, ProjectionContainer,
253285
StyledLabelCmp, StyledLabelCmp2,
286+
HostStyledCmp, HostStyledParentCmp,
254287
NgIfLabel, NgIfThenElseComponent, NgIfMultiple,
255288
NgIfTwoElements, NgIfMultiple,
256289
NgIfElseComponent, NgIfThenElseComponent,
@@ -293,6 +326,18 @@ describe("Renderer E2E", () => {
293326
});
294327
});
295328

329+
it("applies component :host styles", () => {
330+
return nsTestBedRender(HostStyledParentCmp).then((fixture) => {
331+
const proxyView = fixture.componentRef.instance.elementRef.nativeElement;
332+
333+
for (let i = 0; i < 2; i += 1) {
334+
const child = proxyView.getChildAt(i) as ProxyViewContainer;
335+
const label = child.getChildAt(0) as Label;
336+
assert.equal(Red, label.style.color.hex);
337+
}
338+
});
339+
});
340+
296341
it("applies component styles from multiple sources", () => {
297342
return nsTestBedRender(StyledLabelCmp2).then((fixture) => {
298343
const componentRef: ComponentRef<StyledLabelCmp2> = fixture.componentRef;

0 commit comments

Comments
 (0)