Skip to content

Commit 00ebfa0

Browse files
AndrewJakubowiczaugustjkjustinfagnani
authored
Release Lit v3 pre-release docs with blog post (#1116)
* Copy over all unversioned content into a versioned directory The only file changed in the move is the root `docs.json` file. Instead a `v2.json` file was added. * Add initial build-unversioned-docs script. This copies over and adds the correct permalinks to the selected version content. Currently moving `v2` -> `unversioned`. * Fix wireit so npm run dev doesnt spin infinitely. * Add rel=canonical link from latestVersion to unversioned page. * Make all authored cross links versioned. Unversioned links will be generated automatically by the generated unversioned pages. * Add fixUnversionedCrossLinks so unversioned cross-linking work. This works by piping all the content through a function that will fix cross links on unversioned pages. * Add integration tests checking added features. * unblock failing link by adding it to the known good list. * Fix api shortcode such that it uses a versioned URL The versioned URL is stripped for unversioned URLs by our tooling. Add a test to confirm this behavior. * Apply code review feedback. Thank you! * Code review feedback from Justin - Replaced sync fs with async fs. - Made lightweight YAML parser more robust using regex. * Add undiscoverable v3 generated documentation. Currently the Lit 3 commit being used is d04a3e30eb3ae3520fb0ac163fb5ddbbf6030620 because lit/lit#3894 fixes building Lit 3. API docs are visible at /docs/api/v3/ * Explicitly bump node heap size. This will hopefully avoid the Github Actions failures. * Add types/codemirror to fix TS 5 error. Thank you Augustine! Re-ran generator with no content changes. * Remove unneeded dependency Co-authored-by: Augustine Kim <[email protected]> * Code review feedback with Wireit env. * Fix formatting & filter out v3/api/index.html page * Copy over v2 docs to v3 unchanged. * Add banner and config * Fix all cross links in v3 docs to be v3 specific. - Find replace all /v2/ with /v3/ - Replace api shortcode with api-v3 shortcode - linking to v3 api docs * Add Lit 3.0 upgrade guide - first attempt. * Add v3 to the Lit.dev dropdown. * Upstream ssr client-usage docs to v3 page. This makes the page a duplicate of the v2 page. Git for some reason did not include these changes when merging from main. * Remove pre-release v3 docs from search index * Add version links so that v2 <-> v3 changing doesnt change page. A user on v2 docs for a certain page should remain on that page when switching to v3 and vice-versa. This change makes it so switching between v2 and v3 will keep you on the same page, but provide the different versions of the page. Tested manually on every single page. * Update tools section for v3 (#1118) * Update tools section for v3 * Better wording for versions tested * Add pre-releases banner content to v3 banner. * Update packages/lit-dev-content/site/docs/v3/releases/upgrade.md Co-authored-by: Augustine Kim <[email protected]> * Update packages/lit-dev-content/site/docs/v3/releases/upgrade.md Co-authored-by: Augustine Kim <[email protected]> * Lit 3.0 pre-releases blog post (#1115) * Lit 3.0 pre-releases blog post * Apply suggestions from code review * Add link to upgrade guide --------- Co-authored-by: Augustine Kim <[email protected]> * Remove a small paragraph that didn't really make sense from upgrade. * Add missing word "can". * Fix blog dropdown referring 3.0 -> v3 --------- Co-authored-by: Augustine Kim <[email protected]> Co-authored-by: Justin Fagnani <[email protected]>
1 parent 09800da commit 00ebfa0

File tree

110 files changed

+11626
-155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+11626
-155
lines changed

packages/lit-dev-content/.eleventy.js

+8
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,14 @@ ${content}
445445
});
446446
};
447447

