Skip to content
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

[lexical-website] Chore: upgrade to Docusaurus v3.6 - Docusaurus Faster #6761

Merged
merged 13 commits into from
Nov 5, 2024

Conversation

slorber
Copy link
Contributor

@slorber slorber commented Oct 25, 2024

Description

Upgrade Docusaurus to v3.6 (upcoming, WIP)

Enable the Docusaurus Faster options.

The site now bundles in 7 seconds instead of 50 seconds.
(However the doc gen phase remains slow)

Test plan

??? local or preview?

Before

npm run build --prefix packages/lexical-website

After

npm run build --prefix packages/lexical-website

@facebook-github-bot facebook-github-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 Oct 25, 2024
Copy link

vercel bot commented Oct 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 5, 2024 4:41am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 5, 2024 4:41am

Copy link

github-actions bot commented Oct 25, 2024

size-limit report 📦

Path Size
lexical - cjs 29.94 KB (0%)
lexical - esm 29.78 KB (0%)
@lexical/rich-text - cjs 38.59 KB (0%)
@lexical/rich-text - esm 31.63 KB (0%)
@lexical/plain-text - cjs 37.22 KB (0%)
@lexical/plain-text - esm 28.94 KB (0%)
@lexical/react - cjs 40.32 KB (0%)
@lexical/react - esm 33.01 KB (0%)

Copy link
Contributor Author

@slorber slorber left a comment

Choose a reason for hiding this comment

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

I'll let you know once it's safe to review/merge

For now, I mostly needed a v3 site to test the upcoming faster features. I don't have access to the facebook preset source code so the goal was to test what changes I should advise the preset devs to do to add proper support.

package.json Outdated Show resolved Hide resolved
packages/lexical-website/package.json Outdated Show resolved Hide resolved
@@ -0,0 +1,31 @@
diff --git a/packages/lexical-website/node_modules/docusaurus-plugin-internaldocs-fb/index.js b/packages/lexical-website/node_modules/docusaurus-plugin-internaldocs-fb/index.js
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Temporay patch, until the fb preset adds support for Rspack in an upcoming release

@slorber
Copy link
Contributor Author

slorber commented Nov 4, 2024

Docusaurus v3.6 is out: https://docusaurus.io/blog/releases/3.6

I'll let @antonk52 or @jknoxville follow up on the internal FB preset support for Rspack.

@antonk52
Copy link

antonk52 commented Nov 4, 2024

@slorber I've just released [email protected] that should work with rspack. the patch should no longer be needed

@slorber slorber changed the title [lexical-website] Chore: upgrade to Docusaurus v3.6 - WIP [lexical-website] Chore: upgrade to Docusaurus v3.6 - Docusaurus Faster Nov 4, 2024
@slorber
Copy link
Contributor Author

slorber commented Nov 4, 2024

Great, it's working 👍

Just did the PR cleanup, ready to review!

This command works well locally but I can't access Vercel logs:

npm run build --prefix packages/lexical-website

Copy link
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you

@etrepum etrepum added this pull request to the merge queue Nov 5, 2024
Merged via the queue into facebook:main with commit af344f3 Nov 5, 2024
39 of 40 checks passed
@etrepum
Copy link
Collaborator

etrepum commented Nov 11, 2024

@slorber I did notice that docusaurus-plugin-internaldocs-fb has an implicit dependency on mercurial (hg) and it will spew stderr when using watch.

/bin/sh: hg: command not found
/bin/sh: hg: command not found
/bin/sh: hg: command not found
/bin/sh: hg: command not found
❯ rg "'hg\s" node_modules/
node_modules/docusaurus-plugin-internaldocs-fb/lib/tracking-file.js
92:    const p = child_process_1.default.exec('hg root');

node_modules/docusaurus-plugin-internaldocs-fb/index.js
115:            .execSync('hg config fbconduit.reponame')
126:        return child_process_1.default.execSync('hg root').toString().trim();

node_modules/docusaurus-plugin-internaldocs-fb/bin/build-fb.js
9:const hgRoot = execSync('hg root').toString().trim();

node_modules/docusaurus-plugin-internaldocs-fb/bin/start-fb.js
9:const hgRoot = execSync('hg root').toString().trim();

node_modules/docusaurus-plugin-internaldocs-fb/bin/auth.js
9:const hgRoot = execSync('hg root').toString().trim();

node_modules/docusaurus-plugin-internaldocs-fb/bin/fb.js
9:const hgRoot = execSync('hg root').toString().trim();

It seems to work just fine, could probably be "fixed" by redirecting that output to nowhere.

@slorber
Copy link
Contributor Author

slorber commented Nov 12, 2024

@etrepum unfortunately I don't really know about this internal FB plugin, @antonk52 can tell you more about those hg calls.

Weren't they already there before?

@etrepum
Copy link
Collaborator

etrepum commented Nov 12, 2024

I don't recall this stderr output, but the last time I worked on the docs build was a while ago.

@etrepum
Copy link
Collaborator

etrepum commented Nov 12, 2024

The problem isn't so much that there are hg calls, it's that their exceptions are being ignored without capturing stderr

@antonk52
Copy link

unfortunately I don't really know about this internal FB plugin, @antonk52 can tell you more about those hg calls.

Weren't they already there before?

These have been there for the past 2~2.5 years. I do agree that we should update it to only make these calls when inside a mercurial project. I can try to do this, but that would be no sooner than next week.

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants