Skip to content

Commit a102b44

Browse files
merging all conflicts
2 parents 72c167b + e07ac94 commit a102b44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2605
-365
lines changed

scripts/deadLinkChecker.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ const PUBLIC_DIR = path.join(__dirname, '../public');
1010
const fileCache = new Map();
1111
const anchorMap = new Map(); // Map<filepath, Set<anchorId>>
1212
const contributorMap = new Map(); // Map<anchorId, URL>
13+
<<<<<<< HEAD
14+
=======
15+
const redirectMap = new Map(); // Map<source, destination>
16+
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
1317
let errorCodes = new Set();
1418

1519
async function readFileWithCache(filePath) {
@@ -162,6 +166,25 @@ async function validateLink(link) {
162166
return {valid: true};
163167
}
164168

169+
<<<<<<< HEAD
170+
=======
171+
// Check for redirects
172+
if (redirectMap.has(urlWithoutAnchor)) {
173+
const redirectDestination = redirectMap.get(urlWithoutAnchor);
174+
if (
175+
redirectDestination.startsWith('http://') ||
176+
redirectDestination.startsWith('https://')
177+
) {
178+
return {valid: true};
179+
}
180+
const redirectedLink = {
181+
...link,
182+
url: redirectDestination + (anchorMatch ? anchorMatch[0] : ''),
183+
};
184+
return validateLink(redirectedLink);
185+
}
186+
187+
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
165188
// Check if it's an error code link
166189
const errorCodeMatch = urlWithoutAnchor.match(/^\/errors\/(\d+)$/);
167190
if (errorCodeMatch) {
@@ -295,17 +318,52 @@ async function fetchErrorCodes() {
295318
}
296319
const codes = await response.json();
297320
errorCodes = new Set(Object.keys(codes));
321+
<<<<<<< HEAD
298322
console.log(chalk.gray(`Fetched ${errorCodes.size} React error codes\n`));
323+
=======
324+
console.log(chalk.gray(`Fetched ${errorCodes.size} React error codes`));
325+
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
299326
} catch (error) {
300327
throw new Error(`Failed to fetch error codes: ${error.message}`);
301328
}
302329
}
303330

