Skip to content

Archive Lit 1 API content so we can upgrade generator for Lit 2 & 3#1087

Merged
AndrewJakubowicz merged 4 commits intomainfrom
update-docs
May 1, 2023
Merged

Archive Lit 1 API content so we can upgrade generator for Lit 2 & 3#1087
AndrewJakubowicz merged 4 commits intomainfrom
update-docs

Conversation

@AndrewJakubowicz
Copy link
Copy Markdown
Contributor

@AndrewJakubowicz AndrewJakubowicz commented Apr 28, 2023

This PR unblocks updating our Lit v2 API generator (so it's not 10 months out of date) & moves towards unblocking the generation of Lit v3 docs.

Why is documentation generation blocked?

  • To generate documentation we, pull in the lit-html-v1, lit-element-v1 repos and the Lit 2 monorepo.
  • Then we build them (currently by running lerna because we pull in an old version of Lit 2).
  • Finally we use typedoc on the built repos to generate the API docs.

Issues:

  • The version of TypeScript matters in order to build what we need in the repos.
  • Updating typedoc currently breaks all generation because it crashes on the old v1 repos.

How this PR helps?

  • Instead of always rebuilding v1 repos - this PR archives the pages.json and symbols.json built data for the v1 repos.

This means we no longer build the old documentation and it is essentially frozen. To allow us to continue updating the data of the newer repos I've split out the api template to api-v1 so it can also remain frozen.

Testing plan

Tested by manually opening up the preview URL and checking that the Lit 1 api docs look good. They should look good because they use a perfect fork of the layout & the data is unchanged... and may never change again :P

Part of #1086

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2023

A live preview of this PR will be available at the URL(s) below.
The latest URL will be appended to this comment on each push.
Each build takes ~5-10 minutes, and will 404 until finished.

https://pr1087-3825ba2---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1087-002dde8---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1087-7cfe31b---lit-dev-5ftespv5na-uc.a.run.app/

@AndrewJakubowicz
Copy link
Copy Markdown
Contributor Author

AndrewJakubowicz commented Apr 28, 2023

Note: This change has caused the API documentation to vanish from the Lit 1 navigation. Otherwise it seems to be working.

The navigation works correctly however this has made me realize this is a very difficult change - because the built html depends on JavaScript and other built stuff.

We are currently blocked at upgrading our API documentation for v2 and v3 because
the v1 docs prevent us from updating the generator (due to TypeScript version of
the old repos).

By archiving the old documentation into unchanging data, we can upgrade the tooling
to update our v2 and add v3 docs without the burden of updating lit-html-1 and
lit-element-1 repositories.
@@ -0,0 +1,319 @@
---
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a copy of the api.html layout (so v1 docs that never change again stay in sync with their layout that never changes). And we can still update newer docs with newer layouts.

@AndrewJakubowicz AndrewJakubowicz changed the title Archive Lit 1 API documentation so we can upgrade generator Archive Lit 1 API content so we can upgrade generator for Lit 2 & 3 Apr 30, 2023
@AndrewJakubowicz AndrewJakubowicz marked this pull request as ready for review April 30, 2023 18:20
Comment thread packages/lit-dev-tools-cjs/src/api-docs/generate.ts
Comment thread packages/lit-dev-tools-cjs/src/api-docs/generate.ts
@AndrewJakubowicz
Copy link
Copy Markdown
Contributor Author

I do not think it's worth keeping the config around. They are available via source control if needed. Almost immediately after updating TypeScript and TypeDoc the old configurations no longer work at all. It also appears I may need to change the generator further to work for Lit v2 & v3. Especially because Lit.dev will need to be able to build Lit v3 which uses TypeScript 5.0

@justinfagnani
Copy link
Copy Markdown
Contributor

Shouldn't this PR include pages.json and symbols.json?

@AndrewJakubowicz
Copy link
Copy Markdown
Contributor Author

No - because they are unchanged. They haven't been changed in 2 years: https://github.com/lit/lit.dev/tree/main/packages/lit-dev-api/api-data

@justinfagnani
Copy link
Copy Markdown
Contributor

@AndrewJakubowicz thanks! I forgot they were already checked-in 😊

@AndrewJakubowicz AndrewJakubowicz self-assigned this May 1, 2023
@AndrewJakubowicz
Copy link
Copy Markdown
Contributor Author

AndrewJakubowicz commented May 1, 2023

Added README - PTAL @justinfagnani
Thanks for the excellent suggestion.

Edit: Can contribute updates to the README in a follow up commit.

@AndrewJakubowicz AndrewJakubowicz merged commit 80e8290 into main May 1, 2023
@AndrewJakubowicz AndrewJakubowicz deleted the update-docs branch May 1, 2023 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants