-
#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
-
#4421
c7134a40
- Fix server template throwing when encountering an attribute binding on thehtml
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 theref
directive.
- #4382
011b762d
- Add a server-only html function, to define templates that will only be rendered on the server.
-
#4389
ef2976b9
- Fix a race condition inRenderResultReadable
which could skip async work. -
Updated dependencies [
bf551b5b
,949a5467
,c7922a0c
,839ca0f8
]:- lit@3.1.0
- lit-html@3.1.0
-
#4311
cabe72a8
- Update version range forlit
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.
-
#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
-
#4202
77e9b48e
- Fix an obscure potential memory leak, only keeping weak references to directive classes. -
Updated dependencies [
6b515e43
,0f6878dc
,2a01471a
,2eba6997
,d27a77ec
,6470807f
,09949234
]:- @lit/reactive-element@2.0.0-pre.1
- lit-element@4.0.0-pre.1
- lit-html@3.0.0-pre.1
- lit@3.0.0-pre.1
-
#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
- #3977
a2366a39
- Make attribute handling case-insensitive for custom element rendering as it is in the browser for HTML elements.
- #3942
ed42d5f0
- Fix adding node marker for hydration for nested custom elements without attributes. This ensures nested custom elements have theirdefer-hydration
attribute removed when parent is hydrated even without any attributes or bindings.
-
Updated dependencies [
be72f66b
,dfd747cf
,23c404fd
,76795a18
,1db01376
,6f2833fd
,c3e473b4
,92cedaa2
,7e8491d4
,23326c6b
,f06f7972
,76795a18
]:- @lit/reactive-element@2.0.0-pre.0
- lit-html@3.0.0-pre.0
- lit@3.0.0-pre.0
- lit-element@4.0.0-pre.0
- @lit-labs/ssr-dom-shim@1.1.2-pre.0
- @lit-labs/ssr-client@1.1.2-pre.0
-
#3720
575fb578
- Use hydration modules from@lit-labs/ssr-client
-
Updated dependencies [
575fb578
]:- @lit-labs/ssr-client@1.1.0
-
#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
andlit-html
must be updated together.
-
#3590
1d8a38ed
- Make FallbackRenderer not emit a shadow root -
#3584
61ec3dab
- Removeabstract
from members of the ElementRendererConstructor type -
Updated dependencies [
4d698430
,b95c86e5
,b95c86e5
,e00f6f52
,88a40177
]:- lit-html@2.7.0
- @lit-labs/ssr-dom-shim@1.1.0
- lit@2.7.0
- lit-element@3.3.0
- #3432
805607fb
-LitElementRenderer
now usesrenderValue
fromlib/render-value.js
, removing a circular dependency.
-
#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 globalwindow
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 ofwindow
.If you have code that runs during SSR which depends on the presence of
window
, you can either replacewindow
withglobalThis
, or useisSsr
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 theElementRenderer
render methods to be aRenderResult
, 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 NodeReadable
stream implementation that provides values from aRenderResult
. This can be piped into aWritable
stream, or passed to web server frameworks like Koa.
-
#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 anHTMLElement
,CustomElementRegistry
, and defaultcustomElements
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 globalHTMLElement
,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.
- 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
-
#3507
b152db29
-ReactiveElement
'sshadowRootOptions
are now used to configure declarative shadow roots' properties. -
#3507
b152db29
- Module resolution within SSR now supports package exports (viapackage.json
) -
#3507
b152db29
- Add support to SSR for loading of modules from packages with export maps
- Updated dependencies [
b152db29
]:- lit-html@2.5.0
- @lit/reactive-element@1.5.0
- lit@2.5.0
-
#3187
84437af6
- When usingrenderModule
,URL
andURLSearchParams
are now available in global of the VM module context -
#3204
19d7bd25
- Useurl
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
- #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.
-
#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
- #2288
b42f6f0f
- Refactor the import-module into a class-based ModuleLoader API. Adds a module cache that tracks dependencies between modules.
- #2294
dcab56b0
- Add customElementRendered callback to RenderInfo so that callers can know what elements were rendered.
- #2345
4edf4f3b
- Remove unnecessary dependencies:koa
,koa-node-resolve
,koa-static
,@webcomponents/template-shadowroot
-
Updated dependencies [
08e7fc56
,fcc2b3d0
,eb5c5d2b
,49ecf623
,26e3fb7b
,d319cf5f
,1d563e83
,221cb0a9
]:- @lit/reactive-element@1.1.0
- lit@2.1.0
- lit-html@2.1.0
- lit-element@3.1.0
- #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 thethis.isConnected
flag duringupdate
to ensure that e.g. subscriptions that could lead to memory leaks are not made when AsyncDirectives update while disconnected.
-
#2120
2043eb0f
- Don't assign DOM shim window.global (and hence globalThis.global) to windowThis 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
-
#1972
a791514b
- Properties that must remain unminified are now compatible with build tools other than rollup/terser. -
Updated dependencies [
ff0d1556
,b3121ab7
,15a8356d
,d6b385e3
,5768cc60
,8189f094
,b4bd9f7c
,69389958
,5fabe2b5
,52a47c7e
,5b2f3642
,08f60328
,7adfbb0c
,d8ff5901
,5fabe2b5
,24feb430
,5fabe2b5
,5fabe2b5
,0b4d6eda
,13d137e9
,f05be301
,01353317
,a48f39c8
,5fabe2b5
,724a9aab
,0d703bfb
,56e8efd3
,0312f3e5
,e5667d66
,cc5c3a09
,662209c3
,043a16fb
,761375ac
,a791514b
,5fabe2b5
]:- lit-html@2.0.0
- @lit-labs/ssr-client@1.0.0
- lit@2.0.0
- lit-element@3.0.0
-
#2120
2043eb0f
- Don't assign DOM shim window.global (and hence globalThis.global) to windowThis 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
- #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 thethis.isConnected
flag duringupdate
to ensure that e.g. subscriptions that could lead to memory leaks are not made when AsyncDirectives update while disconnected.
-
#1972
a791514b
- Properties that must remain unminified are now compatible with build tools other than rollup/terser. -
Updated dependencies [
ff0d1556
,5768cc60
,69389958
,5fabe2b5
,52a47c7e
,5fabe2b5
,5fabe2b5
,5fabe2b5
,f05be301
,5fabe2b5
,56e8efd3
,662209c3
,a791514b
,5fabe2b5
]:- lit-html@2.0.0-rc.4
Changes below were based on the Keep a Changelog format. All changes above are generated automatically by Changesets.
-
Added
render-global
module for non-sandboxed rendering. -
Added
elementRenderers
option toRenderInfo
, along withstatic matchesClass()
method toElementRenderer
, allowing the default renderer(s) to be overridden. -
Added
defer-hydration
attribute handling, which helps coordinate ordered wakeup of custom elements during hydration.