diff --git a/modules/@angular/benchpress/src/firefox_extension/data/installed_script.dart b/modules/@angular/benchpress/src/firefox_extension/data/installed_script.dart deleted file mode 100644 index 913dc85e98..0000000000 --- a/modules/@angular/benchpress/src/firefox_extension/data/installed_script.dart +++ /dev/null @@ -1,3 +0,0 @@ -library benchpress.src.firefox_extension.data.installed_script; - -//no dart implementation diff --git a/modules/benchmarks_external/e2e_test/compiler_perf.dart b/modules/benchmarks_external/e2e_test/compiler_perf.dart deleted file mode 100644 index a21ac5eb91..0000000000 --- a/modules/benchmarks_external/e2e_test/compiler_perf.dart +++ /dev/null @@ -1,3 +0,0 @@ -library benchmarks_external.e2e_test.compiler_perf; - -main() {} diff --git a/modules/benchmarks_external/e2e_test/largetable_perf.dart b/modules/benchmarks_external/e2e_test/largetable_perf.dart deleted file mode 100644 index 6a620017af..0000000000 --- a/modules/benchmarks_external/e2e_test/largetable_perf.dart +++ /dev/null @@ -1,3 +0,0 @@ -library benchmarks_external.e2e_test.largetable_perf; - -main() {} diff --git a/modules/benchmarks_external/e2e_test/naive_infinite_scroll_perf.dart b/modules/benchmarks_external/e2e_test/naive_infinite_scroll_perf.dart deleted file mode 100644 index f65d170c5d..0000000000 --- a/modules/benchmarks_external/e2e_test/naive_infinite_scroll_perf.dart +++ /dev/null @@ -1,3 +0,0 @@ -library benchmarks_external.e2e_test.naive_infinite_scroll_perf; - -main() {} diff --git a/modules/benchmarks_external/e2e_test/polymer_tree_perf.dart b/modules/benchmarks_external/e2e_test/polymer_tree_perf.dart deleted file mode 100644 index a86d7c6394..0000000000 --- a/modules/benchmarks_external/e2e_test/polymer_tree_perf.dart +++ /dev/null @@ -1,3 +0,0 @@ -library benchmarks_external.e2e_test.polymer_tree_perf; - -main() {} diff --git a/modules/benchmarks_external/e2e_test/react_tree_perf.dart b/modules/benchmarks_external/e2e_test/react_tree_perf.dart deleted file mode 100644 index 9a9a620a11..0000000000 --- a/modules/benchmarks_external/e2e_test/react_tree_perf.dart +++ /dev/null @@ -1,3 +0,0 @@ -library benchmarks_external.e2e_test.react_tree_perf; - -main() {} diff --git a/modules/benchmarks_external/e2e_test/static_tree_perf.dart b/modules/benchmarks_external/e2e_test/static_tree_perf.dart deleted file mode 100644 index 8868f131ba..0000000000 --- a/modules/benchmarks_external/e2e_test/static_tree_perf.dart +++ /dev/null @@ -1,3 +0,0 @@ -library benchmarks_external.e2e_test.static_tree_perf; - -main() {} diff --git a/modules/benchmarks_external/e2e_test/tree_perf.dart b/modules/benchmarks_external/e2e_test/tree_perf.dart deleted file mode 100644 index 7a5ca59fc9..0000000000 --- a/modules/benchmarks_external/e2e_test/tree_perf.dart +++ /dev/null @@ -1,3 +0,0 @@ -library benchmarks_external.e2e_test.tree_perf; - -main() {} diff --git a/modules/benchmarks_external/pubspec.yaml b/modules/benchmarks_external/pubspec.yaml deleted file mode 100644 index a488a5d87b..0000000000 --- a/modules/benchmarks_external/pubspec.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: benchmarks_external -environment: - sdk: '>=1.4.0' -dependencies: - angular: '>=1.1.2+2 <2.0.0' - browser: '>=0.10.0 <0.11.0' -dev_dependencies: - angular2: - path: ../angular2 -dependency_overrides: - intl: '^0.12.4' # angular depends on an older version of intl. -transformers: -- angular: - $include: "web/src" - html_files: - - web/src/naive_infinite_scroll/scroll_area.html - - web/src/naive_infinite_scroll/scroll_item.html -- $dart2js: - $include: "web/src" - commandLineOptions: - - --show-package-warnings diff --git a/modules/benchmarks_external/src/compiler/compiler_benchmark.dart b/modules/benchmarks_external/src/compiler/compiler_benchmark.dart deleted file mode 100644 index ca0ff804a2..0000000000 --- a/modules/benchmarks_external/src/compiler/compiler_benchmark.dart +++ /dev/null @@ -1,90 +0,0 @@ -// compiler benchmark in AngularDart 1.x -library compiler_benchmark_ng10; - -import 'package:angular/angular.dart'; -import 'package:angular/application_factory.dart'; -import 'dart:html'; -import 'package:angular2/src/testing/benchmark_util.dart'; - -main() { - var count = getIntParameter('elements'); - - var m = new Module() - ..bind(Dir0) - ..bind(Dir1) - ..bind(Dir2) - ..bind(Dir3) - ..bind(Dir4); - - var templateWithBindings = loadTemplate('templateWithBindings', count); - var templateNoBindings = loadTemplate('templateWithBindings', count); - - final injector = applicationFactory().addModule(m).run(); - final compiler = injector.get(Compiler); - final directiveMap = injector.get(DirectiveMap); - - compileWithBindings() { - final cloned = templateWithBindings.clone(true); - compiler([cloned], directiveMap); - } - - compileNoBindings() { - final cloned = templateNoBindings.clone(true); - compiler([cloned], directiveMap); - } - - bindAction('#compileWithBindings', compileWithBindings); - bindAction('#compileNoBindings', compileNoBindings); -} - -loadTemplate(templateId, repeatCount) { - String result = ''; - var content = document.querySelector("#${templateId}").innerHtml; - for (var i = 0; i < repeatCount; i++) { - result += content; - } - return createTemplate(result.replaceAll(new RegExp(r'[\[\]]'), '')); -} - -class IdentitySanitizer implements NodeTreeSanitizer { - void sanitizeTree(Node node) {} -} - -createTemplate(String html) { - var div = document.createElement('div'); - div.setInnerHtml(html, treeSanitizer: new IdentitySanitizer()); - return div; -} - -@Decorator(selector: '[dir0]', map: const {'attr0': '=>prop'}) -class Dir0 { - Object prop; -} - -@Decorator(selector: '[dir1]', map: const {'attr1': '=>prop'}) -class Dir1 { - Object prop; - - constructor(Dir0 dir0) {} -} - -@Decorator(selector: '[dir2]', map: const {'attr2': '=>prop'}) -class Dir2 { - Object prop; - - constructor(Dir1 dir1) {} -} - -@Decorator(selector: '[dir3]', map: const {'attr3': '=>prop'}) -class Dir3 { - Object prop; - - constructor(Dir2 dir2) {} -} - -@Decorator(selector: '[dir4]', map: const {'attr4': '=>prop'}) -class Dir4 { - Object prop; - - constructor(Dir3 dir3) {} -} diff --git a/modules/benchmarks_external/src/largetable/largetable_benchmark.dart b/modules/benchmarks_external/src/largetable/largetable_benchmark.dart deleted file mode 100644 index fc8570d098..0000000000 --- a/modules/benchmarks_external/src/largetable/largetable_benchmark.dart +++ /dev/null @@ -1 +0,0 @@ -library benchmarks_external.src.largetable; diff --git a/modules/benchmarks_external/src/naive_infinite_scroll/app.dart b/modules/benchmarks_external/src/naive_infinite_scroll/app.dart deleted file mode 100644 index fcd7b1204c..0000000000 --- a/modules/benchmarks_external/src/naive_infinite_scroll/app.dart +++ /dev/null @@ -1,59 +0,0 @@ -library scroll_app; - -import 'dart:async'; -import 'dart:html'; -import 'package:angular/angular.dart'; -import 'package:angular2/src/testing/benchmark_util.dart'; - -@Component( - selector: 'scroll-app', - template: ''' -
-
- -
-
-

