Skip to content

Latest commit

 

History

History
417 lines (240 loc) · 31.4 KB

CHANGELOG.md

File metadata and controls

417 lines (240 loc) · 31.4 KB

Change Log

3.2.2

Patch Changes

  • #4515 dca963f7 - Fix a memory leak when patching directive constructors for SSR.

  • #4519 8d3e3057 - Fix a bug where server templates with attribute bindings on certain element tags like <td> used top-level would throw an error during server render.

  • Updated dependencies [1a32b61e, e901c582, 57b00630, dca963f7]:

    • lit-html@3.1.2
    • lit@3.1.2
    • @lit-labs/ssr-dom-shim@1.2.0
    • @lit/reactive-element@2.0.4
    • @lit-labs/ssr-client@1.1.7
    • lit-element@4.0.4

3.2.1

Patch Changes

  • #4421 c7134a40 - Fix server template throwing when encountering an attribute binding on the html tag. This is now handled correctly.

  • #4479 ee97d089 - Fix incorrect attribute names being matched to values when attribute expressions are followed by element expressions such as using the ref directive.

3.2.0

Minor Changes

  • #4382 011b762d - Add a server-only html function, to define templates that will only be rendered on the server.

Patch Changes

3.1.9

Patch Changes

  • #4311 cabe72a8 - Update version range for lit dependency to include v2. This allows projects still on lit v2 to use this package without being forced to install lit v3.

  • #4314 f9c3659f - Fix ModuleLoader so it can load modules concurrently.

  • #4298 c05767c2 - Fix svg templates getting surrounded by empty <svg></svg> tags when rendered.

3.1.8

Patch Changes

  • #4141 6b515e43 - Update TypeScript to ~5.2.0

  • #4202 77e9b48e - Fix an obscure potential memory leak, only keeping weak references to directive classes.

  • Updated dependencies:

    • @lit/reactive-element@2.0.0
    • lit-html@3.0.0
    • lit@3.0.0
    • lit-element@4.0.0

3.1.8-pre.0

Patch Changes

3.1.7

Patch Changes

3.1.6

Patch Changes

  • #4188 4b1dc1b6 Thanks @jimsimon! - Improve "partIndex" error message to include the offending template, details about common causes, and a link to the docs.

  • #4175 84bb0523 Thanks @43081j! - Update parse5/tools to simplify importing of node types from the default tree adapter

  • #4168 444599eb Thanks @43081j! - Upgrade parse5 to 7.x in localize-tools and import from root of parse5 where possible

3.1.5

Patch Changes

  • #3977 a2366a39 - Make attribute handling case-insensitive for custom element rendering as it is in the browser for HTML elements.

3.1.4

Patch Changes

  • #3942 ed42d5f0 - Fix adding node marker for hydration for nested custom elements without attributes. This ensures nested custom elements have their defer-hydration attribute removed when parent is hydrated even without any attributes or bindings.

3.1.3-pre.0

Patch Changes

3.1.3

Patch Changes

  • #3905 f8d72859 - Handle non-array iterables including map directive in child parts

3.1.2

Patch Changes

  • #3849 02d6a35a - Add "module" to condition names to resolve for module loader

3.1.1

Patch Changes

  • #3720 575fb578 - Use hydration modules from @lit-labs/ssr-client

  • Updated dependencies [575fb578]:

    • @lit-labs/ssr-client@1.1.0

3.1.0

Minor Changes

  • #3599 ca74ff6e - Forwards compatibility for Declarative Shadow DOM's shadowrootmode rename

  • #3677 b95c86e5 - Reflect ARIA attributes onto server rendered Lit elements with attached internals during SSR and remove them upon hydration.

  • #3667 e00f6f52 - Improved how nodes with attribute/property/event/element bindings are rendered in SSR, to avoid adding comments inside of "raw text elements" like <textarea>. Fixes #3663.

    Note: @lit-labs/ssr and lit-html must be updated together.

Patch Changes

3.0.1

Patch Changes

  • #3432 805607fb - LitElementRenderer now uses renderValue from lib/render-value.js, removing a circular dependency.

3.0.0

