Add ignore of PolymerElement super class node on custom-element analysis #238
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Analysis of Polymer custom components reports Polymer super class related properties and functions.
The pull request adds ignore of this super class to get only component defined properties and function like with Polymer provided tooling.
Example of analyzed source
Markdown result with pull request code
polymer-test2
Properties
testPlop
test-plop
string
testPlopp
test-plopp
number
Events
test-event
Markdown result without pull request code
polymer-test2
Mixins: ElementMixin
Properties
$
{ [key: string]: Element; }
PROPERTY_EFFECT_TYPES
importPath
string
root
HTMLElement | StampedTemplate | ShadowRoot | null
rootPath
string
testPlop
test-plop
string
testPlopp
test-plopp
number
Methods
addPropertyEffect
(property: string, type: string, effect?: object | null | undefined): void
to a list of "property effects" that will run when the accessor for
the specified property is set. Effects are grouped by "type", which
roughly corresponds to a phase in effect processing. The effect
metadata should be in the following form:
{
fn: effectFunction, // Reference to function to call to perform effect
info: { ... } // Effect metadata passed to function
trigger: { // Optional triggering metadata; if not provided
name: string // the property is treated as a wildcard
structured: boolean
wildcard: boolean
}
}
Effects are called from
_propertiesChanged
in the following order bytype:
1. COMPUTE
2. PROPAGATE
3. REFLECT
4. OBSERVE
5. NOTIFY
Effect functions are called with the following signature:
effectFunction(inst, path, props, oldProps, info, hasPaths)
property: Property that should trigger the effect
type: Effect type, from this.PROPERTY_EFFECT_TYPES
effect: Effect metadata object
attributeNameForProperty
(property: string): string
By default, converts camel to dash case, e.g.
fooBar
tofoo-bar
.property: Property to convert
bindTemplate
(template: HTMLTemplateElement): TemplateInfo
for them, and then ensures property accessors are created for any
dependent properties in the template. Binding effects for bound
templates are stored in a linked list on the instance so that
templates can be efficiently stamped and unstamped.
template: Template containing binding
bindings
createComputedProperty
(property: string, expression: string, dynamicFn?: boolean | object | null | undefined): void
method described by the given
expression
each time one or morearguments to the method changes. The expression should be a string
in the form of a normal JavaScript function signature:
'methodName(arg1, [..., argn])'
property: Name of computed property to set
expression: Method expression
dynamicFn: Boolean or object map indicating whether
method names should be included as a dependency to the effect.
createMethodObserver
(expression: string, dynamicFn?: boolean | object | null | undefined): void
expression, which should be a string in the form of a normal JavaScript
function signature:
'methodName(arg1, [..., argn])'
. Each argumentshould correspond to a property or path in the context of this
prototype (or instance), or may be a literal string or number.
expression: Method expression
dynamicFn: Boolean or object map indicating
createNotifyingProperty
(property: string): void
<property>-changed
events to notify of changes to the property.
property: Property name
createObservers
(observers: object | null, dynamicFns: object | null): void
observers
array.Leverages
PropertyEffects
to create observers.observers: Array of observer descriptors for
this class
dynamicFns: Object containing keys for any properties
that are functions and should trigger the effect when the function
reference is changed
createProperties
(props: object): void
and property effects for all of the properties.
props: .
createPropertiesForAttributes
(): void
static
observedAttributes
array.Attribute names are mapped to property names using the
dash-case
tocamelCase
conventioncreatePropertyObserver
(property: string, method: string | ((p0: any, p1: any): any), dynamicFn?: boolean | undefined) => void
property: Property name
method: Function or name of observer method to call
dynamicFn: Whether the method name should be included as
a dependency to the effect.
createReadOnlyProperty
(property: string, protectedSetter?: boolean | undefined): void
To set the property, use the protected
_setProperty
API.To create a custom protected setter (e.g.
_setMyProp()
forproperty
myProp
), passtrue
forprotectedSetter
.Note, if the property will have other property effects, this method
should be called first, before adding other effects.
property: Property name
protectedSetter: Creates a custom protected setter
when
true
.createReflectedProperty
(property: string): void
to a (dash-cased) attribute of the same name.
property: Property name
finalize
(): void
are also finalized. This includes ensuring property
accessors exist on the element prototype. This method calls
_finalizeClass
to finalize each constructor in the prototype chain.get
(path: string | (string | number)[], root?: object | null | undefined): any
Note, if any part in the path is undefined, this method returns
undefined
(this method does not throw when dereferencing undefinedpaths).
path: Path to the value
to read. The path may be specified as a string (e.g.
foo.bar.baz
)or an array of path parts (e.g.
['foo.bar', 'baz']
). Note thatbracketed expressions are not supported; string-based path parts
must be separated by dots. Note that when dereferencing array
indices, the index may be used as a dotted part directly
(e.g.
users.12.name
or['users', 12, 'name']
).root: Root object from which the path is evaluated.
linkPaths
(to: string | (string | number)[], from: string | (string | number)[]): void
are routed to the other.
to: Target path to link.
from: Source path to link.
notifyPath
(path: string, value?: any): void
Example:
this.item.user.name = 'Bob';
this.notifyPath('item.user.name');
path: Path that should be notified.
value: Value at the path (optional).
notifySplices
(path: string, splices: any[] | null): void
Example:
this.items = [ {name: 'Jim'}, {name: 'Todd'}, {name: 'Bill'} ];
...
this.items.splice(1, 1, {name: 'Sam'});
this.items.push({name: 'Bob'});
this.notifySplices('items', [
{ index: 1, removed: [{name: 'Todd'}], addedCount: 1,
object: this.items, type: 'splice' },
{ index: 3, removed: [], addedCount: 1,
object: this.items, type: 'splice'}
]);
path: Path that should be notified.
splices: Array of splice records indicating ordered
changes that occurred to the array. Each record should have the
following fields:
* index: index at which the change occurred
* removed: array of items that were removed from this index
* addedCount: number of new items added at this index
* object: a reference to the array in question
* type: the string literal 'splice'
Note that splice records must be normalized such that they are
reported in index order (raw results from
Object.observe
are notordered and must be normalized/merged before notifying).
pop
(path: string | (string | number)[]): any
The arguments after
path
and return value match that ofArray.prototype.pop
.This method notifies other paths to the same array that a
splice occurred to the array.
path: Path to array.
push
(path: string | (string | number)[], ...items: any[]): number
The arguments after
path
and return value match that ofArray.prototype.push
.This method notifies other paths to the same array that a
splice occurred to the array.
path: Path to array.
items: Items to push onto array
ready
(): void
resolveUrl
(url: string, base?: string | undefined): string
the original location of the document containing the
dom-module
forthis element. This method will return the same URL before and after
bundling.
Note that this function performs no resolution for URLs that start
with
/
(absolute URLs) or#
(hash identifiers). For general purposeURL resolution, use
window.URL
.url: URL to resolve.
base: Optional base URL to resolve against, defaults
to the element's
importPath
set
(path: string | (string | number)[], value: any, root?: object | null | undefined): void
elements bound to the same path.
Note, if any part in the path except for the last is undefined,
this method does nothing (this method does not throw when
dereferencing undefined paths).
path: Path to the value
to write. The path may be specified as a string (e.g.
'foo.bar.baz'
)or an array of path parts (e.g.
['foo.bar', 'baz']
). Note thatbracketed expressions are not supported; string-based path parts
must be separated by dots. Note that when dereferencing array
indices, the index may be used as a dotted part directly
(e.g.
'users.12.name'
or['users', 12, 'name']
).value: Value to set at the specified path.
root: Root object from which the path is evaluated.
When specified, no notification will occur.
setProperties
(props: object | null, setReadOnly?: boolean | undefined): void
synchronously processes all effects of the properties as a batch.
Property names must be simple properties, not paths. Batched
path propagation is not supported.
props: Bag of one or more key-value pairs whose key is
a property and value is the new value to set for that property.
setReadOnly: When true, any private values set in
props
will be set. By default,setProperties
will not setreadOnly: true
root properties.shift
(path: string | (string | number)[]): any
The arguments after
path
and return value match that ofArray.prototype.pop
.This method notifies other paths to the same array that a
splice occurred to the array.
path: Path to array.
splice
(path: string | (string | number)[], start: number, deleteCount?: number | undefined, ...items: any[]): any[]
from the array and inserts 0 or more new items in their place.
The arguments after
path
and return value match that ofArray.prototype.splice
.This method notifies other paths to the same array that a
splice occurred to the array.
path: Path to array.
start: Index from which to start removing/inserting.
deleteCount: Number of items to remove.
items: Items to insert into array.
typeForProperty
(name: string): void
a given property.
name: Name of property
unlinkPaths
(path: string | (string | number)[]): void
_linkPaths
.Note, the path to unlink should be the target (
to
) used whenlinking the paths.
path: Target path to unlink.
unshift
(path: string | (string | number)[], ...items: any[]): number
The arguments after
path
and return value match that ofArray.prototype.push
.This method notifies other paths to the same array that a
splice occurred to the array.
path: Path to array.
items: Items to insert info array
updateStyles
(properties?: object | null | undefined): void
shimmed styles in this element (and its subtree) to be updated
based on current custom property values.
The optional parameter overrides inline custom property styles with an
object of properties where the keys are CSS properties, and the values
are strings.
Example:
this.updateStyles({'--color': 'blue'})
These properties are retained unless a value of
null
is set.Note: This function does not support updating CSS mixins.
You can not dynamically change the value of an
@apply
.properties: Bag of custom property key/values to
apply to this element.
Events
test-event