Following tables are only here to add weight to the UI:

- -
-
- ''') -class App implements ShadowRootAware { - final VmTurnZone ngZone; - List scrollAreas; - int scrollTop = 0; - int iterationCount; - int scrollIncrement; - - App(this.ngZone) { - int appSize = getIntParameter('appSize'); - iterationCount = getIntParameter('iterationCount'); - scrollIncrement = getIntParameter('scrollIncrement'); - appSize = appSize > 1 ? appSize - 1 : 0; // draw at least one table - scrollAreas = new List.generate(appSize, (i) => i); - } - - @override - void onShadowRoot(ShadowRoot shadowRoot) { - bindAction('#run-btn', () { - runBenchmark(); - }); - bindAction('#reset-btn', () { - scrollTop = 0; - }); - } - - void runBenchmark() { - int n = iterationCount; - scheduleScroll() { - new Future(() { - scrollTop += scrollIncrement; - n--; - if (n > 0) { - scheduleScroll(); - } - }); - } - scheduleScroll(); - } -} diff --git a/modules/benchmarks_external/src/naive_infinite_scroll/cells.dart b/modules/benchmarks_external/src/naive_infinite_scroll/cells.dart deleted file mode 100644 index 366d549efd..0000000000 --- a/modules/benchmarks_external/src/naive_infinite_scroll/cells.dart +++ /dev/null @@ -1,128 +0,0 @@ -library cells; - -import 'package:angular/angular.dart'; -import 'common.dart'; - -@Component( - selector: 'company-name', - template: ''' -
{{company.name}}
- ''', - map: const {'company': '=>company', 'cell-width': '=>width',}) -class CompanyNameComponent { - String width; - Company company; -} - -@Component( - selector: 'opportunity-name', - template: ''' -
{{opportunity.name}}
- ''', - map: const {'opportunity': '=>opportunity', 'cell-width': '=>width',}) -class OpportunityNameComponent { - String width; - Opportunity opportunity; -} - -@Component( - selector: 'offering-name', - template: ''' -
{{offering.name}}
- ''', - map: const {'offering': '=>offering', 'cell-width': '=>width',}) -class OfferingNameComponent { - String width; - Offering offering; -} - -class Stage { - String name; - bool isDisabled; - Map style; - Function apply; - - String get styleString => style != null - ? style.keys.map((prop) => '$prop: ${style[prop]}').join(';') - : ''; -} - -@Component( - selector: 'stage-buttons', - template: ''' -
- -
- ''', - map: const {'offering': '=>offering', 'cell-width': '=>width',}) -class StageButtonsComponent { - Offering _offering; - List stages; - String width; - - Offering get offering => _offering; - set offering(Offering offering) { - _offering = offering; - _computeStageButtons(); - } - - setStage(Stage stage) { - _offering.status = stage.name; - _computeStageButtons(); - } - - _computeStageButtons() { - bool disabled = true; - stages = STATUS_LIST.map((String status) { - bool isCurrent = offering.status == status; - var stage = new Stage(); - stage - ..name = status - ..isDisabled = disabled - ..style = { - 'background-color': disabled ? '#DDD' : isCurrent ? '#DDF' : '#FDD' - }; - if (isCurrent) { - disabled = false; - } - return stage; - }).toList(); - } -} - -@Component( - selector: 'account-cell', - template: ''' -
- - {{account.accountId}} - -
- ''', - map: const {'account': '=>account', 'cell-width': '=>width',}) -class AccountCellComponent { - Account account; - String width; -} - -@Component( - selector: 'formatted-cell', - template: '''
{{formattedValue}}
''', - map: const {'value': '=>value', 'cell-width': '=>width',}) -class FormattedCellComponent { - String formattedValue; - String width; - - set value(dynamic value) { - if (value is DateTime) { - formattedValue = '${value.month}/${value.day}/${value.year}'; - } else { - formattedValue = value.toString(); - } - } -} diff --git a/modules/benchmarks_external/src/naive_infinite_scroll/common.dart b/modules/benchmarks_external/src/naive_infinite_scroll/common.dart deleted file mode 100644 index e77ed3b69a..0000000000 --- a/modules/benchmarks_external/src/naive_infinite_scroll/common.dart +++ /dev/null @@ -1,205 +0,0 @@ -library common.stuff; - -import 'dart:async'; -import 'dart:collection'; -import 'package:observe/observe.dart'; - -const ITEMS = 1000; -const ITEM_HEIGHT = 40; -const VISIBLE_ITEMS = 17; - -const HEIGHT = ITEMS * ITEM_HEIGHT; -const VIEW_PORT_HEIGHT = ITEM_HEIGHT * VISIBLE_ITEMS; - -const COMPANY_NAME_WIDTH = 100; -const OPPORTUNITY_NAME_WIDTH = 100; -const OFFERING_NAME_WIDTH = 100; -const ACCOUNT_CELL_WIDTH = 50; -const BASE_POINTS_WIDTH = 50; -const KICKER_POINTS_WIDTH = 50; -const STAGE_BUTTONS_WIDTH = 220; -const BUNDLES_WIDTH = 120; -const DUE_DATE_WIDTH = 100; -const END_DATE_WIDTH = 100; -const AAT_STATUS_WIDTH = 100; -const ROW_WIDTH = COMPANY_NAME_WIDTH + - OPPORTUNITY_NAME_WIDTH + - OFFERING_NAME_WIDTH + - ACCOUNT_CELL_WIDTH + - BASE_POINTS_WIDTH + - KICKER_POINTS_WIDTH + - STAGE_BUTTONS_WIDTH + - BUNDLES_WIDTH + - DUE_DATE_WIDTH + - END_DATE_WIDTH + - AAT_STATUS_WIDTH; - -const STATUS_LIST = const ['Planned', 'Pitched', 'Won', 'Lost']; - -const AAT_STATUS_LIST = const ['Active', 'Passive', 'Abandoned']; - -// Imitate Streamy entities. - -class RawEntity extends Object - with MapMixin - implements ObservableMap { - ObservableMap _data = new ObservableMap(); - - @override - Iterable get keys => _data.keys; - - @override - void clear() { - _data.clear(); - } - - @override - operator [](String key) { - if (!key.contains('.')) { - return _data[key]; - } - var pieces = key.split('.'); - var last = pieces.removeLast(); - var target = _resolve(pieces, this); - if (target == null) { - return null; - } - return target[last]; - } - - @override - operator []=(String key, value) { - if (!key.contains('.')) { - _data[key] = value; - return; - } - var pieces = key.split('.'); - var last = pieces.removeLast(); - var target = _resolve(pieces, this); - target[last] = value; - } - - @override - remove(String key) { - if (!key.contains('.')) { - return _data.remove(key); - } - var pieces = key.split('.'); - var last = pieces.removeLast(); - var target = _resolve(pieces, this); - return target.remove(last); - } - - _resolve(List pieces, start) { - var cur = start; - for (var i = 0; i < pieces.length; i++) { - cur = cur[pieces[i]]; - if (cur == null) { - return null; - } - } - return cur; - } - - @override - Stream> get changes => _data.changes; - @override - bool get hasObservers => _data.hasObservers; - @override - bool deliverChanges() => _data.deliverChanges(); - @override - notifyPropertyChange(Symbol field, Object oldValue, Object newValue) => - _data.notifyPropertyChange(field, oldValue, newValue); - @override - void notifyChange(ChangeRecord record) { - _data.notifyChange(record); - } - - @override - void observed() { - _data.observed(); - } - - @override - void unobserved() { - _data.observed(); - } -} - -class Company extends RawEntity { - String get name => this['name']; - set name(String val) { - this['name'] = val; - } -} - -class Offering extends RawEntity { - String get name => this['name']; - set name(String val) { - this['name'] = val; - } - - Company get company => this['company']; - set company(Company val) { - this['company'] = val; - } - - Opportunity get opportunity => this['opportunity']; - set opportunity(Opportunity val) { - this['opportunity'] = val; - } - - Account get account => this['account']; - set account(Account val) { - this['account'] = val; - } - - int get basePoints => this['basePoints']; - set basePoints(int val) { - this['basePoints'] = val; - } - - int get kickerPoints => this['kickerPoints']; - set kickerPoints(int val) { - this['kickerPoints'] = val; - } - - String get status => this['status']; - set status(String val) { - this['status'] = val; - } - - String get bundles => this['bundles']; - set bundles(String val) { - this['bundles'] = val; - } - - DateTime get dueDate => this['dueDate']; - set dueDate(DateTime val) { - this['dueDate'] = val; - } - - DateTime get endDate => this['endDate']; - set endDate(DateTime val) { - this['endDate'] = val; - } - - String get aatStatus => this['aatStatus']; - set aatStatus(String val) { - this['aatStatus'] = val; - } -} - -class Opportunity extends RawEntity { - String get name => this['name']; - set name(String val) { - this['name'] = val; - } -} - -class Account extends RawEntity { - int get accountId => this['accountId']; - set accountId(int val) { - this['accountId'] = val; - } -} diff --git a/modules/benchmarks_external/src/naive_infinite_scroll/index.dart b/modules/benchmarks_external/src/naive_infinite_scroll/index.dart deleted file mode 100644 index e20afdc602..0000000000 --- a/modules/benchmarks_external/src/naive_infinite_scroll/index.dart +++ /dev/null @@ -1,28 +0,0 @@ -library naive_infinite_scroll; - -import 'package:angular/angular.dart'; -import 'package:angular/application_factory.dart'; -import 'app.dart'; -import 'scroll_area.dart'; -import 'scroll_item.dart'; -import 'cells.dart'; - -class MyAppModule extends Module { - MyAppModule() { - bind(ResourceResolverConfig, - toValue: new ResourceResolverConfig.resolveRelativeUrls(false)); - bind(App); - bind(ScrollAreaComponent); - bind(ScrollItemComponent); - bind(CompanyNameComponent); - bind(OpportunityNameComponent); - bind(OfferingNameComponent); - bind(AccountCellComponent); - bind(StageButtonsComponent); - bind(FormattedCellComponent); - } -} - -void main() { - applicationFactory().addModule(new MyAppModule()).run(); -} diff --git a/modules/benchmarks_external/src/naive_infinite_scroll/random_data.dart b/modules/benchmarks_external/src/naive_infinite_scroll/random_data.dart deleted file mode 100644 index b2f0f89dda..0000000000 --- a/modules/benchmarks_external/src/naive_infinite_scroll/random_data.dart +++ /dev/null @@ -1,69 +0,0 @@ -library random_data; - -import 'common.dart'; - -List generateOfferings(int count) => - new List.generate(count, generateOffering); - -Offering generateOffering(int seed) { - final res = new Offering(); - res.name = generateName(seed++); - res.company = generateCompany(seed++); - res.opportunity = generateOpportunity(seed++); - res.account = generateAccount(seed++); - res.basePoints = seed % 10; - res.kickerPoints = seed % 4; - res.status = STATUS_LIST[seed % STATUS_LIST.length]; - res.bundles = randomString(seed++); - res.dueDate = randomDate(seed++); - res.endDate = randomDate(seed++, minDate: res.dueDate); - res.aatStatus = AAT_STATUS_LIST[seed % AAT_STATUS_LIST.length]; - return res; -} - -Company generateCompany(int seed) { - return new Company()..name = generateName(seed); -} - -Opportunity generateOpportunity(int seed) { - return new Opportunity()..name = generateName(seed); -} - -Account generateAccount(int seed) { - return new Account()..accountId = seed; -} - -String generateName(int seed) { - const names = const [ - 'Foo', - 'Bar', - 'Baz', - 'Qux', - 'Quux', - 'Garply', - 'Waldo', - 'Fred', - 'Plugh', - 'Xyzzy', - 'Thud', - 'Cruft', - 'Stuff' - ]; - return names[seed % names.length]; -} - -DateTime randomDate(int seed, {DateTime minDate}) { - if (minDate == null) { - minDate = new DateTime.now(); - } - - const offsets = const [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; - return minDate.add(new Duration(days: offsets[seed % offsets.length])); -} - -String randomString(int seed) { - return new String.fromCharCodes(new List.generate( - const [5, 7, 9, 11, 13][seed % 5], - (i) => - 'a'.codeUnitAt(0) + const [0, 1, 2, 3, 4, 5, 6, 7, 8][seed % 9] + i)); -} diff --git a/modules/benchmarks_external/src/naive_infinite_scroll/scroll_area.dart b/modules/benchmarks_external/src/naive_infinite_scroll/scroll_area.dart deleted file mode 100644 index efc9414c72..0000000000 --- a/modules/benchmarks_external/src/naive_infinite_scroll/scroll_area.dart +++ /dev/null @@ -1,57 +0,0 @@ -library scroll_area; - -import 'dart:html'; -import 'dart:math' as math; -import 'package:angular/angular.dart'; -import 'common.dart'; -import 'random_data.dart'; - -@Component( - selector: 'scroll-area', - templateUrl: 'scroll_area.html', - map: const {'scroll-top': '=>scrollTop',}) -class ScrollAreaComponent implements ShadowRootAware { - Element scrollDiv; - List _fullList; - List visibleItems = []; - - // Init empty maps and populate later. There seems to be a bug in Angular - // that makes it choke on pre-populated style maps. - final Map paddingStyle = {}; - final Map innerStyle = {}; - final Map scrollDivStyle = {}; - - ScrollAreaComponent() { - _fullList = generateOfferings(ITEMS); - } - - @override - void onShadowRoot(ShadowRoot shadowRoot) { - scrollDiv = shadowRoot.querySelector('#scrollDiv'); - onScroll(); - scrollDivStyle.addAll({ - 'height': '${VIEW_PORT_HEIGHT}px', - 'width': '1000px', - 'border': '1px solid #000', - 'overflow': 'scroll', - }); - innerStyle['width'] = '${ROW_WIDTH}px'; - } - - set scrollTop(int value) { - if (value == null || scrollDiv == null) return; - scrollDiv.scrollTop = value; - } - - void onScroll() { - int scrollY = scrollDiv.scrollTop; - int iStart = scrollY == 0 ? 0 : (scrollY / ITEM_HEIGHT).floor(); - int iEnd = math.min(iStart + VISIBLE_ITEMS + 1, _fullList.length); - int padding = iStart * ITEM_HEIGHT; - innerStyle['height'] = '${HEIGHT - padding}px'; - paddingStyle['height'] = '${padding}px'; - visibleItems - ..clear() - ..addAll(_fullList.getRange(iStart, iEnd)); - } -} diff --git a/modules/benchmarks_external/src/naive_infinite_scroll/scroll_item.dart b/modules/benchmarks_external/src/naive_infinite_scroll/scroll_item.dart deleted file mode 100644 index 2b871fd78c..0000000000 --- a/modules/benchmarks_external/src/naive_infinite_scroll/scroll_item.dart +++ /dev/null @@ -1,39 +0,0 @@ -library scroll_item; - -import 'package:angular/angular.dart'; -import 'common.dart'; - -@Component( - selector: 'scroll-item', - templateUrl: 'scroll_item.html', - map: const {'offering': '=>offering',}) -class ScrollItemComponent implements ShadowRootAware { - Offering offering; - - // Init empty maps and populate later. There seems to be a bug in Angular - // that makes it choke on pre-populated style maps. - Map itemStyle = {}; - - @override - void onShadowRoot(_) { - itemStyle.addAll({ - 'height': '${ITEM_HEIGHT}px', - 'line-height': '${ITEM_HEIGHT}px', - 'font-size': '18px', - 'display': 'flex', - 'justify-content': 'space-between', - }); - } - - get companyNameWidth => '${COMPANY_NAME_WIDTH}px'; - get opportunityNameWidth => '${OPPORTUNITY_NAME_WIDTH}px'; - get offeringNameWidth => '${OFFERING_NAME_WIDTH}px'; - get accountCellWidth => '${ACCOUNT_CELL_WIDTH}px'; - get basePointsWidth => '${BASE_POINTS_WIDTH}px'; - get kickerPointsWidth => '${KICKER_POINTS_WIDTH}px'; - get stageButtonsWidth => '${STAGE_BUTTONS_WIDTH}px'; - get bundlesWidth => '${BUNDLES_WIDTH}px'; - get dueDateWidth => '${DUE_DATE_WIDTH}px'; - get endDateWidth => '${END_DATE_WIDTH}px'; - get aatStatusWidth => '${AAT_STATUS_WIDTH}px'; -} diff --git a/modules/benchmarks_external/src/static_tree/tree_benchmark.dart b/modules/benchmarks_external/src/static_tree/tree_benchmark.dart deleted file mode 100644 index 12ed630dff..0000000000 --- a/modules/benchmarks_external/src/static_tree/tree_benchmark.dart +++ /dev/null @@ -1,164 +0,0 @@ -// static tree benchmark in AngularDart 1.x -library static_tree_benchmark_ng10; - -import 'package:angular/angular.dart'; -import 'package:angular/application_factory.dart'; -import 'package:angular2/src/testing/benchmark_util.dart'; - -setup() { - var m = new Module() - ..bind(CompilerConfig, - toValue: new CompilerConfig.withOptions(elementProbeEnabled: false)) - ..bind(ScopeDigestTTL, - toFactory: () => new ScopeDigestTTL.value(15), inject: []) - ..bind(TreeComponent0) - ..bind(TreeComponent1) - ..bind(TreeComponent2) - ..bind(TreeComponent3) - ..bind(TreeComponent4) - ..bind(TreeComponent5) - ..bind(TreeComponent6) - ..bind(TreeComponent7) - ..bind(TreeComponent8) - ..bind(TreeComponent9); - - final injector = applicationFactory().addModule(m).run(); - - return injector; -} - -const MAX_DEPTH = 10; - -main() { - final injector = setup(); - final zone = injector.get(VmTurnZone); - final rootScope = injector.get(Scope); - rootScope.context['initData'] = null; - var count = 0; - - TreeNode createData() { - var values = count++ % 2 == 0 - ? ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*'] - : ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', '-']; - return buildTree(MAX_DEPTH, values, 0); - } - - destroyDom() { - zone.run(() { - rootScope.context['initData'] = null; - }); - } - - createDom() { - zone.run(() { - rootScope.context['initData'] = createData(); - }); - } - - bindAction('#destroyDom', destroyDom); - bindAction('#createDom', createDom); -} - -@Component( - selector: 'tree0', - map: const {'data': '=>data'}, - template: ' {{data.value}} ') -class TreeComponent0 { - var data; -} - -@Component( - selector: 'tree1', - map: const {'data': '=>data'}, - template: - ' {{data.value}} ') -class TreeComponent1 { - var data; -} - -@Component( - selector: 'tree2', - map: const {'data': '=>data'}, - template: - ' {{data.value}} ') -class TreeComponent2 { - var data; -} - -@Component( - selector: 'tree3', - map: const {'data': '=>data'}, - template: - ' {{data.value}} ') -class TreeComponent3 { - var data; -} - -@Component( - selector: 'tree4', - map: const {'data': '=>data'}, - template: - ' {{data.value}} ') -class TreeComponent4 { - var data; -} - -@Component( - selector: 'tree5', - map: const {'data': '=>data'}, - template: - ' {{data.value}} ') -class TreeComponent5 { - var data; -} - -@Component( - selector: 'tree6', - map: const {'data': '=>data'}, - template: - ' {{data.value}} ') -class TreeComponent6 { - var data; -} - -@Component( - selector: 'tree7', - map: const {'data': '=>data'}, - template: - ' {{data.value}} ') -class TreeComponent7 { - var data; -} - -@Component( - selector: 'tree8', - map: const {'data': '=>data'}, - template: - ' {{data.value}} ') -class TreeComponent8 { - var data; -} - -@Component( - selector: 'tree9', - map: const {'data': '=>data'}, - template: - ' {{data.value}} ') -class TreeComponent9 { - var data; -} - -buildTree(maxDepth, values, curDepth) { - if (maxDepth == curDepth) return new TreeNode(''); - return new TreeNode( - values[curDepth], - buildTree(maxDepth, values, curDepth + 1), - buildTree(maxDepth, values, curDepth + 1)); -} - -class TreeNode { - var value; - TreeNode left; - TreeNode right; - TreeNode([this.value, this.left, this.right]); -} diff --git a/modules/benchmarks_external/src/tree/react/index.dart b/modules/benchmarks_external/src/tree/react/index.dart deleted file mode 100644 index f9f741fad9..0000000000 --- a/modules/benchmarks_external/src/tree/react/index.dart +++ /dev/null @@ -1 +0,0 @@ -library benchmarks_external.src.tree.react; diff --git a/modules/benchmarks_external/src/tree/tree_benchmark.dart b/modules/benchmarks_external/src/tree/tree_benchmark.dart deleted file mode 100644 index c3545b8d9e..0000000000 --- a/modules/benchmarks_external/src/tree/tree_benchmark.dart +++ /dev/null @@ -1,73 +0,0 @@ -// tree benchmark in AngularDart 1.x -library tree_benchmark_ng10; - -import 'package:angular/angular.dart'; -import 'package:angular/application_factory.dart'; -import 'package:angular2/src/testing/benchmark_util.dart'; - -setup() { - var m = new Module() - ..bind(CompilerConfig, - toValue: new CompilerConfig.withOptions(elementProbeEnabled: false)) - ..bind(ScopeDigestTTL, - toFactory: () => new ScopeDigestTTL.value(15), inject: []) - ..bind(TreeComponent); - - final injector = applicationFactory().addModule(m).run(); - - return injector; -} - -main() { - var maxDepth = getIntParameter('depth'); - - final injector = setup(); - final zone = injector.get(VmTurnZone); - final rootScope = injector.get(Scope); - var count = 0; - - destroyDom() { - zone.run(() { - rootScope.context['initData'] = new TreeNode(''); - }); - } - - createDom() { - zone.run(() { - var values = count++ % 2 == 0 - ? ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*'] - : ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', '-']; - - rootScope.context['initData'] = buildTree(maxDepth, values, 0); - }); - } - - bindAction('#destroyDom', destroyDom); - bindAction('#createDom', createDom); -} - -@Component( - selector: 'tree', - map: const {'data': '=>data'}, - template: ' {{data.value}}' - '' - '' - '') -class TreeComponent { - var data; -} - -buildTree(maxDepth, values, curDepth) { - if (maxDepth == curDepth) return new TreeNode(''); - return new TreeNode( - values[curDepth], - buildTree(maxDepth, values, curDepth + 1), - buildTree(maxDepth, values, curDepth + 1)); -} - -class TreeNode { - var value; - TreeNode left; - TreeNode right; - TreeNode([this.value, this.left, this.right]); -} diff --git a/scripts/ci/build_router.sh b/scripts/ci/build_router.sh deleted file mode 100755 index cccd90621a..0000000000 --- a/scripts/ci/build_router.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -ex - -echo ============================================================================= -# go to project dir -SCRIPT_DIR=$(dirname $0) -# this is needed because we're running JS tests in Dartium too -source $SCRIPT_DIR/env_dart.sh -cd $SCRIPT_DIR/../.. - -./node_modules/.bin/gulp buildRouter.dev diff --git a/scripts/ci/test_perf.sh b/scripts/ci/test_perf.sh deleted file mode 100755 index 1e6bcb0542..0000000000 --- a/scripts/ci/test_perf.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -set -ex - -echo ============================================================================= -# go to project dir -SCRIPT_DIR=$(dirname $0) -source $SCRIPT_DIR/env_dart.sh -cd $SCRIPT_DIR/../.. - -./node_modules/.bin/webdriver-manager update - -function killServer () { - kill $serverPid -} - -# Serving pre-compiled dart JS takes an extra 15m. -# So we do this only for post-commit testing. -# Pull requests test with Dartium and pub serve -# TODO(jeffbcross): restore conditional dart2js/pubserve #4316 -#if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then - ./node_modules/.bin/gulp build/pubbuild.dart - ./node_modules/.bin/gulp serve.js.prod serve.js.dart2js& - serverPid=$! -#else -# ./node_modules/.bin/gulp serve.js.prod serve.dart& -# serverPid=$! -#fi - -trap killServer EXIT - -# wait for server to come up! -sleep 10 - -./node_modules/.bin/protractor protractor-js.conf.js --browsers=$PERF_BROWSERS --benchmark -./node_modules/.bin/protractor protractor-dart2js.conf.js --browsers=$PERF_BROWSERS --benchmark diff --git a/scripts/ci/test_router.sh b/scripts/ci/test_router.sh deleted file mode 100755 index 440043d97b..0000000000 --- a/scripts/ci/test_router.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -ex - -echo ============================================================================= -# go to project dir -SCRIPT_DIR=$(dirname $0) -source $SCRIPT_DIR/env_dart.sh -cd $SCRIPT_DIR/../.. - -./node_modules/.bin/gulp test.unit.router/ci --browsers=${KARMA_JS_BROWSERS:-Chrome}