PackageTrack

npm · #3984

@lit/reactive-element

2.1.2lit/lit

A simple low level base class for creating fast, lightweight web components

Release timeline

42 releases since 2020
202120222023202420252026

Releases

  1. 2.1.223 Dec 2025
    Release notes

    Patch Changes

    • #4340 18305b43 - Update dependency version range on graduated package to ^1.0.0 so this package can receive updates.
    Open source →
    Additional notes

    Patch Changes

    • #3953 2407c808 - Fix taskComplete not rejecting if after an error state

    • #3947 0480e006 - Task will not throw errors unless user requests taskComplete

    Open source →
  2. 2.1.111 Jul 2025
    Release notes

    Patch Changes

    Open source →
    Additional notes

    Patch Changes

    Open source →
    Additional notes

    Patch Changes

    • #4224 71526898 - Graduate @lit-labs/react to @lit/react, its permanent location. @lit-labs/react is now just a proxy for @lit/react, so code need not be duplicated in projects that depend on both.

    • #4141 6b515e43 - Update TypeScript to ~5.2.0

    Open source →
    Additional notes

    Patch Changes

    Open source →
  3. 2.1.011 Apr 2025
    Release notes

    Minor Changes

    • #4901 c9160405 Thanks @maxpatiiuk! - Dev mode warnings are now emitted on the next microtask after package import, allowing for a wider opportunity to suppress the warnings by consumers.

    • #4934 4824c4ce - Adds property option for useDefault. When set, the initial default value is not considered a change and does not reflect when reflect is set. In addition, when the attribute is removed, the default value is restored.

    Patch Changes

    • #4949 3e2f87f6 - fixes inconsistent initial changed properties values
    Open source →
    Additional notes

    Minor Changes

    Open source →
  4. 2.0.431 Jan 2024
    Release notes

    Patch Changes

    • #4782 99703a03 - Revert the Terser plugin for Rollup to rollup-plugin-terser from @rollup/plugin-terser due to a bug that prevented our minified name prefixing from working.
    Open source →
    Additional notes

    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]:
    Open source →
    Additional notes

    Patch Changes

    Open source →
  5. 2.0.39 Jan 2024
    Release notes

    Patch Changes

    Open source →
    Additional notes

    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()

    Open source →
    Additional notes

    Patch Changes

    • #4172 dc1d323f - Revert custom children type added in #4142 and instead use our copy of PropsWithoutRef type so that preact/compat typing will work. Preact users facing type errors using wrapped components should configure "paths" in their tsconfig.json so that react types will instead resolve to preact/compat as described in Preact's TypeScript documentation. Going with preact/compat also solves compatibility issues arising from TypeScript >= 5.1 changing JSX tag type check.
    Open source →
    Additional notes

    Patch Changes

    • #3909 feded34b Thanks @chrispaterson! - Refactored and refurbished ScrollerController attach/detach code in effort to reduce potential memory leaks due to held instance references.

    • #3892 f5b2013d - Changed accessor and iterator code to support ES5 compilation.

    • #3929 c3672fca - Added new support utilities for dealing with ResizeObserver loop limit exceeded errors.

    Open source →
  6. 2.0.216 Nov 2023
    Release notes

    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.

    Open source →
    Additional notes

    Patch Changes

    • #4299 fffa4406 - Update version range for lit dependency to include v2 (and/or @lit/reactive-element v1). This allows projects still on lit v2 to use this package without being forced to install lit v3.
    Open source →
    Additional notes

    Patch Changes

    • #4142 170e9164 - Fix type compatibility with Preact when adding children to wrapped components.
    Open source →
    Additional notes

    Patch Changes

    Open source →
  7. 2.0.128 Oct 2023
    Release notes

    Patch Changes

    Open source →
    Additional notes

    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.

    Open source →
    Additional notes

    Patch Changes

    Open source →
    Additional notes

    Patch Changes

    • #4097 364650d0 - Fix type regression to prefer provided event handler prop type over React's built-in handler type.
    Open source →
  8. 2.0.010 Oct 2023
    Release notes

    Major Changes

    • #3850 7e8491d4 - Remove transform for deprecated usage of queryAssignedNodes.

    • #4141 6b515e43 - Update TypeScript to ~5.2.0, which includes breaking changes to the TypeScript compiler APIs

    Open source →
    Additional notes

    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

    Open source →
    Additional notes

    Major Changes

    • #4027 c28cb6ed - - [BREAKING] Removed deprecated call signature for createComponent() taking multiple arguments. A single option object must be passed in instead.

      Example:

      - createComponent(React, 'my-element', MyElement, {onfoo: 'foo'})
      + createComponent({
      +   react: React,
      +   tagName: 'my-element',
      +   elementClass: MyElement,
      +   events: {onfoo: 'foo'},
      + })
      
      • Refactored to move implementation directly into render function of forwardRef rather than creating a class component. This removes an extra React component of the same name showing up in the component tree.

    Patch Changes

    • #4000 2118aeb6 - Add @types/react@17||18 as peer dependency as the package makes direct use of those types.

    • #4061 25d10ee1 - Update WebComponentProps type to allow providing ref prop in JSX.

    Open source →
    Additional notes

    Major Changes

    • New package serving as the main entry point for all users of Lit (including LitElement, ReactiveElement, and lit-html). See the Migration Guide for more details.
    Open source →
  9. 2.0.0-pre.129 Sept 2023pre-release
    Release notes

    Major Changes

    Open source →
    Additional notes

    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

    Open source →
  10. 2.0.0-pre.027 Apr 2023pre-release
    Release notes

    Major Changes

    • #3850 7e8491d4 - Remove transform for deprecated usage of queryAssignedNodes.

    • #3814 23326c6b - Update to TypeScript 5.0, which includes breaking changes to the TypeScript compiler APIs.

    Patch Changes

    Open source →
    Additional notes

    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

    Open source →
  11. 1.6.32 Aug 2023
    Release notes

    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.
    Open source →
  12. 1.6.21 Jun 2023
    Release notes

    Patch Changes

    • #3917 f6387e35 - Allow decorators to accept ReactiveElement class from a different source.
    Open source →
  13. 1.6.112 Jan 2023

    Nothing published for this version

  14. 1.6.09 Jan 2023
    Release notes

    Minor Changes

    Patch Changes

    Open source →
  15. 1.5.08 Dec 2022

    Nothing published for this version

  16. 1.4.23 Nov 2022

    Nothing published for this version

  17. 1.4.118 Aug 2022

    Nothing published for this version

  18. 1.4.012 Aug 2022
    Release notes

    Minor Changes

    • #4987 3ac01aee - Implement the full CustomElementRegistry type for the ssr shim. Improves fidelity and compilability.
    Open source →
  19. 1.4.0-next.125 Jul 2022pre-release

    Nothing published for this version

  20. 1.4.0-next.025 Jul 2022pre-release

    Nothing published for this version

  21. 1.3.422 Jul 2022

    Nothing published for this version

  22. 1.3.329 Jun 2022

    Nothing published for this version

  23. 1.3.229 Apr 2022

    Nothing published for this version

  24. 1.3.115 Mar 2022

    Nothing published for this version

  25. 1.3.018 Feb 2022
    Release notes

    Minor Changes

    • #4755 25962bf5 Thanks @kyubisation! - Implement SSR event handling and an optional flag globalThis.litSsrCallConnectedCallback to call connectedCallback during SSR, if set to true.
    Open source →
  26. 1.2.315 Feb 2022

    Nothing published for this version

  27. 1.2.27 Feb 2022

    Nothing published for this version

  28. 1.2.125 Jan 2022
    Release notes

    Patch Changes

    Open source →
    Additional notes

    Patch Changes

    • #3978 3711e665 - Only add suppressHydrationWarning prop when rendered in the client. This will prevent suppresshydrationwarning attribute being added to the host element when using @lit-labs/ssr-react.
    Open source →
  29. 1.2.013 Jan 2022
    Release notes

    Minor Changes

    Open source →
    Additional notes

    Minor Changes

    • #3885 7932f7dd - @lit-labs/ssr-react and @lit-labs/react now coordinate prop handling during server rendering and hydration.

      • [Breaking] @lit-labs/ssr-react will call setAttribute() with all props provided during server rendering unless they are provided in <code>_$litProps$</code> object made by @lit-labs/react. Previously, it would call setProperty() for props that were found in the element's prototype, and setAttribute() for those that weren't. If you wish to server render custom elements that take properties that can not be set as attributes (i.e. not serializeable or have different name as attribute/property), you must use @lit-labs/react to create a React wrapper component.
      • @lit-labs/react now has a Node build and export condition to do special prop handling during server rendering. It detects the presence of React.createElement monkey patch by @lit-labs/ssr-react and provides props to be set as properties to the createElement() call.
      • @lit-labs/ssr-react will add the defer-hydration attribute to custom elements that had properties set so that @lit-labs/react wrapped elements have a chance to set properties on the element before Lit element hydration is triggered.
      • @lit-labs/react wrapped components will suppress hydration warnings raised by React due to server rendered attributes.
    Open source →
  30. 1.1.212 Jan 2022
    Release notes

    Patch Changes

    Open source →
    Additional notes

    Patch Changes

    Open source →
    Additional notes

    Patch Changes

    • #3901 82e9f370 - Bump minimum version of lit-html dependency to 2.7.1 which includes needed shared internals.
    Open source →
  31. 1.1.16 Jan 2022
    Release notes

    Patch Changes

    Open source →
    Additional notes

    Patch Changes

    • #4614 ab77cc9c - Fix context types to be compatible with WCCG context protocol types.
    Open source →
  32. 1.1.05 Jan 2022
    Release notes

    Minor Changes

    Patch Changes

    Open source →
    Additional notes

    Minor Changes

    • #4371 62df19da Thanks @autopulated! - ContextProvider can now be added to any HTML elements, not just custom elements implementing a ReactiveControllerHost.

    Patch Changes

    • #4373 22919f6d - Make property decorated with @provide() with TypeScript experimental decorators configurable. This allows chaining additional decorators that modify the property like @property() from lit.
    Open source →
  33. 1.0.29 Nov 2021
    Release notes

    Patch Changes

    • #4836 05691ba4 Thanks @maxpatiiuk! - Improve type inference of tuples returned by the args function being used as task function parameter.
    Open source →
    Additional notes

    Patch Changes

    Open source →
    Additional notes

    Patch Changes

    Open source →
    Additional notes

    Patch Changes

    • #4381 001a1b78 - Prefer type of property from an element over built-in React HTMLAttribute types. This also fixes type errors that would arise when they collide and can't be intersected.
    Open source →
    Additional notes

    Patch Changes

    Open source →
    Additional notes

    Patch Changes

    Open source →
  34. 1.0.17 Oct 2021
    Release notes

    Patch Changes

    • #4552 4050cac6 Thanks @jrencz! - Make status of Task a readonly property

      So far status was writable which allowed for setting status of task form outside. Doing so did cause rendering of expected template but the task was becoming internally incoherent.

      Now attempt to assign status will end up in throwing a TypeError.

    Open source →
    Additional notes

    Patch Changes

    • #4348 8f3dd603 - Fix bug where adjacent attribute and element parts would mix-up their values during compilation.
    Open source →
    Additional notes

    Patch Changes

    • #4335 7fc72f7b Thanks @stefanpearson! - When passing a ref callback to the Component, createComponent was previously intercepting it and wrapping it in an unbound function. This change memoizes the consumer ref with useCallback, to keep the reference stable and ensure it isn't invoked repeatedly on subsequent renders.
    Open source →
    Additional notes

    Patch Changes

    • #4329 df1980fe - Remove dependency on lit package. All implementation code only uses @lit/reactive-element. lit is moved to dev dependencies as it is still used for tests.

    • #4286 1fb7a108 - Fix erroneous description for the JSDoc on the @provide() decorator.

    • #4287 4edf9bc8 - Broaden the host type of context controllers and decorators to be compatible with Lit 2

    Open source →
    Additional notes

    Patch Changes

    • #4299 fffa4406 - Update version range for lit dependency to include v2 (and/or @lit/reactive-element v1). This allows projects still on lit v2 to use this package without being forced to install lit v3.
    Open source →
  35. 1.0.021 Sept 2021
    Release notes

    Major Changes

    • #4170 04c8d65a - Graduate @lit-labs/task to @lit/task, its permanent location. @lit-labs/task is now just a proxy for @lit/task, so code need not be duplicated in projects that depend on both.
    Open source →
    Additional notes

    Major Changes

    • #4128 190ee965 - Initial release of @lit-labs/compiler, vending a Lit template TypeScript transformer.
    Open source →
    Additional notes

    Major Changes

    • #4224 71526898 - Graduate @lit-labs/react to @lit/react, its permanent location. @lit-labs/react is now just a proxy for @lit/react, so code need not be duplicated in projects that depend on both.
    Open source →
    Additional notes

    Major Changes

    • #4210 cf7d96d4 - Graduate @lit-labs/context to @lit/context, its permanent location. @lit-labs/context is now just a proxy for @lit/context, so code need not be duplicated in projects that depend on both.
    Open source →
    Additional notes

    Major Changes

    Open source →
    Additional notes

    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 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 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.
    Open source →
  36. 1.0.0-rc.43 Sept 2021pre-release

    Nothing published for this version

  37. 1.0.0-rc.319 Aug 2021pre-release

    Nothing published for this version

  38. 1.0.0-rc.27 May 2021pre-release

    Nothing published for this version

  39. 1.0.0-rc.121 Apr 2021pre-release

    Nothing published for this version

  40. 1.0.0-pre.331 Mar 2021pre-release

    Nothing published for this version

  41. 1.0.0-pre.212 Feb 2021pre-release

    Nothing published for this version

  42. 1.0.0-pre.117 Dec 2020pre-release

    Nothing published for this version