Skip to content

Commit f4bea35

Browse files
merging all conflicts
2 parents 7821f08 + 6bfde58 commit f4bea35

26 files changed

+692
-144
lines changed

src/components/DocsFooter.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const DocsPageFooter = memo<DocsPageFooterProps>(
2727
<>
2828
{prevRoute?.path || nextRoute?.path ? (
2929
<>
30-
<div className="max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-2 gap-4 py-4 md:py-12">
30+
<div className="grid grid-cols-1 gap-4 py-4 mx-auto max-w-7xl md:grid-cols-2 md:py-12">
3131
{prevRoute?.path ? (
3232
<FooterLink
3333
type="Previous"
@@ -69,21 +69,29 @@ function FooterLink({
6969
<NextLink
7070
href={href}
7171
className={cn(
72-
'flex gap-x-4 md:gap-x-6 items-center w-full md:w-80 px-4 md:px-5 py-6 border-2 border-transparent text-base leading-base text-link dark:text-link-dark rounded-lg group focus:text-link dark:focus:text-link-dark focus:bg-highlight focus:border-link dark:focus:bg-highlight-dark dark:focus:border-link-dark focus:border-opacity-100 focus:border-2 focus:ring-1 focus:ring-offset-4 focus:ring-blue-40 active:ring-0 active:ring-offset-0 hover:bg-gray-5 dark:hover:bg-gray-80',
72+
'flex gap-x-4 md:gap-x-6 items-center w-full md:min-w-80 md:w-fit md:max-w-md px-4 md:px-5 py-6 border-2 border-transparent text-base leading-base text-link dark:text-link-dark rounded-lg group focus:text-link dark:focus:text-link-dark focus:bg-highlight focus:border-link dark:focus:bg-highlight-dark dark:focus:border-link-dark focus:border-opacity-100 focus:border-2 focus:ring-1 focus:ring-offset-4 focus:ring-blue-40 active:ring-0 active:ring-offset-0 hover:bg-gray-5 dark:hover:bg-gray-80',
7373
{
7474
'flex-row-reverse justify-self-end text-end': type === 'Next',
7575
}
7676
)}>
7777
<IconNavArrow
78-
className="text-tertiary dark:text-tertiary-dark inline group-focus:text-link dark:group-focus:text-link-dark"
78+
className="inline text-tertiary dark:text-tertiary-dark group-focus:text-link dark:group-focus:text-link-dark"
7979
displayDirection={type === 'Previous' ? 'start' : 'end'}
8080
/>
81+
<<<<<<< HEAD
8182
<span>
8283
<span className="block no-underline text-sm tracking-wide text-secondary dark:text-secondary-dark uppercase font-bold group-focus:text-link dark:group-focus:text-link-dark group-focus:text-opacity-100">
8384
{type === 'Next' ? 'Suivant' : 'Précédent'}
85+
=======
86+
<div className="flex flex-col overflow-hidden">
87+
<span className="text-sm font-bold tracking-wide no-underline uppercase text-secondary dark:text-secondary-dark group-focus:text-link dark:group-focus:text-link-dark group-focus:text-opacity-100">
88+
{type}
89+
>>>>>>> 6bfde58c109ec86fd6c5767421404cb679ffba9a
8490
</span>
85-
<span className="block text-lg group-hover:underline">{title}</span>
86-
</span>
91+
<span className="text-lg break-words group-hover:underline">
92+
{title}
93+
</span>
94+
</div>
8795
</NextLink>
8896
);
8997
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Error Decoder requires reading pregenerated error message from getStaticProps,
2+
// but MDX component doesn't support props. So we use React Context to populate
3+
// the value without prop-drilling.
4+
// TODO: Replace with React.cache + React.use when migrating to Next.js App Router
5+
6+
import {createContext, useContext} from 'react';
7+
8+
const notInErrorDecoderContext = Symbol('not in error decoder context');
9+
10+
export const ErrorDecoderContext = createContext<
11+
| {errorMessage: string | null; errorCode: string | null}
12+
| typeof notInErrorDecoderContext
13+
>(notInErrorDecoderContext);
14+
15+
export const useErrorDecoderParams = () => {
16+
const params = useContext(ErrorDecoderContext);
17+
18+
if (params === notInErrorDecoderContext) {
19+
throw new Error('useErrorDecoder must be used in error decoder pages only');
20+
}
21+
22+
return params;
23+
};

src/components/Layout/Feedback.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import {useState} from 'react';
66
import {useRouter} from 'next/router';
7+
import cn from 'classnames';
78

89
export function Feedback({onSubmit = () => {}}: {onSubmit?: () => void}) {
910
const {asPath} = useRouter();
@@ -60,7 +61,11 @@ function sendGAEvent(isPositive: boolean) {
6061
function SendFeedback({onSubmit}: {onSubmit: () => void}) {
6162
const [isSubmitted, setIsSubmitted] = useState(false);
6263
return (
63-
<div className="max-w-xs w-80 lg:w-auto py-3 shadow-lg rounded-lg m-4 bg-wash dark:bg-gray-95 px-4 flex">
64+
<div
65+
className={cn(
66+
'max-w-xs w-80 lg:w-auto py-3 shadow-lg rounded-lg m-4 bg-wash dark:bg-gray-95 px-4 flex',
67+
{exit: isSubmitted}
68+
)}>
6469
<p className="w-full font-bold text-primary dark:text-primary-dark text-lg me-4">
6570
{isSubmitted ? 'Merci pour votre retour !' : 'Cette page est utile ?'}
6671
</p>

src/components/MDX/ErrorDecoder.tsx

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import {useEffect, useState} from 'react';
2+
import {useErrorDecoderParams} from '../ErrorDecoderContext';
3+
import cn from 'classnames';
4+
5+
function replaceArgs(
6+
msg: string,
7+
argList: Array<string | undefined>,
8+
replacer = '[missing argument]'
9+
): string {
10+
let argIdx = 0;
11+
return msg.replace(/%s/g, function () {
12+
const arg = argList[argIdx++];
13+
// arg can be an empty string: ?args[0]=&args[1]=count
14+
return arg === undefined || arg === '' ? replacer : arg;
15+
});
16+
}
17+
18+
/**
19+
* Sindre Sorhus <https://sindresorhus.com>
20+
* Released under MIT license
21+
* https://github.com/sindresorhus/linkify-urls/blob/edd75a64a9c36d7025f102f666ddbb6cf0afa7cd/index.js#L4C25-L4C137
22+
*
23+
* The regex is used to extract URL from the string for linkify.
24+
*/
25+
const urlRegex =
26+
/((?<!\+)https?:\/\/(?:www\.)?(?:[-\w.]+?[.@][a-zA-Z\d]{2,}|localhost)(?:[-\w.:%+~#*$!?&/=@]*?(?:,(?!\s))*?)*)/g;
27+
28+
// When the message contains a URL (like https://fb.me/react-refs-must-have-owner),
29+
// make it a clickable link.
30+
function urlify(str: string): React.ReactNode[] {
31+
const segments = str.split(urlRegex);
32+
33+
return segments.map((message, i) => {
34+
if (i % 2 === 1) {
35+
return (
36+
<a
37+
key={i}
38+
target="_blank"
39+
className="underline"
40+
rel="noopener noreferrer"
41+
href={message}>
42+
{message}
43+
</a>
44+
);
45+
}
46+
return message;
47+
});
48+
}
49+
50+
// `?args[]=foo&args[]=bar`
51+
// or `// ?args[0]=foo&args[1]=bar`
52+
function parseQueryString(search: string): Array<string | undefined> {
53+
const rawQueryString = search.substring(1);
54+
if (!rawQueryString) {
55+
return [];
56+
}
57+
58+
const args: Array<string | undefined> = [];
59+
60+
const queries = rawQueryString.split('&');
61+
for (let i = 0; i < queries.length; i++) {
62+
const query = decodeURIComponent(queries[i]);
63+
if (query.startsWith('args[')) {
64+
args.push(query.slice(query.indexOf(']=') + 2));
65+
}
66+
}
67+
68+
return args;
69+
}
70+
71+
export default function ErrorDecoder() {
72+
const {errorMessage} = useErrorDecoderParams();
73+
/** error messages that contain %s require reading location.search */
74+
const hasParams = errorMessage?.includes('%s');
75+
const [message, setMessage] = useState<React.ReactNode | null>(() =>
76+
errorMessage ? urlify(errorMessage) : null
77+
);
78+
79+
const [isReady, setIsReady] = useState(errorMessage == null || !hasParams);
80+
81+
useEffect(() => {
82+
if (errorMessage == null || !hasParams) {
83+
return;
84+
}
85+
86+
setMessage(
87+
urlify(
88+
replaceArgs(
89+
errorMessage,
90+
parseQueryString(window.location.search),
91+
'[missing argument]'
92+
)
93+
)
94+
);
95+
setIsReady(true);
96+
}, [hasParams, errorMessage]);
97+
98+
return (
99+
<code
100+
className={cn(
101+
'block bg-red-100 text-red-600 py-4 px-6 mt-5 rounded-lg',
102+
isReady ? 'opacity-100' : 'opacity-0'
103+
)}>
104+
<b>{message}</b>
105+
</code>
106+
);
107+
}

src/components/MDX/MDXComponents.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ import {TocContext} from './TocContext';
3131
import type {Toc, TocItem} from './TocContext';
3232
import {TeamMember} from './TeamMember';
3333

34+
import ErrorDecoder from './ErrorDecoder';
35+
3436
function CodeStep({children, step}: {children: any; step: number}) {
3537
return (
3638
<span
@@ -441,6 +443,7 @@ export const MDXComponents = {
441443
Solution,
442444
CodeStep,
443445
YouTubeIframe,
446+
ErrorDecoder,
444447
};
445448

446449
for (let key in MDXComponents) {

src/content/community/conferences.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ Vous connaissez une conférence React.js locale ? Ajoutez-la ! (Merci de conse
1010

1111
## Conférences à venir {/*upcoming-conferences*/}
1212

13+
### React Paris 2024 {/*react-paris-2024*/}
14+
March 22, 2024. In-person in Paris, France + Remote (hybrid)
15+
16+
[Website](https://react.paris/) - [Twitter](https://twitter.com/BeJS_) - [LinkedIn](https://www.linkedin.com/events/7150816372074192900/comments/)
17+
1318
### App.js Conf 2024 {/*appjs-conf-2024*/}
1419
May 22 - 24, 2024. In-person in Kraków, Poland + remote
1520

@@ -20,6 +25,11 @@ June 12 - June 14, 2024. Atlanta, GA, USA
2025

2126
[Site web](https://renderatl.com) - [Discord](https://www.renderatl.com/discord) - [Twitter](https://twitter.com/renderATL) - [Instagram](https://www.instagram.com/renderatl/) - [Facebook](https://www.facebook.com/renderatl/) - [LinkedIn](https://www.linkedin.com/company/renderatl) - [Podcast](https://www.renderatl.com/culture-and-code#/)
2227

28+
### React Nexus 2024 {/*react-nexus-2024*/}
29+
July 04 & 05, 2024. Bangalore, India (In-person event)
30+
31+
[Website](https://reactnexus.com/) - [Twitter](https://twitter.com/ReactNexus) - [Linkedin](https://www.linkedin.com/company/react-nexus) - [YouTube](https://www.youtube.com/reactify_in)
32+
2333
### React India 2024 {/*react-india-2024*/}
2434
October 17 - 19, 2024. In-person in Goa, India (hybrid event) + Oct 15 2024 - remote day
2535

@@ -50,7 +60,11 @@ October 20 & 23, 2023. In-person in London, UK + remote first interactivity (hyb
5060
### React Brussels 2023 {/*react-brussels-2023*/}
5161
October 13th 2023. In-person in Brussels, Belgium + Remote (hybrid)
5262

63+
<<<<<<< HEAD
5364
[Site web](https://www.react.brussels/) - [Twitter](https://twitter.com/BrusselsReact)
65+
=======
66+
[Website](https://www.react.brussels/) - [Twitter](https://twitter.com/BrusselsReact) - [Videos](https://www.youtube.com/playlist?list=PL53Z0yyYnpWh85KeMomUoVz8_brrmh_aC)
67+
>>>>>>> 6bfde58c109ec86fd6c5767421404cb679ffba9a
5468
5569
### React India 2023 {/*react-india-2023*/}
5670
October 5 - 7, 2023. In-person in Goa, India (hybrid event) + Oct 3 2023 - remote day

src/content/community/meetups.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,100 @@ Vous connaissez un meetup React.js local ? Ajoutez-le ! (Merci de conserver un
8080
* [Aalborg](https://www.meetup.com/Aalborg-React-React-Native-Meetup/)
8181
* [Aarhus](https://www.meetup.com/Aarhus-ReactJS-Meetup/)
8282

83+
<<<<<<< HEAD
8384
## Écosse (R.-U.) {/*scotland-uk*/}
85+
=======
86+
## Egypt {/*egypt*/}
87+
* [Cairo](https://www.meetup.com/react-cairo/)
88+
89+
## England (UK) {/*england-uk*/}
90+
* [Manchester](https://www.meetup.com/Manchester-React-User-Group/)
91+
* [React.JS Girls London](https://www.meetup.com/ReactJS-Girls-London/)
92+
* [React Advanced London](https://guild.host/react-advanced-london)
93+
* [React Native London](https://guild.host/RNLDN)
94+
95+
## France {/*france*/}
96+
* [Nantes](https://www.meetup.com/React-Nantes/)
97+
* [Lille](https://www.meetup.com/ReactBeerLille/)
98+
* [Paris](https://www.meetup.com/ReactJS-Paris/)
99+
100+
## Germany {/*germany*/}
101+
* [Cologne](https://www.meetup.com/React-Cologne/)
102+
* [Düsseldorf](https://www.meetup.com/de-DE/ReactJS-Meetup-Dusseldorf/)
103+
* [Hamburg](https://www.meetup.com/Hamburg-React-js-Meetup/)
104+
* [Karlsruhe](https://www.meetup.com/react_ka/)
105+
* [Kiel](https://www.meetup.com/Kiel-React-Native-Meetup/)
106+
* [Munich](https://www.meetup.com/ReactJS-Meetup-Munich/)
107+
* [React Berlin](https://guild.host/react-berlin)
108+
109+
## Greece {/*greece*/}
110+
* [Athens](https://www.meetup.com/React-To-React-Athens-MeetUp/)
111+
* [Thessaloniki](https://www.meetup.com/Thessaloniki-ReactJS-Meetup/)
112+
113+
## Hungary {/*hungary*/}
114+
* [Budapest](https://www.meetup.com/React-Budapest/)
115+
116+
## India {/*india*/}
117+
* [Ahmedabad](https://www.meetup.com/react-ahmedabad/)
118+
* [Bangalore (React)](https://www.meetup.com/ReactJS-Bangalore/)
119+
* [Bangalore (React Native)](https://www.meetup.com/React-Native-Bangalore-Meetup)
120+
* [Chennai](https://www.meetup.com/React-Chennai/)
121+
* [Delhi NCR](https://www.meetup.com/React-Delhi-NCR/)
122+
* [Mumbai](https://reactmumbai.dev)
123+
* [Pune](https://www.meetup.com/ReactJS-and-Friends/)
124+
125+
## Indonesia {/*indonesia*/}
126+
* [Indonesia](https://www.meetup.com/reactindonesia/)
127+
128+
## Ireland {/*ireland*/}
129+
* [Dublin](https://guild.host/reactjs-dublin)
130+
131+
## Israel {/*israel*/}
132+
* [Tel Aviv](https://www.meetup.com/ReactJS-Israel/)
133+
134+
## Italy {/*italy*/}
135+
* [Milan](https://www.meetup.com/React-JS-Milano/)
136+
137+
## Kenya {/*kenya*/}
138+
* [Nairobi - Reactdevske](https://kommunity.com/reactjs-developer-community-kenya-reactdevske)
139+
140+
## Malaysia {/*malaysia*/}
141+
* [Kuala Lumpur](https://www.kl-react.com/)
142+
* [Penang](https://www.facebook.com/groups/reactpenang/)
143+
144+
## Netherlands {/*netherlands*/}
145+
* [Amsterdam](https://guild.host/react-amsterdam)
146+
147+
## New Zealand {/*new-zealand*/}
148+
* [Wellington](https://www.meetup.com/React-Wellington/)
149+
150+
## Norway {/*norway*/}
151+
* [Norway](https://reactjs-norway.webflow.io/)
152+
* [Oslo](https://www.meetup.com/ReactJS-Oslo-Meetup/)
153+
154+
## Pakistan {/*pakistan*/}
155+
* [Karachi](https://www.facebook.com/groups/902678696597634/)
156+
* [Lahore](https://www.facebook.com/groups/ReactjsLahore/)
157+
158+
## Panama {/*panama*/}
159+
* [Panama](https://www.meetup.com/React-Panama/)
160+
161+
## Peru {/*peru*/}
162+
* [Lima](https://www.meetup.com/ReactJS-Peru/)
163+
164+
## Philippines {/*philippines*/}
165+
* [Manila](https://www.meetup.com/reactjs-developers-manila/)
166+
* [Manila - ReactJS PH](https://www.meetup.com/ReactJS-Philippines/)
167+
168+
## Poland {/*poland*/}
169+
* [Warsaw](https://www.meetup.com/React-js-Warsaw/)
170+
* [Wrocław](https://www.meetup.com/ReactJS-Wroclaw/)
171+
172+
## Portugal {/*portugal*/}
173+
* [Lisbon](https://www.meetup.com/JavaScript-Lisbon/)
174+
175+
## Scotland (UK) {/*scotland-uk*/}
176+
>>>>>>> 6bfde58c109ec86fd6c5767421404cb679ffba9a
84177
* [Edinburgh](https://www.meetup.com/React-Scotland/)
85178

86179
## Égypte {/*egypt*/}
@@ -117,6 +210,7 @@ Vous connaissez un meetup React.js local ? Ajoutez-le ! (Merci de conserver un
117210
* [New York, NY - React Ladies](https://www.meetup.com/React-Ladies/)
118211
* [New York, NY - React Native](https://www.meetup.com/React-Native-NYC/)
119212
* [New York, NY - useReactNYC](https://www.meetup.com/useReactNYC/)
213+
* [New York, NY - React.NYC](https://guild.host/react-nyc)
120214
* [Omaha, NE - ReactJS/React Native](https://www.meetup.com/omaha-react-meetup-group/)
121215
* [Palo Alto, CA - React Native](https://www.meetup.com/React-Native-Silicon-Valley/)
122216
* [Philadelphia, PA - ReactJS](https://www.meetup.com/Reactadelphia/)

src/content/community/versioning-policy.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,15 @@ Cette section s'adresse surtout aux développeurs·ses qui travaillent sur des f
7979

8080
Chaque canal de livraison de React est conçu pour un cas d'utilisation précis :
8181

82+
<<<<<<< HEAD
8283
- [**Latest**](#latest-channel) est dédié aux versions stables de React, basées sur *semver*. C'est ce que vous récupérez lorsque vous installez React avec npm. C'est le canal que vous utilisez déjà aujourd'hui. **Les applications basées sur React et destinées aux utilisateurs finaux utilisent ce canal**.
8384
- [**Canary**](#canary-channel) suit la branche principale du dépôt du code source de React. Voyez-les comme des versions candidates pour la prochaine version *semver*. **[Les frameworks et autres environnements choisis peuvent décider d'utiliser ce canal avec une version épinglée de React](/blog/2023/05/03/react-canaries). Vous pouvez aussi utiliser les versions Canary pour tester l'intégration de React avec des projets tiers.**
8485
- [**Expérimental**](#experimental-channel) inclut les API et fonctionnalités expérimentales qui ne sont pas disponibles dans les versions stables. Il suit lui aussi la branche principale, mais avec certains drapeaux de fonctionnalités supplémentaires activés. Vous pouvez l'utiliser pour tester en amont les prochaines fonctionnalités avant qu'elles ne soient livrées.
86+
=======
87+
- [**Latest**](#latest-channel) is for stable, semver React releases. It's what you get when you install React from npm. This is the channel you're already using today. **User-facing applications that consume React directly use this channel.**
88+
- [**Canary**](#canary-channel) tracks the main branch of the React source code repository. Think of these as release candidates for the next semver release. **[Frameworks or other curated setups may choose to use this channel with a pinned version of React.](/blog/2023/05/03/react-canaries) You can also use Canaries for integration testing between React and third party projects.**
89+
- [**Experimental**](#experimental-channel) includes experimental APIs and features that aren't available in the stable releases. These also track the main branch, but with additional feature flags turned on. Use this to try out upcoming features before they are released.
90+
>>>>>>> 6bfde58c109ec86fd6c5767421404cb679ffba9a
8591
8692
Toutes ces livraisons sont publiées sur npm, mais seules les *Latest* utilisent le versionnement sémantique. Les pré-versions (celles des canaux Canary et Expérimental) ont des versions générées à partir d'une empreinte de leur contenu et de la date du commit, par exemple `18.3.0-canary-388686f29-20230503` pour Canary et `0.0.0-experimental-388686f29-20230503` pour Expérimental.
8793

src/content/errors/377.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Intro>
2+
3+
In the minified production build of React, we avoid sending down full error messages in order to reduce the number of bytes sent over the wire.
4+
5+
</Intro>
6+
7+
We highly recommend using the development build locally when debugging your app since it tracks additional debug info and provides helpful warnings about potential problems in your apps, but if you encounter an exception while using the production build, this page will reassemble the original error message.
8+
9+
The full text of the error you just encountered is:
10+
11+
<ErrorDecoder />
12+
13+
This error occurs when you pass a BigInt value from a Server Component to a Client Component.

src/content/errors/generic.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Intro>
2+
3+
In the minified production build of React, we avoid sending down full error messages in order to reduce the number of bytes sent over the wire.
4+
5+
</Intro>
6+
7+
We highly recommend using the development build locally when debugging your app since it tracks additional debug info and provides helpful warnings about potential problems in your apps, but if you encounter an exception while using the production build, this page will reassemble the original error message.
8+
9+
The full text of the error you just encountered is:
10+
11+
<ErrorDecoder />

0 commit comments

Comments
 (0)