Skip to content

Commit 0b4d34f

Browse files
authored
Merge branch 'main' into docs/translate-blog-react-19.2
2 parents 2a26a17 + 5aa677b commit 0b4d34f

File tree

5 files changed

+46
-27
lines changed

5 files changed

+46
-27
lines changed

eslint-local-rules/__tests__/lint-markdown-code-blocks.test.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ const path = require('path');
1111
const {ESLint} = require('eslint');
1212
const plugin = require('..');
1313

14-
const FIXTURES_DIR = path.join(__dirname, 'fixtures', 'src', 'content');
14+
const FIXTURES_DIR = path.join(
15+
__dirname,
16+
'fixtures',
17+
'src',
18+
'content'
19+
);
1520
const PARSER_PATH = path.join(__dirname, '..', 'parser.js');
1621

1722
function createESLint({fix = false} = {}) {
@@ -48,7 +53,11 @@ async function lintFixture(name, {fix = false} = {}) {
4853

4954
async function run() {
5055
const basicResult = await lintFixture('basic-error.md');
51-
assert.strictEqual(basicResult.messages.length, 1, 'expected one diagnostic');
56+
assert.strictEqual(
57+
basicResult.messages.length,
58+
1,
59+
'expected one diagnostic'
60+
);
5261
assert(
5362
basicResult.messages[0].message.includes('Calling setState during render'),
5463
'expected message to mention setState during render'
@@ -82,7 +91,9 @@ async function run() {
8291
fix: true,
8392
});
8493
assert(
85-
duplicateFixed.output.includes("{expectedErrors: {'react-compiler': [4]}}"),
94+
duplicateFixed.output.includes(
95+
"{expectedErrors: {'react-compiler': [4]}}"
96+
),
8697
'expected duplicates to be rewritten to a single canonical block'
8798
);
8899
assert(
@@ -107,12 +118,14 @@ async function run() {
107118
fix: true,
108119
});
109120
assert(
110-
malformedFixed.output.includes("{expectedErrors: {'react-compiler': [4]}}"),
121+
malformedFixed.output.includes(
122+
"{expectedErrors: {'react-compiler': [4]}}"
123+
),
111124
'expected malformed metadata to be replaced with canonical form'
112125
);
113126
}
114127

115-
run().catch((error) => {
128+
run().catch(error => {
116129
console.error(error);
117130
process.exitCode = 1;
118-
});
131+
});

eslint-local-rules/rules/metadata.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,15 @@ function parseExpectedErrorsEntries(rawEntries) {
8484

8585
if (parsed && typeof parsed === 'object') {
8686
for (const [key, value] of Object.entries(parsed)) {
87-
entries[key] = normalizeEntryValues(
88-
Array.isArray(value) ? value.flat() : value
89-
);
87+
entries[key] = normalizeEntryValues(Array.isArray(value) ? value.flat() : value);
9088
}
9189
}
9290

9391
return entries;
9492
}
9593

9694
function parseExpectedErrorsToken(tokenText) {
97-
const match = tokenText.match(
98-
/^\{\s*expectedErrors\s*:\s*(\{[\s\S]*\})\s*\}$/
99-
);
95+
const match = tokenText.match(/^\{\s*expectedErrors\s*:\s*(\{[\s\S]*\})\s*\}$/);
10096
if (!match) {
10197
return null;
10298
}
@@ -207,9 +203,7 @@ function cloneMetadata(metadata) {
207203
}
208204

209205
function findExpectedErrorsToken(metadata) {
210-
return (
211-
metadata.tokens.find((token) => token.type === 'expectedErrors') || null
212-
);
206+
return metadata.tokens.find((token) => token.type === 'expectedErrors') || null;
213207
}
214208

215209
function getCompilerExpectedLines(metadata) {
@@ -380,4 +374,4 @@ module.exports = {
380374
removeCompilerExpectedLines,
381375
setCompilerExpectedLines,
382376
stringifyFenceMetadata,
383-
};
377+
};

eslint-local-rules/rules/react-compiler.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,17 @@ function runReactCompiler(code, filename) {
9898
continue;
9999
}
100100

101-
const loc =
102-
typeof detail.primaryLocation === 'function'
103-
? detail.primaryLocation()
104-
: null;
101+
const loc = typeof detail.primaryLocation === 'function'
102+
? detail.primaryLocation()
103+
: null;
105104

106105
if (loc == null || typeof loc === 'symbol') {
107106
continue;
108107
}
109108

110-
const message =
111-
typeof detail.printErrorMessage === 'function'
112-
? detail.printErrorMessage(result.sourceCode, {eslint: true})
113-
: detail.description || 'Unknown React Compiler error';
109+
const message = typeof detail.printErrorMessage === 'function'
110+
? detail.printErrorMessage(result.sourceCode, {eslint: true})
111+
: detail.description || 'Unknown React Compiler error';
114112

115113
diagnostics.push({detail, loc, message});
116114
}
@@ -121,4 +119,4 @@ function runReactCompiler(code, filename) {
121119
module.exports = {
122120
hasRelevantCode,
123121
runReactCompiler,
124-
};
122+
};

src/content/blog/2025/10/01/react-19-2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ DOM 이벤트와 유사하게, Effect 이벤트는 항상 최신 props와 상태
120120
121121
</RSC>
122122
123-
`cacheSignal`을 사용하면 [`cache()`](/reference/react/cache)의 수명이 끝났을 때 알 수 있습니다:
123+
`cacheSignal`을 사용하면 [`cache()`](/reference/react/cache)의 수명이 끝났을 때 알 수 있습니다.
124124
125125
```
126126
import {cache, cacheSignal} from 'react';
@@ -143,7 +143,7 @@ async function Component() {
143143
144144
### 성능 트랙 {/*performance-tracks*/}
145145
146-
React 19.2는 Chrome DevTools 성능 프로필에 새로운 [커스텀 트랙](https://developer.chrome.com/docs/devtools/performance/extension) 세트를 추가하여 React 앱의 성능에 대한 더 많은 정보를 제공합니다:
146+
React 19.2는 Chrome DevTools 성능 프로필에 새로운 [커스텀 트랙](https://developer.chrome.com/docs/devtools/performance/extension) 세트를 추가하여 React 앱의 성능에 대한 더 많은 정보를 제공합니다.
147147
148148
<div style={{display: 'flex', justifyContent: 'center', marginBottom: '1rem'}}>
149149
<picture >

src/sidebarBlog.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@
3232
"date": "October 1, 2025",
3333
"path": "/blog/2025/10/01/react-19-2"
3434
},
35+
{
36+
"title": "React Compiler v1.0",
37+
"titleForHomepage": "React Compiler v1.0",
38+
"icon": "blog",
39+
"date": "October 8, 2025",
40+
"path": "/blog/2025/10/07/react-compiler-1"
41+
},
42+
{
43+
"title": "Introducing the React Foundation",
44+
"titleForHomepage": "Introducing the React Foundation",
45+
"icon": "blog",
46+
"date": "October 7, 2025",
47+
"path": "/blog/2025/10/07/introducing-the-react-foundation"
48+
},
3549
{
3650
"title": "React Labs: View Transitions, Activity, and more",
3751
"titleForHomepage": "View Transitions and Activity",

0 commit comments

Comments
 (0)