diff --git a/packages/website/package.json b/packages/website/package.json index bef2ecb416bc..ef1d0757d6d2 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -29,6 +29,7 @@ "@babel/runtime": "^7.24.4", "@docusaurus/core": "^3.2.1", "@docusaurus/plugin-client-redirects": "^3.2.1", + "@docusaurus/plugin-content-blog": "^3.7.0", "@docusaurus/plugin-pwa": "^3.2.1", "@docusaurus/preset-classic": "^3.2.1", "@docusaurus/remark-plugin-npm2yarn": "^3.2.1", @@ -66,7 +67,7 @@ "@typescript-eslint/utils": "workspace:*", "copy-webpack-plugin": "^13.0.0", "cross-fetch": "*", - "history": "^4.9.0", + "history": "^5.3.0", "make-dir": "*", "mdast-util-from-markdown": "^2.0.1", "mdast-util-mdx": "^3.0.0", diff --git a/packages/website/src/hooks/useHistorySelector.ts b/packages/website/src/hooks/useHistorySelector.ts index c180fef9ea59..356d7808c54c 100644 --- a/packages/website/src/hooks/useHistorySelector.ts +++ b/packages/website/src/hooks/useHistorySelector.ts @@ -9,7 +9,9 @@ export function useHistorySelector( selector: HistorySelector, getServerSnapshot: () => T, ): T { - const history = useHistory(); + // by default H.History + const history = useHistory() as unknown as H.History; + return useSyncExternalStore( history.listen, () => selector(history), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 693a76ae4899..ca60bbf46ad7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -728,6 +728,9 @@ importers: '@docusaurus/plugin-client-redirects': specifier: ^3.2.1 version: 3.7.0(@mdx-js/react@3.1.0(@types/react@18.3.21)(react@18.3.1))(@swc/core@1.11.24(@swc/helpers@0.5.17))(acorn@8.14.1)(eslint@9.27.0(jiti@2.4.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.8.2) + '@docusaurus/plugin-content-blog': + specifier: ^3.7.0 + version: 3.7.0(@docusaurus/plugin-content-docs@3.7.0(@mdx-js/react@3.1.0(@types/react@18.3.21)(react@18.3.1))(@swc/core@1.11.24(@swc/helpers@0.5.17))(acorn@8.14.1)(eslint@9.27.0(jiti@2.4.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.8.2))(@mdx-js/react@3.1.0(@types/react@18.3.21)(react@18.3.1))(@swc/core@1.11.24(@swc/helpers@0.5.17))(acorn@8.14.1)(eslint@9.27.0(jiti@2.4.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.8.2) '@docusaurus/plugin-pwa': specifier: ^3.2.1 version: 3.7.0(@docusaurus/plugin-content-docs@3.7.0(@mdx-js/react@3.1.0(@types/react@18.3.21)(react@18.3.1))(@swc/core@1.11.24(@swc/helpers@0.5.17))(acorn@8.14.1)(eslint@9.27.0(jiti@2.4.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.8.2))(@mdx-js/react@3.1.0(@types/react@18.3.21)(react@18.3.1))(@swc/core@1.11.24(@swc/helpers@0.5.17))(@types/babel__core@7.20.5)(acorn@8.14.1)(eslint@9.27.0(jiti@2.4.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.8.2) @@ -835,8 +838,8 @@ importers: specifier: '*' version: 4.1.0 history: - specifier: ^4.9.0 - version: 4.10.1 + specifier: ^5.3.0 + version: 5.3.0 make-dir: specifier: '*' version: 5.0.0 @@ -5522,6 +5525,9 @@ packages: history@4.10.1: resolution: {integrity: sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==} + history@5.3.0: + resolution: {integrity: sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ==} + hoist-non-react-statics@3.3.2: resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} @@ -15055,6 +15061,10 @@ snapshots: tiny-warning: 1.0.3 value-equal: 1.0.1 + history@5.3.0: + dependencies: + '@babel/runtime': 7.27.1 + hoist-non-react-statics@3.3.2: dependencies: react-is: 16.13.1 diff --git a/tools/scripts/generate-sponsors.mts b/tools/scripts/generate-sponsors.mts index 1bdb3b094c4c..b87ababe4279 100644 --- a/tools/scripts/generate-sponsors.mts +++ b/tools/scripts/generate-sponsors.mts @@ -1,4 +1,4 @@ -import type { SponsorData } from 'website/src/components/FinancialContributors/types.ts'; +import type { SponsorData } from '@site/src/components/FinancialContributors/types.ts'; import fetch from 'cross-fetch'; import * as fs from 'node:fs'; diff --git a/tsconfig.repo-config-files.json b/tsconfig.repo-config-files.json index 574ce356d589..fab38f63fa3c 100644 --- a/tsconfig.repo-config-files.json +++ b/tsconfig.repo-config-files.json @@ -4,7 +4,10 @@ "outDir": "./dist", "allowJs": true, "allowImportingTsExtensions": true, - "erasableSyntaxOnly": true + "erasableSyntaxOnly": true, + "paths": { + "@site/*": ["./packages/website/*"] + } }, "include": [ "typings", @@ -12,7 +15,8 @@ "tools/**/*.mts", "eslint.config.mjs", "knip.ts", - ".github/**/*.js" + ".github/**/*.js", + "package/website" ], "references": [ { @@ -20,6 +24,9 @@ }, { "path": "./tsconfig.spec.json" + }, + { + "path": "./packages/website" } ] }