Skip to content

Update TypeDoc #1090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
May 3, 2023
Merged

Update TypeDoc #1090

merged 15 commits into from
May 3, 2023

Conversation

AndrewJakubowicz
Copy link
Contributor

@AndrewJakubowicz AndrewJakubowicz commented May 2, 2023

Git is a bit confused about the commits in the change. The only changes not in main are those post the merge commit.

There are certainly improvements that can be made with the newer TypeDoc version. However this PR aims to change the pages.json data as little as possible.

To achieve this I've added a glue function which takes the new TypeDoc.Comment node and basically replaces it with the legacy fields (shortText and text) which is what we expect when generating the HTML for the docs.

Because of subtle changes in generation, I've also updated the template to fix the Parameters table. For example, compare the preview url with production at:

  • /docs/api/ReactiveElement/#ReactiveElement.requestUpdate

This version of TypeDoc supports TS 5.0.

Testing

I went page by page in the v2 docs and diffed them. The upgraded TypeDoc pages seem to add some additional "View Source" links.

E.g.,

Part of #1074

Screenshots

With this PR:
Screenshot 2023-05-02 at 10 24 10 AM

On prod (notice lack of descriptions in the Parameters):
Screenshot 2023-05-02 at 10 24 58 AM

AndrewJakubowicz and others added 11 commits May 1, 2023 14:56
This required changing the build setup to use our wireit.

From a spot check this will need more work as some debug only symbols
have crept into the documentation.
The cost does not seem worthwhile for fixing this and blocking progress
on Lit.dev support for v3. Instead unblock by manually providing the
transpiled JavaScript for the Mixin sample.
This is due to a breaking change in TypeDoc.

Default `entryPointStrategy` was changed from `expand` to `resolve`.
Fixed by explicitly setting the prior version.
This fixes the source file links.
The most major change that impacts our documentation generation is the
`Comment` node has been updated to be a list of partial text fragments.

We instead used to use a first line `shortText`, and remainder in
`text`.
This commit "fakes" that setup by doing the processing manually.
@AndrewJakubowicz AndrewJakubowicz changed the base branch from main to update-docs-2 May 2, 2023 00:40
@github-actions
Copy link

github-actions bot commented May 2, 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://pr1090-bfd76a6---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1090-32e1786---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1090-dd5ea09---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1090-8247548---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1090-a4b4f90---lit-dev-5ftespv5na-uc.a.run.app/

@AndrewJakubowicz
Copy link
Contributor Author

Many thanks to #1041 for containing great insights and solutions. This PR fixes the issues in the imports and the comment text.

Base automatically changed from update-docs-2 to main May 2, 2023 16:30
For example see parameters in:
/docs/api/ReactiveElement/#ReactiveElement.requestUpdate
}
}

private replaceCommentNodeForLegacyFormat(commentNode: MigrationComment) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This name might also be better as something along the lines of. replaceCommentNodePartsWithMarkdown?

@AndrewJakubowicz
Copy link
Contributor Author

I have gone through the docs pages and am much more certain that we haven't lost any documentation and only gained docs from this change.

I went through docs with a diff checker.

Tested by checking `observedAttributes` docs and `updateComplete`
@AndrewJakubowicz AndrewJakubowicz merged commit b4f2919 into main May 3, 2023
@AndrewJakubowicz AndrewJakubowicz deleted the update-docs-typedoc branch May 3, 2023 18:12
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.

2 participants