diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 0000000000..c8474bfbcd --- /dev/null +++ b/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "bower_components/" +} diff --git a/.gitignore b/.gitignore index 5e26662be8..a0d4c4078d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ packages/ .buildlog node_modules +bower_components .pub .DS_STORE diff --git a/bower.json b/bower.json new file mode 100644 index 0000000000..b98268f089 --- /dev/null +++ b/bower.json @@ -0,0 +1,7 @@ +{ + "name": "angular2", + "version": "0.0.0", + "dependencies": { + "polymer": "dart-lang/polymer_js#0.8.0-preview" + } +} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 0e9df73223..616cc23c34 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -215,7 +215,12 @@ var CONFIG = { [ { src: 'node_modules/angular/angular.js', mimeType: 'text/javascript', copy: true }, { src: 'tools/build/snippets/url_params_to_form.js', mimeType: 'text/javascript', copy: true } - ].concat(_HTML_DEFAULT_SCRIPTS_JS) + ].concat(_HTML_DEFAULT_SCRIPTS_JS), + 'benchmarks_external/**/*polymer*/**': + [ + { src: 'bower_components/polymer/lib/polymer.html', copyOnly: true }, + { src: 'tools/build/snippets/url_params_to_form.js', mimeType: 'text/javascript', copy: true } + ] }, dart: { '**': _HTML_DEFAULT_SCRIPTS_DART, diff --git a/modules/benchmarks_external/e2e_test/polymer_tree_perf.es6 b/modules/benchmarks_external/e2e_test/polymer_tree_perf.es6 new file mode 100644 index 0000000000..d471010d8e --- /dev/null +++ b/modules/benchmarks_external/e2e_test/polymer_tree_perf.es6 @@ -0,0 +1,20 @@ +var perfUtil = require('angular2/src/test_lib/perf_util'); + +describe('polymer tree benchmark', function () { + + var URL = 'benchmarks_external/src/tree/polymer/index.html'; + + afterEach(perfUtil.verifyNoBrowserErrors); + + it('should log the stats', function(done) { + perfUtil.runClickBenchmark({ + url: URL, + buttons: ['#destroyDom', '#createDom'], + id: 'polymer.tree', + params: [{ + name: 'depth', value: 9, scale: 'log2' + }] + }).then(done, done.fail); + }); + +}); diff --git a/modules/benchmarks_external/src/index.html b/modules/benchmarks_external/src/index.html index 8ab0defcbe..c159c7bbf2 100644 --- a/modules/benchmarks_external/src/index.html +++ b/modules/benchmarks_external/src/index.html @@ -8,6 +8,9 @@
  • Tree benchmark
  • +
  • + Polymer Tree benchmark +
  • Largetable benchmark
  • diff --git a/modules/benchmarks_external/src/tree/polymer/binary_tree.html b/modules/benchmarks_external/src/tree/polymer/binary_tree.html new file mode 100644 index 0000000000..d1fc193fc4 --- /dev/null +++ b/modules/benchmarks_external/src/tree/polymer/binary_tree.html @@ -0,0 +1,43 @@ + + + + + diff --git a/modules/benchmarks_external/src/tree/polymer/index.html b/modules/benchmarks_external/src/tree/polymer/index.html new file mode 100644 index 0000000000..2aba6179e0 --- /dev/null +++ b/modules/benchmarks_external/src/tree/polymer/index.html @@ -0,0 +1,28 @@ + + + + + + + +

    TODO

    +Params +
    + Depth: + +
    + +
    + +

    Polymer JS 0.8-preview tree benchmark

    + + +$SCRIPTS$ + + + diff --git a/modules/benchmarks_external/src/tree/polymer/root_tree.html b/modules/benchmarks_external/src/tree/polymer/root_tree.html new file mode 100644 index 0000000000..cb4c436528 --- /dev/null +++ b/modules/benchmarks_external/src/tree/polymer/root_tree.html @@ -0,0 +1,49 @@ + + + + + + + diff --git a/package.json b/package.json index 1897aeae32..715265094c 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "url": "https://github.com/angular/angular.git" }, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "postinstall": "./node_modules/.bin/bower install" }, "dependencies": { "es6-module-loader": "^0.9.2", diff --git a/protractor-dart2js.conf.js b/protractor-dart2js.conf.js index 53066b7b4a..ba9e223554 100644 --- a/protractor-dart2js.conf.js +++ b/protractor-dart2js.conf.js @@ -6,7 +6,8 @@ config.baseUrl = 'http://localhost:8002/'; config.exclude.push( 'dist/js/cjs/examples/e2e_test/sourcemap/sourcemap_spec.js', // TODO: remove this line when largetable dart has been added - 'dist/js/cjs/benchmarks_external/e2e_test/largetable_perf.js' + 'dist/js/cjs/benchmarks_external/e2e_test/largetable_perf.js', + 'dist/js/cjs/benchmarks_external/e2e_test/polymer_tree_perf.js' ); data.createBenchpressRunner({ lang: 'dart' }); diff --git a/tools/build/html.js b/tools/build/html.js index d41a2bf280..c3371d4a1f 100644 --- a/tools/build/html.js +++ b/tools/build/html.js @@ -17,7 +17,7 @@ module.exports = function(gulp, plugins, config) { var scripts = util.filterByFile(config.scriptsPerFolder, fileName).map(function(script) { var scriptTag; var scriptSrc = script.src; - if (script.copy) { + if (script.copy || script.copyOnly) { scriptSrc = path.basename(script.src); self.push(new VinylFile({ cwd: file.cwd, @@ -26,6 +26,9 @@ module.exports = function(gulp, plugins, config) { contents: fs.readFileSync(script.src) })); }; + if (script.copyOnly) { + return ''; + } if (scriptSrc) { scriptTag = ''; } else {