From 7a3772a566e1b92aee96a5c2cf90bc27149f7d45 Mon Sep 17 00:00:00 2001 From: Aleksandar Zgonjan Date: Thu, 29 Jan 2026 16:00:36 +0100 Subject: [PATCH 1/3] docs(deployment): recommend Cloudflare Workers over Cloudflare Pages (#11673) Co-authored-by: Aleksandar Zgonjan Co-authored-by: sebastien --- website/docs/deployment.mdx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/website/docs/deployment.mdx b/website/docs/deployment.mdx index 18b79e86e39b..646fd5d0c91a 100644 --- a/website/docs/deployment.mdx +++ b/website/docs/deployment.mdx @@ -924,9 +924,12 @@ You can deploy your Docusaurus project to [Stormkit](https://www.stormkit.io), a See [docs](https://docs.quantcdn.io/docs/cli/continuous-integration) and [blog](https://www.quantcdn.io/blog) for more examples and use cases for deploying to QuantCDN. -## Deploying to Cloudflare Pages {#deploying-to-cloudflare-pages} +## Deploying to Cloudflare {#deploying-to-cloudflare} -[Cloudflare Pages](https://pages.cloudflare.com/) is a Jamstack platform for frontend developers to collaborate and deploy websites. Get started within a few minutes by following [this page](https://developers.cloudflare.com/pages/framework-guides/deploy-a-docusaurus-site/). +[Cloudflare](https://cloudflare.com/) offers two approaches for deploying your Docusaurus site: **Cloudflare Workers** and **Cloudflare Pages**. + +- [Cloudflare's framework guide for deploying Docusaurus with Workers](https://developers.cloudflare.com/workers/framework-guides/web-apps/more-web-frameworks/docusaurus/). +- [Cloudflare's guide to deploying Docusaurus with Pages](https://developers.cloudflare.com/pages/framework-guides/deploy-a-docusaurus-site/). ## Deploying to Azure Static Web Apps {#deploying-to-azure-static-web-apps} From e553c03bac89310cbed2d7b84d98557db26511b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Thu, 29 Jan 2026 17:35:30 +0100 Subject: [PATCH 2/3] chore(monorepo): upgrade React monorepo types to v19 (#11697) --- package.json | 2 +- .../src/theme-classic.d.ts | 4 ++-- .../Navbar/MobileSidebar/Layout/index.tsx | 3 ++- .../src/hooks/useCodeWordWrap.ts | 4 ++-- .../src/utils/reactUtils.tsx | 2 +- .../src/utils/skipToContentUtils.tsx | 2 +- .../docusaurus/src/client/exports/Link.tsx | 2 +- website/src/components/APITable/index.tsx | 5 +++- website/types.d.ts | 22 +++++++++++++++++ yarn.lock | 24 +++++++------------ 10 files changed, 45 insertions(+), 25 deletions(-) create mode 100644 website/types.d.ts diff --git a/package.json b/package.json index 92d57c5705d0..3b8bf1346e27 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "@types/lodash": "^4.14.197", "@types/node": "^18.16.19", "@types/prompts": "^2.4.4", - "@types/react": "^18.2.15", + "@types/react": "^19.2.10", "@types/react-test-renderer": "^18.0.0", "@types/semver": "^7.5.0", "@types/shelljs": "^0.8.12", diff --git a/packages/docusaurus-theme-classic/src/theme-classic.d.ts b/packages/docusaurus-theme-classic/src/theme-classic.d.ts index 961d68fcc044..03a00f833a76 100644 --- a/packages/docusaurus-theme-classic/src/theme-classic.d.ts +++ b/packages/docusaurus-theme-classic/src/theme-classic.d.ts @@ -1745,11 +1745,11 @@ declare module '@theme/Icon/LightMode' { } declare module '@theme/Icon/SystemColorMode' { - import type {ComponentProps} from 'react'; + import type {ComponentProps, ReactNode} from 'react'; export interface Props extends ComponentProps<'svg'> {} - export default function IconSystemColorMode(props: Props): JSX.Element; + export default function IconSystemColorMode(props: Props): ReactNode; } declare module '@theme/Icon/Menu' { diff --git a/packages/docusaurus-theme-classic/src/theme/Navbar/MobileSidebar/Layout/index.tsx b/packages/docusaurus-theme-classic/src/theme/Navbar/MobileSidebar/Layout/index.tsx index 7afe2f823c6f..29e705b220e1 100644 --- a/packages/docusaurus-theme-classic/src/theme/Navbar/MobileSidebar/Layout/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/Navbar/MobileSidebar/Layout/index.tsx @@ -17,7 +17,8 @@ import type {Props} from '@theme/Navbar/MobileSidebar/Layout'; function inertProps(inert: boolean) { const isBeforeReact19 = parseInt(version!.split('.')[0]!, 10) < 19; if (isBeforeReact19) { - return {inert: inert ? '' : undefined}; + // TODO Docusaurus v4: remove temporary inert workaround + return {inert: inert ? '' : undefined} as unknown as {inert: boolean}; } return {inert}; } diff --git a/packages/docusaurus-theme-common/src/hooks/useCodeWordWrap.ts b/packages/docusaurus-theme-common/src/hooks/useCodeWordWrap.ts index 11cd15896590..df17460c46f6 100644 --- a/packages/docusaurus-theme-common/src/hooks/useCodeWordWrap.ts +++ b/packages/docusaurus-theme-common/src/hooks/useCodeWordWrap.ts @@ -11,7 +11,7 @@ import {useMutationObserver} from './useMutationObserver'; // Callback fires when the "hidden" attribute of a tabpanel changes // See https://github.com/facebook/docusaurus/pull/7485 function useTabBecameVisibleCallback( - codeBlockRef: RefObject, + codeBlockRef: RefObject, callback: () => void, ) { const [hiddenTabElement, setHiddenTabElement] = useState< @@ -53,7 +53,7 @@ function useTabBecameVisibleCallback( } export type WordWrap = { - readonly codeBlockRef: RefObject; + readonly codeBlockRef: RefObject; readonly isEnabled: boolean; readonly isCodeScrollable: boolean; readonly toggle: () => void; diff --git a/packages/docusaurus-theme-common/src/utils/reactUtils.tsx b/packages/docusaurus-theme-common/src/utils/reactUtils.tsx index d0d212fd7d7d..80e349e3ba8f 100644 --- a/packages/docusaurus-theme-common/src/utils/reactUtils.tsx +++ b/packages/docusaurus-theme-common/src/utils/reactUtils.tsx @@ -44,7 +44,7 @@ export function useEvent unknown>( * Gets `value` from the last render. */ export function usePrevious(value: T): T | undefined { - const ref = useRef(); + const ref = useRef(undefined); useIsomorphicLayoutEffect(() => { ref.current = value; diff --git a/packages/docusaurus-theme-common/src/utils/skipToContentUtils.tsx b/packages/docusaurus-theme-common/src/utils/skipToContentUtils.tsx index 3c5e16fd1cf1..fcc4228a6830 100644 --- a/packages/docusaurus-theme-common/src/utils/skipToContentUtils.tsx +++ b/packages/docusaurus-theme-common/src/utils/skipToContentUtils.tsx @@ -52,7 +52,7 @@ function useSkipToContent(): { * so that keyboard navigators can instantly interact with the link and jump * to content. */ - containerRef: React.RefObject; + containerRef: React.RefObject; /** * Callback fired when the skip to content link has been clicked. * It will programmatically focus the main content. diff --git a/packages/docusaurus/src/client/exports/Link.tsx b/packages/docusaurus/src/client/exports/Link.tsx index 76c9f4f5ea69..e294ecff7b70 100644 --- a/packages/docusaurus/src/client/exports/Link.tsx +++ b/packages/docusaurus/src/client/exports/Link.tsx @@ -100,7 +100,7 @@ function Link( const IOSupported = ExecutionEnvironment.canUseIntersectionObserver; - const ioRef = useRef(); + const ioRef = useRef(undefined); const handleRef = (el: HTMLAnchorElement | null) => { innerRef.current = el; diff --git a/website/src/components/APITable/index.tsx b/website/src/components/APITable/index.tsx index 96d4e43278c2..29ad3e57881f 100644 --- a/website/src/components/APITable/index.tsx +++ b/website/src/components/APITable/index.tsx @@ -26,7 +26,9 @@ interface Props { function getRowName(node: ReactElement): string { let curNode: ReactNode = node; while (isValidElement(curNode)) { - [curNode] = React.Children.toArray(curNode.props.children); + [curNode] = React.Children.toArray( + (curNode.props as {children: ReactNode}).children, + ); } if (typeof curNode !== 'string') { throw new Error( @@ -99,6 +101,7 @@ export default function APITable({children, name}: Props): ReactNode { highlightedRow.current?.focus(); }, [highlightedRow]); const rows = React.Children.map( + // @ts-expect-error: TODO fix typing tbody.props.children, (row: ReactElement>) => ( diff --git a/website/types.d.ts b/website/types.d.ts new file mode 100644 index 000000000000..7f7393587fc7 --- /dev/null +++ b/website/types.d.ts @@ -0,0 +1,22 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// This is a bad workaround to make our site typecheck under React 19 +// We run our site with "skipLibCheck=false", unfortunately some libraries +// are still using the global JSX namespace, that has been removed in v19 +// See https://react.dev/blog/2024/04/25/react-19-upgrade-guide#the-jsx-namespace-in-typescript +// See https://github.com/mdx-js/mdx/issues/2487 +import type {JSX as Jsx} from 'react/jsx-runtime'; + +declare global { + namespace JSX { + type ElementClass = Jsx.ElementClass; + type Element = Jsx.Element; + type ElementType = Jsx.ElementType; + type IntrinsicElements = Jsx.IntrinsicElements; + } +} diff --git a/yarn.lock b/yarn.lock index 19cd653d21ab..7ef3380fafb4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4562,11 +4562,6 @@ "@types/node" "*" kleur "^3.0.3" -"@types/prop-types@*": - version "15.7.13" - resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.13.tgz#2af91918ee12d9d32914feb13f5326658461b451" - integrity sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA== - "@types/qs@*": version "6.9.16" resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.16.tgz#52bba125a07c0482d26747d5d4947a64daf8f794" @@ -4617,13 +4612,12 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18.2.15": - version "18.3.12" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.12.tgz#99419f182ccd69151813b7ee24b792fe08774f60" - integrity sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw== +"@types/react@*", "@types/react@^19.2.10": + version "19.2.10" + resolved "https://registry.yarnpkg.com/@types/react/-/react-19.2.10.tgz#f3ea799e6b4cebad6dfd231c238fc9de7652e2d2" + integrity sha512-WPigyYuGhgZ/cTPRXB2EwUw+XvsRA3GqHlsP4qteqrnnjDrApbS7MxcGr/hke5iUoeB7E/gQtrs9I37zAJ0Vjw== dependencies: - "@types/prop-types" "*" - csstype "^3.0.2" + csstype "^3.2.2" "@types/resolve@1.20.2": version "1.20.2" @@ -7267,10 +7261,10 @@ cssstyle@^2.3.0: dependencies: cssom "~0.3.6" -csstype@^3.0.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" - integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw== +csstype@^3.2.2: + version "3.2.3" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.2.3.tgz#ec48c0f3e993e50648c86da559e2610995cf989a" + integrity sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ== cytoscape-cose-bilkent@^4.1.0: version "4.1.0" From db677a3cf07c083eea696da4d3c3131bb776d97d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Thu, 29 Jan 2026 18:09:28 +0100 Subject: [PATCH 3/3] feat(create-docusaurus): Newly initialized TS sites should use "strict: true" (#11696) Co-authored-by: slorber <749374+slorber@users.noreply.github.com> --- .../templates/classic-typescript/package.json | 1 + .../templates/classic-typescript/tsconfig.json | 7 +++++-- yarn.lock | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/create-docusaurus/templates/classic-typescript/package.json b/packages/create-docusaurus/templates/classic-typescript/package.json index 7d01472f6bbf..a6b52a1aa5ed 100644 --- a/packages/create-docusaurus/templates/classic-typescript/package.json +++ b/packages/create-docusaurus/templates/classic-typescript/package.json @@ -27,6 +27,7 @@ "@docusaurus/module-type-aliases": "3.9.2", "@docusaurus/tsconfig": "3.9.2", "@docusaurus/types": "3.9.2", + "@types/react": "^19.0.0", "typescript": "~5.6.2" }, "browserslist": { diff --git a/packages/create-docusaurus/templates/classic-typescript/tsconfig.json b/packages/create-docusaurus/templates/classic-typescript/tsconfig.json index 920d7a6523b8..aceae0dd36e4 100644 --- a/packages/create-docusaurus/templates/classic-typescript/tsconfig.json +++ b/packages/create-docusaurus/templates/classic-typescript/tsconfig.json @@ -1,8 +1,11 @@ +// This file is not used by "docusaurus start/build" commands. +// It is here to improve your IDE experience (type-checking, autocompletion...), +// and can also run the package.json "typecheck" script manually. { - // This file is not used in compilation. It is here just for a nice editor experience. "extends": "@docusaurus/tsconfig", "compilerOptions": { - "baseUrl": "." + "baseUrl": ".", + "strict": true }, "exclude": [".docusaurus", "build"] } diff --git a/yarn.lock b/yarn.lock index 7ef3380fafb4..fa426bd31fb0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4612,7 +4612,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^19.2.10": +"@types/react@*", "@types/react@^19.0.0", "@types/react@^19.2.10": version "19.2.10" resolved "https://registry.yarnpkg.com/@types/react/-/react-19.2.10.tgz#f3ea799e6b4cebad6dfd231c238fc9de7652e2d2" integrity sha512-WPigyYuGhgZ/cTPRXB2EwUw+XvsRA3GqHlsP4qteqrnnjDrApbS7MxcGr/hke5iUoeB7E/gQtrs9I37zAJ0Vjw==