@@ -4,7 +4,7 @@ import { gitHubReadToken } from "./env";
44const LOOKUP_REGEX = / < I n t r o > \s * ( .* ?) \s * < \/ I n t r o > / gs;
55const LINK_REGEX = / \[ ( [ ^ \] ] + ) \] \( (? ! h t t p s ? : \/ \/ ) ( [ ^ ) ] + ) \) / g;
66
7- const EXTRACT_SEARCH_KEY_REGEX = / (?< = ! ( d o c s | r e a c t - d o c s ) \s ) [ ^ \s ] + / ;
7+ const EXTRACT_SEARCH_KEY_REGEX = / (?< = ! ( d o c s | r e a c t - d o c s ) \s ) [ ^ \s . ] + / ;
88
99const BASE_URL =
1010 "https://api.github.com/repos/reactjs/react.dev/contents/src/content/reference/" ;
@@ -60,21 +60,23 @@ const processReactDocumentation = (content: string) => {
6060 const matches = [ ...patchedContentLinks . matchAll ( LOOKUP_REGEX ) ] ;
6161
6262 if ( matches . length > 0 ) {
63- const [ introContent ] = matches . map ( ( [ , match ] ) => match . trim ( ) ) ;
63+ const [ introContent ] = matches . map ( ( [ , match ] ) =>
64+ match . trim ( ) . replace ( / \n \n / g, "\n" ) ,
65+ ) ;
6466 return introContent ;
6567 }
6668
6769 return null ;
6870} ;
6971
7072const REACT_AVAILABLE_DOCS = [
73+ "react/act" ,
7174 "react/cache" ,
7275 "react/Children" ,
7376 "react/cloneElement" ,
7477 "react/Component" ,
7578 "react/createContext" ,
7679 "react/createElement" ,
77- "react/createFactory" ,
7880 "react/createRef" ,
7981 "react/experimental_taintObjectReference" ,
8082 "react/experimental_taintUniqueValue" ,
@@ -90,9 +92,8 @@ const REACT_AVAILABLE_DOCS = [
9092 "react/startTransition" ,
9193 "react/StrictMode" ,
9294 "react/Suspense" ,
93- "react/use-client" ,
94- "react/use-server" ,
9595 "react/use" ,
96+ "react/useActionState" ,
9697 "react/useCallback" ,
9798 "react/useContext" ,
9899 "react/useDebugValue" ,
@@ -111,18 +112,19 @@ const REACT_AVAILABLE_DOCS = [
111112 "react/useTransition" ,
112113 "react-dom/client/createRoot" ,
113114 "react-dom/client/hydrateRoot" ,
114- "react-dom/hooks/useFormState" ,
115+ "react-dom/createPortal" ,
116+ "react-dom/flushSync" ,
115117 "react-dom/hooks/useFormStatus" ,
116- "react-dom/server/renderToNodeStream" ,
118+ "react-dom/preconnect" ,
119+ "react-dom/prefetchDNS" ,
120+ "react-dom/preinit" ,
121+ "react-dom/preinitModule" ,
122+ "react-dom/preload" ,
123+ "react-dom/preloadModule" ,
117124 "react-dom/server/renderToPipeableStream" ,
118125 "react-dom/server/renderToReadableStream" ,
119126 "react-dom/server/renderToStaticMarkup" ,
120- "react-dom/server/renderToStaticNodeStream" ,
121127 "react-dom/server/renderToString" ,
122- "react-dom/unmountComponentAtNode" ,
123- "react-dom/hydrate" ,
124- "react-dom/render" ,
125- "react-dom/createPortal" ,
126- "react-dom/findDOMNode" ,
127- "react-dom/flushSync" ,
128+ "react-dom/static/prerender" ,
129+ "react-dom/static/prerenderToNodeStream" ,
128130] ;
0 commit comments