Skip to content

Commit 4dae846

Browse files
committed
chore: Update build to React 19
1 parent b8d4351 commit 4dae846

File tree

8 files changed

+529
-544
lines changed

8 files changed

+529
-544
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,17 @@ jobs:
3030
matrix:
3131
os: [ubuntu-latest, windows-latest]
3232
node-version: [20.x, 22.x, 24.x]
33+
react-version:
34+
- "v19.2.0"
35+
- "v18.3.1"
3336
docusaurus-version:
3437
- "v3.9.2"
3538
- "v3.8.1"
3639
- "v3.7.0"
40+
exclude:
41+
# React 19 only compiles with Docusaurus 3.8.0+ due to one of its dependencies.
42+
- react-version: "v19.2.0"
43+
docusaurus-version: "v3.7.0"
3744

3845
steps:
3946
- uses: actions/checkout@v4
@@ -50,8 +57,8 @@ jobs:
5057
- run: pnpm install --frozen-lockfile
5158
- run: pnpm run lint
5259

53-
- name: Installing Docusaurus ${{ matrix.docusaurus-version }} and dependencies
54-
run: pnpm -r add --save-dev '@docusaurus/core@${{ matrix.docusaurus-version }}' '@docusaurus/preset-classic@${{ matrix.docusaurus-version }}' '@docusaurus/module-type-aliases@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-blog@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-docs@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-pages@${{ matrix.docusaurus-version }}' '@docusaurus/theme-common@${{ matrix.docusaurus-version }}' '@docusaurus/theme-classic@${{ matrix.docusaurus-version }}' '@docusaurus/types@${{ matrix.docusaurus-version }}'
60+
- name: Installing Docusaurus ${{ matrix.docusaurus-version }}, React ${{ matrix.react-version }} and dependencies
61+
run: pnpm -r add --save-dev '@docusaurus/core@${{ matrix.docusaurus-version }}' '@docusaurus/preset-classic@${{ matrix.docusaurus-version }}' '@docusaurus/module-type-aliases@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-blog@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-docs@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-pages@${{ matrix.docusaurus-version }}' '@docusaurus/theme-common@${{ matrix.docusaurus-version }}' '@docusaurus/theme-classic@${{ matrix.docusaurus-version }}' '@docusaurus/types@${{ matrix.docusaurus-version }}' 'react@${{ matrix.react-version }}' 'react-dom@${{ matrix.react-version }}' '@types/react@${{ matrix.react-version }}' '@types/react-dom@${{ matrix.react-version }}'
5562
- run: pnpm dedupe
5663

5764
- run: pnpm run build
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
diff --git a/dist/esm/components/Highlight.d.ts b/dist/esm/components/Highlight.d.ts
2+
index 214dbddacc8d343a7eea42f91b4c18a20369bbf5..1b367d17bab5cf0bcf4fbf5d66e40bfc94dcb124 100644
3+
--- a/dist/esm/components/Highlight.d.ts
4+
+++ b/dist/esm/components/Highlight.d.ts
5+
@@ -1,6 +1,7 @@
6+
/// <reference types="react" />
7+
+import React from 'react';
8+
import { AutocompleteRenderer, HighlightHitParams } from '../types';
9+
export declare function createHighlightComponent({ createElement, Fragment, }: AutocompleteRenderer): {
10+
- <THit>({ hit, attribute, tagName, }: HighlightHitParams<THit>): JSX.Element;
11+
+ <THit>({ hit, attribute, tagName, }: HighlightHitParams<THit>): React.JSX.Element;
12+
__autocomplete_componentName: string;
13+
};
14+
diff --git a/dist/esm/components/ReverseHighlight.d.ts b/dist/esm/components/ReverseHighlight.d.ts
15+
index bb5937f5e56734cf4b18764a9376046239b467e5..c39c4f30073f988528dfa67cb930b5ae3a75d74b 100644
16+
--- a/dist/esm/components/ReverseHighlight.d.ts
17+
+++ b/dist/esm/components/ReverseHighlight.d.ts
18+
@@ -1,6 +1,7 @@
19+
/// <reference types="react" />
20+
+import React from 'react';
21+
import { AutocompleteRenderer, HighlightHitParams } from '../types';
22+
export declare function createReverseHighlightComponent({ createElement, Fragment, }: AutocompleteRenderer): {
23+
- <THit>({ hit, attribute, tagName, }: HighlightHitParams<THit>): JSX.Element;
24+
+ <THit>({ hit, attribute, tagName, }: HighlightHitParams<THit>): React.JSX.Element;
25+
__autocomplete_componentName: string;
26+
};
27+
diff --git a/dist/esm/components/ReverseSnippet.d.ts b/dist/esm/components/ReverseSnippet.d.ts
28+
index c4bbd50996a9dfb285019a957b381922cf97622b..13c9b2825f7ea7cac78ee897908120e9dbab2c71 100644
29+
--- a/dist/esm/components/ReverseSnippet.d.ts
30+
+++ b/dist/esm/components/ReverseSnippet.d.ts
31+
@@ -1,6 +1,7 @@
32+
/// <reference types="react" />
33+
+import React from 'react';
34+
import { AutocompleteRenderer, HighlightHitParams } from '../types';
35+
export declare function createReverseSnippetComponent({ createElement, Fragment, }: AutocompleteRenderer): {
36+
- <THit>({ hit, attribute, tagName, }: HighlightHitParams<THit>): JSX.Element;
37+
+ <THit>({ hit, attribute, tagName, }: HighlightHitParams<THit>): React.JSX.Element;
38+
__autocomplete_componentName: string;
39+
};
40+
diff --git a/dist/esm/components/Snippet.d.ts b/dist/esm/components/Snippet.d.ts
41+
index 7b4785836d848abd3415ad489404760c4a3ad529..11f3665497eee4025875005da91e274fa9ebca4c 100644
42+
--- a/dist/esm/components/Snippet.d.ts
43+
+++ b/dist/esm/components/Snippet.d.ts
44+
@@ -1,6 +1,7 @@
45+
/// <reference types="react" />
46+
+import React from 'react';
47+
import { AutocompleteRenderer, HighlightHitParams } from '../types';
48+
export declare function createSnippetComponent({ createElement, Fragment, }: AutocompleteRenderer): {
49+
- <THit>({ hit, attribute, tagName, }: HighlightHitParams<THit>): JSX.Element;
50+
+ <THit>({ hit, attribute, tagName, }: HighlightHitParams<THit>): React.JSX.Element;
51+
__autocomplete_componentName: string;
52+
};
53+
diff --git a/dist/esm/getDefaultOptions.d.ts b/dist/esm/getDefaultOptions.d.ts
54+
index 6691997c7b0e62605ea6a1fd9b379aab3a33eb5f..1173dfd1a084e847dec8075b9f346c8d2e92a27b 100644
55+
--- a/dist/esm/getDefaultOptions.d.ts
56+
+++ b/dist/esm/getDefaultOptions.d.ts
57+
@@ -1,4 +1,5 @@
58+
/// <reference types="react" />
59+
+import React from "react";
60+
import { BaseItem } from '@algolia/autocomplete-core';
61+
import { AutocompleteClassNames, AutocompleteOptions, AutocompleteRender } from './types';
62+
export declare function getDefaultOptions<TItem extends BaseItem>(options: AutocompleteOptions<TItem>): {
63+
@@ -165,11 +166,11 @@ export declare function getDefaultOptions<TItem extends BaseItem>(options: Autoc
64+
};
65+
detachedMediaQuery: string;
66+
components: {
67+
- [x: string]: (props: any) => JSX.Element;
68+
- Highlight: <THit>({ hit, attribute, tagName, }: import("./types").HighlightHitParams<THit>) => JSX.Element;
69+
- ReverseHighlight: <THit>({ hit, attribute, tagName, }: import("./types").HighlightHitParams<THit>) => JSX.Element;
70+
- ReverseSnippet: <THit>({ hit, attribute, tagName, }: import("./types").HighlightHitParams<THit>) => JSX.Element;
71+
- Snippet: <THit>({ hit, attribute, tagName, }: import("./types").HighlightHitParams<THit>) => JSX.Element;
72+
+ [x: string]: (props: any) => React.JSX.Element;
73+
+ Highlight: <THit>({ hit, attribute, tagName, }: import("./types").HighlightHitParams<THit>) => React.JSX.Element;
74+
+ ReverseHighlight: <THit>({ hit, attribute, tagName, }: import("./types").HighlightHitParams<THit>) => React.JSX.Element;
75+
+ ReverseSnippet: <THit>({ hit, attribute, tagName, }: import("./types").HighlightHitParams<THit>) => React.JSX.Element;
76+
+ Snippet: <THit>({ hit, attribute, tagName, }: import("./types").HighlightHitParams<THit>) => React.JSX.Element;
77+
};
78+
translations: {
79+
detachedCancelButtonText: string;
80+
diff --git a/dist/esm/types/AutocompleteComponents.d.ts b/dist/esm/types/AutocompleteComponents.d.ts
81+
index cc1272833b8876769dc85b095beda01b123377ec..6e458f35a5ad85af219bcfa288dd47fbd1917ee8 100644
82+
--- a/dist/esm/types/AutocompleteComponents.d.ts
83+
+++ b/dist/esm/types/AutocompleteComponents.d.ts
84+
@@ -1,7 +1,8 @@
85+
/// <reference types="react" />
86+
+import React from "react";
87+
import { HighlightHitParams } from '.';
88+
-declare type AutocompleteHighlightComponent = <THit>({ hit, attribute, tagName, }: HighlightHitParams<THit>) => JSX.Element;
89+
-export declare type PublicAutocompleteComponents = Record<string, (props: any) => JSX.Element>;
90+
+declare type AutocompleteHighlightComponent = <THit>({ hit, attribute, tagName, }: HighlightHitParams<THit>) => React.JSX.Element;
91+
+export declare type PublicAutocompleteComponents = Record<string, (props: any) => React.JSX.Element>;
92+
export interface AutocompleteComponents extends PublicAutocompleteComponents {
93+
/**
94+
* Highlight matches in an Algolia hit.
95+
diff --git a/dist/esm/types/AutocompleteRenderer.d.ts b/dist/esm/types/AutocompleteRenderer.d.ts
96+
index 3ca05d5a52c06d4a23c3227e91af4c5e22853945..58f33910e086f8d3facf2fd611ec27194969d5dd 100644
97+
--- a/dist/esm/types/AutocompleteRenderer.d.ts
98+
+++ b/dist/esm/types/AutocompleteRenderer.d.ts
99+
@@ -1,5 +1,7 @@
100+
/// <reference types="react" />
101+
-export declare type Pragma = (type: any, props: Record<string, any> | null, ...children: ComponentChildren[]) => JSX.Element;
102+
+import React from 'react';
103+
+
104+
+export declare type Pragma = (type: any, props: Record<string, any> | null, ...children: ComponentChildren[]) => React.JSX.Element;
105+
export declare type PragmaFrag = any;
106+
declare type ComponentChild = VNode<any> | string | number | boolean | null | undefined;
107+
declare type ComponentChildren = ComponentChild[] | ComponentChild;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/index.d.ts b/index.d.ts
2+
index 0dd7c4f97a0cf4779fadae69a14555293351c9ec..d3520360143e7f207c8f5f326a880d8345ddd738 100644
3+
--- a/index.d.ts
4+
+++ b/index.d.ts
5+
@@ -5,13 +5,13 @@ declare module 'react-helmet-async' {
6+
[key: string]: string | number | boolean | null | undefined;
7+
}
8+
9+
- type HtmlProps = JSX.IntrinsicElements['html'] & OtherElementAttributes;
10+
+ type HtmlProps = React.JSX.IntrinsicElements['html'] & OtherElementAttributes;
11+
12+
- type BodyProps = JSX.IntrinsicElements['body'] & OtherElementAttributes;
13+
+ type BodyProps = React.JSX.IntrinsicElements['body'] & OtherElementAttributes;
14+
15+
- type LinkProps = JSX.IntrinsicElements['link'];
16+
+ type LinkProps = React.JSX.IntrinsicElements['link'];
17+
18+
- type MetaProps = JSX.IntrinsicElements['meta'];
19+
+ type MetaProps = React.JSX.IntrinsicElements['meta'];
20+
21+
export interface HelmetTags {
22+
baseTag: Array<any>;

patches/@types__mdx.patch

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
diff --git a/types.d.ts b/types.d.ts
2+
index 498bb694de2e6a62f14d3fe998dc538aff920fc6..d3669b3bb313e4f796a45a7eafa3b3800ba9e312 100644
3+
--- a/types.d.ts
4+
+++ b/types.d.ts
5+
@@ -1,11 +1,12 @@
6+
// Internal helper types
7+
+import React from "react";
8+
9+
/**
10+
- * This is the global JSX.ElementType if it’s defined, otherwise never.
11+
+ * This is the global React.JSX.ElementType if it’s defined, otherwise never.
12+
*/
13+
-// @ts-ignore JSX runtimes may optionally define JSX.ElementType. The MDX types need to work regardless whether this is
14+
+// @ts-ignore JSX runtimes may optionally define React.JSX.ElementType. The MDX types need to work regardless whether this is
15+
// defined or not.
16+
-type ElementType = any extends JSX.ElementType ? never : JSX.ElementType;
17+
+type ElementType = any extends React.JSX.ElementType ? never : React.JSX.ElementType;
18+
19+
/**
20+
* This matches any function component types that ar part of `ElementType`.
21+
@@ -20,35 +21,35 @@ type ClassElementType = Extract<ElementType, new(props: Record<string, any>) =>
22+
/**
23+
* A valid JSX string component.
24+
*/
25+
-type StringComponent = Extract<keyof JSX.IntrinsicElements, ElementType extends never ? string : ElementType>;
26+
+type StringComponent = Extract<keyof React.JSX.IntrinsicElements, ElementType extends never ? string : ElementType>;
27+
28+
/**
29+
* A JSX element returned by MDX content.
30+
*/
31+
-export type Element = JSX.Element;
32+
+export type Element = React.JSX.Element;
33+
34+
/**
35+
* A valid JSX function component.
36+
*/
37+
type FunctionComponent<Props> = ElementType extends never
38+
- // If JSX.ElementType isn’t defined, the valid return type is JSX.Element
39+
+ // If React.JSX.ElementType isn’t defined, the valid return type is React.JSX.Element
40+
? (props: Props) => Element | null
41+
: FunctionElementType extends never
42+
- // If JSX.ElementType is defined, but doesn’t allow function components, function components are disallowed.
43+
+ // If React.JSX.ElementType is defined, but doesn’t allow function components, function components are disallowed.
44+
? never
45+
- // If JSX.ElementType allows function components, its return value determines what is a valid.
46+
+ // If React.JSX.ElementType allows function components, its return value determines what is a valid.
47+
: (props: Props) => ReturnType<FunctionElementType>;
48+
49+
/**
50+
* A valid JSX class component.
51+
*/
52+
type ClassComponent<Props> = ElementType extends never
53+
- // If JSX.ElementType isn’t defined, the valid return type is a constructor that returns JSX.ElementClass
54+
- ? new(props: Props) => JSX.ElementClass
55+
+ // If React.JSX.ElementType isn’t defined, the valid return type is a constructor that returns React.JSX.ElementClass
56+
+ ? new(props: Props) => React.JSX.ElementClass
57+
: ClassElementType extends never
58+
- // If JSX.ElementType is defined, but doesn’t allow constructors, function components are disallowed.
59+
+ // If React.JSX.ElementType is defined, but doesn’t allow constructors, function components are disallowed.
60+
? never
61+
- // If JSX.ElementType allows class components, its return value determines what is a valid.
62+
+ // If React.JSX.ElementType allows class components, its return value determines what is a valid.
63+
: new(props: Props) => InstanceType<ClassElementType>;
64+
65+
/**
66+
@@ -70,7 +71,7 @@ interface NestedMDXComponents {
67+
export type MDXComponents =
68+
& NestedMDXComponents
69+
& {
70+
- [Key in StringComponent]?: Component<JSX.IntrinsicElements[Key]>;
71+
+ [Key in StringComponent]?: Component<React.JSX.IntrinsicElements[Key]>;
72+
}
73+
& {
74+
/**
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
diff --git a/index.d.ts b/index.d.ts
2+
index babf652dddf4ef47f3ae018704581cac1cf82ac0..0adb8f473d88d1138ab0363ac4b83423769841f6 100755
3+
--- a/index.d.ts
4+
+++ b/index.d.ts
5+
@@ -43,4 +43,4 @@ export function renderRoutes(
6+
routes: RouteConfig[] | undefined,
7+
extraProps?: any,
8+
switchProps?: SwitchProps,
9+
-): JSX.Element;
10+
+): React.JSX.Element;

patches/prism-react-renderer.patch

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
diff --git a/dist/index.d.ts b/dist/index.d.ts
2+
index 9aa7ee82156501f162ba2e03c9f0a77744c0262a..1bf7408fe7a862ff28b8016fe6260e9208b78ab5 100644
3+
--- a/dist/index.d.ts
4+
+++ b/dist/index.d.ts
5+
@@ -1,5 +1,5 @@
6+
import * as react from 'react';
7+
-import { CSSProperties } from 'react';
8+
+import { CSSProperties, JSX } from 'react';
9+
import Prism__default, { Grammar, Token as Token$1 } from 'prismjs';
10+
import * as Prism from 'prismjs';
11+
export { Prism };

0 commit comments

Comments
 (0)