Skip to content

Commit 4d437a6

Browse files
authored
feat: To update react v19.1 => v19.2.x (#3149)
* feat: To update docusaurus v3.9.2 => 3.10.0 * feat: To update react v19.1=>v19.2.6 antd 6.0 => v6.3.5 remove v5-patch
1 parent 17af4b9 commit 4d437a6

6 files changed

Lines changed: 342 additions & 328 deletions

File tree

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
},
3131
"dependencies": {
3232
"@ant-design/icons": "^5.3.7",
33-
"@ant-design/v5-patch-for-react-19": "^1.0.3",
3433
"@docusaurus/core": "^3.10.0",
3534
"@docusaurus/faster": "^3.10.0",
3635
"@docusaurus/plugin-client-redirects": "^3.10.0",
@@ -39,7 +38,7 @@
3938
"@mdx-js/react": "^3.0.0",
4039
"@types/turndown": "^5.0.5",
4140
"ahooks": "^3.8.0",
42-
"antd": "^6.0.0",
41+
"antd": "^6.3.5",
4342
"axios": "^1.14.0",
4443
"clsx": "^2.0.0",
4544
"copy-to-clipboard": "^3.3.3",
@@ -53,8 +52,8 @@
5352
"js-cookie": "^3.0.5",
5453
"prism-react-renderer": "^2.3.0",
5554
"prop-types": "^15.8.1",
56-
"react": "^19.1.0",
57-
"react-dom": "^19.1.0",
55+
"react": "^19.2.5",
56+
"react-dom": "^19.2.5",
5857
"react-icons": "^5.5.0",
5958
"react-markdown": "^9.0.1",
6059
"react-scroll-progress-bar": "^2.0.3",

src/components/CopyPageButton/index.tsx

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState, useMemo, useCallback } from "react";
2-
import { Button, Dropdown, Flex, Spin } from "antd";
2+
import { Button, Dropdown, Flex, Space, Spin } from "antd";
33
import styles from "./styles.module.scss";
44
import { FaAngleDown } from "react-icons/fa6";
55

@@ -39,7 +39,7 @@ const CopyDropdownButton: React.FC = () => {
3939
function copyHtml() {
4040
setIsCopied(true);
4141
const htmlContent = getPageContentAsHtml();
42-
const markdownContent = convertHtmlToMarkdown(htmlContent);
42+
const markdownContent = convertHtmlToMarkdown(htmlContent as string);
4343
navigator.clipboard.writeText(markdownContent?.replace("Copy Page", ""));
4444
setTimeout(() => {
4545
setIsCopied(false);
@@ -71,7 +71,7 @@ const CopyDropdownButton: React.FC = () => {
7171
return (
7272
metadata?.source?.replace(
7373
"@site",
74-
"https://raw.githubusercontent.com/databendlabs/databend-docs/refs/heads/main"
74+
"https://raw.githubusercontent.com/databendlabs/databend-docs/refs/heads/main",
7575
) || ""
7676
);
7777
}, [metadata]);
@@ -134,15 +134,15 @@ const CopyDropdownButton: React.FC = () => {
134134
if (key === "markdown") window.open(sourceUrl, "_blank");
135135
if (key === "gpt")
136136
window.open(
137-
`https://chat.openai.com/?hints=search&q=Read from ${window.location.href} so I can ask questions about it.`
137+
`https://chat.openai.com/?hints=search&q=Read from ${window.location.href} so I can ask questions about it.`,
138138
);
139139
if (key === "claude")
140140
window.open(
141-
`https://claude.ai/new?q=Read from ${window.location.href} so I can ask questions about it.`
141+
`https://claude.ai/new?q=Read from ${window.location.href} so I can ask questions about it.`,
142142
);
143143
if (key === "perplexity") {
144144
window.open(
145-
`https://www.perplexity.ai/search/new?q=Read from ${window.location.href} so I can ask questions about it`
145+
`https://www.perplexity.ai/search/new?q=Read from ${window.location.href} so I can ask questions about it`,
146146
);
147147
}
148148
},
@@ -163,20 +163,18 @@ const CopyDropdownButton: React.FC = () => {
163163
</span>
164164
</Flex>
165165
),
166-
[loading, isCopied]
166+
[loading, isCopied],
167167
);
168168

169169
return (
170-
<Dropdown.Button
171-
onClick={() => handleCopy(sourceUrl)}
172-
menu={menu}
173-
placement="bottomRight"
174-
icon={<FaAngleDown className={styles.svg} />}
175-
className={styles.buttonCainter}
176-
trigger={["click"]}
177-
>
178-
{renderButtonContent}
179-
</Dropdown.Button>
170+
<Space.Compact className={styles.buttonCainter}>
171+
<Button onClick={() => handleCopy(sourceUrl)}>
172+
{renderButtonContent}
173+
</Button>
174+
<Dropdown menu={menu} placement="bottomRight" trigger={["click"]}>
175+
<Button icon={<FaAngleDown className={styles.svg} />} />
176+
</Dropdown>
177+
</Space.Compact>
180178
);
181179
};
182180

src/theme/DocRoot/Layout/Main/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ export default function DocRootLayoutMain({
2626
<main
2727
className={clsx(
2828
styles.docMainContainer,
29-
(hiddenSidebarContainer || !sidebar) && styles.docMainContainerEnhanced
29+
(hiddenSidebarContainer || !sidebar) && styles.docMainContainerEnhanced,
3030
)}
3131
>
3232
<div
3333
onClick={getImgElement}
3434
className={clsx(
3535
"container padding-top--md padding-bottom--lg",
3636
styles.docItemWrapper,
37-
hiddenSidebarContainer && styles.docItemWrapperEnhanced
37+
hiddenSidebarContainer && styles.docItemWrapperEnhanced,
3838
)}
3939
>
4040
{children}
@@ -44,9 +44,9 @@ export default function DocRootLayoutMain({
4444
style={{ display: "none" }}
4545
preview={{
4646
scaleStep: 0.25,
47-
visible: previewImage,
47+
open: previewImage,
4848
src: previewImageSrc,
49-
onVisibleChange: (value) => {
49+
onOpenChange: (value) => {
5050
setPreviewImage(value);
5151
},
5252
}}

src/theme/Footer/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { useThemeConfig } from "@docusaurus/theme-common";
1313
import styles from "./index.module.scss";
1414
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
1515
import { useMount } from "ahooks";
16-
import "@ant-design/v5-patch-for-react-19";
1716
import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment";
1817
import "vanilla-cookieconsent/dist/cookieconsent.css";
1918
import * as CookieConsent from "vanilla-cookieconsent";

src/theme/MDXComponents/A.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function MDXA(props) {
1717
if (hasProtocolPrefix(props?.href)) {
1818
return (
1919
<Tooltip
20-
destroyTooltipOnHide
20+
destroyOnHidden
2121
classNames={{
2222
root: styles.tooltip,
2323
}}

0 commit comments

Comments
 (0)