448+
addApiShortcode(
449+
'api-v3',
450+
'/docs/v3/api',
451+
JSON.parse(
452+
fsSync.readFileSync('../lit-dev-api/api-data/lit-3/symbols.json', 'utf8')
453+
)
454+
);
455+
448456
addApiShortcode(
449457
'api',
450458
'/docs/v2/api',

packages/lit-dev-content/site/_includes/default.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@
2828
{% endif %}
2929
{% inlinejs "global/dsd-polyfill.js" %}
3030

31-
{% if selectedVersion !== latestVersion %}
31+
{% if selectedVersion == "v1" %}
3232
<link rel="canonical" href="{{ versions[latestVersion].path }}/{{ versionLinks[latestVersion] }}">
33+
{% endif %}
34+
{% if selectedVersion !== latestVersion %}
3335
{% inlinejs "components/litdev-banner.js" %}
3436
{% endif %}
3537

@@ -65,12 +67,17 @@
6567

6668
{% include 'header.html' %}
6769

68-
{% if selectedVersion !== latestVersion %}
70+
{% if selectedVersion !== latestVersion and selectedVersion !== "v3" %}
6971
<litdev-banner>
7072
You're viewing docs for an older version of Lit. Click
7173
<a href="{{ versions[latestVersion].path }}/{{ versionLinks[latestVersion] }}">
7274
here</a> for the latest version.
7375
</litdev-banner>
76+
{% elif selectedVersion === "v3" %}
77+
<litdev-banner>
78+
You're viewing docs for a pre-release version of Lit. Read the Lit 3.0 pre-releases
79+
announcement <a href="/blog/2023-05-15-lit-3.0-prerelease/">here</a>.
80+
</litdev-banner>
7481
{% endif %}
7582

7683
<main {% if not page.url.includes('/docs/')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
tags: blogPosts
3+
layout: blog-post.html
4+
title: "Announcing Lit 3.0 Pre-releases"
5+
summary: "Get an early look at the upcoming Lit 3.0 release."
6+
date: 2023-05-15
7+
author:
8+
- justin-fagnani
9+
---
10+
11+
# Announcing Lit 3.0 Pre-releases
12+
13+
The Lit team is excited to announce the first pre-releases of Lit 3.0!
14+
15+
Lit 3.0 is our first major version since [introducing the unified Lit project and Lit 2.0](https://lit.dev/blog/2021-04-21-lit-2.0-meet-lit-all-over-again/) two years ago. We really value stability and backwards compatibility for our community, so we've focused on adding new features with minor versions of the core libraries and new labs packages, and not making any breaking changes.
16+
17+
But the time is right for just a few breaking changes that will improve development velocity and testing stability on the core Lit project.
18+
19+
## Changes
20+
21+
Lit 3.0 adds no new features, because new features are generally not breaking changes and can be added in minor versions, according to semver. The Lit 3.0 release is an opportunity to make a few breaking changes that trim out some technical debt to unlock new features we have scheduled for our 3.x release series.
22+
23+
The Lit 3.0 changes are mostly in browser support, removing deprecated APIs, and how packages are published. If you run Lit 2.x with no deprecation warnings, this should be a seamless upgrade!
24+
25+
Here are the biggest things Lit 3.0 changes:
26+
- IE11 is no longer supported.
27+
- Lit's npm modules are now published as ES2021.
28+
- APIs deprecated during the Lit 1.x release timeframe have been removed.
29+
- SSR hydration support modules were moved to the `@lit-labs/ssr-client` package.
30+
31+
A preview of the [Lit v2 to v3 upgrade guide](/docs/v3/releases/upgrade/) is available on the site.
32+
33+
Detailed change logs can be found [on GitHub](https://github.com/lit/lit/releases?q=%22-pre.0%22&expanded=true).
34+
35+
## Trying the Pre-releases
36+
37+
We would love your help testing the new versions, to ensure a smooth upgrade process with the final releases. We're especially interested in making sure the new language version works with your toolchains. We expect some users may need to upgrade their tooling to the latest versions.
38+
39+
You can try the pre-releases out by updating your package.json file to include the following:
40+
41+
```json
42+
"lit": "^3.0.0-pre.0"
43+
"lit-html": "^3.0.0-pre.0"
44+
"lit-element": "^4.0.0-pre.0"
45+
"@lit/reactive-element": "^2.0.0-pre.0"
46+
```
47+
48+
You can also use the `pre` npm tag, like `npm i lit@pre`.
49+
50+
All other packages, like labs packages, have pre-release versions too that depend on the pre-release core libraries. If you depend on those you'll have to update them too. If you're more daring you can use npm overrides to select the pre-releases even for dependencies. This should work for most dependencies.
51+
52+
Even if dependencies are using Lit 2.x, the good news is that Lit 2.x and Lit 3.x are interoperable, because:
53+
1. The inherent interoperability web components: components built with different libraries work together, including those build with different versions of Lit.
54+
2. We made interop of core features like templates and directives a priority for Lit 2. You can share templates, directives, decorators, etc., across Lit versions.
55+
56+
## Docs
57+
58+
We are preparing new docs for 3.0 on [lit.dev](https://lit.dev). Even though these will be mostly the same as 2.x, we are clarifying the browser and toolchain support, and want to make it easy to select the right docs set for the version you're using to enable future changes specific to to 3.x. At the 3.0 launch, we’ll archive the 2.x docs (but they will remain available in the doc version dropdown, as will 1.x). During the 3.0 pre-release phase, 2.x will remain the default, and you can select v3 from the dropdown next to the Documentation tab.
59+
60+
## Feedback
61+
62+
We hope you enjoy Lit 3.0! If you have questions or feedback, please let us know in [GitHub issues](https://github.com/lit/lit/issues) or on our [Lit and Friends Discord](https://lit.dev/discord/).
63+
64+
**Thanks!,**
65+
66+
**-The Lit Team**

packages/lit-dev-content/site/docs/v2/components/decorators.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ eleventyNavigation:
66
order: 8
77
versionLinks:
88
v1: components/decorators/
9+
v3: components/decorators/
910
---
1011

1112
Decorators are special functions that can modify the behavior of classes, class methods, and class fields. Lit uses decorators to provide declarative APIs for things like registering elements, reactive properties, and queries.

packages/lit-dev-content/site/docs/v2/components/defining.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ eleventyNavigation:
66
order: 1
77
versionLinks:
88
v1: components/templates/
9+
v3: components/defining/
910
---
1011

1112
Define a Lit component by creating a class extending `LitElement` and registering your class with the browser:

packages/lit-dev-content/site/docs/v2/components/events.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ eleventyNavigation:
66
order: 7
77
versionLinks:
88
v1: components/events/
9+
v3: components/events/
910
---
1011

1112
Events are the standard way that elements communicate changes. These changes typically occur due to user interaction. For example, a button dispatches a click event when a user clicks on it; an input dispatches a change event when the user enters a value in it.

packages/lit-dev-content/site/docs/v2/components/lifecycle.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ eleventyNavigation:
66
order: 5
77
versionLinks:
88
v1: components/lifecycle/
9+
v3: components/lifecycle/
910
---
1011

1112
Lit components use the standard custom element lifecycle methods. In addition Lit introduces a reactive update cycle that renders changes to DOM when reactive properties change.

packages/lit-dev-content/site/docs/v2/components/overview.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ eleventyNavigation:
66
order: 0
77
versionLinks:
88
v1: components/templates/
9+
v3: components/overview/
910
---
1011

1112
A Lit component is a reusable piece of UI. You can think of a Lit component as a container that has some state and that displays a UI based on its state. It can also react to user input, fire events—anything you'd expect a UI component to do. And a Lit component is an HTML element, so it has all of the standard element APIs.

packages/lit-dev-content/site/docs/v2/components/properties.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ eleventyNavigation:
66
order: 3
77
versionLinks:
88
v1: components/properties/
9+
v3: components/properties/
910
---
1011

1112
Lit components receive input and store their state as JavaScript class fields or properties. *Reactive properties* are properties that can trigger the reactive update cycle when changed, re-rendering the component, and optionally be read or written to attributes.

packages/lit-dev-content/site/docs/v2/components/rendering.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ eleventyNavigation:
66
order: 2
77
versionLinks:
88
v1: components/templates/
9+
v3: components/rendering/
910
---
1011

1112
Add a template to your component to define what it should render. Templates can include _expressions_, which are placeholders for dynamic content.

packages/lit-dev-content/site/docs/v2/components/shadow-dom.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ eleventyNavigation:
66
order: 6
77
versionLinks:
88
v1: components/templates/#accessing-nodes-in-the-shadow-dom
9+
v3: components/shadow-dom/
910
---
1011

1112
Lit components use [shadow DOM](https://developers.google.com/web/fundamentals/web-components/shadowdom) to encapsulate their DOM. Shadow DOM provides a way to add a separate isolated and encapsulated DOM tree to an element. DOM encapsulation is the key to unlocking interoperability with any other code—including other web components or Lit components—functioning on the page.

packages/lit-dev-content/site/docs/v2/components/styles.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ eleventyNavigation:
66
order: 4
77
versionLinks:
88
v1: components/styles/
9+
v3: components/styles/
910
---
1011

1112
Your component's template is rendered to its shadow root. The styles you add to your component are automatically _scoped_ to the shadow root and only affect elements in the component's shadow root.

packages/lit-dev-content/site/docs/v2/composition/component-composition.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
parent: Composition
55
key: Component composition
66
order: 2
7+
versionLinks:
8+
v3: composition/component-composition/
79
---
810

911
The most common way to handle complexity and factor Lit code into separate units is _component composition_: that is, the process of building a large, complex component out of smaller, simpler components. Imagine you've been tasked with implementing a screen of UI:

packages/lit-dev-content/site/docs/v2/composition/controllers.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
parent: Composition
55
key: Controllers
66
order: 4
7+
versionLinks:
8+
v3: composition/controllers/
79
---
810

911
Lit 2 introduces a new concept for code reuse and composition called _reactive controllers_.

packages/lit-dev-content/site/docs/v2/composition/mixins.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
parent: Composition
55
key: Mixins
66
order: 3
7+
versionLinks:
8+
v3: composition/mixins/
79
---
810

911
Class mixins are a pattern for sharing code between classes using standard JavaScript. As opposed to "has-a" composition patterns like [reactive

packages/lit-dev-content/site/docs/v2/composition/overview.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
parent: Composition
55
key: Overview
66
order: 1
7+
versionLinks:
8+
v3: composition/overview/
79
---
810

911
Composition is a strategy for managing complexity and organizing code into reusable pieces. Lit provides a few options for composition and code reuse:

packages/lit-dev-content/site/docs/v2/data/context.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ eleventyNavigation:
55
parent: Managing Data
66
order: 1
77
labs: true
8+
versionLinks:
9+
v3: data/context/
810
---
911

1012
{% labs-disclaimer %}

packages/lit-dev-content/site/docs/v2/frameworks/react.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ eleventyNavigation:
55
parent: Frameworks
66
order: 1
77
labs: true
8+
versionLinks:
9+
v3: frameworks/react/
810
---
911

1012
{% labs-disclaimer %}

packages/lit-dev-content/site/docs/v2/getting-started.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ eleventyNavigation:
66
order: 3
77
versionLinks:
88
v1: getting-started/
9+
v3: getting-started/
910
---
1011

1112
There are many ways to get started using Lit, from our Playground and interactive tutorial to installing into an existing project.

packages/lit-dev-content/site/docs/v2/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ eleventyNavigation:
66
order: 1
77
versionLinks:
88
v1:
9+
v3:
910
---
1011

1112
![Lit Logo]({{ site.baseurl }}/images/logo.svg){.logo width="425" height="200"}

packages/lit-dev-content/site/docs/v2/libraries/labs.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ eleventyNavigation:
55
parent: Related libraries
66
order: 3
77
labs: true
8+
versionLinks:
9+
v3: libraries/labs/
810
---
911

1012
Lit Labs is an umbrella for Lit packages under development that we are actively seeking feedback on. While we encourage real-world use in order to help the feedback process, please note:

packages/lit-dev-content/site/docs/v2/libraries/standalone-templates.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
key: Standalone lit-html
55
parent: Related libraries
66
order: 1
7+
versionLinks:
8+
v3: libraries/standalone-templates/
79
---
810

911
Lit combines the component model of LitElement with JavaScript template literal-based rendering into an easy-to-use package. However, the templating portion of Lit is factored into a standalone library called `lit-html`, which can be used outside of the Lit component model anywhere you need to efficiently render and update HTML.

packages/lit-dev-content/site/docs/v2/localization/best-practices.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
key: Best practices
55
parent: Localization
66
order: 5
7+
versionLinks:
8+
v3: localization/best-practices/
79
---
810

911

packages/lit-dev-content/site/docs/v2/localization/cli-and-config.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
key: CLI and config
55
parent: Localization
66
order: 4
7+
versionLinks:
8+
v3: localization/cli-and-config/
79
---
810

911
## CLI

packages/lit-dev-content/site/docs/v2/localization/overview.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
key: Overview
55
parent: Localization
66
order: 1
7+
versionLinks:
8+
v3: localization/overview/
79
---
810

911
Localization is the process of supporting multiple languages and regions in your

packages/lit-dev-content/site/docs/v2/localization/runtime-mode.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
key: Runtime mode
55
parent: Localization
66
order: 2
7+
versionLinks:
8+
v3: localization/runtime-mode/
79
---
810

911
In Lit Localize runtime mode, one JavaScript or TypeScript module is generated

packages/lit-dev-content/site/docs/v2/localization/transform-mode.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
key: Transform mode
55
parent: Localization
66
order: 3
7+
versionLinks:
8+
v3: localization/transform-mode/
79
---
810

911
In Lit Localize transform mode, a separate folder is generated for each locale.

packages/lit-dev-content/site/docs/v2/releases/upgrade.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
key: Upgrade guide
55
parent: Releases
66
order: 3
7+
versionLinks:
8+
v3: releases/upgrade/
79
---
810

911
## Overview

packages/lit-dev-content/site/docs/v2/resources/community.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ eleventyNavigation:
66
order: 1
77
versionLinks:
88
v1: resources/community/
9+
v3: resources/community/
910
---
1011

1112
There are many great resources and locations to learn about Lit,

packages/lit-dev-content/site/docs/v2/ssr/authoring.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
key: Authoring components
55
parent: Server rendering
66
order: 4
7+
versionLinks:
8+
v3: ssr/authoring/
79
---
810

911
{% labs-disclaimer %}

packages/lit-dev-content/site/docs/v2/ssr/client-usage.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
key: Client usage
55
parent: Server rendering
66
order: 3
7+
versionLinks:
8+
v3: ssr/client-usage/
79
---
810

911
{% labs-disclaimer %}

packages/lit-dev-content/site/docs/v2/ssr/dom-emulation.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
key: DOM emulation
55
parent: Server rendering
66
order: 5
7+
versionLinks:
8+
v3: ssr/dom-emulation/
79
---
810

911
{% labs-disclaimer %}

packages/lit-dev-content/site/docs/v2/ssr/overview.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
key: Overview
55
parent: Server rendering
66
order: 1
7+
versionLinks:
8+
v3: ssr/overview/
79
---
810

911
{% labs-disclaimer %}

packages/lit-dev-content/site/docs/v2/ssr/server-usage.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ eleventyNavigation:
44
key: Server usage
55
parent: Server rendering
66
order: 2
7+
versionLinks:
8+
v3: ssr/server-usage/
79
---
810

911
{% labs-disclaimer %}

packages/lit-dev-content/site/docs/v2/templates/conditionals.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ eleventyNavigation:
66
order: 3
77
versionLinks:
88
v1: components/templates/#use-properties-loops-and-conditionals-in-a-template
9+
v3: templates/conditionals/
910
---
1011

1112
Since Lit leverages normal Javascript expressions, you can use standard Javascript control flow constructs like [conditional operators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator), function calls, and `if` or `switch` statements to render conditional content.

packages/lit-dev-content/site/docs/v2/templates/custom-directives.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ eleventyNavigation:
77
order: 6
88
versionLinks:
99
v1: lit-html/creating-directives/
10+
v3: templates/custom-directives/
1011
---
1112

1213
Directives are functions that can extend Lit by customizing how a template expression renders. Directives are useful and powerful because they can be stateful, access the DOM, be notified when templates are disconnected and reconnected, and independently update expressions outside of a render call.

0 commit comments

Comments
 (0)