Skip to content

Commit

Permalink
Flip site to v3 as the latest Lit version (#1194)
Browse files Browse the repository at this point in the history
* flip site to v3 as the latestVersion

* add updated goldens

* fix integration test

* remove linux goldens

* flip default playground to v3

This flips tutorials, and samples.

* Very rough draft of 3.0 blog post (#1196)


Co-authored-by: Andrew Jakubowicz <[email protected]>
Co-authored-by: Augustine Kim <[email protected]>

* Typo fixes to release blog

* Update screenshot goldens

* Add Lit 3 release banner

* fix link to blog post

* Fill task section of release blog

* Fix old redirect urls

* Update known good urls

* Redirects don't work with hash urls

* Apply suggestions from code review

Co-authored-by: Peter Burns <[email protected]>

* Some update to 3.0 section

* First draft of Context section

* Apply suggestions from code review

Co-authored-by: Peter Burns <[email protected]>

* Apply suggestions from code review

Co-authored-by: Peter Burns <[email protected]>

* Apply suggestions from code review

Co-authored-by: Peter Burns <[email protected]>

* Add signals section

* whitespace

* Add end section

* Update packages/lit-dev-content/site/blog/2023-10-10-lit-3.0.md

Co-authored-by: Andrew Jakubowicz <[email protected]>

* Apply suggestions from code review

Co-authored-by: Peter Burns <[email protected]>
Co-authored-by: Augustine Kim <[email protected]>

* Apply suggestions from code review

Co-authored-by: Augustine Kim <[email protected]>

* Update packages/lit-dev-content/site/blog/2023-10-10-lit-3.0.md

Co-authored-by: Justin Fagnani <[email protected]>

---------

Co-authored-by: Justin Fagnani <[email protected]>
Co-authored-by: Augustine Kim <[email protected]>
Co-authored-by: Peter Burns <[email protected]>
  • Loading branch information
4 people authored Oct 10, 2023
1 parent c0a4a63 commit d5c093d
Show file tree
Hide file tree
Showing 49 changed files with 307 additions and 27 deletions.
2 changes: 1 addition & 1 deletion packages/lit-dev-content/samples/base.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "/samples/v2-base.json"
"extends": "/samples/v3-base.json"
}
7 changes: 1 addition & 6 deletions packages/lit-dev-content/site/_includes/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,12 @@

{% include 'header.html' %}

{% if selectedVersion !== latestVersion and selectedVersion !== "v3" %}
{% if selectedVersion !== latestVersion %}
<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-09-27-lit-3.0-prerelease-2/">here</a>.
</litdev-banner>
{% endif %}

<main {% if not page.url.includes('/docs/')
Expand Down
264 changes: 264 additions & 0 deletions packages/lit-dev-content/site/blog/2023-10-10-lit-3.0.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion packages/lit-dev-content/site/docs/v2/v2.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"collection": "docs-v2"
"collection": "docs-v2",
"selectedVersion": "v2"
}
2 changes: 1 addition & 1 deletion packages/lit-dev-content/site/home/1-splash.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<section id="new-banner">
<p><span class="emoji">📣</span> Have a question, or looking to chat? Join our <a href="{{site.baseurl}}/discord/">Discord server!</a></p>
<p><span class="emoji">📣</span> Lit 3 just landed! Check out the <a href="/blog/2023-10-10-lit-3.0/">Lit 3 release announcement!</a></p>
</section>
<section id="intro">
<div id="splashLogo" role="heading" aria-level="1">
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions packages/lit-dev-content/site/site.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"selectedVersion": "v2",
"latestVersion": "v2",
"selectedVersion": "v3",
"latestVersion": "v3",
"versions": {
"v3": {
"path": "/docs/v3",
"path": "/docs",
"label": "v3"
},
"v2": {
"path": "/docs",
"path": "/docs/v2",
"label": "v2"
},
"v1": {
Expand Down
23 changes: 13 additions & 10 deletions packages/lit-dev-server/src/redirects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,29 @@ export const pageRedirects = new Map([
['/msg/dev-mode', '/docs/tools/development/#development-and-production-builds'],
// TODO(sorvell) https://github.com/lit/lit.dev/issues/455
['/msg/multiple-versions', '/docs/tools/requirements/'],
['/msg/polyfill-support-missing', '/docs/tools/requirements/#polyfills'],
['/msg/polyfill-support-missing', '/docs/v2/tools/requirements/#polyfills'],
['/msg/class-field-shadowing', '/docs/components/properties/#avoiding-issues-with-class-fields'],
// TODO(aomarks) Should we add something specifically about this issue?
['/msg/change-in-update', '/docs/components/properties/#when-properties-change'],
['/msg/deprecated-import-path', '/docs/releases/upgrade/#update-packages-and-import-paths'],
['/msg/removed-api', '/docs/releases/upgrade/#litelement'],
['/msg/renamed-api', '/docs/releases/upgrade/#update-to-renamed-apis'],
['/msg/undefined-attribute-value', '/docs/releases/upgrade/#litelement'],
['/msg/request-update-promise', '/docs/releases/upgrade/#litelement'],
['/msg/deprecated-import-path', '/docs/v2/releases/upgrade/#update-packages-and-import-paths'],
['/msg/removed-api', '/docs/v2/releases/upgrade/#litelement'],
['/msg/renamed-api', '/docs/v2/releases/upgrade/#update-to-renamed-apis'],
['/msg/undefined-attribute-value', '/docs/v2/releases/upgrade/#litelement'],
['/msg/request-update-promise', '/docs/v2/releases/upgrade/#litelement'],
['/msg/expression-in-template', '/docs/templates/expressions/#invalid-locations'],
['/msg/expression-in-textarea', '/docs/templates/expressions/#invalid-locations'],
// Relocated pages
['/docs/libraries/localization', '/docs/localization/overview/'],
['/blog/feed.xml', '/blog/atom.xml'],
// Urls not ending with '/' violate CSP policies.
['/docs/releases/release-notes/1.3.0.html', '/docs/releases/release-notes/1.3.0/'],
['/docs/releases/release-notes/1.2.0.html', '/docs/releases/release-notes/1.2.0/'],
['/docs/releases/release-notes/1.3.0.html', '/docs/v2/releases/release-notes/1.3.0/'],
['/docs/releases/release-notes/1.2.0.html', '/docs/v2/releases/release-notes/1.2.0/'],
// `.0` is treated as a file extension, ensure it resolves correctly.
['/docs/releases/release-notes/1.3.0', '/docs/releases/release-notes/1.3.0/'],
['/docs/releases/release-notes/1.2.0', '/docs/releases/release-notes/1.2.0/'],
['/docs/releases/release-notes/1.3.0', '/docs/v2/releases/release-notes/1.3.0/'],
['/docs/releases/release-notes/1.2.0', '/docs/v2/releases/release-notes/1.2.0/'],
// Old release-notes redirects to new v2 location.
['/docs/releases/release-notes/1.3.0/', '/docs/v2/releases/release-notes/1.3.0/'],
['/docs/releases/release-notes/1.2.0/', '/docs/v2/releases/release-notes/1.2.0/'],
// Old Lit tutorial redirect to new tutorial catalog
['/tutorial/', '/tutorials/'],
].map(([path, redir]) => [
Expand Down
17 changes: 17 additions & 0 deletions packages/lit-dev-tests/known-good-urls.txt
Original file line number Diff line number Diff line change
Expand Up @@ -497,3 +497,20 @@ https://docs.astro.build/en/guides/integrations-guide/lit/
https://rocket.modern-web.dev/
https://stackblitz.com/edit/lit-ssr-global?file=src/server.js
https://twitter.com/techytacos
https://github.com/itsdouges/typescript-transformer-handbook#the-basics
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
https://developer.mozilla.org/en-US/docs/Glossary/Primitive
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/extends#mix-ins
https://github.com/webcomponents-cg/community-protocols/blob/main/proposals/context.md
https://www.w3.org/community/webcomponents/
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
https://developer.mozilla.org/en-US/docs/Web/API/AbortController
https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
https://developer.mozilla.org/en-US/docs/Web/API/fetch
https://developer.mozilla.org/en-US/docs/Web/CSS/display#box
https://github.com/google/safe-html-types/blob/master/doc/safehtml-types.md
https://devblogs.microsoft.com/typescript/announcing-typescript-5-2/#decorator-metadata
https://preactjs.com/guide/v10/signals/
https://www.youtube.com/watch?v=l6Gn5uV83sw
https://github.com/e111077
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ test.describe('docs/components/styles', () => {

// Wait for the exact playground preview we want to load.
await page.waitForSelector(
'litdev-example[project="v2-docs/components/style/superstyles"] playground-preview [part="preview-loading-indicator"][aria-hidden="true"]'
'litdev-example[project="v3-docs/components/style/superstyles"] playground-preview [part="preview-loading-indicator"][aria-hidden="true"]'
);
// Wait for the loading bar to fade out.
await page.waitForTimeout(250);

await expect(
await page
.locator(
'litdev-example[project="v2-docs/components/style/superstyles"] playground-preview'
'litdev-example[project="v3-docs/components/style/superstyles"] playground-preview'
)
.screenshot()
).toMatchSnapshot('inheritingStylesPlaygroundPreview.png');
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/lit-dev-tools-esm/src/build-unversioned-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const CONTENT_PKG = pathlib.resolve(REPO_ROOT, 'packages', 'lit-dev-content');
const SITE_JSON = pathlib.resolve(CONTENT_PKG, 'site', 'site.json');

interface SiteJSON {
latestVersion: 'v1' | 'v2';
latestVersion: 'v1' | 'v2' | 'v3';
}

type EleventyFrontMatterData = string[];
Expand Down Expand Up @@ -44,7 +44,7 @@ const UNVERSIONED_VERSION_LOCATION = pathlib.resolve(
*
* The following transforms are then applied on the files:
* - Permalink frontmatter is added to strip the version from the URL. E.g.,
* /docs/v2/* becomes /docs/*.
* /docs/v3/* becomes /docs/*.
* - `api.html` has frontmatter transformed so base api paths become
* unversioned.
* - The latest version `v[N].json` file is renamed `unversioned.json` so it
Expand Down

0 comments on commit d5c093d

Please sign in to comment.