Skip to content

Commit

Permalink
Version Packages (#3556)
Browse files Browse the repository at this point in the history
  • Loading branch information
lit-robot committed Jan 9, 2023
1 parent c37bbb9 commit 304e461
Show file tree
Hide file tree
Showing 34 changed files with 173 additions and 110 deletions.
5 changes: 0 additions & 5 deletions .changeset/empty-cooks-clap.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fair-spiders-wave.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fast-insects-fix.md

This file was deleted.

12 changes: 0 additions & 12 deletions .changeset/healthy-pants-sit.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/loud-radios-change.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/modern-pans-jam.md

This file was deleted.

15 changes: 0 additions & 15 deletions .changeset/olive-shoes-relax.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/rich-icons-attack.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/sour-coins-design.md

This file was deleted.

17 changes: 0 additions & 17 deletions .changeset/thick-bees-approve.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/twenty-bugs-cheer.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/wet-shirts-turn.md

This file was deleted.

2 changes: 1 addition & 1 deletion packages/labs/cli/src/lib/lit-version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const litVersion = '2.5.0';
export const litVersion = '2.6.0';
2 changes: 1 addition & 1 deletion packages/labs/cli/test-goldens/init/js-named/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lit"
],
"dependencies": {
"lit": "^2.5.0"
"lit": "^2.6.0"
},
"devDependencies": {
"@web/dev-server": "^0.1.32"
Expand Down
2 changes: 1 addition & 1 deletion packages/labs/cli/test-goldens/init/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lit"
],
"dependencies": {
"lit": "^2.5.0"
"lit": "^2.6.0"
},
"devDependencies": {
"@web/dev-server": "^0.1.32"
Expand Down
2 changes: 1 addition & 1 deletion packages/labs/cli/test-goldens/init/ts-named/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lit"
],
"dependencies": {
"lit": "^2.5.0"
"lit": "^2.6.0"
},
"devDependencies": {
"@web/dev-server": "^0.1.32",
Expand Down
12 changes: 12 additions & 0 deletions packages/labs/eleventy-plugin-lit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @lit-labs/eleventy-plugin-lit

## 1.0.0

### Major Changes

- [#3522](https://github.com/lit/lit/pull/3522) [`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8) - The Lit SSR global DOM shim is no longer automatically loaded when rendering Lit components from Eleventy. When paired with the latest version of Lit, the global DOM shim is no longer typically required, because Lit now automatically imports shimmed versions of needed APIs.

### Patch Changes

- Updated dependencies [[`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8), [`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8), [`ff637f52`](https://github.com/lit/lit/commit/ff637f52a3c2252e37d6ea6ae352c3c0f35a9e87), [`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8), [`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8), [`c77220e8`](https://github.com/lit/lit/commit/c77220e80bc5b04628776ef8e5828fcde5f8ad16)]:
- @lit-labs/ssr@3.0.0
- lit@2.6.0

## 0.2.3

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/labs/eleventy-plugin-lit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lit-labs/eleventy-plugin-lit",
"version": "0.2.3",
"version": "1.0.0",
"description": "Eleventy plugin for rendering Lit components.",
"author": "Google LLC",
"license": "BSD-3-Clause",
Expand Down Expand Up @@ -90,8 +90,8 @@
}
},
"dependencies": {
"@lit-labs/ssr": "^2.0.1",
"lit": "^2.3.0"
"@lit-labs/ssr": "^3.0.0",
"lit": "^2.6.0"
},
"devDependencies": {
"@11ty/eleventy": "^1.0.0",
Expand Down
13 changes: 13 additions & 0 deletions packages/labs/ssr-dom-shim/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# @lit-labs/ssr-dom-shim

## 1.0.0

### Major Changes

- [#3522](https://github.com/lit/lit/pull/3522) [`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8) - 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 an `HTMLElement`, `CustomElementRegistry`, and default `customElements` 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 global `HTMLElement`, `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.
2 changes: 1 addition & 1 deletion packages/labs/ssr-dom-shim/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lit-labs/ssr-dom-shim",
"version": "0.0.1",
"version": "1.0.0",
"publishConfig": {
"access": "public"
},
Expand Down
46 changes: 46 additions & 0 deletions packages/labs/ssr/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
# Change Log

## 3.0.0

### Major Changes

- [#3522](https://github.com/lit/lit/pull/3522) [`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8) - ModuleLoader now provides a default VM global context object which provides basic globals that are available in both Node and browsers.

- [#3522](https://github.com/lit/lit/pull/3522) [`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8) - The SSR dom shim will now throw if a custom element is redefined.

- [#3431](https://github.com/lit/lit/pull/3431) [`ff637f52`](https://github.com/lit/lit/commit/ff637f52a3c2252e37d6ea6ae352c3c0f35a9e87) - The Lit SSR DOM shim no longer defines a global `window` 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 of `window`.

If you have code that runs during SSR which depends on the presence of `window`, you can either replace `window` with `globalThis`, or use `isSsr` to avoid running that code on the server (see https://lit.dev/docs/ssr/authoring/#browser-only-code).

- [#3467](https://github.com/lit/lit/pull/3467) [`c77220e8`](https://github.com/lit/lit/commit/c77220e80bc5b04628776ef8e5828fcde5f8ad16) - Allow SSR renderers to produce asynchronous values. This is a BREAKING change.

This changes the return type of `render()` and the `ElementRenderer` render methods to be a `RenderResult`, 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 Node `Readable` stream implementation that provides values from a `RenderResult`. This can be piped into a `Writable` stream, or passed to web server frameworks like Koa.

### Minor Changes

- [#3522](https://github.com/lit/lit/pull/3522) [`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8) - 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 an `HTMLElement`, `CustomElementRegistry`, and default `customElements` 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 global `HTMLElement`, `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](https://github.com/lit/lit/pull/3522) [`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8) - 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.

### Patch Changes

- Updated dependencies [[`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8)]:
- @lit-labs/ssr-dom-shim@1.0.0
- @lit/reactive-element@1.6.0
- lit-html@2.6.0
- lit@2.6.0

## 2.3.0

### Minor Changes
Expand Down
10 changes: 5 additions & 5 deletions packages/labs/ssr/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@lit-labs/ssr",
"type": "module",
"version": "2.3.0",
"version": "3.0.0",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -202,14 +202,14 @@
},
"dependencies": {
"@lit-labs/ssr-client": "^1.0.0",
"@lit-labs/ssr-dom-shim": "^0.0.1",
"@lit/reactive-element": "^1.5.0",
"@lit-labs/ssr-dom-shim": "^1.0.0",
"@lit/reactive-element": "^1.6.0",
"@parse5/tools": "^0.1.0",
"@types/node": "^16.0.0",
"enhanced-resolve": "^5.10.0",
"lit": "^2.5.0",
"lit": "^2.6.0",
"lit-element": "^3.1.0",
"lit-html": "^2.5.0",
"lit-html": "^2.6.0",
"node-fetch": "^3.2.8",
"parse5": "^7.1.1"
},
Expand Down
19 changes: 19 additions & 0 deletions packages/labs/testing/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# @lit-labs/testing

## 0.2.0

### Minor Changes

- [#3522](https://github.com/lit/lit/pull/3522) [`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8) - @lit-labs/testing no longer automatically loads the Lit SSR global DOM shim
when performing SSR, instead relying on newer versions of Lit which automatically
load necessary shims with minimal global pollution.

This may cause new or different test failures, because APIs such as `document`
will no longer be available on the server by default. Use `isServer` from the
`lit` package to guard against calling such APIs during SSR (see
https://lit.dev/docs/ssr/authoring/#browser-only-code for more information).

### Patch Changes

- Updated dependencies [[`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8), [`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8), [`ff637f52`](https://github.com/lit/lit/commit/ff637f52a3c2252e37d6ea6ae352c3c0f35a9e87), [`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8), [`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8), [`c77220e8`](https://github.com/lit/lit/commit/c77220e80bc5b04628776ef8e5828fcde5f8ad16)]:
- @lit-labs/ssr@3.0.0
- lit@2.6.0

## 0.1.1

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/labs/testing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lit-labs/testing",
"version": "0.1.1",
"version": "0.2.0",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -85,10 +85,10 @@
"lib/**/*.{d.ts,d.ts.map,js,js.map}"
],
"dependencies": {
"@lit-labs/ssr": "^2.2.0",
"@lit-labs/ssr": "^3.0.0",
"@web/test-runner-commands": "^0.6.1",
"@webcomponents/template-shadowroot": "^0.1.0",
"lit": "^2.3.0"
"lit": "^2.6.0"
},
"devDependencies": {
"@open-wc/testing": "^3.1.5"
Expand Down
12 changes: 12 additions & 0 deletions packages/lit-html/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Change Log

## 2.6.0

### Minor Changes

- [#3522](https://github.com/lit/lit/pull/3522) [`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8) - 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 an `HTMLElement`, `CustomElementRegistry`, and default `customElements` 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 global `HTMLElement`, `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.

## 2.5.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/lit-html/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lit-html",
"version": "2.5.0",
"version": "2.6.0",
"description": "HTML templates literals in JavaScript",
"license": "BSD-3-Clause",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/lit-html/src/lit-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2096,7 +2096,7 @@ polyfillSupport?.(Template, ChildPart);

// IMPORTANT: do not change the property name or the assignment expression.
// This line will be used in regexes to search for lit-html usage.
(global.litHtmlVersions ??= []).push('2.5.0');
(global.litHtmlVersions ??= []).push('2.6.0');
if (DEV_MODE && global.litHtmlVersions.length > 1) {
issueWarning!(
'multiple-versions',
Expand Down
18 changes: 18 additions & 0 deletions packages/lit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Change Log

## 2.6.0

### Minor Changes

- [#3522](https://github.com/lit/lit/pull/3522) [`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8) - 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 an `HTMLElement`, `CustomElementRegistry`, and default `customElements` 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 global `HTMLElement`, `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.

### Patch Changes

- Updated dependencies [[`72fcf0d7`](https://github.com/lit/lit/commit/72fcf0d70b4f4644e080e9c375a58cf8fc35e9e8)]:
- @lit/reactive-element@1.6.0
- lit-html@2.6.0

## 2.5.0

### Minor Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/lit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lit",
"version": "2.5.0",
"version": "2.6.0",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -337,9 +337,9 @@
"/logo.svg"
],
"dependencies": {
"@lit/reactive-element": "^1.5.0",
"@lit/reactive-element": "^1.6.0",
"lit-element": "^3.2.0",
"lit-html": "^2.5.0"
"lit-html": "^2.6.0"
},
"devDependencies": {
"@webcomponents/shadycss": "^1.8.0",
Expand Down

0 comments on commit 304e461

Please sign in to comment.