BREAKING CHANGES: Dart applications and TypeScript applications meant to transpile to Dart must now import `package:angular2/bootstrap.dart` instead of `package:angular2/angular2.dart` in their bootstrap code. `package:angular2/angular2.dart` no longer export the bootstrap function. The transformer rewrites imports of `bootstrap.dart` and calls to `bootstrap` to `bootstrap_static.dart` and `bootstrapStatic` respectively.
		
			
				
	
	
		
			34 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
library angular2.benchmark.transform.reflection_remover.simple;
 | 
						|
 | 
						|
import 'dart:async';
 | 
						|
import 'package:angular2/src/transform/common/options.dart';
 | 
						|
import 'package:angular2/src/transform/reflection_remover/transformer.dart';
 | 
						|
import 'package:barback/barback.dart';
 | 
						|
import 'package:code_transformers/benchmarks.dart';
 | 
						|
import 'package:unittest/unittest.dart';
 | 
						|
 | 
						|
Future main() => runBenchmark();
 | 
						|
 | 
						|
allTests() {
 | 
						|
  test('Reflection Remover Benchmark Runs', runBenchmark);
 | 
						|
}
 | 
						|
 | 
						|
Future runBenchmark() async {
 | 
						|
  var options = new TransformerOptions(['web/index.dart']);
 | 
						|
  var files = {new AssetId('a', 'web/index.dart'): indexContents,};
 | 
						|
  return new TransformerBenchmark([[new ReflectionRemover(options)]], files)
 | 
						|
      .measure();
 | 
						|
}
 | 
						|
 | 
						|
const indexContents = '''
 | 
						|
library web_foo;
 | 
						|
 | 
						|
import 'package:angular2/bootstrap.dart';
 | 
						|
import 'package:angular2/src/reflection/reflection.dart';
 | 
						|
import 'package:angular2/src/reflection/reflection_capabilities.dart';
 | 
						|
 | 
						|
void main() {
 | 
						|
  reflector.reflectionCapabilities = new ReflectionCapabilities();
 | 
						|
  bootstrap(MyComponent);
 | 
						|
}''';
 |