This repository was archived by the owner on Jul 26, 2023. It is now read-only.
Update dependency lit-html to v2 #118
Open
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.2.1Release Notes
lit/lit
v2.2.1Compare 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.0Compare Source
Minor Changes
2c9d0008- Added a devlog events system that may be used for debugging and visualizing Lit's internals.v2.1.3Compare 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 thesvgtagged template literal (TTL). The new documentation makes it more clear that thesvgtag function should only be used for SVG fragments, and not for the<svg>HTML element.v2.1.2Compare Source
Patch Changes
#2399
5ac025bf- Correct typo inasync-directivemodule comment#2410
b9a6962b- Correct the link path of CONTRIBUTING.md in README.md filesv2.1.1Compare Source
Patch Changes
5860533f- Fix choose directive jsdoc code example.v2.1.0Compare Source
Minor Changes
fcc2b3d0- Add akeyed(key, value)directive that clears a part if the key changes.d319cf5f- Addwhen,map,join, andrangedirectives.1d563e83- Add choose() directivePatch Changes
221cb0a9- Added an additional check to prevent spoofing of internal lit types in data bindings.v2.0.2Compare Source
Patch Changes
8bb33c88- Work around a Chrome bug with trusted types: https://crbug.com/9932685fc3818a- PreventpolyfillSupport.noPatchSupportedfrom implicitly beingany.Deduplicate types for
DevMode-suffixed polyfill support functions.v2.0.1Compare Source
Patch Changes
ba5e1391- Replace dynamic name lookups for polyfill support functions with static names.v2.0.0Compare Source
Major Changes
The
templateFactoryoption ofRenderOptionshas been removed.TemplateProcessorhas 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-rendermodule 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.styleElementis 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@applyfeature. 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
Directivebase class anddirective()factory function arenow exported from the
lit-html/directive.jsmodule.NodeParthas been renamed toChildPart,along with other methods and variables that use the "Node" naming, like
PartType.Nodewhich 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.jsto construct parts.The
eventContextrender option has been changed tohost.#2103
15a8356d- Updates theexportsfield ofpackage.jsonfiles 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
renderBeforeto render options. If specified, content is rendered before the node given via render options, e.g.{renderBefore: node}.developmentNode exports condition. See Development and production builds for more details.instanceofhas been removed, making rendering more likely towork when multiple instances of the library interact.
rendernow returns theChildPartthat was created/updated byrender.AsyncDirective, which is aDirectivesubclass whosedisconnectedcallback 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
setConnectedAPI, and whosereconnectedcallbackwill be called when manually re-connected using
setConnected. Whenimplementing
disconnected, thereconnectedcallback should also beimplemented to return the directive to a usable state. Note that
LitElementwill 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, thedisconnectedcallback 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'reconnectedcallback will be called prior to its nextupdate/rendercallbacks. Note that
LitElementwill call this method by default on therendered part in its
connectedCallbackanddisconnetedCallback.static-htmlmodule, a statichtmltag function, aliteraltag 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.jsmodule with helpers for creating custom directives. See Custom directives for more details.null,undefined, or empty string in aChildPartnow 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.noChangeare now unchanged. Thisallows the
guarddirective to guard directive values (#1519).creationScopetoRenderOptions, which controls the node from which the template is cloned from.Patch Changes
#1922
8189f094- BindingnoChangeinto 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-partyAsyncDirectives (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.1Compare Source
v1.4.0Compare Source
v1.3.0Compare Source
Changed
Added
shadyTemplateFactoryfromlib/shady-render.js(#1135)v1.2.1Compare Source
Fixed
v1.2.0Compare Source
Added
unsafeSVGdirective 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
classMapandstyleMapdirectives wouldn't render mutated objects. (#972)classMapdirective to set classes correctly on SVGs (#1070).Configuration
📅 Schedule: 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 WhiteSource Renovate. View repository job log here.