fix(common): cleanup the StylingDiffer and related code (#34307)

Since I was learning the codebase and had a hard time understanding what was going on I've done a
bunch of changes in one commit that under normal circumstances should have been split into several
commits. Because this code is likely going to be overwritten with Misko's changes I'm not going to
spend the time with trying to split this up.

Overall I've done the following:
- I processed review feedback from #34307
- I did a bunch of renaming to make the code easier to understand
- I refactored some internal functions that were either inefficient or hard to read
- I also updated lots of type signatures to correct them and to remove many casts in the code

PR Close #34307
This commit is contained in:
Igor Minar
2020-01-11 11:23:53 -08:00
committed by Matias Niemelä
parent abd4628587
commit 0b1e34de40
8 changed files with 309 additions and 236 deletions

View File

@ -257,8 +257,7 @@ runInEachFileSystem(() => {
// We need to make sure that the flat typings file exports this directly
const dtsContents = fs.readFile(_('/node_modules/@angular/common/common.d.ts'));
expect(dtsContents)
.toContain(`export declare class ${exportedName} implements ɵNgClassImpl`);
expect(dtsContents).toContain(`export declare class ${exportedName} extends ɵNgClassImpl`);
// And that ngcc's modifications to that class use the correct (exported) name
expect(dtsContents).toContain(`static ɵprov: ɵngcc0.ɵɵInjectableDef<${exportedName}>`);
});