All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Added
enableUpdating()toUpdatingElementto enable customizing when updating is enabled #860. - Added
queryAssignedNodes(slotName, flatten)to enable querying assignedNodes for a given slot #860.
- Properties annotated with the
eventOptionsdecorator will now survive property renaming optimizations when used with tsickle and Closure JS Compiler.
- Elements should now override the new
_getUpdateCompletemethod instead of theupdateCompletegetter, for compatibility with TypeScript ES5 output, which does not support calling a superclass getter (e.g.super.updateComplete.then(...)) due to TypeScript#338.
- Fixed compatibility with Closure JS Compiler optimizations relating to static properties (#732).
- css tagged template literals now allow numbers to be used in expressions (#488).
LitElement.renderRootis nowpublic readonlyinstead ofprotected.
- Exceptions generated during update/render do not block subsequent updates (#262).
- Initial update is scheduled at construction time rather than connected time (#594).
- A reflecting property set immediately after a corresponding attribute now reflects properly (#592).
- Properties annotated with the
@queryand@queryAlldecorators will now survive property renaming optimizations when used with tsickle and Closure JS Compiler.
- Use
lit-html1.0 (#543).
- [Breaking] Renamed
unsafeCsstounsafeCSSfor consistency with lit-html'sunsafeHTML(#524) - Remove all uses of
anyoutside of tests (#457)
- A bunch of docs fixes (#464), (#458), (#493), (#504), (#505), (#501), (#494), (#491), (#509), (#513), (#515), (#512), (#503), (#460), (#413), (#426), (#516), (#537), (#535), (#539), (#540)
- Build on checkout (#423)
- Adds a check to ensure
CSSStyleSheetis constructable (#527).
- Fixed a bug causing duplicate styles when an array was returned from
static get styles(#480).
- [Maintenance] Added script to publish dev releases automatically (#476).
- Adds
unsafeCssfor composing "unsafe" values intocss. Note,CSSResultis no longer constructable. (#451 and #471).
- Fixed a bug where we broke compatibility with closure compiler's property renaming optimizations. JSCompiler_renameProperty can't be a module export (#465).
- Fixed an issue with inheriting from
stylesproperty when extending a superclass that is never instanced. (#470). - Fixed an issue with Closure Compiler and (#470) (#476).
- README: Fixed jsfiddle reference (#435).
- Compile with Closure Compiler cleanly (#436).
- Opt
@propertydecorators out of Closure Compiler renaming (#448).
- [Breaking] Property accessors are no longer wrapped when they already exist. Instead the
noAccessorflag should be set when a user-defined accessor exists on the prototype (and in this case, user-defined accessors must callrequestUpdatethemselves). (#454). - Class fields can now be used to define styles, e.g.
static styles = cssandstylescorrectly compose when elements are extended (#456). - Styles returned via
static stylesare automatically flattend (#437). - Replace use of for/of loops over Maps with forEach (#455)
- Fix references to
@polymer/lit-elementin README and docs (#427). - Fix decorator types causing compiler errors for TypeScript users. (#431).
- [Breaking] Changed NPM package name to
lit-element
- Updated decorator implementations to support TC39 decorator API proposal (supported by Babel 7.1+) in addition to the legacy decorator API (supported by older Babel and TypeScript) (#156).
- Added
static get styles()to allow defining element styling separate fromrendermethod. This takes advantage ofadoptedStyleSheetswhen possible (#391). - Added the
performUpdatemethod to allow control of update timing (#290). - Updates deferred until first connection (#258).
- Export
TemplateResultandSVGTemplateResult(#415).
- [Breaking] The
createRenderRootmethod has moved fromUpdatingElementtoLitElement. Therefore,UpdatingElementno longer creates ashadowRootby default (#391). - [Breaking] Changes property options to add
converter. This option works the same as the previoustypeoption except that theconvertermethods now also gettypeas the second argument. This effectively changestypeto be a hint for theconverter. A defaultconverteris used if none is provided and it now supportsBoolean,String,Number,Object, andArray(#264). - [Breaking] Numbers and strings now become null if their reflected attribute is removed (lit/lit-element#264)).
- [Breaking] Previously, when an attribute changed as a result of a reflecting property changing, the property was prevented from mutating again as can happen when a custom
converteris used. Now, the oppose is also true. When a property changes as a result of an attribute changing, the attribute is prevented from mutating again (lit/lit-element#264))
- [Breaking] User defined accessors are now wrapped to enable better composition (#286)
- Type for
eventOptionsdecorator now properly includespassiveandonceoptions (#325)
- Use lit-html 1.0 release candidate.
- Update lit-html dependency to ^0.14.0 (#324).
- Update lit-html dependency to ^0.13.0 (#298).
- LitElement changed to a non-abstract class to be more compatible with the JavaScript mixin pattern (#227).
- Update lit-html dependency to ^0.12.0 (#244).
- Passes the component's
thisreference to lit-html as theeventContext, allowing unbound event listener methods (#244).
- A
disconnectedCallback()method was added to UpdatingElement (#213). - Added
@eventOptions()decorator for setting event listener options on methods (#244).
- Fixes part rendering and css custom properties issues introduced with lit-html 0.11.3 by updating to 0.11.4 (lit/lit-element#202).
- Removed custom_typings for Polymer as they are no longer needed (lit/lit-element#186).
- Added
@query(),@queryAll(), and@customElementdecorators (#159)
- Significantly changed update/render lifecycle and property API. Render lifecycle
is now
requestUpdate,shouldUpdate,update,render,firstUpdated(first time only),updated,updateComplete. Property options are now{attribute, reflect, type, hasChanged}. Properties may be defined in astatic get propertiesor using the@propertydecorator. (lit/lit-element#132).
- Removed render helpers
classStringandstyleString. Similar directives (classMapandstyleMap) have been added to lit-html and should be used instead (lit/lit-element#165 and lit/lit#486).
- The
npm run checksizecommand should now return the correct minified size (lit/lit-element#153). - The
firstUpdatedmethod should now always be called the first time the element updates, even ifshouldUpdateinitially returnedfalse(lit/lit-element#173).