Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6615bb6
Copy over all unversioned content into a versioned directory
AndrewJakubowicz May 9, 2023
19a07fb
Add initial build-unversioned-docs script.
AndrewJakubowicz May 10, 2023
abfec32
Fix wireit so npm run dev doesnt spin infinitely.
AndrewJakubowicz May 10, 2023
e56c92b
Add rel=canonical link from latestVersion to unversioned page.
AndrewJakubowicz May 10, 2023
487ac0c
Make all authored cross links versioned.
AndrewJakubowicz May 10, 2023
1901713
Add fixUnversionedCrossLinks so unversioned cross-linking work.
AndrewJakubowicz May 10, 2023
d8fe522
Add integration tests checking added features.
AndrewJakubowicz May 10, 2023
99bc58d
unblock failing link by adding it to the known good list.
AndrewJakubowicz May 10, 2023
132a32c
Fix api shortcode such that it uses a versioned URL
AndrewJakubowicz May 10, 2023
116eb04
Apply code review feedback. Thank you!
AndrewJakubowicz May 11, 2023
191905a
Code review feedback from Justin
AndrewJakubowicz May 12, 2023
6b7e419
Add undiscoverable v3 generated documentation.
AndrewJakubowicz May 11, 2023
6bd0076
Explicitly bump node heap size.
AndrewJakubowicz May 11, 2023
7d6c201
Add types/codemirror to fix TS 5 error.
AndrewJakubowicz May 11, 2023
dba2615
Remove unneeded dependency
AndrewJakubowicz May 12, 2023
73b5ed3
Code review feedback with Wireit env.
AndrewJakubowicz May 12, 2023
1c359db
Fix formatting & filter out v3/api/index.html page
AndrewJakubowicz May 12, 2023
b3a7c73
Merge branch 'main' of github.com:lit/lit.dev into version-v3-pre
AndrewJakubowicz May 12, 2023
d1b2b73
Copy over v2 docs to v3 unchanged.
AndrewJakubowicz May 12, 2023
60e66a3
Add banner and config
AndrewJakubowicz May 12, 2023
ca73955
Fix all cross links in v3 docs to be v3 specific.
AndrewJakubowicz May 12, 2023
d5bf37b
Add Lit 3.0 upgrade guide - first attempt.
AndrewJakubowicz May 12, 2023
22fc70d
Merge branch 'main' of github.com:lit/lit.dev into version-v3-docs
AndrewJakubowicz May 15, 2023
586b050
Add v3 to the Lit.dev dropdown.
AndrewJakubowicz May 15, 2023
6108ce5
Upstream ssr client-usage docs to v3 page.
AndrewJakubowicz May 15, 2023
b8bfeeb
Remove pre-release v3 docs from search index
AndrewJakubowicz May 15, 2023
d13180f
Add version links so that v2 <-> v3 changing doesnt change page.
AndrewJakubowicz May 15, 2023
62e4b98
Update tools section for v3 (#1118)
augustjk May 15, 2023
de6d620
Add pre-releases banner content to v3 banner.
AndrewJakubowicz May 15, 2023
13c9807
Merge branch 'version-v3-docs' of github.com:lit/lit.dev into version…
AndrewJakubowicz May 15, 2023
00cfb49
Update packages/lit-dev-content/site/docs/v3/releases/upgrade.md
AndrewJakubowicz May 15, 2023
e9a53fd
Update packages/lit-dev-content/site/docs/v3/releases/upgrade.md
AndrewJakubowicz May 15, 2023
08cdc7d
Lit 3.0 pre-releases blog post (#1115)
justinfagnani May 15, 2023
5417170
Remove a small paragraph that didn't really make sense from upgrade.
AndrewJakubowicz May 15, 2023
bd43fdd
Add missing word "can".
AndrewJakubowicz May 15, 2023
74a54e0
Fix blog dropdown referring 3.0 -> v3
augustjk May 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/lit-dev-content/.eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,14 @@ ${content}
});
};

addApiShortcode(
'api-v3',
'/docs/v3/api',
JSON.parse(
fsSync.readFileSync('../lit-dev-api/api-data/lit-3/symbols.json', 'utf8')
)
);

