Skip to content

Commit

Permalink
Merge pull request #475 from easyops-cn/steve/react-19
Browse files Browse the repository at this point in the history
feat: support React 19
  • Loading branch information
weareoutman authored Jan 7, 2025
2 parents 8b49aba + e7888c4 commit 970b7e2
Show file tree
Hide file tree
Showing 9 changed files with 3,966 additions and 1,466 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -23,18 +23,18 @@ jobs:
with:
timezone: Asia/Shanghai

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- uses: actions/cache@v3
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- uses: actions/cache@v3
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -42,7 +42,7 @@ jobs:
- run: yarn build:i18n

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/build
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: google-github-actions/release-please-action@v3
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GH_TOKEN_EVE }}
Expand All @@ -24,13 +24,13 @@ jobs:
bump-minor-pre-major: true

# The logic below handles the npm publication:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.docusaurus-search-local--release_created }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
if: ${{ steps.release.outputs.docusaurus-search-local--release_created }}
Expand All @@ -40,7 +40,7 @@ jobs:
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
if: ${{ steps.release.outputs.docusaurus-search-local--release_created }}

- uses: actions/cache@v3
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand Down
10 changes: 5 additions & 5 deletions docusaurus-search-local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@easyops-cn/autocomplete.js": "^0.38.1",
"@node-rs/jieba": "^1.6.0",
"cheerio": "^1.0.0",
"clsx": "^1.1.1",
"clsx": "^2.1.1",
"comlink": "^4.4.2",
"debug": "^4.2.0",
"fs-extra": "^10.0.0",
Expand All @@ -60,8 +60,8 @@
"@types/klaw-sync": "^6.0.0",
"@types/lunr": "^2.3.3",
"@types/node": "^18.0.0",
"@types/react": "^18.2.37",
"@types/react-helmet": "^6.1.0",
"@types/react": "^19.0.3",
"@types/react-helmet": "^6.1.1",
"@types/react-router-dom": "^5.1.6",
"concurrently": "^7.0.0",
"copyfiles": "^2.4.0",
Expand All @@ -70,7 +70,7 @@
},
"peerDependencies": {
"@docusaurus/theme-common": "^2 || ^3",
"react": "^16.14.0 || ^17 || ^18",
"react-dom": "^16.14.0 || 17 || ^18"
"react": "^16.14.0 || ^17 || ^18 || ^19",
"react-dom": "^16.14.0 || 17 || ^18 || ^19"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default function SearchBar({
// eslint-disable-next-line react-hooks/rules-of-hooks
const { preferredVersion } = useDocsPreferredVersion(
activePlugin?.pluginId ?? docsPluginIdForPreferredVersion
);
) as { preferredVersion: { path: string; isLast: boolean } };
if (preferredVersion && !preferredVersion.isLast) {
versionUrl = preferredVersion.path + "/";
}
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@
],
"packageManager": "[email protected]",
"resolutions": {
"@docusaurus/core": "3.0.0",
"@docusaurus/module-type-aliases": "3.0.0",
"@docusaurus/preset-classic": "3.0.0",
"@docusaurus/theme-classic": "3.0.0",
"@docusaurus/theme-common": "3.0.0",
"@docusaurus/plugin-content-docs": "3.0.0",
"@types/react": "18.2.37"
"@docusaurus/core": "3.7.0",
"@docusaurus/module-type-aliases": "3.7.0",
"@docusaurus/preset-classic": "3.7.0",
"@docusaurus/theme-classic": "3.7.0",
"@docusaurus/theme-common": "3.7.0",
"@docusaurus/plugin-content-docs": "3.7.0",
"@types/react": "19.0.3"
},
"engines": {
"node": ">=18"
"node": ">=20"
}
}
20 changes: 10 additions & 10 deletions website-multi-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "^3.0.0",
"@docusaurus/plugin-content-docs": "^3.0.0",
"@docusaurus/preset-classic": "^3.0.0",
"@docusaurus/theme-classic": "^3.0.0",
"@docusaurus/theme-common": "^3.0.0",
"@docusaurus/core": "^3.7.0",
"@docusaurus/plugin-content-docs": "^3.7.0",
"@docusaurus/preset-classic": "^3.7.0",
"@docusaurus/theme-classic": "^3.7.0",
"@docusaurus/theme-common": "^3.7.0",
"@easyops-cn/docusaurus-search-local": "^workspace:*",
"@mdx-js/react": "^3.0.0",
"clsx": "^1.1.1",
"@mdx-js/react": "^3.1.0",
"clsx": "^2.1.1",
"prism-react-renderer": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.0.0"
"@docusaurus/module-type-aliases": "^3.7.0"
},
"browserslist": {
"production": [
Expand Down
17 changes: 9 additions & 8 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
"serve": "docusaurus serve"
},
"dependencies": {
"@docusaurus/core": "^3.0.0",
"@docusaurus/preset-classic": "^3.0.0",
"@docusaurus/theme-classic": "^3.0.0",
"@docusaurus/theme-common": "^3.0.0",
"@docusaurus/core": "^3.7.0",
"@docusaurus/plugin-content-docs": "^3.7.0",
"@docusaurus/preset-classic": "^3.7.0",
"@docusaurus/theme-classic": "^3.7.0",
"@docusaurus/theme-common": "^3.7.0",
"@easyops-cn/docusaurus-search-local": "workspace:*",
"@mdx-js/react": "^3.0.0",
"clsx": "^1.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"@mdx-js/react": "^3.1.0",
"clsx": "^2.1.1",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"browserslist": {
"production": [
Expand Down
Loading

0 comments on commit 970b7e2

Please sign in to comment.