Skip to content

Latest commit

 

History

History
301 lines (174 loc) · 22.2 KB

CHANGELOG.md

File metadata and controls

301 lines (174 loc) · 22.2 KB

Change Log

1.4.1

Patch Changes

  • #3222 486739ec - Fix CSSStyleSheet is not defined error that would occur when importing a Lit component in Node when both static styles and the @property decorator were used.

1.4.0

Minor Changes

  • #3156 ae6f6808 - Lit and its underlying libraries can now be imported directly from Node without crashing, without the need to load the @lit-labs/ssr dom-shim library. Note that actually rendering from a Node context still requires the @lit-labs/ssr dom-shim, and the appropriate integration between @lit-labs/ssr and your framework/tool.

Patch Changes

  • #3120 6361a4b4 - Bind this to custom attribute converter methods

1.3.4

Patch Changes

  • #3132 2fe2053f - Added "types" entry to package exports. This tells newer versions of TypeScript where to look for typings for each module.

1.3.3

Patch Changes

  • #2978 634d4560 - Changed the caching behavior of the css`` template literal tag so that same-text styles do not share a CSSStyleSheet. Note that this may be a breaking change in some very unusual scenarios on Chromium and Firefox > 101 only.

1.3.2

Patch Changes

  • #2688 ef178ef6 - Add explicit types to the jsdoc code samples for query, queryAll, and queryAsync.

1.3.1

Patch Changes

  • #2635 ae358703 - Make the event debug logger lazier, doing even less work (with no side effects) even in dev mode unless the page has opted in.

1.3.0

Minor Changes

  • #2401 2c9d0008 - Added a devlog events system that may be used for debugging and visualizing Lit's internals.

1.2.3

Patch Changes

  • #2518 bbbf21d4 - Fix breaking change in the PropertyValues type. Make PropertyValues compatible with Map<string, string> and other Map types.

  • #2526 a50d188a - Export PropertyValueMap such that JavaScript generated by Google Closure Compiler can reference this type. Do not directly import the PropertyValueMap interface.

1.2.2

Patch Changes

  • #2482 6ea3d6c4 - Update the definition of the PropertyValues type to give better types to .get(k). .get(k) is now defined to return the correct type when using PropertyValues<this> and a parameter that's a key of the element class.

  • #2464 df4e1a46 - Fix type signature in queryAssignedNodes JSDoc code example.

  • #2457 48d69184 - Add JSDoc to the willUpdate lifecycle callback. Expand the docs for firstUpdated, and attributeChangedCallback. Minor code sample fixes.

1.2.1

Patch Changes

  • #2370 7453e365 - Replace square bracket links with the linkcode JSDoc tag. Editors will create a jump to definition hyperlink for the linkcode tag if the identifier is in scope.

  • #2410 b9a6962b - Correct the link path of CONTRIBUTING.md in README.md files

1.2.0

Minor Changes

1.1.2

Patch Changes

  • #2392 dc3301ce - Fix @queryAssignedElements decorator so it is compatible with legacy browsers. Uses HTMLSlotElement.assignedElements if available with a graceful fallback on HTMLSlotElement.assignedNodes which is supported by polyfills.

1.1.1

Patch Changes

  • #2384 39b8db85 - Fix missing decorators/query-assigned-elements.js file

1.1.0

Minor Changes

  • #2327 49ecf623 - Add queryAssignedElements decorator for a declarative API that calls HTMLSlotElement.assignedElements() on a specified slot. selector option allows filtering returned elements with a CSS selector.

Patch Changes

  • #2360 08e7fc56 - Update @queryAssignedNodes and @queryAssignedElements documentation for better lit.dev API generation.
  • #2338 26e3fb7b - Deprecate @queryAssignedNodes API in preference for the new options object API which mirrors the @queryAssignedElements API. Update the documentation for both @queryAssignedNodes and @queryAssignedElements to better document the expected return type annotation.

1.0.2

Patch Changes

  • #2236 5fc3818a - Prevent polyfillSupport.noPatchSupported from implicitly being any. Deduplicate types for DevMode-suffixed polyfill support functions.
  • #2160 90a8c123 - Prevents the dev-mode error about shadowed properties from being thrown in certain cases where the property intentionally has no generated descriptor.

1.0.1

Patch Changes

  • #2152 ba5e1391 - Replace dynamic name lookups for polyfill support functions with static names.

1.0.0

