Lit is a simple library for building fast, lightweight web components.
#4575 aa4fc3ef
- The Node build of @lit-labs/ssr-react/enable-lit-ssr.js
now also monkey-patches react/jsx-runtime
to include logic for deeply server-rendering Lit components without modifying jsxImportSource
in tsconfig.
The monkey-patching logic also adds a workaround for inconsistent es module interop behavior in tools like webpack which could lead to errors like TypeError: Cannot set property createElement of [object Module] which has only a getter
.
#4575 aa4fc3ef
- Add support for Next.js 14 and App Router. No longer support Next.js 12.
Note: By default, components in the App Router are React Server Components (RSCs). Deep SSR of Lit components does not work within server components as they result in React hydration mismatch due to the presence of the <template>
element in the RSC payload containing the serialized server component tree, and the custom element definitions will not be included with the client bundle either when imported in server component files.
Make sure any Lit components you wish to use are beyond the 'use client';
boundary. These will still be server rendered for the initial page load just like they did for the Pages Router.
aa4fc3ef
, aa4fc3ef
]:
#4572 5ed30d47
- Fix issue where event handler prop was incorrectly being set on the underlying custom element instance and potentially overriding an existing method/property.
#4534 d68f5c70
- Wrapped components will now keep track of JSX props from previous render that were set as a property on the element, but are now missing, and set the property to undefined
. Note, wrapped components still do not have "default props" and missing props will be treated the same as explicitly passing in undefined
.
This fixes the previously unexpected behavior where the following JSX when first rendered with a truthy condition
return condition ? <WrappedInput disabled /> : <WrappedInput />;
would leave the disabled
property and reflected attribute to be true
even when the condition turns falsey.