feat(dart/transform): Remove unnecessary .ng_deps.dart files
Removes `.ng_deps.dart` files which 1. Do not register any `@Injectable` classes 2. Do not call `initReflector` on any other `.ng_deps.dart` files. Closes #1929
This commit is contained in:
@ -50,13 +50,18 @@ void _testNgDeps(String name, String inputPath,
|
||||
reader.addAsset(assetId, await reader.readAsString(inputId));
|
||||
inputId = assetId;
|
||||
}
|
||||
var annotationMatcher = new AnnotationMatcher()..addAll(customDescriptors);
|
||||
var output = formatter
|
||||
.format(await createNgDeps(reader, inputId, annotationMatcher));
|
||||
var expectedPath = path.join(path.dirname(inputPath), 'expected',
|
||||
path.basename(inputPath).replaceFirst('.dart', '.ng_deps.dart'));
|
||||
var expectedId = _assetIdForPath(expectedPath);
|
||||
expect(output).toEqual(await reader.readAsString(expectedId));
|
||||
|
||||
var annotationMatcher = new AnnotationMatcher()..addAll(customDescriptors);
|
||||
var output = await createNgDeps(reader, inputId, annotationMatcher);
|
||||
if (output == null) {
|
||||
expect(await reader.hasInput(expectedId)).toBeFalse();
|
||||
} else {
|
||||
expect(formatter.format(output))
|
||||
.toEqual(await reader.readAsString(expectedId));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1,9 +0,0 @@
|
||||
library dinner.bad_soup.ng_deps.dart;
|
||||
|
||||
import 'bad_soup.dart';
|
||||
|
||||
var _visited = false;
|
||||
void initReflector(reflector) {
|
||||
if (_visited) return;
|
||||
_visited = true;
|
||||
}
|
Reference in New Issue
Block a user