Skip to content

Commit 750efc6

Browse files
Clean up
1 parent bcaf769 commit 750efc6

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

benchmark/dart2js_output.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ abstract class CompareCommand extends BaseCommand {
5050
);
5151
}
5252

53-
dynamic get _baseDep => parseDependency(argResults!['base'] as String);
53+
dynamic get _baseDep => parseOverReactDependency(argResults!['base'] as String);
5454

55-
dynamic get _headDep => parseDependency(argResults!['head'] as String);
55+
dynamic get _headDep => parseOverReactDependency(argResults!['head'] as String);
5656
}
5757

5858
class CompareSizeCommand extends CompareCommand {
@@ -125,7 +125,7 @@ class GetCodeCommand extends BaseCommand {
125125
);
126126
}
127127

128-
dynamic get _dep => parseDependency(argResults!['dependency'] as String);
128+
dynamic get _dep => parseOverReactDependency(argResults!['dependency'] as String);
129129

130130
@override
131131
Future<void> run() async {

benchmark/dart2js_output/dependency.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ final localPathDepString = jsonEncode({
66
'path': Directory.current.path,
77
});
88

9-
dynamic parseDependency(String dependency) {
9+
/// Parses a string representation of an `over_react` [dependency] from a command-line arg.
10+
///
11+
/// Supports either
12+
/// - a JSON format, equivalent to the YAML-parsed value of `dependencies`.`over_react` in a pubspec.yaml
13+
/// - a `git:<ref>` shorthand
14+
dynamic parseOverReactDependency(String dependency) {
1015
final gitShorthandMatch = RegExp(r'^git:(.+)$').matchAsPrefix(dependency);
1116
if (gitShorthandMatch != null) {
1217
return {

benchmark/dart2js_output/source.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// Returns Dart source for a general (function) component declaration,
2+
/// for use in various benchmarks.
13
String componentBenchmark({
24
required int componentCount,
35
required int propsCount,

0 commit comments

Comments
 (0)