feat(ivy): add ɵɵtextInterpolateX instructions (#30011)
- `ɵɵtextBinding(..., ɵɵinterpolationX())` instructions will now just be `ɵɵtextInterpolate(...)` instructions PR Close #30011
This commit is contained in:
@ -44,7 +44,7 @@ describe('template source-mapping', () => {
|
||||
{source: '<h3>', generated: 'i0.ɵɵelementStart(0, "h3")', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain({
|
||||
source: 'Hello {{ name }}',
|
||||
generated: 'i0.ɵɵtextBinding(1, i0.ɵɵinterpolation1("Hello ", ctx.name, ""))',
|
||||
generated: 'i0.ɵɵtextInterpolate1("Hello ", ctx.name, "")',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain(
|
||||
@ -57,8 +57,7 @@ describe('template source-mapping', () => {
|
||||
{source: '<h2>', generated: 'i0.ɵɵelementStart(0, "h2")', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain({
|
||||
source: '{{ greeting + " " + name }}',
|
||||
generated:
|
||||
'i0.ɵɵtextBinding(1, i0.ɵɵinterpolation1("", ctx.greeting + " " + ctx.name, ""))',
|
||||
generated: 'i0.ɵɵtextInterpolate(ctx.greeting + " " + ctx.name)',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain(
|
||||
@ -85,8 +84,7 @@ describe('template source-mapping', () => {
|
||||
{source: '<div>', generated: 'i0.ɵɵelementStart(0, "div")', sourceUrl: '../test.ts'});
|
||||
expect(mappings).toContain({
|
||||
source: '{{200.3 | percent : 2 }}',
|
||||
generated:
|
||||
'i0.ɵɵtextBinding(1, i0.ɵɵinterpolation1("", i0.ɵɵpipeBind2(2, 1, 200.3, 2), ""))',
|
||||
generated: 'i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(2, 1, 200.3, 2))',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
expect(mappings).toContain(
|
||||
@ -270,7 +268,7 @@ describe('template source-mapping', () => {
|
||||
|
||||
// expect(mappings).toContain({
|
||||
// source: '{{ name }}',
|
||||
// generated: 'i0.ɵɵtextBinding(1, i0.ɵɵinterpolation1("", ctx_r0.name, ""))',
|
||||
// generated: 'i0.ɵɵtextInterpolate(ctx_r0.name)',
|
||||
// sourceUrl: '../test.ts'
|
||||
// });
|
||||
});
|
||||
@ -294,7 +292,7 @@ describe('template source-mapping', () => {
|
||||
|
||||
// expect(mappings).toContain({
|
||||
// source: '{{ name }}',
|
||||
// generated: 'i0.ɵɵtextBinding(1, i0.ɵɵinterpolation1("", ctx_r0.name, ""))',
|
||||
// generated: 'i0.ɵɵtextInterpolate(ctx_r0.name)',
|
||||
// sourceUrl: '../test.ts'
|
||||
// });
|
||||
});
|
||||
@ -370,7 +368,7 @@ describe('template source-mapping', () => {
|
||||
|
||||
// Update mode
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵɵtextBinding(3, i0.ɵɵinterpolation1("", 1 + 2, ""))',
|
||||
generated: 'i0.ɵɵtextInterpolate(1 + 2)',
|
||||
source: '{{ 1 + 2 }}',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
@ -396,9 +394,10 @@ describe('template source-mapping', () => {
|
||||
expect(mappings).toContain(
|
||||
{generated: 'i0.ɵɵelementEnd()', source: '</div>', sourceUrl: '../test.ts'});
|
||||
|
||||
// TODO(benlesh): We need to circle back and prevent the extra parens from being generated.
|
||||
// Update mode
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵɵtextBinding(3, i0.ɵɵinterpolation1("", 1 + 2, ""))',
|
||||
generated: 'i0.ɵɵtextInterpolate(1 + 2)',
|
||||
source: '{{ 1 + 2 }}',
|
||||
sourceUrl: '../test.ts'
|
||||
});
|
||||
@ -452,7 +451,7 @@ describe('template source-mapping', () => {
|
||||
|
||||
// Update mode
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵɵtextBinding(3, i0.ɵɵinterpolation1("", 1 + 2, ""))',
|
||||
generated: 'i0.ɵɵtextInterpolate(1 + 2)',
|
||||
source: '{{ 1 + 2 }}',
|
||||
sourceUrl: '../dir/test.html'
|
||||
});
|
||||
@ -496,7 +495,7 @@ describe('template source-mapping', () => {
|
||||
|
||||
// Update mode
|
||||
expect(mappings).toContain({
|
||||
generated: 'i0.ɵɵtextBinding(3, i0.ɵɵinterpolation1("", 1 + 2, ""))',
|
||||
generated: 'i0.ɵɵtextInterpolate(1 + 2)',
|
||||
source: '{{ 1 + 2 }}',
|
||||
sourceUrl: '../extraRootDir/test.html'
|
||||
});
|
||||
|
Reference in New Issue
Block a user