Skip to content

Commit f6767f2

Browse files
Merge branch 'main' of https://github.com/reactjs/react.dev into sync-c7d6b700
2 parents 20324ed + c7d6b70 commit f6767f2

5 files changed

Lines changed: 60 additions & 12 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"@babel/preset-react": "^7.18.6",
5353
"@mdx-js/mdx": "^2.1.3",
5454
"@resvg/resvg-js": "^2.6.2",
55+
"@shuding/opentype.js": "1.4.0-beta.0",
5556
"@types/body-scroll-lock": "^2.6.1",
5657
"@types/classnames": "^2.2.10",
5758
"@types/debounce": "^1.2.1",

scripts/generateOgImages.mjs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import path from 'path';
1414
import satori from 'satori';
1515
import {Resvg} from '@resvg/resvg-js';
1616
import matter from 'gray-matter';
17+
import opentype from '@shuding/opentype.js';
1718

1819
const ROOT = process.cwd();
1920
const CONTENT_DIR = path.join(ROOT, 'src', 'content');
@@ -34,6 +35,33 @@ const medium = fs.readFileSync(
3435
path.join(ROOT, 'public', 'fonts', 'Optimistic_Display_W_Md.ttf')
3536
);
3637

38+
// Title area width: card width minus the horizontal padding (80px per side).
39+
const TITLE_MAX_WIDTH = 1200 - 80 * 2;
40+
const TITLE_MAX_FONT = 96;
41+
const TITLE_MIN_FONT = 56;
42+
// Small margin so borderline titles don't wrap and orphan a single trailing
43+
// character (e.g. the "p" in "renderToStaticMarkup", which is 1px too wide
44+
// to fit on one line at 96px).
45+
const TITLE_SAFETY = 8;
46+
47+
const boldFont = opentype.parse(
48+
bold.buffer.slice(bold.byteOffset, bold.byteOffset + bold.byteLength)
49+
);
50+
51+
// Multi-word titles wrap cleanly at spaces, so a length bucket is fine for
52+
// them. Single-word titles (most API names) can only break mid-word, which
53+
// leaves an orphaned letter on its own line, so instead shrink them just
54+
// enough to fit on a single line.
55+
function titleFontSize(title) {
56+
const trimmed = title.trim();
57+
if (/\s/.test(trimmed)) {
58+
return trimmed.length > 24 ? 72 : 96;
59+
}
60+
const widthPerPx = boldFont.getAdvanceWidth(trimmed, 1);
61+
const fit = Math.floor((TITLE_MAX_WIDTH - TITLE_SAFETY) / widthPerPx);
62+
return Math.max(TITLE_MIN_FONT, Math.min(TITLE_MAX_FONT, fit));
63+
}
64+
3765
function el(type, style, children) {
3866
return {type, props: {style, children}};
3967
}
@@ -103,7 +131,7 @@ function card(title, pagePath) {
103131
flexGrow: 1,
104132
display: 'flex',
105133
alignItems: 'center',
106-
fontSize: title.length > 24 ? 72 : 96,
134+
fontSize: titleFontSize(title),
107135
fontFamily: 'Optimistic Display Bold',
108136
color: '#f6f7f9',
109137
lineHeight: 1.1,

src/content/community/conferences.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,41 @@ Do you know of a local React.js conference? Add it here! (Please keep the list c
1010

1111
## Upcoming Conferences {/*upcoming-conferences*/}
1212

13-
### React Paris 2026 {/*react-paris-2026*/}
14-
March 26 - 27, 2026. In-person in Paris, France (hybrid event)
13+
### ZurichJS Conf 2026 {/*zurichjs-conf-2026*/}
14+
September 10-11, 2026. In-person in Zurich, Switzerland
1515

16-
[Website](https://react.paris/) - [Twitter](https://x.com/BeJS_)
16+
[Website](https://conf.zurichjs.com?utm_campaign=ZurichJS_Conf&utm_source=referral&utm_content=reactjs_community_conferences) - [Twitter](https://x.com/zurichjs) - [LinkedIn](https://www.linkedin.com/company/zurichjs/)
1717

18-
### CityJS London 2026 {/*cityjs-london-2026*/}
19-
April 14-17, 2026. In-person in London
18+
### React Alicante 2026 {/*react-alicante-2026*/}
19+
Sep 24 - 26, 2026. In-person in Alicante
2020

21-
[Website](https://india.cityjsconf.org/) - [Twitter](https://x.com/cityjsconf) - [Bluesky](https://bsky.app/profile/cityjsconf.bsky.social)
21+
[Website](https://reactalicante.es//) - [Twitter](https://x.com/ReactAlicante)
2222

23-
### ZurichJS Conf 2026 {/*zurichjs-conf-2026*/}
24-
September 10-11, 2026. In-person in Zurich, Switzerland
23+
### CityJS Athens 2026 {/*cityjs-athens-2026*/}
24+
October 21-23, 2026. In-person in Athens
25+
26+
[Website](https://athens.cityjsconf.org/) - [Twitter](https://x.com/cityjsconf) - [Bluesky](https://bsky.app/profile/cityjsconf.bsky.social)
27+
28+
29+
## Past Conferences {/*past-conferences*/}
2530

26-
[Website](https://conf.zurichjs.com?utm_campaign=ZurichJS_Conf&utm_source=referral&utm_content=reactjs_community_conferences) - [Twitter](https://x.com/zurichjs) - [LinkedIn](https://www.linkedin.com/company/zurichjs/)
2731

2832
### React Conf Japan 2027 {/*react-conf-japan-2027*/}
2933
April 24, 2027. In-person in Tokyo, Japan
3034

3135
[Website](https://reactconf.jp/) - [Twitter](https://x.com/reactconfjp)
3236

33-
## Past Conferences {/*past-conferences*/}
37+
### CityJS London 2026 {/*cityjs-london-2026*/}
38+
April 14-17, 2026. In-person in London
39+
40+
[Website](https://india.cityjsconf.org/) - [Twitter](https://x.com/cityjsconf) - [Bluesky](https://bsky.app/profile/cityjsconf.bsky.social)
41+
42+
43+
### React Paris 2026 {/*react-paris-2026*/}
44+
March 26 - 27, 2026. In-person in Paris, France (hybrid event)
45+
46+
[Website](https://react.paris/) - [Twitter](https://x.com/BeJS_)
47+
3448

3549
### CityJS New Delhi 2026 {/*cityjs-newdelhi-2026*/}
3650
February 12-13, 2026. In-person in New Delhi, India

src/content/reference/react/use.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ This cache pattern is the foundation for [re-fetching data](#re-fetching-data-in
662662
663663
<Pitfall>
664664
665-
Don't skip calling `use` based on whether a Promise is already settled.
665+
##### Don't skip calling `use` based on whether a Promise is already settled. {/*conditional-use*/}
666666
667667
Unlike other hooks, `use` can be called inside conditions and loops — but it must always be called for the Promise itself. Never read `promise.status` or `promise.value` directly to bypass `use`; always pass the Promise to `use` and let React handle it.
668668

vercel.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@
174174
"destination": "/warnings/invalid-hook-call-warning#mismatching-versions-of-react-and-react-dom",
175175
"permanent": false
176176
},
177+
{
178+
"source": "/warnings/conditional-use-of-use",
179+
"destination": "/reference/react/use#conditional-use",
180+
"permanent": false
181+
},
177182
{
178183
"source": "/reference/react/directives",
179184
"destination": "/reference/rsc/directives",

0 commit comments

Comments
 (0)