feat(bootstrap): remove the need for explicit reflection setup in bootstrap code

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.
This commit is contained in:
yjbanov
2015-07-22 10:18:04 -07:00
parent 55e8dca8de
commit 3531bb7118
119 changed files with 896 additions and 827 deletions

View File

@ -4,7 +4,7 @@ import 'hello.dart';
export 'hello.dart';
import 'package:angular2/src/reflection/reflection.dart' as _ngRef;
import 'package:angular2/angular2.dart'
show bootstrap, Component, Directive, View, NgElement;
show Component, Directive, View, NgElement;
var _visited = false;
void initReflector() {

View File

@ -1,7 +1,7 @@
library examples.src.hello_world.absolute_url_expression_files;
import 'package:angular2/angular2.dart'
show bootstrap, Component, Directive, View, NgElement;
show Component, Directive, View, NgElement;
@Component(selector: 'hello-app')
@View(

View File

@ -116,8 +116,10 @@ void allTests() {
void _testNgDeps(String name, String inputPath,
{List<AnnotationDescriptor> customDescriptors: const [], AssetId assetId,
AssetReader reader, List<String> expectedLogs, bool inlineViews: true}) {
it(name, () async {
AssetReader reader, List<String> expectedLogs, bool inlineViews: true,
bool isolate: false}) {
var testFn = isolate ? iit : it;
testFn(name, () async {
if (expectedLogs != null) {
log.setLogger(new RecordingLogger());
}

View File

@ -4,7 +4,7 @@ import 'hello.dart';
export 'hello.dart';
import 'package:angular2/src/reflection/reflection.dart' as _ngRef;
import 'package:angular2/angular2.dart'
show bootstrap, Component, Directive, View, NgElement;
show Component, Directive, View, NgElement;
var _visited = false;
void initReflector() {

View File

@ -4,7 +4,7 @@ import 'hello.dart';
export 'hello.dart';
import 'package:angular2/src/reflection/reflection.dart' as _ngRef;
import 'package:angular2/angular2.dart'
show bootstrap, Component, Directive, View, NgElement;
show Component, Directive, View, NgElement;
var _visited = false;
void initReflector() {

View File

@ -1,7 +1,7 @@
library test.transform.directive_processor.invalid_url_files.hello;
import 'package:angular2/angular2.dart'
show bootstrap, Component, Directive, View, NgElement;
show Component, Directive, View, NgElement;
@Component(selector: 'hello-app')
@View(

View File

@ -4,7 +4,7 @@ import 'hello.dart';
export 'hello.dart';
import 'package:angular2/src/reflection/reflection.dart' as _ngRef;
import 'package:angular2/angular2.dart'
show bootstrap, Component, Directive, View, NgElement;
show Component, Directive, View, NgElement;
var _visited = false;
void initReflector() {

View File

@ -1,7 +1,7 @@
library examples.src.hello_world.multiple_style_urls_files;
import 'package:angular2/angular2.dart'
show bootstrap, Component, Directive, View, NgElement;
show Component, Directive, View, NgElement;
@Component(selector: 'hello-app')
@View(

View File

@ -4,7 +4,7 @@ import 'hello.dart';
export 'hello.dart';
import 'package:angular2/src/reflection/reflection.dart' as _ngRef;
import 'package:angular2/angular2.dart'
show bootstrap, Component, Directive, View, NgElement;
show Component, Directive, View, NgElement;
var _visited = false;
void initReflector() {

View File

@ -1,7 +1,7 @@
library examples.src.hello_world.multiple_style_urls_not_inlined_files;
import 'package:angular2/angular2.dart'
show bootstrap, Component, Directive, View, NgElement;
show Component, Directive, View, NgElement;
@Component(selector: 'hello-app')
@View(

View File

@ -4,7 +4,7 @@ import 'hello.dart';
export 'hello.dart';
import 'package:angular2/src/reflection/reflection.dart' as _ngRef;
import 'package:angular2/angular2.dart'
show bootstrap, Component, Directive, View, NgElement;
show Component, Directive, View, NgElement;
var _visited = false;
void initReflector() {

View File

@ -1,7 +1,7 @@
library examples.src.hello_world.split_url_expression_files;
import 'package:angular2/angular2.dart'
show bootstrap, Component, Directive, View, NgElement;
show Component, Directive, View, NgElement;
@Component(selector: 'hello-app')
@View(templateUrl: 'templ' 'ate.html')

View File

@ -4,7 +4,7 @@ import 'hello.dart';
export 'hello.dart';
import 'package:angular2/src/reflection/reflection.dart' as _ngRef;
import 'package:angular2/angular2.dart'
show bootstrap, Component, Directive, View, NgElement;
show Component, Directive, View, NgElement;
var _visited = false;
void initReflector() {

View File

@ -1,7 +1,7 @@
library examples.src.hello_world.url_expression_files;
import 'package:angular2/angular2.dart'
show bootstrap, Component, Directive, View, NgElement;
show Component, Directive, View, NgElement;
@Component(selector: 'hello-app')
@View(templateUrl: 'template.html')