Skip to content

Commit 6c58034

Browse files
thePunderWomanalxhub
authored andcommitted
fix(migrations): Remove unhelpful parsing errors from the log (angular#52401)
When running the control flow migration, unhelpful ICU parsing errors were being logged and creating a bunch of noise for users. PR Close angular#52401
1 parent 6b3f0bd commit 6c58034

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

packages/core/schematics/ng-generate/control-flow-migration/util.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,9 @@ export function migrateTemplate(template: string): {migrated: string|null, error
107107

108108
// Don't migrate invalid templates.
109109
if (parsed.errors && parsed.errors.length > 0) {
110-
for (let error of parsed.errors) {
111-
errors.push({type: 'parse', error});
112-
}
113110
return {migrated: null, errors};
114111
}
115-
} catch (error: unknown) {
116-
errors.push({type: 'parse', error});
112+
} catch {
117113
return {migrated: null, errors};
118114
}
119115

packages/core/schematics/test/control_flow_migration_spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,7 +1963,7 @@ describe('control flow migration', () => {
19631963
19641964
@Component({
19651965
imports: [NgIf],
1966-
template: \`<div><span *ngIf="toggle>This should be hidden</span></div>\`
1966+
template: \`<div><span *ngIf="toggle">This should be hidden</span></div>\`
19671967
})
19681968
class Comp {
19691969
toggle = false;
@@ -1973,7 +1973,8 @@ describe('control flow migration', () => {
19731973
await runMigration();
19741974
tree.readContent('/comp.ts');
19751975

1976-
expect(warnOutput.join(' ')).toContain('WARNING: 1 errors occured during your migration');
1976+
expect(warnOutput.join(' '))
1977+
.toContain('IMPORTANT! This migration is in developer preview. Use with caution.');
19771978
});
19781979
});
19791980

0 commit comments

Comments
 (0)