From ac0c90f17510ebbfa315cfb5aaefd8b1c33a5237 Mon Sep 17 00:00:00 2001 From: Chema Balsas Date: Wed, 18 Oct 2017 18:35:52 +0200 Subject: [PATCH] Revert "Merge pull request #275 from Robert-Frampton/metal-soy-bundle" This reverts commit 39ee3da961f4089b669730d6630d278708c25b1d, reversing changes made to cfe20c6d46ca55e7e9dc5832af4985c1e3de2475. --- karma-coverage.conf.js | 7 ------ karma-sauce.conf.js | 7 ------ packages/metal-soy-bundle/README.md | 12 --------- packages/metal-soy-bundle/gulpfile.js | 8 +----- packages/metal-soy-bundle/test/bundle.js | 32 ------------------------ 5 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 packages/metal-soy-bundle/test/bundle.js diff --git a/karma-coverage.conf.js b/karma-coverage.conf.js index 3f37b92d..327cc067 100644 --- a/karma-coverage.conf.js +++ b/karma-coverage.conf.js @@ -27,12 +27,6 @@ module.exports = function(config) { included: true, served: true }, - { - pattern: 'packages/metal-soy-bundle/build/bundle.js', - watched: false, - included: false, - served: true - }, { pattern: 'packages/metal-web-component/node_modules/babel-polyfill/dist/polyfill.min.js', watched: false, @@ -71,7 +65,6 @@ module.exports = function(config) { 'packages/metal-incremental-dom/src/incremental-dom.js': ['browserify'], 'packages/metal-incremental-dom/lib/incremental-dom.js': ['browserify'], 'packages/metal-soy-bundle/lib/bundle.js': ['browserify'], - 'packages/metal-soy-bundle/build/bundle.js': ['browserify'], 'packages/metal*/test/**/*.js': ['browserify'] }, diff --git a/karma-sauce.conf.js b/karma-sauce.conf.js index 4ef18283..6615fb81 100644 --- a/karma-sauce.conf.js +++ b/karma-sauce.conf.js @@ -27,12 +27,6 @@ module.exports = function(config) { included: true, served: true }, - { - pattern: 'packages/metal-soy-bundle/build/bundle.js', - watched: false, - included: false, - served: true - }, { pattern: 'packages/metal-web-component/node_modules/babel-polyfill/dist/polyfill.min.js', watched: false, @@ -71,7 +65,6 @@ module.exports = function(config) { 'packages/metal-incremental-dom/src/incremental-dom.js': ['browserify'], 'packages/metal-incremental-dom/lib/incremental-dom.js': ['browserify'], 'packages/metal-soy/node_modules/metal-soy-bundle/lib/bundle.js': ['browserify'], - 'packages/metal-soy-bundle/build/bundle.js': ['browserify'], 'packages/metal*/test/**/*.js': ['browserify'] }, diff --git a/packages/metal-soy-bundle/README.md b/packages/metal-soy-bundle/README.md index 13182ddf..85dd8078 100644 --- a/packages/metal-soy-bundle/README.md +++ b/packages/metal-soy-bundle/README.md @@ -4,15 +4,3 @@ metal-soy-bundle A bundle containing all the closure dependencies required by soy files compiled to incremental-dom. Note that this bundle was built by hand, and some features were deliberately removed to make the resulting bundle smaller, like escaping (which shouldn't be necessary for incremental dom anyway) and bidi directives (which will be added back soon). - -## Build Process - -There are two steps to generating the consumable `lib/bundle.js` file. The entire process is triggered by the `npm prepublish` script. - -### Concatentation - -The `gulp build` task first concatenates the files found in the `src/closure-library` and `src/closure-templates` directories into the `build/bundle.js` file. - -### Transpilation - -Once the source files have been concatenated, the generated `build/bundle.js` file is transpiled by the `npm compile` script and placed in the `lib` directory at `lib/bundle.js`. This file is the entry point for the `metal-soy-bundle` package. diff --git a/packages/metal-soy-bundle/gulpfile.js b/packages/metal-soy-bundle/gulpfile.js index dd7cd071..c48d87c3 100644 --- a/packages/metal-soy-bundle/gulpfile.js +++ b/packages/metal-soy-bundle/gulpfile.js @@ -23,13 +23,7 @@ gulp.task('build', function() { return gulp.src(dependencies) .pipe(concat('bundle.js')) .pipe(replace('var goog = goog || {};', 'var goog = this.goog || {};')) - .pipe(header('import \'metal-incremental-dom\';\n\n(function() {\nthis.CLOSURE_NO_DEPS = true;\nthis.goog = this.goog || {};\n\n' + - 'if (this.__METAL_SOY_BUNDLE_LOADED__) {\n' + - ' console.warn(\'Warning: metal-soy-bundle has already been loaded. Dedupe bundle to remove this warning.\');\n' + - ' return;\n' + - '}\n' + - 'this.__METAL_SOY_BUNDLE_LOADED__ = true;\n\n' - )) + .pipe(header('import \'metal-incremental-dom\';\n\n(function() {\nthis.CLOSURE_NO_DEPS = true;\nthis.goog = this.goog || {};\n\n')) .pipe(footer('\n\ngoog.loadModule(function() {\n' + ' goog.module(\'incrementaldom\');\n' + ' return IncrementalDOM;\n' + diff --git a/packages/metal-soy-bundle/test/bundle.js b/packages/metal-soy-bundle/test/bundle.js deleted file mode 100644 index 24eabd80..00000000 --- a/packages/metal-soy-bundle/test/bundle.js +++ /dev/null @@ -1,32 +0,0 @@ -describe('metal-soy-bundle', function() { - before(function() { - sinon.stub(console, 'warn'); - }); - - after(function() { - console.warn.restore(); - }); - - it('should show warning instead of erroring when loading bundle twice', function(done) { - assert(window.__METAL_SOY_BUNDLE_LOADED__); - assert.equal(console.warn.callCount, 0); - - loadBundle(function() { - assert.equal(console.warn.callCount, 1); - assert(console.warn.calledWith('Warning: metal-soy-bundle has already been loaded. Dedupe bundle to remove this warning.')); - - done(); - }); - }); -}); - -function loadBundle(done) { - var script = document.createElement('script'); - - script.crossOrigin = 'anonymous'; - script.onload = done; - script.src = '/base/packages/metal-soy-bundle/build/bundle.js'; - script.type = 'text/javascript'; - - document.body.appendChild(script); -}