lit

Lit is a simple library for building fast, lightweight web components.

BSD-3-CLAUSE License

Downloads
46.4M
Stars
18.6K
Committers
190

Bot releases are hidden (Show)

lit - @lit-labs/[email protected]

Published by kevinpschaaf about 3 years ago

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.

  • #1942 c8fe1d4 - For minified class fields on classes in lit libraries, added prefix to stable properties to avoid collisions with user properties.
  • #2113 5b2f3642 - Dependency upgrades including TypeScript 4.4.2
lit - @lit-labs/[email protected]

Published by kevinpschaaf about 3 years ago

  • #1942 c8fe1d4 - For minified class fields on classes in lit libraries, added prefix to stable properties to avoid collisions with user properties.
  • #2113 5b2f3642 - Dependency upgrades including TypeScript 4.4.2
lit - @lit-labs/[email protected]

Published by kevinpschaaf about 3 years ago

Patch Changes

  • #1942 c8fe1d4 - For minified class fields on classes in lit libraries, added prefix to stable properties to avoid collisions with user properties.
  • #2113 5b2f3642 - Dependency upgrades including TypeScript 4.4.2
  • #2123 efe88ba5 - Adds React.HTMLAttributes to component props, which enables the built-in onXyz event handler props.
lit - @lit-labs/[email protected]

Published by kevinpschaaf about 3 years ago

Patch Changes

  • #2166 94dff0a4 - Renamed animate option animateOptions to keyframeOptions and AnimateController animateOptions to defaultOptions
  • #1942 c8fe1d4 - For minified class fields on classes in lit libraries, added prefix to stable properties to avoid collisions with user properties.
  • #2113 5b2f3642 - Dependency upgrades including TypeScript 4.4.2
lit - [email protected]

Published by kevinpschaaf about 3 years ago

