lit-html
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -20,2 +20,8 @@ # Change Log | ||
## [1.4.0] - 2021-04-26 | ||
### Added | ||
* The lit-html 2.0 directive API has been added in order to enable writing libraries that work against both lit-html 1.4 and 2.0, easing upgrades. ([#1654](https://github.com/Polymer/lit-html/pull/1654)) See the [README](./README.md) for more information. | ||
## [1.3.0] - 2020-08-19 | ||
@@ -22,0 +28,0 @@ |
@@ -47,3 +47,3 @@ /** | ||
if (typeof window !== 'undefined') { | ||
(window['litHtmlVersions'] || (window['litHtmlVersions'] = [])).push('1.3.0'); | ||
(window['litHtmlVersions'] || (window['litHtmlVersions'] = [])).push('1.4.0'); | ||
} | ||
@@ -50,0 +50,0 @@ /** |
{ | ||
"name": "lit-html", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "HTML template literals in JavaScript", | ||
@@ -47,3 +47,2 @@ "license": "BSD-3-Clause", | ||
"author": "The Polymer Authors", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
@@ -50,0 +49,0 @@ "@types/chai": "^4.1.0", |
# lit-html | ||
Efficient, Expressive, Extensible HTML templates in JavaScript | ||
[![Build Status](https://travis-ci.org/Polymer/lit-html.svg?branch=master)](https://travis-ci.org/Polymer/lit-html) | ||
[![Build Status](https://travis-ci.org/lit/lit.svg?branch=lit-html-1.4.x)](https://travis-ci.org/Polymer/lit-html) | ||
[![Published on npm](https://img.shields.io/npm/v/lit-html.svg)](https://www.npmjs.com/package/lit-html) | ||
[![Join our Slack](https://img.shields.io/badge/slack-join%20chat-4a154b.svg)](https://www.polymer-project.org/slack-invite) | ||
[![Mentioned in Awesome lit-html](https://awesome.re/mentioned-badge.svg)](https://github.com/web-padawan/awesome-lit-html) | ||
[![Join our Slack](https://img.shields.io/badge/slack-join%20chat-4a154b.svg)](https://lit.dev/slack-invite/) | ||
[![Mentioned in Awesome Lit](https://awesome.re/mentioned-badge.svg)](https://github.com/web-padawan/awesome-lit) | ||
@@ -45,4 +45,31 @@ ## Documentation | ||
## Forward compatibility with lit-html 2.0 | ||
lit-html 2.0 has a new directive authoring API that has been back-ported to lit-html 1.4 in order to ease upgrading. | ||
The lit-html 2.0 directive API is available in new modules whose paths are the same in lit-html 1.4 and 2.0, allowing code to import and use the APIs against either version. | ||
You can import the new APIs like so: | ||
```ts | ||
import {html} from 'lit-html'; | ||
import {directive, Directive, Part, PartInfo, PartType} from 'lit-html/directive.js'; | ||
``` | ||
Then implement a directive class and convert it to a directive function: | ||
```ts | ||
class MyDirective extends Directive { | ||
// ... | ||
} | ||
/** My directive docs **/ | ||
export const myDirective = directive(MyDirective); | ||
``` | ||
**Important note:** The `AsyncDirective` base class is available, but lit-html 1.4 does _not_ implement the `disconnected` and `reconnected` callbacks. | ||
For more details on upgrading see the [Update custom directive implementations](https://lit.dev/docs/releases/upgrade/#update-custom-directive-implementations) guide. | ||
## Contributing | ||
Please see [CONTRIBUTING.md](./CONTRIBUTING.md). |
@@ -59,3 +59,3 @@ /** | ||
if (typeof window !== 'undefined') { | ||
(window['litHtmlVersions'] || (window['litHtmlVersions'] = [])).push('1.3.0'); | ||
(window['litHtmlVersions'] || (window['litHtmlVersions'] = [])).push('1.4.0'); | ||
} | ||
@@ -62,0 +62,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
667591
220
9877
75
0