Skip to content

Commit 25166d4

Browse files
marclavalAndrewKushnir
authored andcommitted
fix(ivy): support property values changed in ngOnChanges (forward rref case) (angular#29054)
PR Close angular#29054
1 parent 6215799 commit 25166d4

24 files changed

+615
-120
lines changed

integration/_payload-limits.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"master": {
1313
"uncompressed": {
1414
"runtime": 1440,
15-
"main": 13659,
15+
"main": 13921,
1616
"polyfills": 38390
1717
}
1818
}

packages/compiler-cli/test/compliance/r3_compiler_compliance_spec.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,7 @@ describe('compiler compliance', () => {
798798
if (rf & 2) {
799799
const $myComp$ = $r3$.ɵnextContext();
800800
const $foo$ = $r3$.ɵreference(1);
801+
$r3$.ɵflushHooksUpTo(1);
801802
$r3$.ɵtextBinding(1, $r3$.ɵinterpolation2("", $myComp$.salutation, " ", $foo$, ""));
802803
}
803804
}
@@ -1255,6 +1256,7 @@ describe('compiler compliance', () => {
12551256
}
12561257
if (rf & 2) {
12571258
$r3$.ɵelementProperty(0, "ngIf", $r3$.ɵbind(ctx.visible));
1259+
$r3$.ɵflushHooksUpTo(1);
12581260
$r3$.ɵelementProperty(1, "ngIf", $r3$.ɵbind(ctx.visible));
12591261
}
12601262
}
@@ -1947,6 +1949,7 @@ describe('compiler compliance', () => {
19471949
}
19481950
if (rf & 2) {
19491951
$r3$.ɵtextBinding(0, $r3$.ɵinterpolation1("", $r3$.ɵpipeBind2(1, 3, $r3$.ɵpipeBind2(2, 6, ctx.name, ctx.size), ctx.size), ""));
1952+
$r3$.ɵflushHooksUpTo(4);
19501953
$r3$.ɵtextBinding(4, $r3$.ɵinterpolation2("", $r3$.ɵpipeBindV(5, 9, $r3$.ɵpureFunction1(18, $c0$, ctx.name)), " ", (ctx.name ? 1 : $r3$.ɵpipeBind1(6, 16, 2)), ""));
19511954
}
19521955
},
@@ -2061,6 +2064,7 @@ describe('compiler compliance', () => {
20612064
}
20622065
if (rf & 2) {
20632066
const $user$ = $r3$.ɵreference(1);
2067+
$r3$.ɵflushHooksUpTo(2);
20642068
$r3$.ɵtextBinding(2, $r3$.ɵinterpolation1("Hello ", $user$.value, "!"));
20652069
}
20662070
},
@@ -2123,6 +2127,7 @@ describe('compiler compliance', () => {
21232127
$r3$.ɵnextContext();
21242128
const $foo$ = $r3$.ɵreference(1);
21252129
const $baz$ = $r3$.ɵreference(5);
2130+
$r3$.ɵflushHooksUpTo(1);
21262131
$r3$.ɵtextBinding(1, $r3$.ɵinterpolation3("", $foo$, "-", $bar$, "-", $baz$, ""));
21272132
}
21282133
}
@@ -2138,6 +2143,7 @@ describe('compiler compliance', () => {
21382143
const $bar$ = $r3$.ɵreference(4);
21392144
$r3$.ɵnextContext();
21402145
const $foo$ = $r3$.ɵreference(1);
2146+
$r3$.ɵflushHooksUpTo(1);
21412147
$r3$.ɵtextBinding(1, $r3$.ɵinterpolation2(" ", $foo$, "-", $bar$, " "));
21422148
}
21432149
}
@@ -2157,6 +2163,7 @@ describe('compiler compliance', () => {
21572163
}
21582164
if (rf & 2) {
21592165
const $foo$ = $r3$.ɵreference(1);
2166+
$r3$.ɵflushHooksUpTo(2);
21602167
$r3$.ɵtextBinding(2, $r3$.ɵinterpolation1(" ", $foo$, " "));
21612168
}
21622169
},
@@ -2209,6 +2216,7 @@ describe('compiler compliance', () => {
22092216
if (rf & 2) {
22102217
const $item$ = $i0$.ɵnextContext().$implicit;
22112218
const $foo$ = $i0$.ɵreference(2);
2219+
$r3$.ɵflushHooksUpTo(1);
22122220
$i0$.ɵtextBinding(1, $i0$.ɵinterpolation2(" ", $foo$, " - ", $item$, " "));
22132221
}
22142222
}
@@ -2222,6 +2230,7 @@ describe('compiler compliance', () => {
22222230
}
22232231
if (rf & 2) {
22242232
const $app$ = $i0$.ɵnextContext();
2233+
$r3$.ɵflushHooksUpTo(3);
22252234
$i0$.ɵelementProperty(3, "ngIf", $i0$.ɵbind($app$.showing));
22262235
}
22272236
}
@@ -2313,6 +2322,7 @@ describe('compiler compliance', () => {
23132322
}
23142323
if (rf & 2) {
23152324
$r3$.ɵelementProperty(0, "name", $r3$.ɵbind(ctx.name1));
2325+
$r3$.ɵflushHooksUpTo(1);
23162326
$r3$.ɵelementProperty(1, "name", $r3$.ɵbind(ctx.name2));
23172327
}
23182328
},
@@ -2443,7 +2453,10 @@ describe('compiler compliance', () => {
24432453
$r3$.ɵtemplate(1, MyComponent__svg_g_1_Template, 2, 0, "g", $t1_attrs$);
24442454
$r3$.ɵelementEnd();
24452455
}
2446-
if (rf & 2) { $r3$.ɵelementProperty(1,"forOf",$r3$.ɵbind(ctx.items)); }
2456+
if (rf & 2) {
2457+
$r3$.ɵflushHooksUpTo(1);
2458+
$r3$.ɵelementProperty(1,"forOf",$r3$.ɵbind(ctx.items));
2459+
}
24472460
},
24482461
directives: function() { return [ForOfDirective]; },
24492462
encapsulation: 2
@@ -2505,6 +2518,7 @@ describe('compiler compliance', () => {
25052518
}
25062519
if (rf & 2) {
25072520
const $item$ = ctx.$implicit;
2521+
$r3$.ɵflushHooksUpTo(1);
25082522
$r3$.ɵtextBinding(1, $r3$.ɵinterpolation1("", $item$.name, ""));
25092523
}
25102524
}
@@ -2522,6 +2536,7 @@ describe('compiler compliance', () => {
25222536
$r3$.ɵelementEnd();
25232537
}
25242538
if (rf & 2) {
2539+
$r3$.ɵflushHooksUpTo(1);
25252540
$r3$.ɵelementProperty(1, "forOf", $r3$.ɵbind(ctx.items));
25262541
}
25272542
},
@@ -2586,6 +2601,7 @@ describe('compiler compliance', () => {
25862601
if (rf & 2) {
25872602
const $info$ = ctx.$implicit;
25882603
const $item$ = $r3$.ɵnextContext().$implicit;
2604+
$r3$.ɵflushHooksUpTo(1);
25892605
$r3$.ɵtextBinding(1, $r3$.ɵinterpolation2(" ", $item$.name, ": ", $info$.description, " "));
25902606
}
25912607
}
@@ -2603,7 +2619,9 @@ describe('compiler compliance', () => {
26032619
}
26042620
if (rf & 2) {
26052621
const $item$ = ctx.$implicit;
2622+
$r3$.ɵflushHooksUpTo(2);
26062623
$r3$.ɵtextBinding(2, $r3$.ɵinterpolation1("", IDENT.name, ""));
2624+
$r3$.ɵflushHooksUpTo(4);
26072625
$r3$.ɵelementProperty(4, "forOf", $r3$.ɵbind(IDENT.infos));
26082626
}
26092627
}
@@ -2622,6 +2640,7 @@ describe('compiler compliance', () => {
26222640
$r3$.ɵelementEnd();
26232641
}
26242642
if (rf & 2) {
2643+
$r3$.ɵflushHooksUpTo(1);
26252644
$r3$.ɵelementProperty(1, "forOf", $r3$.ɵbind(ctx.items));
26262645
}
26272646
},

packages/compiler-cli/test/compliance/r3_view_compiler_binding_spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ describe('compiler compliance: bindings', () => {
4444
$i0$.ɵelementEnd();
4545
}
4646
if (rf & 2) {
47+
$r3$.ɵflushHooksUpTo(1);
4748
$i0$.ɵtextBinding(1, $i0$.ɵinterpolation1("Hello ", $ctx$.name, ""));
4849
}
4950
}`;
@@ -473,6 +474,7 @@ describe('compiler compliance: bindings', () => {
473474
}
474475
if (rf & 2) {
475476
const $_r0$ = $i0$.ɵreference(1);
477+
$r3$.ɵflushHooksUpTo(4);
476478
$i0$.ɵtextBinding(4, $i0$.ɵinterpolation1(" ", $_r0$.id, " "));
477479
}
478480
}

0 commit comments

Comments
 (0)