addApiShortcode(
'api',
'/docs/v2/api',
Expand Down
11 changes: 9 additions & 2 deletions packages/lit-dev-content/site/_includes/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
{% endif %}
{% inlinejs "global/dsd-polyfill.js" %}

{% if selectedVersion !== latestVersion %}
{% if selectedVersion == "v1" %}
<link rel="canonical" href="{{ versions[latestVersion].path }}/{{ versionLinks[latestVersion] }}">
{% endif %}
{% if selectedVersion !== latestVersion %}
{% inlinejs "components/litdev-banner.js" %}
{% endif %}

Expand Down Expand Up @@ -65,12 +67,17 @@

{% include 'header.html' %}

{% if selectedVersion !== latestVersion %}
{% if selectedVersion !== latestVersion and selectedVersion !== "v3" %}
<litdev-banner>
You're viewing docs for an older version of Lit. Click
<a href="{{ versions[latestVersion].path }}/{{ versionLinks[latestVersion] }}">
here</a> for the latest version.
</litdev-banner>
{% elif selectedVersion === "v3" %}
<litdev-banner>
You're viewing docs for a pre-release version of Lit. Read the Lit 3.0 pre-releases
announcement <a href="/blog/2023-05-15-lit-3.0-prerelease/">here</a>.
</litdev-banner>
{% endif %}

<main {% if not page.url.includes('/docs/')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
tags: blogPosts
layout: blog-post.html
title: "Announcing Lit 3.0 Pre-releases"
summary: "Get an early look at the upcoming Lit 3.0 release."
date: 2023-05-15
author:
- justin-fagnani
---

# Announcing Lit 3.0 Pre-releases

The Lit team is excited to announce the first pre-releases of Lit 3.0!

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.

But the time is right for just a few breaking changes that will improve development velocity and testing stability on the core Lit project.

## Changes

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.

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!

Here are the biggest things Lit 3.0 changes:
- IE11 is no longer supported.
- Lit's npm modules are now published as ES2021.
- APIs deprecated during the Lit 1.x release timeframe have been removed.
- SSR hydration support modules were moved to the `@lit-labs/ssr-client` package.

A preview of the [Lit v2 to v3 upgrade guide](/docs/v3/releases/upgrade/) is available on the site.

Detailed change logs can be found [on GitHub](https://github.com/lit/lit/releases?q=%22-pre.0%22&expanded=true).

## Trying the Pre-releases

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.

You can try the pre-releases out by updating your package.json file to include the following:

```json
"lit": "^3.0.0-pre.0"
"lit-html": "^3.0.0-pre.0"
"lit-element": "^4.0.0-pre.0"
"@lit/reactive-element": "^2.0.0-pre.0"
```

You can also use the `pre` npm tag, like `npm i lit@pre`.

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.

Even if dependencies are using Lit 2.x, the good news is that Lit 2.x and Lit 3.x are interoperable, because:
1. The inherent interoperability web components: components built with different libraries work together, including those build with different versions of Lit.
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.

## Docs

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.

## Feedback

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/).

**Thanks!,**

**-The Lit Team**
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ eleventyNavigation:
order: 8
versionLinks:
v1: components/decorators/
v3: components/decorators/
---

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ eleventyNavigation:
order: 1
versionLinks:
v1: components/templates/
v3: components/defining/
---

Define a Lit component by creating a class extending `LitElement` and registering your class with the browser:
Expand Down
1 change: 1 addition & 0 deletions packages/lit-dev-content/site/docs/v2/components/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ eleventyNavigation:
order: 7
versionLinks:
v1: components/events/
v3: components/events/
---

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ eleventyNavigation:
order: 5
versionLinks:
v1: components/lifecycle/
v3: components/lifecycle/
---

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ eleventyNavigation:
order: 0
versionLinks:
v1: components/templates/
v3: components/overview/
---

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ eleventyNavigation:
order: 3
versionLinks:
v1: components/properties/
v3: components/properties/
---

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ eleventyNavigation:
order: 2
versionLinks:
v1: components/templates/
v3: components/rendering/
---

Add a template to your component to define what it should render. Templates can include _expressions_, which are placeholders for dynamic content.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ eleventyNavigation:
order: 6
versionLinks:
v1: components/templates/#accessing-nodes-in-the-shadow-dom
v3: components/shadow-dom/
---

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.
Expand Down
1 change: 1 addition & 0 deletions packages/lit-dev-content/site/docs/v2/components/styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ eleventyNavigation:
order: 4
versionLinks:
v1: components/styles/
v3: components/styles/
---

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
parent: Composition
key: Component composition
order: 2
versionLinks:
v3: composition/component-composition/
---

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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
parent: Composition
key: Controllers
order: 4
versionLinks:
v3: composition/controllers/
---

Lit 2 introduces a new concept for code reuse and composition called _reactive controllers_.
Expand Down
2 changes: 2 additions & 0 deletions packages/lit-dev-content/site/docs/v2/composition/mixins.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
parent: Composition
key: Mixins
order: 3
versionLinks:
v3: composition/mixins/
---

Class mixins are a pattern for sharing code between classes using standard JavaScript. As opposed to "has-a" composition patterns like [reactive
Expand Down
2 changes: 2 additions & 0 deletions packages/lit-dev-content/site/docs/v2/composition/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
parent: Composition
key: Overview
order: 1
versionLinks:
v3: composition/overview/
---

Composition is a strategy for managing complexity and organizing code into reusable pieces. Lit provides a few options for composition and code reuse:
Expand Down
2 changes: 2 additions & 0 deletions packages/lit-dev-content/site/docs/v2/data/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ eleventyNavigation:
parent: Managing Data
order: 1
labs: true
versionLinks:
v3: data/context/
---

{% labs-disclaimer %}
Expand Down
2 changes: 2 additions & 0 deletions packages/lit-dev-content/site/docs/v2/frameworks/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ eleventyNavigation:
parent: Frameworks
order: 1
labs: true
versionLinks:
v3: frameworks/react/
---

{% labs-disclaimer %}
Expand Down
1 change: 1 addition & 0 deletions packages/lit-dev-content/site/docs/v2/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ eleventyNavigation:
order: 3
versionLinks:
v1: getting-started/
v3: getting-started/
---

There are many ways to get started using Lit, from our Playground and interactive tutorial to installing into an existing project.
Expand Down
1 change: 1 addition & 0 deletions packages/lit-dev-content/site/docs/v2/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ eleventyNavigation:
order: 1
versionLinks:
v1:
v3:
---

![Lit Logo]({{ site.baseurl }}/images/logo.svg){.logo width="425" height="200"}
Expand Down
2 changes: 2 additions & 0 deletions packages/lit-dev-content/site/docs/v2/libraries/labs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ eleventyNavigation:
parent: Related libraries
order: 3
labs: true
versionLinks:
v3: libraries/labs/
---

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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
key: Standalone lit-html
parent: Related libraries
order: 1
versionLinks:
v3: libraries/standalone-templates/
---

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
key: Best practices
parent: Localization
order: 5
versionLinks:
v3: localization/best-practices/
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
key: CLI and config
parent: Localization
order: 4
versionLinks:
v3: localization/cli-and-config/
---

## CLI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
key: Overview
parent: Localization
order: 1
versionLinks:
v3: localization/overview/
---

Localization is the process of supporting multiple languages and regions in your
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
key: Runtime mode
parent: Localization
order: 2
versionLinks:
v3: localization/runtime-mode/
---

In Lit Localize runtime mode, one JavaScript or TypeScript module is generated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
key: Transform mode
parent: Localization
order: 3
versionLinks:
v3: localization/transform-mode/
---

In Lit Localize transform mode, a separate folder is generated for each locale.
Expand Down
2 changes: 2 additions & 0 deletions packages/lit-dev-content/site/docs/v2/releases/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
key: Upgrade guide
parent: Releases
order: 3
versionLinks:
v3: releases/upgrade/
---

## Overview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ eleventyNavigation:
order: 1
versionLinks:
v1: resources/community/
v3: resources/community/
---

There are many great resources and locations to learn about Lit,
Expand Down
2 changes: 2 additions & 0 deletions packages/lit-dev-content/site/docs/v2/ssr/authoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
key: Authoring components
parent: Server rendering
order: 4
versionLinks:
v3: ssr/authoring/
---

{% labs-disclaimer %}
Expand Down
2 changes: 2 additions & 0 deletions packages/lit-dev-content/site/docs/v2/ssr/client-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
key: Client usage
parent: Server rendering
order: 3
versionLinks:
v3: ssr/client-usage/
---

{% labs-disclaimer %}
Expand Down
2 changes: 2 additions & 0 deletions packages/lit-dev-content/site/docs/v2/ssr/dom-emulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
key: DOM emulation
parent: Server rendering
order: 5
versionLinks:
v3: ssr/dom-emulation/
---

{% labs-disclaimer %}
Expand Down
2 changes: 2 additions & 0 deletions packages/lit-dev-content/site/docs/v2/ssr/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
key: Overview
parent: Server rendering
order: 1
versionLinks:
v3: ssr/overview/
---

{% labs-disclaimer %}
Expand Down
2 changes: 2 additions & 0 deletions packages/lit-dev-content/site/docs/v2/ssr/server-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ eleventyNavigation:
key: Server usage
parent: Server rendering
order: 2
versionLinks:
v3: ssr/server-usage/
---

{% labs-disclaimer %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ eleventyNavigation:
order: 3
versionLinks:
v1: components/templates/#use-properties-loops-and-conditionals-in-a-template
v3: templates/conditionals/
---

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ eleventyNavigation:
order: 6
versionLinks:
v1: lit-html/creating-directives/
v3: templates/custom-directives/
---

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.
Expand Down
Loading