Major Changes

  • The templateFactory option of RenderOptions has been removed.

  • TemplateProcessor has been removed.

  • Symbols are not converted to a string before mutating DOM, so passing a Symbol to an attribute or text binding will result in an exception.

  • The shady-render module has been removed and is now part of platform-support, and Lit's polyfill support now adds the following limitations: (1) Bindings in style elements are no longer supported. Previously these could not change and in the future they may be supported via static bindings. (2) ShadyCSS.styleElement is no longer called automatically. This must be called whenever dynamic changes that affect styling are made that involve css custom property shimming (older browsers) or changes to custom properties used via the deprecated @apply feature. It was previously called only on first render, and it is now up to the user to decide when this should be called. See Polyfills for more details.

  • render() no longer clears the container it's rendered to. It now appends to the container by default.

  • Expressions in comments are no longer rendered or updated. See Valid expression locations for more details.

  • Template caching happens per callsite, not per template-tag/callsize pair. This means some rare forms of highly dynamic template tags are no longer supported.

  • Arrays and other iterables passed to attribute bindings are not specially handled. Arrays will be rendered with their default toString representation. This means that html`<div class=${['a', 'b']}> will render <div class="a,b"> instead of <div class="a b">. To get the old behavior, use array.join(' ').

  • Multiple bindings in a single attribute value don't require the attribute value is quoted, as long as there is no whitespace or other attribute-ending character in the attribute value. html`<div id=${a}-${b}>`

  • The directive and part APIs are significantly different. See Custom Directives and the Upgrade Guide for more details.

  • The Directive base class and directive() factory function are
    now exported from the lit-html/directive.js module.

  • NodePart has been renamed to ChildPart,
    along with other methods and variables that use the "Node" naming, like
    PartType.Node which is now PartType.CHILD.

  • The part exports (ChildPart,
    AttributePart, etc) have been change to interface-only exports. The constructors are no longer exported. Directive authors should use helpers in directive-helpers.js to construct parts.

  • The eventContext render option has been changed to host.

  • #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.

  • #1764 0b4d6eda - Don't allow classMap to remove static classes. This keeps classMap consistent with building a string out of the classnames to be applied.

Minor Changes

  • Added renderBefore to render options. If specified, content is rendered before the node given via render options, e.g. {renderBefore: node}.
  • Added development mode, which can be enabled by setting the development Node exports condition. See Development and production builds for more details.
  • All usage of instanceof has been removed, making rendering more likely to
    work when multiple instances of the library interact.
  • Template processing is more robust to expressions in places other than text and attribute values.
  • render now returns the ChildPart that was created/updated by render.
  • Added AsyncDirective, which is a Directive subclass whose
    disconnected callback will be called when the part containing the directive
    is cleared (or transitively cleared by a Part higher in the tree) or manually
    disconnected using the setConnected API, and whose reconnected callback
    will be called when manually re-connected using setConnected. When
    implementing disconnected, the reconnected callback should also be
    implemented to return the directive to a usable state. Note that LitElement
    will disconnect directives upon element disconnection, and re-connect
    directives upon element re-connection. See Async directives for more details.
  • Added setConnected(isConnected: boolean) to ChildPart; when called with
    false, the disconnected callback will be run on any directives contained within
    the part (directly or transitively), but without clearing or causing a
    re-render to the tree. When called with true, any such directives'
    reconnected callback will be called prior to its next update/render
    callbacks. Note that LitElement will call this method by default on the
    rendered part in its connectedCallback and disconnetedCallback.
  • Added the static-html module, a static html tag function, a literal tag function, and unsafeStatic(), which allows template authors to add strings to the
    static structure of the template, before it's parsed as HTML. See Static expressions for more details.
  • Added lit-html/directive-helpers.js module with helpers for creating custom directives. See Custom directives for more details.
  • Rendering null, undefined, or empty string in a ChildPart now has the same affect as rendering nothing: it does not produce an empty text node. When rendering into an element with Shadow DOM, this makes it harder to inadvertently prevent <slot> fallback content from rendering.
  • Nested directives whose parent returns noChange are now unchanged. This
    allows the guard directive to guard directive values (#1519).
  • Added optional creationScope to RenderOptions, which controls the node from which the template is cloned from.
  • Added support for running with Trusted Types enforced.

Patch Changes

  • #1922 8189f094 - Binding noChange into an interpolated attribute expression now no longer removes the attribute on first render - instead it acts like an empty string. This is mostly noticable when using until() without a fallback in interpolated attributes.

  • #1964 f43b811 - Don't publish src/ to npm.

  • #2070 a48f39c8 - Throw instead of rendering an innocuous value into a style or script when security hooks are enabled.

  • #2044 662209c3 - Improves disconnection handling for first-party AsyncDirectives (until, asyncAppend, asyncReplace) so that the directive (and any DOM associated with it) can be garbage collected before any promises they are awaiting resolve.

lit - [email protected]

Published by kevinpschaaf about 3 years ago

Major Changes

  • Most users should no longer import directly from lit-element, and instead prefer importing LitElement from the lit packages. The default entry point for lit-element remains backward-compatible and includes all decorators. However, it's recommended to use import {LitElement} from 'lit'; and import decorators from lit/decorators as necessary. See the Upgrade Guide for more details.

  • UpdatingElement has been moved from the lit-element package to the @lit/reactive-element package and renamed to ReactiveElement. See the ReactiveElement API documentation for more details. In addition, the source for css-tag, and all decorators have been moved to @lit/reactive-element. However, all symbols are re-exported from both lit and lit-element packages.

  • The @internalProperty decorator has been renamed to @state.

  • 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.

  • The lib folder has been removed.

  • Rendering of renderRoot/shadowRoot) via createRenderRoot and support for static styles has moved from LitElement to ReactiveElement.

  • The createRenderRoot method is now called just before the first update rather than in the constructor. Element code can not assume the renderRoot exists before the element hasUpdated. This change was made for compatibility with SSR.

  • ReactiveElement's initialize method has been removed. This work is now done in the element constructor.

  • The static render has been removed.

  • 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).

  • The dirty check in attributeChangedCallback has been removed. While technically breaking, in practice it should very rarely be (#699).

  • LitElement's adoptStyles method has been removed. Styling is now adopted in createRenderRoot. This method may be overridden to customize this behavior.

  • LitElement's static getStyles method has been renamed to static finalizeStyles and now takes a list of styles the user provided and returns the styles which should be used in the element. If this method is overridden to integrate into a style management system, typically the super implementation should be called.

  • Removed build support for TypeScript 3.4.

  • Decorators are no longer exported from the lit-element module. Instead, import any decorators you use from lit/decorators/*.

  • lit-html has been updated to 2.x.

  • Support for running in older browsers has been removed from the default configuration. Import the polyfill-support module to support Shady DOM. Note also that Lit parts inside <style> elements are no longer supported. See Polyfills for more details.

  • For simplicity, requestUpdate no longer returns a Promise. Instead await the updateComplete Promise.

  • Removed requestUpdateInternal. The requestUpdate method is now identical to this method and should be used instead.

  • #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.

Minor Changes

  • A public renderOptions class field now exists on LitElement and can be set/overridden to modify the options passed to lit-html.
  • Adds static shadowRootOptions for customizing shadowRoot options. Rather than implementing createRenderRoot, this property can be set. For example, to create a closed shadowRoot using delegates focus: static shadowRootOptions = {mode: 'closed', delegatesFocus: true}.
  • Adds development mode, which can be enabled by setting the development Node exports condition. See Development and production builds for more details.

Patch Changes

  • #1964 f43b811 - Don't publish src/ to npm.
  • For efficiency, the css function now maintains a cache and will use a cached value if available when the same style text is requested.
  • Fixed reflecting a property when it is set in a setter of another property that is called because its attribute changed (#965).
  • Fixed exceptions when parsing attributes from JSON (#722).
  • Fixed issue with combining static get properties on an undefined superclass with @property on a subclasss ([#890]https://github.com/Polymer/lit-element/issues/890));
lit -

Published by justinfagnani about 3 years ago

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.

  • #2113 5b2f3642 - Dependency upgrades including TypeScript 4.4.2
  • #2073 0312f3e5 - (Cleanup) Removed obsolete TODOs from codebase
lit -

Published by justinfagnani about 3 years ago

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.

  • #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.
  • #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
  • #2056 e5667d66 - Fixed issue where AsyncDirectives could see this.isConnected === true if a LitElement performed its initial render while it was disconnected.
  • #2043 761375ac - Update some internal types to avoid casting globalThis to any to retrieve globals where possible.
lit -

Published by justinfagnani about 3 years ago

Patch Changes

  • #2098 b3121ab7 - Fix ChildPart parentNode for top-level parts to return the parentNode they will be inserted into, rather than the DocumentFragment they were cloned into. Fixes #2032.
  • #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.

  • #2074 d6b385e3 - (Cleanup) Added missing tests to close out TODOs in the code.
    Fixed unsafeHTML and unsafeSVG to render no content (empty string) for values undefined, null, and nothing.
  • #1922 8189f094 - Binding noChange into an interpolated attribute expression now no longer removes the attribute on first render - instead it acts like an empty string. This is mostly noticable when using until() without a fallback in interpolated attributes.
  • #2114 b4bd9f7c - Parts are not supported inside the template or textarea tags. In dev mode, we indicate if parts are placed here so the developer can remove them.
  • #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.
  • #1764 0b4d6eda - Don't allow classMap to remove static classes. This keeps classMap consistent with building a string out of the classnames to be applied.
  • #2071 01353317 - In dev mode, throw for tag name bindings. These should use static templates.
  • #2070 a48f39c8 - Throw instead of rendering an innocuous value into a style or script when security hooks are enabled.
  • #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
  • #2056 e5667d66 - Fixed issue where AsyncDirectives could see this.isConnected === true if a LitElement performed its initial render while it was disconnected.
  • #2128 cc5c3a09 - Add test for AsyncDirectives that synchronously call this.setValue()
  • #2046 043a16fb - In development mode, constructing an EventPart from an improperly formed attribute will now throw: the attribute must contain only a single expression and the surrounding two strings must be the empty string. Before, constructing an EventPart with extra expressions or surrounding text would cause that part to be silently and incorrectly treated as an AttributePart.
  • #2043 761375ac - Update some internal types to avoid casting globalThis to any to retrieve globals where possible.
lit -

Published by justinfagnani about 3 years ago

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.
lit -

Published by justinfagnani about 3 years ago

Patch Changes

lit -

Published by justinfagnani about 3 years ago

Patch Changes

  • #2113 5b2f3642 - Dependency upgrades including TypeScript 4.4.2
  • #2120 2043eb0f - Don't assign DOM shim window.global (and hence globalThis.global) to window

    This means that globalThis.global will retain its Node built-ins, whereas
    before it would lose anything we didn't explicitly set on window.

    Fixes https://github.com/lit/lit/issues/2118

lit -

Published by justinfagnani about 3 years ago

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.

  • #2113 5b2f3642 - Dependency upgrades including TypeScript 4.4.2
lit -

Published by justinfagnani about 3 years ago

Patch Changes

  • #2113 5b2f3642 - Dependency upgrades including TypeScript 4.4.2
lit -

Published by justinfagnani about 3 years ago

Patch Changes

  • #2113 5b2f3642 - Dependency upgrades including TypeScript 4.4.2
  • #2123 efe88ba5 - Adds React.HTMLAttributes to component props, which enables the built-in onXyz event handler props.
lit -

Published by justinfagnani about 3 years ago

Patch Changes

lit - [email protected]

Published by justinfagnani about 3 years ago

Patch Changes

  • #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.
  • #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.
lit - [email protected]

Published by justinfagnani about 3 years ago

Major Changes

  • #1959 69389958 - Changed all prefixes used for minifying object and class properties from greek
    characters to ASCII, to avoid requiring an explicit script charset on some
    browser/webview environments.

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)
  • #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.
  • #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.
  • #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.
  • #1937 3663f09 - Re-export PropertyPart from 'directive.ts'
  • #1991 f05be301 - Fixed bug where Template.createElement was not patchable by polyfill-support when compiled using closure compiler, leading to incorrect style scoping.
  • #1990 56e8efd3 - Fixed an error thrown when an empty <style></style> tag is rendered while using the @apply shim under native Shadow DOM.
  • #2044 662209c3 - Improves disconnection handling for first-party AsyncDirectives (until, asyncAppend, asyncReplace) so that the directive (and any DOM associated with it) can be garbage collected before any promises they are awaiting resolve.
  • #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
lit - @lit-labs/[email protected]

Published by justinfagnani about 3 years ago

Patch Changes

  • #1942 c8fe1d4 - For minified class fields on classes in lit libraries, added prefix to stable properties to avoid collisions with user properties.
  • Included development folder in release #1912.
lit - @lit-labs/[email protected]

Published by justinfagnani about 3 years ago

Patch Changes

  • #1942 c8fe1d4 - For minified class fields on classes in lit libraries, added prefix to stable properties to avoid collisions with user properties.