Skip to content

Commit

Permalink
vulcanize strips comments now
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ Ortega committed Apr 30, 2015
1 parent b197f05 commit eff005d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
4 changes: 2 additions & 2 deletions dist/polymer-micro.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!--
<html><head><meta charset="UTF-8"><!--
@license
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--><html><head><meta charset="UTF-8"><script>Polymer = {
--><script>Polymer = {
Settings: function () {
var user = window.Polymer || {};
location.search.slice(1).split('&').forEach(function (o) {
Expand Down
4 changes: 2 additions & 2 deletions dist/polymer-mini.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!--
<html><head><meta charset="UTF-8"><!--
@license
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--><html><head><meta charset="UTF-8"><link rel="import" href="polymer-micro.html">
--><link rel="import" href="polymer-micro.html">
<script>Polymer.Base._addFeature({
_prepTemplate: function () {
this._template = this._template || Polymer.DomModule.import(this.is, 'template');
Expand Down
25 changes: 20 additions & 5 deletions dist/polymer.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
<!--
<html><head><meta charset="UTF-8"><!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--><!--
@license
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--><html><head><meta charset="UTF-8"><link rel="import" href="polymer-mini.html">
--><link rel="import" href="polymer-mini.html">
<script>(function (scope) {
function withDependencies(task, depends) {
depends = depends || [];
Expand Down Expand Up @@ -1144,7 +1152,7 @@
this._distributeConfig(this._config);
},
_configureProperties: function (properties, config) {
for (i in properties) {
for (var i in properties) {
var c = properties[i];
if (c.value !== undefined) {
var value = c.value;
Expand Down Expand Up @@ -2591,21 +2599,28 @@
created: function () {
this.boundCollectionObserver = this.render.bind(this);
},
detached: function () {
if (this.rows) {
for (var i = 0; i < this.rows.length; i++) {
this._detachRow(i);
}
}
},
ready: function () {
if (!this.ctor) {
this.templatize(this);
}
},
_sortChanged: function () {
var dataHost = this._getRootDataHost();
this._sortFn = this.sort && (typeof this.sort == 'function' ? this.sort : dataHost[this.sort].bind(this.host));
this._sortFn = this.sort && (typeof this.sort == 'function' ? this.sort : dataHost[this.sort].bind(dataHost));
if (this.items) {
this.debounce('render', this.render);
}
},
_filterChanged: function () {
var dataHost = this._getRootDataHost();
this._filterFn = this.filter && (typeof this.filter == 'function' ? this.filter : dataHost[this.filter].bind(this.host));
this._filterFn = this.filter && (typeof this.filter == 'function' ? this.filter : dataHost[this.filter].bind(dataHost));
if (this.items) {
this.debounce('render', this.render);
}
Expand Down
3 changes: 1 addition & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function vulcanize(filename, dstdir, excludes) {
});
cmd = cmd + ' --implicit-strip';
}
cmd = cmd + ' --strip-comments';
cmd = cmd + ' ' + filename + ' > ' + dstdir + '/' + filename;
return cmd
}
Expand All @@ -27,8 +28,6 @@ gulp.task('max', shell.task(vulcanize(max, 'dist', [mini, micro])));
gulp.task('strip', ['micro', 'mini', 'max'], function() {
return gulp.src('dist/*.html')
.pipe(polyclean.cleanJsComments())
// Get rid of erroneous html comments
.pipe(replace(/<!--((?!@license)[^])*?-->/g, ''))
// Reduce script tags
.pipe(replace(/<\/script>\s*<script>/g, '\n'))
// Collapse newlines
Expand Down

0 comments on commit eff005d

Please sign in to comment.