331+
<<<<<<< HEAD
332+
=======
333+
async function buildRedirectsMap() {
334+
try {
335+
const vercelConfigPath = path.join(__dirname, '../vercel.json');
336+
const vercelConfig = JSON.parse(
337+
await fs.promises.readFile(vercelConfigPath, 'utf8')
338+
);
339+
340+
if (vercelConfig.redirects) {
341+
for (const redirect of vercelConfig.redirects) {
342+
redirectMap.set(redirect.source, redirect.destination);
343+
}
344+
console.log(
345+
chalk.gray(`Loaded ${redirectMap.size} redirects from vercel.json`)
346+
);
347+
}
348+
} catch (error) {
349+
console.log(
350+
chalk.yellow(
351+
`Warning: Could not load redirects from vercel.json: ${error.message}\n`
352+
)
353+
);
354+
}
355+
}
356+
357+
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
304358
async function main() {
305359
const files = getMarkdownFiles();
306360
console.log(chalk.gray(`Checking ${files.length} markdown files...`));
307361

308362
await fetchErrorCodes();
363+
<<<<<<< HEAD
364+
=======
365+
await buildRedirectsMap();
366+
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
309367
await buildContributorMap();
310368
await buildAnchorMap(files);
311369

@@ -315,6 +373,10 @@ async function main() {
315373
const totalLinks = results.reduce((sum, r) => sum + r.totalLinks, 0);
316374

317375
if (deadLinks.length > 0) {
376+
<<<<<<< HEAD
377+
=======
378+
console.log('\n');
379+
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
318380
for (const link of deadLinks) {
319381
console.log(chalk.yellow(`${link.file}:${link.line}:${link.column}`));
320382
console.log(chalk.reset(` Link text: ${link.text}`));

src/content/blog/2024/10/21/react-compiler-beta-release.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ Or, if you're using Yarn:
7272
yarn add -D eslint-plugin-react-compiler@beta
7373
</TerminalBlock>
7474

75-
After installation you can enable the linter by [adding it to your ESLint config](/learn/react-compiler#installing-eslint-plugin-react-compiler). Using the linter helps identify Rules of React breakages, making it easier to adopt the compiler when it's fully released.
75+
After installation you can enable the linter by [adding it to your ESLint config](/learn/react-compiler/installation#eslint-integration). Using the linter helps identify Rules of React breakages, making it easier to adopt the compiler when it's fully released.
7676

7777
## Backwards Compatibility {/*backwards-compatibility*/}
7878

79-
React Compiler produces code that depends on runtime APIs added in React 19, but we've since added support for the compiler to also work with React 17 and 18. If you are not on React 19 yet, in the Beta release you can now try out React Compiler by specifying a minimum `target` in your compiler config, and adding `react-compiler-runtime` as a dependency. [You can find docs on this here](/learn/react-compiler#using-react-compiler-with-react-17-or-18).
79+
React Compiler produces code that depends on runtime APIs added in React 19, but we've since added support for the compiler to also work with React 17 and 18. If you are not on React 19 yet, in the Beta release you can now try out React Compiler by specifying a minimum `target` in your compiler config, and adding `react-compiler-runtime` as a dependency. [You can find docs on this here](/reference/react-compiler/configuration#react-17-18).
8080

8181
## Using React Compiler in libraries {/*using-react-compiler-in-libraries*/}
8282

@@ -86,7 +86,7 @@ React Compiler can also be used to compile libraries. Because React Compiler nee
8686

8787
Because your code is pre-compiled, users of your library will not need to have the compiler enabled in order to benefit from the automatic memoization applied to your library. If your library targets apps not yet on React 19, specify a minimum `target` and add `react-compiler-runtime` as a direct dependency. The runtime package will use the correct implementation of APIs depending on the application's version, and polyfill the missing APIs if necessary.
8888

89-
[You can find more docs on this here.](/learn/react-compiler#using-the-compiler-on-libraries)
89+
[You can find more docs on this here.](/reference/react-compiler/compiling-libraries)
9090

9191
## Opening up React Compiler Working Group to everyone {/*opening-up-react-compiler-working-group-to-everyone*/}
9292

src/content/community/meetups.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
137137
## Portugal {/*portugal*/}
138138
* [Lisbon](https://www.meetup.com/JavaScript-Lisbon/)
139139

140-
## Scotland (UK) {/*scotland-uk*/}
141-
* [Edinburgh](https://www.meetup.com/React-Scotland/)
142-
143140
## Spain {/*spain*/}
144141
* [Barcelona](https://www.meetup.com/ReactJS-Barcelona/)
145142

src/content/learn/add-react-to-an-existing-project.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ Here's how we recommend to set it up:
2424
2. **Specify `/some-app` as the *base path*** in your framework's configuration (here's how: [Next.js](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath), [Gatsby](https://www.gatsbyjs.com/docs/how-to/previews-deploys-hosting/path-prefix/)).
2525
3. **Configure your server or a proxy** so that all requests under `/some-app/` are handled by your React app.
2626

27+
<<<<<<< HEAD
2728
This ensures the React part of your app can [benefit from the best practices](/learn/creating-a-react-app#full-stack-frameworks) baked into those frameworks.
29+
=======
30+
This ensures the React part of your app can [benefit from the best practices](/learn/build-a-react-app-from-scratch#consider-using-a-framework) baked into those frameworks.
31+
>>>>>>> e07ac94bc2c1ffd817b13930977be93325e5bea9
2832
2933
Many React-based frameworks are full-stack and let your React app take advantage of the server. However, you can use the same approach even if you can't or don't want to run JavaScript on the server. In that case, serve the HTML/CSS/JS export ([`next export` output](https://nextjs.org/docs/advanced-features/static-html-export) for Next.js, default for Gatsby) at `/some-app/` instead.
3034

0 commit comments

Comments
 (0)