Skip to content

Commit 2efccb9

Browse files
committed
Remove @Suppress {missingProperties}
It may break stuff in closure to use this much, so try to shape classes for closure directly. Use polymer pass v2 to remove warnings for properties defined in `properties` block
1 parent 9b7e184 commit 2efccb9

15 files changed

Lines changed: 342 additions & 191 deletions

closure.log

Lines changed: 223 additions & 91 deletions
Large diffs are not rendered by default.

externs/polymer-externs.js

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,18 @@ Polymer.sanitizeDOMValue;
6161
*/
6262
function JSCompiler_renameProperty(string, obj) {}
6363

64-
/** @record */
65-
function PolymerTelemetry(){}
66-
/** @type {number} */
67-
PolymerTelemetry.prototype.instanceCount;
68-
/** @type {Array<HTMLElement>} */
69-
PolymerTelemetry.prototype.registrations;
70-
/** @type {function(HTMLElement)} */
71-
PolymerTelemetry.prototype._regLog;
72-
/** @type {function(HTMLElement)} */
73-
PolymerTelemetry.prototype.register;
74-
/** @type {function(HTMLElement)} */
75-
PolymerTelemetry.prototype.dumpRegistrations;
64+
/** @type {Object} */
65+
Polymer.telemetry;
66+
67+
/** @type {Object} */
68+
Polymer_PropertyEffects.prototype.__computeEffects;
69+
/** @type {Object} */
70+
Polymer_PropertyEffects.prototype.__reflectEffects;
71+
/** @type {Object} */
72+
Polymer_PropertyEffects.prototype.__notifyEffects;
73+
/** @type {Object} */
74+
Polymer_PropertyEffects.prototype.__propagateEffects;
75+
/** @type {Object} */
76+
Polymer_PropertyEffects.prototype.__observeEffects;
77+
/** @type {Object} */
78+
Polymer_PropertyEffects.prototype.__readOnly;

externs/webcomponents-externs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* @fileoverview Externs for webcomponents polyfills
33
* @externs
44
*/
5+
/* eslint-disable */
56

67
let HTMLImports = {
78
/**

gulpfile.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ gulp.task('closure', ['clean'], () => {
107107
}
108108

109109
config('polymer.html');
110+
// config('lib/mixins/property-effects.html');
110111

111112
const project = new PolymerProject({
112113
shell: `./${entry}`,
@@ -146,16 +147,19 @@ gulp.task('closure', ['clean'], () => {
146147
rewrite_polyfills: false,
147148
new_type_inf: true,
148149
checks_only: CLOSURE_LINT_ONLY,
150+
polymer_version: 2,
149151
externs: [
150152
'bower_components/shadycss/externs/shadycss-externs.js',
151153
'externs/webcomponents-externs.js',
152154
'externs/closure-types.js',
153155
'externs/polymer-externs.js',
154156
],
155157
extra_annotation_name: [
156-
'polymerMixin',
157-
'polymerMixinClass',
158-
'polymerElement'
158+
'appliesMixin',
159+
'mixinClass',
160+
'mixinFunction',
161+
'polymer',
162+
'customElement'
159163
]
160164
}, closurePluginOptions);
161165

lib/elements/array-selector.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
*
3333
* @mixinFunction
3434
* @polymer
35-
* @appliesMixin Polymer.ElementMixin
3635
* @memberof Polymer
3736
* @summary Element mixin for recording dynamic associations between item paths in a
3837
* master `items` array and a `selected` array
@@ -48,6 +47,7 @@
4847

4948
/**
5049
* @mixinClass
50+
* @polymer
5151
* @implements {Polymer_ArraySelectorMixin}
5252
* @unrestricted
5353
*/

lib/elements/dom-bind.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
/**
8888
* Forces the element to render its content. This is typically only
8989
* necessary to call if HTMLImports with the async attribute are used.
90-
* @suppress {missingProperties}
9190
*/
9291
render() {
9392
let template;

lib/elements/dom-if.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@
230230
return true;
231231
}
232232

233-
/** @suppress {missingProperties} */
234233
__syncHostProperties() {
235234
let props = this.__invalidProps;
236235
if (props) {

lib/elements/dom-repeat.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
* @polymer
119119
* @memberof Polymer
120120
* @extends {domRepeatBase}
121-
* @appliesMixin Polymer.MutableData
121+
* @appliesMixin Polymer.OptionalMutableData
122122
* @summary Custom element for stamping instance of a template bound to
123123
* items in an array.
124124
*/
@@ -372,10 +372,6 @@
372372
return true;
373373
}
374374

375-
/* eslint-disable valid-jsdoc */
376-
/**
377-
* @suppress {missingProperties}
378-
*/
379375
__getMethodHost() {
380376
// Technically this should be the owner of the outermost template.
381377
// In shadow dom, this is always getRootNode().host, but we can
@@ -384,7 +380,6 @@
384380
// instance causing it to get a dataHost.
385381
return this.__dataHost._methodHost || this.__dataHost;
386382
}
387-
/* eslint-enable valid-jsdoc */
388383

389384
__sortChanged(sort) {
390385
let methodHost = this.__getMethodHost();

lib/legacy/class.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
* @param {!PolymerInit} info Polymer info object
136136
* @param {!HTMLElement} Base base class to extend with info object
137137
* @return {!HTMLElement} Generated class
138-
* @suppress {missingProperties, checkTypes}
138+
* @suppress {checkTypes}
139139
* @private
140140
*/
141141
function GenerateClassFromInfo(info, Base) {
@@ -151,7 +151,6 @@
151151
}
152152

153153
/**
154-
* @suppress {missingProperties}
155154
* @return {HTMLTemplateElement} template for this class
156155
*/
157156
static get template() {

lib/legacy/legacy-element-mixin.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@
459459
* a user should call `distributeContent` if distribution has been
460460
* invalidated due to an element being added or removed from the shadowRoot
461461
* that contains an insertion point (`<slot>`) inside its subtree.
462-
* @suppress {missingProperties}
463462
*/
464463
distributeContent() {
465464
if (window.ShadyDOM && this.shadowRoot) {

0 commit comments

Comments
 (0)