Skip to content

[lexical-website] Chore: Update docusaurus-plugin-typedoc#7766

Merged
etrepum merged 19 commits intofacebook:mainfrom
etrepum:update-docusaurus
Sep 7, 2025
Merged

[lexical-website] Chore: Update docusaurus-plugin-typedoc#7766
etrepum merged 19 commits intofacebook:mainfrom
etrepum:update-docusaurus

Conversation

@etrepum
Copy link
Copy Markdown
Collaborator

@etrepum etrepum commented Aug 17, 2025

Description

Updates the API documentation build to use the latest docusaurus-plugin-typedoc and typedoc-plugin-markdown.

Was a lot harder than I expected to track down all of the changes we'd need to make this work similarly to the current version.

The biggest change is that now all of the classes and interfaces are documented in the module they are exported from, there is no longer a separate file for each class and interface or a global index of all classes and all interfaces. In order to get the URLs to be the same I had to write some extra plugins.

Before: https://lexical.dev/docs/api/
After: https://lexical-git-fork-etrepum-update-docusaurus-fbopensource.vercel.app/docs/api/

Other relevant changes:

  • Updated CI node-version to current LTS node versions (now 22.19.0 and 20.19.4; previously 20.11.0 and 18.18.0)
  • Switched prettier config from js to json (avoiding cjs here since we are not type: module in package.json yet)
  • Updated prettier from 2.8.8 to 3.6.2, which causes churn elsewhere (primarily in a1f21cd) and required some other changes to build infrastructure since it has an async API now. Previously we had two versions of prettier (one for build & one for app usage) which was a bit problematic.
  • Updated typescript to 5.9.2

Closes #6072

Test plan

There aren't tests for the documentation, but the build process does throw errors if there are broken links.

@vercel
Copy link
Copy Markdown

vercel bot commented Aug 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
lexical Ready Ready Preview Comment Sep 5, 2025 5:34pm
lexical-playground Ready Ready Preview Comment Sep 5, 2025 5:34pm

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 17, 2025
@etrepum etrepum changed the title Update docusaurus-plugin-typedoc [lexical-website] Chore: Update docusaurus-plugin-typedoc Aug 18, 2025
@etrepum etrepum marked this pull request as draft August 18, 2025 00:43
* @param node LexicalNode.
* @returns An array (tuple) containing the found Lexical node and the depth difference, or null, if this node doesn't exist.
*/
export function $getAdjacentSiblingOrParentSiblingCaret<
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This was already defined separately in lexical so re-exporting for compatibility

);
}

class LegacyRouter extends ModuleRouter {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The paths all changed in this version of typedoc so this is a custom router that uses a URL scheme that's backwards compatible with ours

app.renderer.defineRouter('legacy', LegacyRouter);
app.converter.on(
Converter.EVENT_CREATE_DECLARATION,
function removeLicenseComment(ctx, reflection) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This avoids attaching the license to the first definition in the module if it doesn't have its own comment

@etrepum etrepum marked this pull request as ready for review September 5, 2025 17:47
configureWebpack(_config, _isServer) {
return {
optimization: {
concatenateModules: false,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is a performance improvement for the build, but may produce more js (~3%) for the clients to download facebook/docusaurus#11199

@etrepum etrepum enabled auto-merge September 6, 2025 21:34
@etrepum
Copy link
Copy Markdown
Collaborator Author

etrepum commented Sep 6, 2025

@zurfyx I think something in the admin side of the repo needs to be flipped so this can land, it appears to be looking for statuses of specific checks with the old matrix node-versions

@etrepum etrepum added this pull request to the merge queue Sep 7, 2025
Merged via the queue into facebook:main with commit 6f0e30a Sep 7, 2025
75 of 76 checks passed
@etrepum etrepum deleted the update-docusaurus branch September 7, 2025 19:29
This was referenced Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: [lexical-website] Upgrade docusaurus-plugin-typedoc and typedoc-plugin-markdown

2 participants