Skip to content

Commit c942f56

Browse files
committed
🐛 fix sidebar item cache fault and use ReactNode from import
1 parent 0748718 commit c942f56

File tree

172 files changed

+920
-654
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+920
-654
lines changed

.eslintrc.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,15 @@ module.exports = {
3636
},
3737
},
3838
reportUnusedDisableDirectives: true,
39-
plugins: ["react-hooks", "@typescript-eslint", "regexp", "@docusaurus"],
39+
plugins: [
40+
"react-compiler",
41+
"react-hooks",
42+
"@typescript-eslint",
43+
"regexp",
44+
"@docusaurus",
45+
],
4046
rules: {
47+
"react-compiler/react-compiler": ERROR,
4148
"react/jsx-uses-react": OFF, // JSX runtime: automatic
4249
"react/react-in-jsx-scope": OFF, // JSX runtime: automatic
4350
"array-callback-return": WARNING,
@@ -213,7 +220,6 @@ module.exports = {
213220
["parent", "sibling", "index"],
214221
"type",
215222
],
216-
"newlines-between": "always",
217223
pathGroups: [
218224
// always put css import to the last, ref:
219225
// https://github.com/import-js/eslint-plugin-import/issues/1239

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"eslint-plugin-import": "^2.27.5",
6060
"eslint-plugin-jsx-a11y": "^6.7.1",
6161
"eslint-plugin-react": "^7.32.2",
62+
"eslint-plugin-react-compiler": "^19.0.0-beta-40c6c23-20250301",
6263
"eslint-plugin-react-hooks": "^4.6.0",
6364
"eslint-plugin-regexp": "^1.15.0",
6465
"lerna": "^6.6.2",

packages/theme-nonepress/src/contexts/SidebarContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function SidebarContentProvider({
1717
children,
1818
}: {
1919
children: ReactNode;
20-
}): React.ReactNode {
20+
}): ReactNode {
2121
const value = useState<Content>(null);
2222

2323
return <Context.Provider value={value}>{children}</Context.Provider>;

packages/theme-nonepress/src/contexts/SidebarDisplay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function SidebarDisplayProvider({
4040
children,
4141
}: {
4242
children: ReactNode;
43-
}): React.ReactNode {
43+
}): ReactNode {
4444
const value = useContextValue();
4545
return <Context.Provider value={value}>{children}</Context.Provider>;
4646
}

packages/theme-nonepress/src/contexts/TOCContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function TOCContentProvider({
2222
children,
2323
}: {
2424
children: ReactNode;
25-
}): React.ReactNode {
25+
}): ReactNode {
2626
const value = useState<Content>(null);
2727

2828
return <Context.Provider value={value}>{children}</Context.Provider>;

packages/theme-nonepress/src/contexts/TOCDisplay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function TOCDisplayProvider({
4040
children,
4141
}: {
4242
children: ReactNode;
43-
}): React.ReactNode {
43+
}): ReactNode {
4444
const value = useContextValue();
4545
return <Context.Provider value={value}>{children}</Context.Provider>;
4646
}

packages/theme-nonepress/src/theme/Admonition/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function processAdmonitionProps(props: Props): Props {
217217
};
218218
}
219219

220-
export default function Admonition(props: Props): React.ReactNode {
220+
export default function Admonition(props: Props): ReactNode {
221221
const {
222222
children,
223223
type,

packages/theme-nonepress/src/theme/AnnouncementBar/CloseButton/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import React, { type ReactNode } from "react";
22

33
import clsx from "clsx";
44

@@ -9,7 +9,7 @@ import IconClose from "@theme/Icon/Close";
99

1010
export default function AnnouncementBarCloseButton(
1111
props: Props,
12-
): React.ReactNode | null {
12+
): ReactNode | null {
1313
return (
1414
<div className={clsx(props.className, "announcement-button")}>
1515
<button

packages/theme-nonepress/src/theme/AnnouncementBar/Content/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import React from "react";
1+
import React, { type ReactNode } from "react";
22

33
import clsx from "clsx";
44

55
import { useNonepressThemeConfig } from "@nullbot/docusaurus-theme-nonepress/client";
66

77
import type { Props } from "@theme/AnnouncementBar/Content";
88

9-
export default function AnnouncementBarContent(props: Props): React.ReactNode {
9+
export default function AnnouncementBarContent(props: Props): ReactNode {
1010
const { announcementBar } = useNonepressThemeConfig();
1111
const { content } = announcementBar!;
1212
return (

packages/theme-nonepress/src/theme/AnnouncementBar/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import React from "react";
1+
import React, { type ReactNode } from "react";
22

33
import { useAnnouncementBar } from "@docusaurus/theme-common/internal";
44

5-
import "./styles.css";
6-
75
import { useNonepressThemeConfig } from "@nullbot/docusaurus-theme-nonepress/client";
86

97
import AnnouncementBarCloseButton from "@theme/AnnouncementBar/CloseButton";
108
import AnnouncementBarContent from "@theme/AnnouncementBar/Content";
119

12-
export default function AnnouncementBar(): React.ReactNode | null {
10+
import "./styles.css";
11+
12+
export default function AnnouncementBar(): ReactNode | null {
1313
const { announcementBar } = useNonepressThemeConfig();
1414
const { isActive, close } = useAnnouncementBar();
1515
if (!announcementBar || !isActive) {

0 commit comments

Comments
 (0)