Skip to content

Commit

Permalink
Merge pull request #5497 from Polymer/legacy-undefined-noBatch
Browse files Browse the repository at this point in the history
[3.x] legacy flags (undefined, noBatch, notifyOrder, warnings)
  • Loading branch information
bicknellr authored Apr 22, 2020
2 parents 6cffb7b + 742a103 commit 2ce7163
Show file tree
Hide file tree
Showing 35 changed files with 5,077 additions and 1,101 deletions.
24 changes: 24 additions & 0 deletions externs/polymer-externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,30 @@ Polymer.legacyOptimizations;
/** @type {boolean} */
Polymer.syncInitialRender;

/** @type {boolean} */
Polymer.legacyUndefined;

/** @type {boolean} */
Polymer.legacyNoBatch;

/** @type {boolean} */
Polymer.legacyWarnings;

/** @type {boolean} */
Polymer.legacyNotifyOrder;

/** @type {boolean} */
Polymer.orderedComputed;

/** @type {boolean} */
Polymer.fastDomIf;

/** @type {boolean} */
Polymer.removeNestedTemplates;

/** @type {boolean} */
Polymer.suppressTemplateNotifications;

// nb. This is explicitly 'var', as Closure Compiler checks that this is the case.
/**
* @constructor
Expand Down
8 changes: 6 additions & 2 deletions externs/polymer-internal-shared-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ TemplateInfo.prototype.hostProps;
/** @type {!Object} */
TemplateInfo.prototype.propertyEffects;
/** @type {TemplateInfo | undefined} */
TemplateInfo.prototype.nextTemplateInfo;
TemplateInfo.prototype.nextSibling;
/** @type {TemplateInfo | undefined} */
TemplateInfo.prototype.previousTemplateInfo;
TemplateInfo.prototype.previousSibling;
/** @type {TemplateInfo | undefined} */
TemplateInfo.prototype.firstChild;
/** @type {TemplateInfo | undefined} */
TemplateInfo.prototype.parent;
/** @type {!Array<!Node>} */
TemplateInfo.prototype.childNodes;
/** @type {boolean} */
Expand Down
79 changes: 46 additions & 33 deletions externs/webcomponents-externs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* @fileoverview Externs for webcomponents polyfills
* @externs
* @suppress {duplicate}
*
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
Expand All @@ -12,42 +13,49 @@
*/
/* eslint-disable */

var HTMLImports = {
/**
* @param {function()} callback
*/
whenReady(callback) {},
/**
* @param {!Node} element
* @return {?HTMLLinkElement|?Document|undefined}
*/
importForElement(element) {}
};
var HTMLImports = {};

/**
* @param {function()=} callback
*/
HTMLImports.whenReady = function(callback) {};

/**
* Returns the import document containing the element.
* @param {!Node} element
* @return {?HTMLLinkElement|?Document|undefined}
*/
HTMLImports.importForElement = function(element) {};

window.HTMLImports = HTMLImports;

var ShadyDOM = {
inUse: false,
flush() {},
/**
* @param {!Node} target
* @param {function(Array<MutationRecord>, MutationObserver)} callback
* @return {MutationObserver}
*/
observeChildren(target, callback) {},
/**
* @param {MutationObserver} observer
*/
unobserveChildren(observer) {},
/**
* @param {Node} node
*/
patch(node) {},
/**
* @param {!ShadowRoot} shadowroot
*/
flushInitial(shadowroot) {}
};
var ShadyDOM = {};

ShadyDOM.inUse;

ShadyDOM.flush = function() {};

/**
* @param {!Node} target
* @param {function(Array<MutationRecord>, MutationObserver)} callback
* @return {MutationObserver}
*/
ShadyDOM.observeChildren = function(target, callback) {};

/**
* @param {MutationObserver} observer
*/
ShadyDOM.unobserveChildren = function(observer) {};

/**
* @param {Node} node
*/
ShadyDOM.patch = function(node) {};

/**
* @param {!ShadowRoot} shadowroot
*/
ShadyDOM.flushInitial = function(shadowroot) {};

window.ShadyDOM = ShadyDOM;

Expand All @@ -66,3 +74,8 @@ HTMLTemplateElement.decorate = function(template){};
* @param {function(function())} cb callback
*/
CustomElementRegistry.prototype.polyfillWrapFlushCallback = function(cb){};

/**
* @param {string} cssText
*/
CSSStyleSheet.prototype.replaceSync = function(cssText) {};
2 changes: 0 additions & 2 deletions interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ export interface TemplateInfo {
hasInsertionPoint?: boolean;
hostProps: Object;
propertyEffects: Object;
nextTemplateInfo?: TemplateInfo;
previousTemplateInfo?: TemplateInfo;
childNodes: Node[];
wasPreBound: boolean;
}
Expand Down
Loading

0 comments on commit 2ce7163

Please sign in to comment.