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
20,563 changes: 13,038 additions & 7,525 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
},
"engineStrict": true,
"scripts": {
"postinstall": "patch-package",
"patch-package": "patch-package",
"start": "cross-env NODE_ENV=development concurrently \"npm:collab\" \"npm run dev --prefix packages/lexical-playground\"",
"start:website": "npm run start --prefix packages/lexical-website -- --port 3001",
"start:playground": "npm run start-test-server",
Expand Down Expand Up @@ -144,6 +146,7 @@
"concurrently": "^8.2.2",
"confusing-browser-globals": "^1.0.10",
"cross-env": "^7.0.3",
"docusaurus-plugin-internaldocs-fb": "1.18.4",
slorber marked this conversation as resolved.
Show resolved Hide resolved
"eslint": "^8.57.0",
"eslint-config-fbjs": "^4.0.0",
"eslint-config-prettier": "^9.1.0",
Expand Down Expand Up @@ -174,6 +177,7 @@
"lint-staged": "^11.1.0",
"minimist": "^1.2.5",
"npm-run-all": "^4.1.5",
"patch-package": "^8.0.0",
"prettier": "^2.3.2",
"prettier-plugin-hermes-parser": "^0.20.1",
"prettier-plugin-organize-attributes": "^0.0.5",
Expand Down
4 changes: 4 additions & 0 deletions packages/lexical-website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ const config = {

favicon: 'img/favicon.ico',

future: {
experimental_faster: (process.env.DOCUSAURUS_FASTER ?? 'true') === 'true',
},

markdown: {
preprocessor: ({fileContent}) =>
fileContent.replaceAll(
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical-website/fb/sdoc-cache.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"snippets": {},
"description": "@generated"
}
}
11 changes: 7 additions & 4 deletions packages/lexical-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "^3.3.2",
"@docusaurus/preset-classic": "^3.3.2",
"@docusaurus/theme-search-algolia": "^3.3.2",
"@docusaurus/core": "3.5.2-canary-6121",
"@docusaurus/faster": "3.5.2-canary-6121",
"@docusaurus/babel": "3.5.2-canary-6121",
"@docusaurus/bundler": "3.5.2-canary-6121",
slorber marked this conversation as resolved.
Show resolved Hide resolved
"@docusaurus/preset-classic": "3.5.2-canary-6121",
"@docusaurus/theme-search-algolia": "3.5.2-canary-6121",
"@mdx-js/react": "^3.0.1",
"@radix-ui/react-tabs": "^1.0.4",
"@vercel/analytics": "^1.0.1",
"docusaurus-plugin-internaldocs-fb": "1.18.2",
"docusaurus-plugin-internaldocs-fb": "1.18.5",
"docusaurus-plugin-typedoc": "^0.22.0",
"fs-extra": "^10.0.0",
"prism-react-renderer": "^2.3.1",
Expand Down
10 changes: 6 additions & 4 deletions packages/lexical-website/plugins/webpack-buffer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@

'use strict';

const webpack = require('webpack');

module.exports = async function (context, options) {
return {
configureWebpack(config, isServer, utils) {
configureWebpack(config, isServer, {currentBundler}) {
return {
plugins: [new webpack.ProvidePlugin({Buffer: ['buffer', 'Buffer']})],
plugins: [
new currentBundler.instance.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
resolve: {
fallback: {buffer: require.resolve('buffer/')},
},
Expand Down
31 changes: 31 additions & 0 deletions patches/docusaurus-plugin-internaldocs-fb+1.18.5.patch
Original file line number Diff line number Diff line change
@@ -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

index 9c3afcf..37a3d47 100644
--- a/packages/lexical-website/node_modules/docusaurus-plugin-internaldocs-fb/index.js
+++ b/packages/lexical-website/node_modules/docusaurus-plugin-internaldocs-fb/index.js
@@ -23,7 +23,7 @@ function plugin(context, opts) {
fs_extra_1.default.pathExistsSync(path_1.default.resolve(context.siteDir, 'node_modules', '.cache'));
return {
name: 'internaldocs-fb',
- configureWebpack: () => {
+ configureWebpack: (_config,_isServer,{currentBundler}) => {
return {
resolve: {
fallback: {
@@ -35,7 +35,7 @@ function plugin(context, opts) {
},
},
plugins: [
- new webpack_1.default.EnvironmentPlugin({
+ new (currentBundler.instance ?? webpack_1.default).EnvironmentPlugin({
FB_INTERNAL: process.env.FB_INTERNAL || false,
PHABRICATOR_DIFF_NUMBER: process.env.PHABRICATOR_DIFF_NUMBER || '',
}),
@@ -94,7 +94,7 @@ function plugin(context, opts) {
.replace(/^\//, ''),
};
setGlobalData(globalData);
- setInterval(async () => await processReferencedFiles(opts, true), 5000);
+ // setInterval(async () => await processReferencedFiles(opts, true), 5000);
},
};
}
Loading