Skip to content

Commit f592c0f

Browse files
authored
Merge branch 'main' into sync-7b6c3ceb
2 parents 7971e81 + dce342f commit f592c0f

10 files changed

Lines changed: 439 additions & 872 deletions

File tree

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"classnames": "^2.2.6",
3737
"debounce": "^1.2.1",
3838
"github-slugger": "^1.3.0",
39-
"next": "15.5.18",
39+
"next": "15.5.21",
4040
"next-remote-watch": "^1.0.0",
4141
"parse-numeric-range": "^1.2.0",
4242
"raw-loader": "^4.0.2",
@@ -47,12 +47,11 @@
4747
"remark-gfm": "^3.0.1"
4848
},
4949
"devDependencies": {
50-
"@babel/core": "^7.12.9",
51-
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
52-
"@babel/preset-react": "^7.18.6",
50+
"@babel/core": "7.29.6",
51+
"@babel/plugin-transform-modules-commonjs": "7.28.6",
52+
"@babel/preset-react": "7.28.5",
5353
"@mdx-js/mdx": "^2.1.3",
5454
"@resvg/resvg-js": "^2.6.2",
55-
"@shuding/opentype.js": "1.4.0-beta.0",
5655
"@types/body-scroll-lock": "^2.6.1",
5756
"@types/classnames": "^2.2.10",
5857
"@types/debounce": "^1.2.1",
@@ -123,4 +122,4 @@
123122
"src/**/*.md": "yarn fix-headings"
124123
},
125124
"packageManager": "yarn@1.22.22"
126-
}
125+
}

scripts/generateOgImages.mjs

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ 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';
1817

1918
const ROOT = process.cwd();
2019
const CONTENT_DIR = path.join(ROOT, 'src', 'content');
@@ -35,33 +34,6 @@ const medium = fs.readFileSync(
3534
path.join(ROOT, 'public', 'fonts', 'Optimistic_Display_W_Md.ttf')
3635
);
3736

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-
6537
function el(type, style, children) {
6638
return {type, props: {style, children}};
6739
}
@@ -131,7 +103,7 @@ function card(title, pagePath) {
131103
flexGrow: 1,
132104
display: 'flex',
133105
alignItems: 'center',
134-
fontSize: titleFontSize(title),
106+
fontSize: title.length > 24 ? 72 : 96,
135107
fontFamily: 'Optimistic Display Bold',
136108
color: '#f6f7f9',
137109
lineHeight: 1.1,

src/content/learn/tutorial-tic-tac-toe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,11 +901,11 @@ body {
901901
902902
React Developer Tools, React component’lerinizin props ve state’ini kontrol etmenizi sağlar. [Chrome](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en), [Firefox](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/) ve [Edge](https://microsoftedge.microsoft.com/addons/detail/react-developer-tools/gpphkfbcpidddadnkolkpfckpihlkkil) browser extension olarak kullanılabilir.
903903
904-
Yükledikten sonra, React kullanan siteler için browser Developer Tools içinde yeni bir **Components** tab’ı görünür. CodeSandbox’ta takip ediyorsanız, önce sandbox preview’unuzu yeni bir tab’da açmanız gerekir:
904+
Yükledikten sonra, React kullanan siteler için browser Developer Tools içinde yeni bir *Components* tab’ı görünür. CodeSandbox’ta takip ediyorsanız, önce sandbox preview’unuzu yeni bir tab’da açmanız gerekir:
905905
906906
![yeni tab’da açma](../images/tutorial/sandbox-new-tab.png)
907907
908-
Ardından preview sayfasında browser’ınızın DevTools’unu açın ve **Components** tab’ını bulun:
908+
Ardından preview sayfasında browser’ınızın DevTools’unu açın ve *Components* tab’ını bulun:
909909
910910
![components tab](../images/tutorial/components-tab.png)
911911

src/content/reference/react-dom/server/renderToPipeableStream.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const { pipe } = renderToPipeableStream(<App />, {
6868
6969
* **optional** `onShellReady`: [Initial shell](#specifying-what-goes-into-the-shell) render edildikten hemen sonra tetiklenen bir callback. Burada [status code’u ayarlayabilir](#setting-the-status-code) ve streaming’i başlatmak için `pipe` çağırabilirsiniz. React, shell’den sonra ek [content’i stream eder](#streaming-more-content-as-it-loads) ve HTML loading fallback’lerini content ile değiştiren inline `<script>` tag’lerini de beraberinde gönderir.
7070
71-
* **optional** `onShellError`: Initial shell render edilirken bir error oluşursa tetiklenen bir callback. Error’ı argüman olarak alır. Stream’den henüz hiç byte emit edilmemiştir ve ne `onShellReady` ne de `onAllReady` çağrılır; bu yüzden [fallback HTML shell output edebilirsiniz](#recovering-from-errors-inside-the-shell).
71+
* **optional** `onShellError`: Initial shell render edilirken bir hata oluşursa tetiklenen bir callback. Error’ı argüman olarak alır. Stream’den henüz hiç byte emit edilmemiştir ve ne `onShellReady` ne de `onAllReady` çağrılır; bu yüzden [fallback HTML shell output edebilirsiniz](#recovering-from-errors-inside-the-shell).
7272
7373
* **optional** `progressiveChunkSize`: Bir chunk içindeki byte sayısı. [Default heuristic hakkında daha fazla okuyun.](https://github.com/react/react/blob/14c2be8dac2d5482fda8a0906a31d239df8551fc/packages/react-server/src/ReactFizzServer.js#L210-L225)
7474

src/content/reference/react/Component.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ State türetmek ayrıntılı koda yol açar ve bileşenlerinizi düşünmeyi zor
10091009
10101010
#### Uyarılar {/*static-getderivedstatefromprops-caveats*/}
10111011
1012-
- Bu method, nedeni ne olursa olsun **her** render’da tetiklenir. Bu, yalnızca parent bir re-render’a neden olduğunda tetiklenen ve local `setState` sonucu tetiklenmeyen [`UNSAFE_componentWillReceiveProps`](#unsafe_componentwillreceiveprops)’tan farklıdır.
1012+
- Bu method, nedeni ne olursa olsun *her* render’da tetiklenir. Bu, yalnızca parent bir re-render’a neden olduğunda tetiklenen ve local `setState` sonucu tetiklenmeyen [`UNSAFE_componentWillReceiveProps`](#unsafe_componentwillreceiveprops)’tan farklıdır.
10131013
10141014
- Bu metod, bileşen örneğine erişime sahip değildir. İsterseniz, `static getDerivedStateFromProps` ve diğer sınıf metodları arasında, bileşen prop'larının ve state'inin saf fonksiyonlarını sınıf tanımının dışında çıkararak bazı kodları yeniden kullanabilirsiniz.
10151015

0 commit comments

Comments
 (0)