Skip to content

Latest commit

 

History

History
464 lines (262 loc) · 33.2 KB

CHANGELOG.md

File metadata and controls

464 lines (262 loc) · 33.2 KB

Change Log

2.0.4

Patch Changes

  • #4485 57b00630 - Add "browser" export condition entrypoints to any package.json files with "node" export conditions. This fixes Node test runners emulating browser environments that were incorrectly loading the "node" entrypoints instead of the browser code.
  • Updated dependencies [e901c582]:

2.0.3

Patch Changes

  • #4473 9a4d569f - Add a warning in dev mode when binding this.requestUpdate directly as an event listener.

  • #4413 f60a3a2c - Remove unused internal parameters to requestUpdate()

2.0.2

Patch Changes

  • #4387 bf551b5b - Ensure renderRoot exists before first update (#4268)

  • #4282 c7922a0c Thanks @MaxArt2501! - Fix a bug where accessing a @query decorated field with the cache flag set before the first update would result in null being cached permanently. null will no longer be cached before the first update and in DEV_MODE now raises a warning.

  • #4388 839ca0f8 - Fixes bug where adding or removing controllers during a reactive controller lifecycle would affect the execution of other controllers (#4266). Controllers can now be added/removed during lifecycle without affecting others.

2.0.1

Patch Changes

  • #4284 89a5b088 - Allow null to be in the type of @query() decorated fields

  • #4306 c28ebba1 - Update dependency version to refer to stable versions, rather than pre-release versions of our own packages.

2.0.0

Major Changes

  • #4146 0f6878dc - Generated accessor for reactive properties now wrap user accessors and automatically call this.requestUpdate() in the setter. As in previous versions, users can still specify noAccessor: true, in which case they should call this.requestUpdate() themselves in the setter if they want to trigger a reactive update.

  • #4254 1040f758 - Change the type of ReactiveElement.renderRoot and return type of ReactiveElement.createRenderRoot() to be HTMLElement | DocumentFragment to match each other and lit-html's render() method.

  • #3850 7e8491d4 - Delete deprecated queryAssignedNodes behavior and arguments. Migrate deprecated usage with a selector argument to use @queryAssignedElements. E.g.: @queryAssignedNodes('list', true, '.item') to @queryAssignedElements({slot: '', flatten: false, selector: '.item'}).

  • #3756 f06f7972 - Drop IE11 support

  • #3896 2eba6997 - Warn on async overrides of performUpdate()

Patch Changes

  • #4183 6470807f - Make the decorators work with the accessor keyword when experimentalDecorators is true.

  • #3816 be72f66b - Use Symbol.for in accessor to keep things easy for HMR.

  • #3710 09949234 - Add undefined to the return type of PropertyValues.get()

  • #3762 23c404fd - Remove Lit 1 -> Lit 2 migration warnings

  • #3918 2a01471a - Some code golf on ReactiveElement

  • #3809 6f2833fd - Use for/of loops in more places

  • #4141 6b515e43 - Update TypeScript to ~5.2.0

2.0.0-pre.1

Major Changes

  • #4146 0f6878dc - Generated accessor for reactive properties now wrap user accessors and automatically call this.requestUpdate() in the setter. As in previous versions, users can still specify noAccessor: true, in which case they should call this.requestUpdate() themselves in the setter if they want to trigger a reactive update.

  • #3896 2eba6997 - Warn on async overrides of performUpdate()

Minor Changes

  • #4081 d27a77ec - Sync from last stable release

  • #4183 6470807f - Make the decorators work with the accessor keyword when experimentalDecorators is true.

Patch Changes

2.0.0-pre.0

Major Changes

  • #3850 7e8491d4 - Delete deprecated queryAssignedNodes behavior and arguments.

    Migrate deprecated usage with a selector argument to use @queryAssignedElements. E.g.: @queryAssignedNodes('list', true, '.item') to @queryAssignedElements({slot: '', flatten: false, selector: '.item'}).

  • #3756 f06f7972 - Drop IE11 support

Patch Changes

1.6.3

Patch Changes

  • #4031 8057c78d - Rename ReactiveElement._initialize to __initialize, make it private, and remove the @internal annotation. This will help prevent collisions with subclasses that implement their own _initialize method, while using development builds.

1.6.2

Patch Changes

  • #3917 f6387e35 - Allow decorators to accept ReactiveElement class from a different source.

1.6.1

Patch Changes

  • #3561 e5c254e9 - Fix built-in shimming of HTMLElement for Node build of reactive-element to respect existing HTMLElement in global

1.6.0

Minor Changes

  • #3522 72fcf0d7 - When running in Node, Lit now automatically includes minimal DOM shims which are sufficient for most SSR (Server Side Rendering) use-cases, removing the need to import the global DOM shim from @lit-labs/ssr.

    The new @lit-labs/ssr-dom-shim package has been introduced, which exports an HTMLElement, CustomElementRegistry, and default customElements singleton.

    The existing @lit-labs/ssr global DOM shim can still be used, and is compatible with the new package, because @lit-labs/ssr imports from @lit-labs/ssr-dom-shim. Importing the global DOM shim adds more APIs to the global object, such as a global HTMLElement, TreeWalker, fetch, and other APIs. It is recommended that users try to remove usage of the @lit-labs/ssr DOM shim, and instead rely on the more minimal, automatic shimming that @lit/reactive-element now provides automatically.

Patch Changes

1.5.0

Minor Changes

  • #3507 b152db29 - lit-html and reactive-element now include development Node builds with unminified code and dev warnings.

1.4.2

Patch Changes

  • #3374 bb098950 - Initializers added to subclasses are no longer improperly added to superclass.

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.