Major Changes

  • @lit/reactive-element is a new package that factors out the base class that provides the reactive update lifecycle based on property/attribute changes to LitElement (what was previously called UpdatingElement) into a separate package. LitElement now extends ReactiveElement to add lit-html rendering via the render() callback. See ReactiveElement API for more details.
  • UpdatingElement has been renamed to ReactiveElement.
  • The updating-element package has been renamed to @lit/reactive-element.
  • The @internalProperty decorator has been renamed to @state.
  • For consistency, renamed _getUpdateComplete to getUpdateComplete.
  • When a property declaration is reflect: true and its toAttribute function returns undefined the attribute is now removed where previously it was left unchanged (#872).
  • Errors that occur during the update cycle were previously squelched to allow subsequent updates to proceed normally. Now errors are re-fired asynchronously so they can be detected. Errors can be observed via an unhandledrejection event handler on window.
  • ReactiveElement's renderRoot is now created when the element's connectedCallback is initially run.
  • Removed requestUpdateInternal. The requestUpdate method is now identical to this method and should be used instead.
  • The initialize method has been removed. This work is now done in the element constructor.

Minor Changes

  • Adds static addInitializer for adding a function which is called with the element instance when is created. This can be used, for example, to create decorators which hook into element lifecycle by creating a reactive controller (#1663).
  • Added ability to add a controller to an element. A controller can implement callbacks that tie into element lifecycle, including hostConnected, hostDisconnected, hostUpdate, and hostUpdated. To ensure it has access to the element lifecycle, a controller should be added in the element's constructor. To add a controller to the element, call addController(controller).
  • Added removeController(controller) which can be used to remove a controller from a ReactiveElement.
  • Added willUpdate(changedProperties) lifecycle method to UpdatingElement. This is called before the update method and can be used to compute derived state needed for updating. This method is intended to be called during server side rendering and should not manipulate element DOM.

1.0.0-rc.4

Patch Changes

  • #2103 15a8356d - Updates the exports field of package.json files to replace the subpath folder mapping syntax with an explicit list of all exported files.

    The /-suffixed syntax for subpath folder mapping originally used in these files is deprecated. Rather than update to the new syntax, this change replaces these mappings with individual entries for all exported files so that (a) users must import using extensions and (b) bundlers or other tools that don't resolve subpath folder mapping exactly as Node.js does won't break these packages' expectations around how they're imported.

  • #2097 2b8dd1c7 - Adds scheduleUpdate() to control update timing. This should be implemented instead of performUpdate(); however, existing overrides of performUpdate() will continue to work.
  • #1980 018f6520 - fix queryAssignedNodes returning null if slot is not found
  • #2113 5b2f3642 - Dependency upgrades including TypeScript 4.4.2
  • #2072 7adfbb0c - Remove unneeded matches support in @queryAssignedNodes. Update styling tests to use static bindings where needed. Fix TODOs related to doc links.
  • #2112 61fc9452 - Throws rather than warns in dev mode when an element has a class field that shadows a reactive property. The element is in a broken state in this case.
  • #2075 724a9aab - Ensures dev mode warnings do not spam by taking care to issue unique warnings only once.
  • #2073 0312f3e5 - (Cleanup) Removed obsolete TODOs from codebase
  • #2065 8b6e2415 - Fixes #2062. To match Lit1 behavior, the @query decorator returns null (rather than undefined) if a decorated property is accessed before first update. Likewise, a @queryAll decorated property returns [] rather than undefined.
  • #2043 761375ac - Update some internal types to avoid casting globalThis to any to retrieve globals where possible.

1.0.0-rc.3

Patch Changes

  • #2002 ff0d1556 - Fixes polyfill-support styling issues: styling should be fully applied by firstUpdated/update time; late added styles are now retained (matching Lit1 behavior)
  • #2030 34280cb0 - Remove unnecessary attribute:false assignment in @state decorator
  • #2034 5768cc60 - Reverts the change in Lit 2 to pause ReactiveElement's update cycle while the element is disconnected. The update cycle for elements will now run while disconnected as in Lit 1, however AsyncDirectives must now check the this.isConnected flag during update to ensure that e.g. subscriptions that could lead to memory leaks are not made when AsyncDirectives update while disconnected.
  • #1918 72877fd - Changed the caching strategy used in CSSResults returned from the css tag to cache the stylesheet rather than individual CSSResults.
  • #1942 c8fe1d4 - For minified class fields on classes in lit libraries, added prefix to stable properties to avoid collisions with user properties.
  • #2041 52a47c7e - Remove some unnecessary internal type declarations.
  • #1917 550a218 - Use a brand property instead of instanceof to identify CSSResults to make the checks compatible with multiple copies of the @lit/reactive-element package.
  • #1959 6938995 - Changed prefix used for minifying class field names on lit libraries to stay within ASCII subset, to avoid needing to explicitly set the charset for scripts in some browsers.
  • #1943 39ad574 - Add support for private custom element constructors in @customElement().
  • #1972 a791514b - Properties that must remain unminified are now compatible with build tools other than rollup/terser.
  • #2050 8758e06 - Fix syntax highlighting in some documentation examples

  • (Since 1.0.0-rc.2) Reverted change of the css tag's return to CSSResultGroup, which was a breaking change. The css tag again returns a CSSResult object.

  • (Since 1.0.0-rc.2) Remove the CSSResultFlatArray type alias in css-tag.ts.


Changes below were based on the Keep a Changelog format. All changes above are generated automatically by Changesets.


1.0.0-rc.2 - 2021-05-07

Changed

  • (Since 1.0.0-rc.1) [Breaking] Change the type name Warnings to WarningKind #1854.

1.0.0-rc.1 - 2021-04-20

Fixed

  • (Since 1.0.0-pre.3) A controller's hostConnected is called only once if an element is upgraded to a custom element #1731.

1.0.0-pre.3 - 2021-03-31

Fixed

  • (Since 1.0.0-pre.2) The createRenderRoot method is now called only once #1679.

[1.0.0-pre.2] - 2021-02-11

Added

  • (Since 1.0.0-pre.1) Adds static addInitializer for adding a function which is called with the element instance when is created. This can be used, for example, to create decorators which hook into element lifecycle by creating a reactive controller (#1663).
  • (Since 1.0.0-pre.1) Added removeController(controller) which can be used to remove a controller from a ReactiveElement.

Changed

  • (Since 1.0.0-pre.1) A controller's hostUpdated method is now called before the host's firstUpdated method (#1650).

  • (Since 1.0.0-pre.1) Fixed @query decorator when cache flag is used and code is compiled with Babel (#1591).

  • (Since 1.0.0-pre.1) Renamed all decorator modules to use kebab-case filename convention rather than camelCase.

  • (Since 1.0.0-pre.1) ReactiveController callbacks all now begin with host, for example hostConnected, hostDisconnected, hostUpdate, hostUpdated.

  • (Since 1.0.0-pre.1) If a Controller is added after a host element is connected, its connected will be called.

  • (Since 1.0.0-pre.1) Removed willUpdate from ReactiveController.

  • (Since 1.0.0-pre.1) Renamed Controller's dis/connectedCallback methods.

  • (Since 1.0.0-pre.1) Renamed Controller to ReactiveController.

  • Made JSCompiler_renameProperty block scoped so that it's inlined in the Terser prod build. Closure should compile from the development build, or after a custom TypeScript compilation.

[1.0.0-pre.1] - 2020-12-16

Changed

  • [Breaking] (since 3.0.0-pre1) UpdatingElement has been renamed to ReactiveElement.

  • [Breaking] (since 3.0.0-pre1) The updating-element package has been renamed to @lit/reactive-element.

  • [Breaking] (since 3.0.0-pre1) The @internalProperty decorator has been renamed to @state.

  • [Breaking] For consistency, renamed _getUpdateComplete to getUpdateComplete.

  • [Breaking] When a property declaration is reflect: true and its toAttribute function returns undefined the attribute is now removed where previously it was left unchanged (#872).

  • Errors that occur during the update cycle were previously squelched to allow subsequent updates to proceed normally. Now errors are re-fired asynchronously so they can be detected. Errors can be observed via an unhandledrejection event handler on window.

  • UpdatingElement's renderRoot is now created when the element's connectedCallback is initially run.

  • [Breaking] Update callbacks will only be called when the element is connected to the document. If an element is disconnected while an update is pending, or if an update is requested while the element is disconnected, update callbacks will be called if/when the element is re-connected.

Added

  • Console warnings added for removed API and other element problems in developer mode. Some warnings are errors and are always issued while others are optional. Optional warnings can be configured per class via MyElement.enable/disableWarning. Making changes in update warns by default and can be toggled via MyElement.disableWarning('change-in-update); migration warnings are off by default and can be toggled via MyElement.enableWarning('migration').

  • Added ability to add a controller to an element. A controller can implement callbacks that tie into element lifecycle, including connectedCallback, disconnectedCallback, willUpdate, update, and updated. To ensure it has access to the element lifecycle, a controller should be added in the element's constructor. To add a controller to the element, call addController(controller).

  • Added willUpdate(changedProperties) lifecycle method to UpdatingElement. This is called before the update method and can be used to compute derived state needed for updating. This method is intended to be called during server side rendering and should not manipulate element DOM.

  • UpdatingElement moved from lit-element package to updating-element package.

Removed

  • [Breaking] Removed requestUpdateInternal. The requestUpdate method is now identical to this method and should be used instead.
  • [Breaking] The initialize method has been removed. This work is now done in the element constructor.

Fixed

  • Fixes an issue with queryAssignedNodes when applying a selector on a slot that included text nodes on older browsers not supporting Element.matches #1088.