Skip to content

Commit 26a3390

Browse files
Tim Blasikegluneq
authored andcommitted
refactor(dart/transform): Remove deprecated angular2/bootstrap
BREAKING CHANGE Remove the deprecated angular2/bootstrap.ts & angular2/bootstrap_static.ts libraries. Browser entry points should import angular2/platform/browser which supplies the `bootstrap` function. Closes angular#7650
1 parent 9a1959f commit 26a3390

8 files changed

Lines changed: 6 additions & 46 deletions

File tree

modules/angular2/bootstrap.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

modules/angular2/bootstrap_static.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

modules_dart/transform/lib/src/transform/common/annotation_matcher.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const _INJECTABLES = const [
1515
const ClassDescriptor('Injectable', 'package:angular2/core.dart'),
1616
const ClassDescriptor('Injectable', 'package:angular2/src/core/di.dart'),
1717
const ClassDescriptor('Injectable', 'package:angular2/angular2.dart'),
18-
const ClassDescriptor('Injectable', 'package:angular2/bootstrap_static.dart'),
1918
const ClassDescriptor(
2019
'Injectable', 'package:angular2/web_worker/worker.dart'),
2120
];
@@ -65,7 +64,6 @@ const _PIPES = const [
6564
const _VIEWS = const [
6665
const ClassDescriptor('View', 'package:angular2/angular2.dart'),
6766
const ClassDescriptor('View', 'package:angular2/web_worker/worker.dart'),
68-
const ClassDescriptor('View', 'package:angular2/bootstrap_static.dart'),
6967
const ClassDescriptor('View', 'package:angular2/core.dart'),
7068
const ClassDescriptor('View', 'package:angular2/src/core/metadata/view.dart'),
7169
const ClassDescriptor('View', 'package:angular2/src/core/metadata.dart'),
@@ -74,9 +72,6 @@ const _VIEWS = const [
7472
const _ENTRYPOINTS = const [
7573
const ClassDescriptor('AngularEntrypoint', 'package:angular2/angular2.dart'),
7674
const ClassDescriptor('AngularEntrypoint', 'package:angular2/core.dart'),
77-
const ClassDescriptor('AngularEntrypoint', 'package:angular2/bootstrap.dart'),
78-
const ClassDescriptor(
79-
'AngularEntrypoint', 'package:angular2/bootstrap_static.dart'),
8075
const ClassDescriptor(
8176
'AngularEntrypoint', 'package:angular2/platform/browser.dart'),
8277
const ClassDescriptor(

modules_dart/transform/lib/src/transform/common/mirror_matcher.dart

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ library angular2.transform.common.mirror_matcher;
33
import 'package:analyzer/src/generated/ast.dart';
44
import 'package:angular2/src/transform/common/names.dart';
55

6-
/// Files from which `bootstrap` is exported.
6+
/// File from which `bootstrap` is exported.
77
///
8-
/// These files transitively imports dart:mirrors.
9-
/// They should be replaced with [BOOTSTRAP_STATIC_URI] in production apps.
10-
const _BOOTSTRAP_URIS = const <String>[
11-
'package:angular2/bootstrap.dart',
12-
'package:angular2/platform/browser.dart',
13-
];
8+
/// This file transitively imports dart:mirrors.
9+
/// It should be replaced with [BOOTSTRAP_STATIC_URI] in production apps.
10+
const _BOOTSTRAP_URI = 'package:angular2/platform/browser.dart';
1411

1512
/// File from which `ReflectionCapabilities` is exported.
1613
///
@@ -23,7 +20,7 @@ const _REFLECTION_CAPABILITIES_URI =
2320
/// File from which `bootstrapStatic` is exported.
2421
///
2522
/// This file does not transitively import dart:mirrors.
26-
/// It should be used in place of [_BOOTSTRAP_URIS] in production apps.
23+
/// It should be used in place of [_BOOTSTRAP_URI] in production apps.
2724
const BOOTSTRAP_STATIC_URI = 'package:angular2/platform/browser_static.dart';
2825

2926
/// Syntactially checks for code related to the use of `dart:mirrors`.
@@ -42,5 +39,5 @@ class MirrorMatcher {
4239
}
4340

4441
bool hasBootstrapUri(UriBasedDirective node) =>
45-
_BOOTSTRAP_URIS.contains(node.uri.stringValue);
42+
_BOOTSTRAP_URI == node.uri.stringValue;
4643
}

modules_dart/transform/test/transform/reflection_remover/all_tests.dart

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,6 @@ void allTests() {
7171
});
7272

7373
describe('`bootstrap` import and call', () {
74-
// TODO(kegluneq): Remove when we remove angular2/bootstrap.dart
75-
it('deprecated import should be rewritten to `bootstrapStatic`.', () {
76-
final bootstrapCode =
77-
readFile('reflection_remover/deprecated_bootstrap_files/index.dart')
78-
.replaceAll('\r\n', '\n');
79-
var output = new Rewriter(bootstrapCode, codegen, entrypointMatcher,
80-
writeStaticInit: true)
81-
.rewrite(parseCompilationUnit(bootstrapCode));
82-
expect(output).toEqual(bootstrap_expected.code);
83-
});
84-
8574
it('should be rewritten to `bootstrapStatic`.', () {
8675
final bootstrapCode =
8776
readFile('reflection_remover/bootstrap_files/index.dart')

modules_dart/transform/test/transform/reflection_remover/deprecated_bootstrap_files/index.dart

Lines changed: 0 additions & 7 deletions
This file was deleted.

tools/broccoli/html-replace/SCRIPTS.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// not even be in src/*. Move them!
1010
'angular2/src/testing/benchmark_util',
1111
'angular2/src/facade/browser',
12-
'angular2/bootstrap',
1312
'rxjs'
1413
];
1514
if (@@USE_BUNDLES) {

tools/broccoli/html-replace/SCRIPTS_benchmarks.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
// not even be in src/*. Move them!
1111
'angular2/src/testing/benchmark_util',
1212
'angular2/src/facade/browser',
13-
'angular2/bootstrap',
1413
'rxjs'
1514
];
1615
if (@@USE_BUNDLES) {

0 commit comments

Comments
 (0)