Major Changes

  • #3522 72fcf0d7 - ModuleLoader now provides a default VM global context object which provides basic globals that are available in both Node and browsers.

  • #3522 72fcf0d7 - The SSR dom shim will now throw if a custom element is redefined.

  • #3431 ff637f52 - The Lit SSR DOM shim no longer defines a global window variable. This was removed to improve compatibility with libraries that detect whether they are running in Node vs the browser by checking for the presence of window.

    If you have code that runs during SSR which depends on the presence of window, you can either replace window with globalThis, or use isSsr to avoid running that code on the server (see https://lit.dev/docs/ssr/authoring/#browser-only-code).

  • #3467 c77220e8 - Allow SSR renderers to produce asynchronous values. This is a BREAKING change.

    This changes the return type of render() and the ElementRenderer render methods to be a RenderResult, which is an iterable of strings or Promises and nested RenderResults.

    The iterable remains a sync iterable, not an async iterable. This is to support environments that require synchronous renders and because sync iterables are faster than async iterables. Since many server renders will not require async rendering, they should work in sync contexts and shouldn't pay the overhead of an async iterable.

    Including Promises in the sync iterable creates a kind of hybrid sync/async iteration protocol. Consumers of RenderResults must check each value to see if it is a Promise or iterable and wait or recurse as needed.

    This change introduces three new utilities to do this:

    • collectResult(result: RenderResult): Promise<string> - an async function that joins a RenderResult into a string. It waits for Promises and recurses into nested iterables.
    • collectResultSync(result: RenderResult) - a sync function that joins a RenderResult into a string. It recurses into nested iterables, but throws when it encounters a Promise.
    • RenderResultReadable - a Node Readable stream implementation that provides values from a RenderResult. This can be piped into a Writable stream, or passed to web server frameworks like Koa.

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.

  • #3522 72fcf0d7 - APIs such as attachShadow, setAttribute have been moved from the HTMLElement class shim to the Element class shim, matching the structure of the real API. This should have no effect in most cases, as HTMLElement inherits from Element.

Patch Changes

  • Updated dependencies [72fcf0d7]:
    • @lit-labs/ssr-dom-shim@1.0.0
    • @lit/reactive-element@1.6.0
    • lit-html@2.6.0
    • lit@2.6.0

2.3.0

Minor Changes

  • #3507 b152db29 - ReactiveElement's shadowRootOptions are now used to configure declarative shadow roots' properties.

  • #3507 b152db29 - Module resolution within SSR now supports package exports (via package.json)

  • #3507 b152db29 - Add support to SSR for loading of modules from packages with export maps

Patch Changes

  • Updated dependencies [b152db29]:
    • lit-html@2.5.0
    • @lit/reactive-element@1.5.0
    • lit@2.5.0

2.2.3

Patch Changes

  • #3187 84437af6 - When using renderModule, URL and URLSearchParams are now available in global of the VM module context

  • #3204 19d7bd25 - Use url module to parse file URL to path for Windows compatibility

  • Updated dependencies [daddeb34, 0725fdb4, 3766ae4c, 6361a4b4, ae6f6808]:

    • lit-html@2.3.0
    • lit@2.3.0
    • @lit/reactive-element@1.4.0

2.2.2

Patch Changes

2.2.1

Patch Changes

  • #3045 9a7b6546 - Fix behavior of setAttribute when value is not a string to match browsers. It is now cast to a string. Fixes problems such as reflection of type:Number properties on ReactiveElements.

2.2.0

Minor Changes

  • #2940 ac356997 - Add option to defer hydration of top level custom elements.

2.1.0

Minor Changes

  • #2662 1d51ed8b - Adds HTMLElement.shadowRoot property to dom-shim.

2.0.4

Patch Changes

  • #2580 b8ceafb0 - Handle rendering of null and undefined element attribute values

2.0.3

Patch Changes

  • #2510 937388e2 - Replace window proxy with reference to globalThis in global DOM shim

2.0.2

Patch Changes

  • #2488 28d856e3 - Fix typo in README import statements.

  • #2456 0b774e0e - Fix TypeScript typing issues when using @lit-labs/ssr. Adds a dependency on @types/node for URL, which is part of the public ModuleLoader API. Adds a new VmModule interface for the ModuleLoader API, whose return type was previously completely missing.

  • #2480 c9022d53 - Fix bug which could cause errors resolving lit modules with isolated vm modules.

  • #2406 5d77f893 - [@lit-labs/ssr] Fix typo in ssr readme. Fixes #2381

2.0.1

Patch Changes

2.0.0

Major Changes

  • #2288 b42f6f0f - Refactor the import-module into a class-based ModuleLoader API. Adds a module cache that tracks dependencies between modules.

Minor Changes

  • #2294 dcab56b0 - Add customElementRendered callback to RenderInfo so that callers can know what elements were rendered.

Patch Changes

  • #2346 53e64286 - Remove dependency on escape-html (which is not an ES module)
  • #2344 bc46ddd6 - Fix bug where static attributes did not render for unknown elements
  • #2345 4edf4f3b - Remove unnecessary dependencies: koa, koa-node-resolve, koa-static, @webcomponents/template-shadowroot

1.0.0

Patch Changes

  • #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.
  • #2113 5b2f3642 - Dependency upgrades including TypeScript 4.4.2
  • #2141 d8ff5901 - Add LICENSE files to public packages without one.
  • #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 lit#2118

  • #1881 a83f616 - Add demo for using global DOM shim instead of isolated VM contexts

1.0.0-rc.3

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 lit#2118

1.0.0-rc.2

Patch Changes

  • #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.
  • #1881 a83f616 - Add demo for using global DOM shim instead of isolated VM contexts

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


1.0.0-rc.1 - 2021-04-20

Added

  • Added render-global module for non-sandboxed rendering.

  • Added elementRenderers option to RenderInfo, along with static matchesClass() method to ElementRenderer, allowing the default renderer(s) to be overridden.

  • Added defer-hydration attribute handling, which helps coordinate ordered wakeup of custom elements during hydration.