Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.1.2
->2.8.0
Release Notes
lit/lit (lit-html)
v2.8.0
Compare Source
Minor Changes
e2c50569
- Fix return type ofisTemplateResult
helper to include theCompiledTemplateResult
and fix thecache
directive to work correctly withCompiledTemplateResult
s. Also add an explicitisCompiledTemplateResult
helper.v2.7.5
Compare Source
Patch Changes
#3968
5bb40831
- Allow undefined to be passed to the ref() directive#3969
7d8d4a15
- Make RefOrCallback generic like Ref#3987
bb2560f1
- Change theh
field ofCompiledTemplate
s to aTemplateStringsArray
preventing the spoofing ofCompiledTemplate
s by JSON injection attacks. This should not be a breaking change for most users unless you're using CompiledTemplates. This is a necessary security fix, similar to #2307.v2.7.4
Compare Source
Patch Changes
0f30e6fb
- Fix a memory leak cause by lit-html's shared TreeWalker holding a reference to the last tree it walked.v2.7.3
Compare Source
Patch Changes
#3825
343187b1
-static-html
no longer adds an item toTemplateResult
's value array for the last consumed static value. This fixes an error with server-side rendering of static html.#3766
4431cbb8
- Fix styleMap initial render of mixed-case custom propsv2.7.2
Compare Source
Patch Changes
88fe0390
- Allow numbers to be used as values in styleMap()v2.7.1
Compare Source
Patch Changes
#3768
7c1191da
- Fix styleMap's handling of important flags#3720
575fb578
-lit-html/experimental-hydrate.js
andlit-element/experimental-hydrate-support.js
have been moved to@lit-labs/ssr-client
.The modules in the original location have been marked deprecated and will be removed in a future version.
v2.7.0
Compare Source
Minor Changes
#3667
e00f6f52
- [SSR only] 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.Patch Changes
#3615
4d698430
- Don't throw inChildPart.parentNode
if theparentNode
is null#3583
88a40177
- [SSR only] Add more detail to some hydration errorsv2.6.1
Compare Source
Patch Changes
65e56655
- Disable ShadyDOM noPatch in Node dev build. This fixes the issue of throwing due to undefinedwindow
.v2.6.0
Compare Source
Minor Changes
#3522
72fcf0d7
- When running in Node, Lit now automatically includes minimal DOM shims which aresufficient 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.v2.5.0
Compare Source
Minor Changes
b152db29
-lit-html
andreactive-element
now include development Node builds with unminified code and dev warnings.v2.4.0
Compare Source
Minor Changes
21313077
- Adds anisServer
variable export tolit
andlit-html/is-server.js
which will betrue
in Node andfalse
in the browser. This can be used when authoring components to change behavior based on whether or not the component is executing in an SSR context.v2.3.1
Compare Source
Patch Changes
5a65ca97
- Use existingdocument
in Node buildv2.3.0
Compare Source
Minor Changes
ae6f6808
- Lit and its underlying libraries can now be imported directly from Node without crashing, without the need to load the @lit-labs/ssr dom-shim library. Note that actually rendering from a Node context still requires the @lit-labs/ssr dom-shim, and the appropriate integration between @lit-labs/ssr and your framework/tool.Patch Changes
#3003
daddeb34
- Lit'sasync-directive
now re-exports everything from thedirective
module.#3199
0725fdb4
- In DEV_MODE, render a warning instead of rendering a template's host in the template.Most commonly this would happen when rendering
${this}
in a LitElement's template, which has the counterintuitive behavior of removing the element from the DOM, because when rendering the element's template we attach it into its own shadow root, which removes it from the DOM, causing it simply disappear. This is especially problematic with a fast HMR system.#3186
3766ae4c
-StaticValue
interface type is now exported.v2.2.7
Compare Source
Patch Changes
#3130
1f0567f1
- Export the underlying type of thekeyed
directive.#3132
2fe2053f
- Added "types" entry to package exports. This tells newer versions of TypeScript where to look for typings for each module.v2.2.6
Compare Source
Patch Changes
b12e8d93
- Expand documentation forrender
andTemplateResult
.v2.2.5
Compare Source
Patch Changes
a78cc3b7
- Fix SSR hydration bug relating to and other void elements having attribute bindings.v2.2.4
Compare Source
Patch Changes
#2847
79d82385
- Fix typo in API docs for live() directive.#2828
b3b6bc33
- Remove private Lit 2 migration helpers:INTERNAL
andclearContainerForLit2MigrationOnly
. This logic is no longer depended on.v2.2.3
Compare Source
Patch Changes
3e181bcb
- Enforce use of file extensions in imports. Fixes an issue with older TypeScript compilers.v2.2.2
Compare Source
Patch Changes
#2657
a6069c40
- Remove readonly restriction fromStyleInfo
interface as addition, deletion, and updating of styles is valid. ExpandedstyleMap
documentation with links to lit.dev.#2642
badc532c
- Add an additional security brand check to StaticValues; Similar to #2307#2691
171143bd
- Fixesref
bug when auto-bound class method used as a callback could incorrectly receiveundefined
.#2661
9a3a38cd
- Give a clearer error message when rendering into null/undefined#2646
365cd09a
- Clarify that hacking around the template strings array brand error can create security vulnerabilities.v2.2.1
Compare Source
Patch Changes
ae358703
- Make the event debug logger lazier, doing even less work (with no side effects) even in dev mode unless the page has opted in.v2.2.0
Compare Source
Minor Changes
2c9d0008
- Added a devlog events system that may be used for debugging and visualizing Lit's internals.v2.1.3
Compare Source
Patch Changes
#2498
2a1dc7a1
- Replace 'rare' with 'invalid' in svg tag function JSDocs.#2459
23df9d45
- Fix bindings inside of <title> elements#2479
89560520
- Expand JSDocs for thesvg
tagged template literal (TTL). The new documentation makes it more clear that thesvg
tag function should only be used for SVG fragments, and not for the<svg>
HTML element.v2.1.2
Compare Source
Patch Changes
#2399
5ac025bf
- Correct typo inasync-directive
module comment#2410
b9a6962b
- Correct the link path of CONTRIBUTING.md in README.md filesv2.1.1
Compare Source
Patch Changes
5860533f
- Fix choose directive jsdoc code example.v2.1.0
Compare Source
Minor Changes
fcc2b3d0
- Add akeyed(key, value)
directive that clears a part if the key changes.d319cf5f
- Addwhen
,map
,join
, andrange
directives.1d563e83
- Add choose() directivePatch Changes
221cb0a9
- Added an additional check to prevent spoofing of internal lit types in data bindings.v2.0.2
Compare Source
Patch Changes
8bb33c88
- Work around a Chrome bug with trusted types: https://crbug.com/9932685fc3818a
- PreventpolyfillSupport.noPatchSupported
from implicitly beingany
.Deduplicate types for
DevMode
-suffixed polyfill support functions.v2.0.1
Compare Source
Patch Changes
ba5e1391
- Replace dynamic name lookups for polyfill support functions with static names.v2.0.0
Compare Source
Major Changes
The
templateFactory
option ofRenderOptions
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 ofplatform-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, usearray.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 anddirective()
factory function arenow exported from the
lit-html/directive.js
module.NodePart
has been renamed toChildPart
,along with other methods and variables that use the "Node" naming, like
PartType.Node
which is nowPartType.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 indirective-helpers.js
to construct parts.The
eventContext
render option has been changed tohost
.#2103
15a8356d
- Updates theexports
field ofpackage.json
files to replace the subpathfolder
mapping
syntax with an explicit list of all exported files.
The
/
-suffixed syntax for subpath folder mapping originally used in thesefiles 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
renderBefore
to render options. If specified, content is rendered before the node given via render options, e.g.{renderBefore: node}
.development
Node exports condition. See Development and production builds for more details.instanceof
has been removed, making rendering more likely towork when multiple instances of the library interact.
render
now returns theChildPart
that was created/updated byrender
.AsyncDirective
, which is aDirective
subclass whosedisconnected
callback will be called when the part containing the directiveis cleared (or transitively cleared by a Part higher in the tree) or manually
disconnected using the
setConnected
API, and whosereconnected
callbackwill be called when manually re-connected using
setConnected
. Whenimplementing
disconnected
, thereconnected
callback should also beimplemented 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.
setConnected(isConnected: boolean)
toChildPart
; when called withfalse
, thedisconnected
callback will be run on any directives contained withinthe 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 nextupdate
/render
callbacks. Note that
LitElement
will call this method by default on therendered part in its
connectedCallback
anddisconnectedCallback
.static-html
module, a statichtml
tag function, aliteral
tag function, andunsafeStatic()
, which allows template authors to add strings to thestatic structure of the template, before it's parsed as HTML. See Static expressions for more details.
lit-html/directive-helpers.js
module with helpers for creating custom directives. See Custom directives for more details.null
,undefined
, or empty string in aChildPart
now has the same affect as renderingnothing
: 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.noChange
are now unchanged. Thisallows the
guard
directive to guard directive values (#1519).creationScope
toRenderOptions
, which controls the node from which the template is cloned from.Patch Changes
#1922
8189f094
- BindingnoChange
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 usinguntil()
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-partyAsyncDirective
s (until
,asyncAppend
,asyncReplace
) so that the directive (and any DOM associated with it) can be garbage collected before any promises they are awaiting resolve.v1.4.1
Compare Source
v1.4.0
Compare Source
v1.3.0
Compare Source
Changed
Added
shadyTemplateFactory
fromlib/shady-render.js
(#1135)v1.2.1
Compare Source
Fixed
v1.2.0
Compare Source
Added
unsafeSVG
directive to bind SVG source inside SVGs. (#304)templateContent()
directive for stamping out the contents of an HTML template into a text binding. (#1058)live()
directive. (#877)Fixed
classMap
andstyleMap
directives wouldn't render mutated objects. (#972)classMap
directive to set classes correctly on SVGs (#1070).Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.