Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion scripts/deadLinkChecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const PUBLIC_DIR = path.join(__dirname, '../public');
const fileCache = new Map();
const anchorMap = new Map(); // Map<filepath, Set<anchorId>>
const contributorMap = new Map(); // Map<anchorId, URL>
const redirectMap = new Map(); // Map<source, destination>
let errorCodes = new Set();

async function readFileWithCache(filePath) {
Expand Down Expand Up @@ -162,6 +163,22 @@ async function validateLink(link) {
return {valid: true};
}

// Check for redirects
if (redirectMap.has(urlWithoutAnchor)) {
const redirectDestination = redirectMap.get(urlWithoutAnchor);
if (
redirectDestination.startsWith('http://') ||
redirectDestination.startsWith('https://')
) {
return {valid: true};
}
const redirectedLink = {
...link,
url: redirectDestination + (anchorMatch ? anchorMatch[0] : ''),
};
return validateLink(redirectedLink);
}

// Check if it's an error code link
const errorCodeMatch = urlWithoutAnchor.match(/^\/errors\/(\d+)$/);
if (errorCodeMatch) {
Expand Down Expand Up @@ -295,17 +312,42 @@ async function fetchErrorCodes() {
}
const codes = await response.json();
errorCodes = new Set(Object.keys(codes));
console.log(chalk.gray(`Fetched ${errorCodes.size} React error codes\n`));
console.log(chalk.gray(`Fetched ${errorCodes.size} React error codes`));
} catch (error) {
throw new Error(`Failed to fetch error codes: ${error.message}`);
}
}

async function buildRedirectsMap() {
try {
const vercelConfigPath = path.join(__dirname, '../vercel.json');
const vercelConfig = JSON.parse(
await fs.promises.readFile(vercelConfigPath, 'utf8')
);

if (vercelConfig.redirects) {
for (const redirect of vercelConfig.redirects) {
redirectMap.set(redirect.source, redirect.destination);
}
console.log(
chalk.gray(`Loaded ${redirectMap.size} redirects from vercel.json`)
);
}
} catch (error) {
console.log(
chalk.yellow(
`Warning: Could not load redirects from vercel.json: ${error.message}\n`
)
);
}
}

async function main() {
const files = getMarkdownFiles();
console.log(chalk.gray(`Checking ${files.length} markdown files...`));

await fetchErrorCodes();
await buildRedirectsMap();
await buildContributorMap();
await buildAnchorMap(files);

Expand All @@ -315,6 +357,7 @@ async function main() {
const totalLinks = results.reduce((sum, r) => sum + r.totalLinks, 0);

if (deadLinks.length > 0) {
console.log('\n');
for (const link of deadLinks) {
console.log(chalk.yellow(`${link.file}:${link.line}:${link.column}`));
console.log(chalk.reset(` Link text: ${link.text}`));
Expand Down
29 changes: 16 additions & 13 deletions src/components/Layout/HomeContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -755,9 +755,7 @@ function CommunityGallery() {
}, []);

return (
<div
ref={ref}
className="relative flex overflow-x-hidden overflow-y-visible w-auto">
<div ref={ref} className="relative flex overflow-x-clip w-auto">
<div
className="w-full py-12 lg:py-20 whitespace-nowrap flex flex-row animate-marquee lg:animate-large-marquee"
style={{
Expand All @@ -784,21 +782,26 @@ const CommunityImages = memo(function CommunityImages({isLazy}) {
<div
key={i}
className={cn(
`group flex justify-center px-5 min-w-[50%] lg:min-w-[25%] rounded-2xl relative`
`group flex justify-center px-5 min-w-[50%] lg:min-w-[25%] rounded-2xl`
)}>
<div
className={cn(
'h-auto relative rounded-2xl overflow-hidden before:-skew-x-12 before:absolute before:inset-0 before:-translate-x-full group-hover:before:animate-[shimmer_1s_forwards] before:bg-gradient-to-r before:from-transparent before:via-white/10 before:to-transparent transition-all ease-in-out duration-300',
'h-auto rounded-2xl before:rounded-2xl before:absolute before:pointer-events-none before:inset-0 before:transition-opacity before:-z-1 before:shadow-lg lg:before:shadow-2xl before:opacity-0 before:group-hover:opacity-100 transition-transform ease-in-out duration-300',
i % 2 === 0
? 'rotate-2 group-hover:rotate-[-1deg] group-hover:scale-110 group-hover:shadow-lg lg:group-hover:shadow-2xl'
: 'group-hover:rotate-1 group-hover:scale-110 group-hover:shadow-lg lg:group-hover:shadow-2xl rotate-[-2deg]'
? 'rotate-2 group-hover:rotate-[-1deg] group-hover:scale-110'
: 'group-hover:rotate-1 group-hover:scale-110 rotate-[-2deg]'
)}>
<img
loading={isLazy ? 'lazy' : 'eager'}
src={src}
alt={alt}
className="aspect-[4/3] h-full w-full flex object-cover rounded-2xl bg-gray-10 dark:bg-gray-80"
/>
<div
className={cn(
'overflow-clip relative before:absolute before:inset-0 before:pointer-events-none before:-translate-x-full group-hover:before:animate-[shimmer_1s_forwards] before:bg-gradient-to-r before:from-transparent before:via-white/10 before:to-transparent transition-transform ease-in-out duration-300'
)}>
<img
loading={isLazy ? 'lazy' : 'eager'}
src={src}
alt={alt}
className="aspect-[4/3] h-full w-full flex object-cover rounded-2xl bg-gray-10 dark:bg-gray-80"
/>
</div>
</div>
</div>
))}
Expand Down
6 changes: 3 additions & 3 deletions src/content/blog/2024/10/21/react-compiler-beta-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ Or, if you're using Yarn:
yarn add -D eslint-plugin-react-compiler@beta
</TerminalBlock>

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.
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.

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

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).
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).

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

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

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.

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

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

Expand Down
3 changes: 0 additions & 3 deletions src/content/community/meetups.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
## Portugal {/*portugal*/}
* [Lisbon](https://www.meetup.com/JavaScript-Lisbon/)

## Scotland (UK) {/*scotland-uk*/}
* [Edinburgh](https://www.meetup.com/React-Scotland/)

## Spain {/*spain*/}
* [Barcelona](https://www.meetup.com/ReactJS-Barcelona/)

Expand Down
2 changes: 1 addition & 1 deletion src/content/learn/add-react-to-an-existing-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ title: किसी मौजूदा प्रोजेक्ट में Rea

यह सुनिश्चित करता है कि आपके ऐप का React हिस्सा हो सकता है [सर्वोत्तम प्रथाओं से लाभ](/learn/creating-a-react-app#full-stack-frameworks) उन फ्रेमवर्क में पका हुआ।

कई React-आधारित फ्रेमवर्क full-stack हैं और आपके React ऐप को सर्वर का लाभ उठाते हैं।हालाँकि, आप उसी दृष्टिकोण का उपयोग कर सकते हैं, भले ही आप सर्वर पर जावास्क्रिप्ट नहीं चलाना चाहते हैं या नहीं चाहते हैं।उस स्थिति में, HTML/CSS/JS निर्यात परोसें([`next export` output](https://nextjs.org/docs/advanced-features/static-html-export) Next.js के लिए, GATSBY के लिए डिफ़ॉल्ट) इसके `/some-app/` बजाय।
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.

## अपनी मौजूदा वेबसाइट के संपूर्ण सबरूट के लिए React का उपयोग करना {/*using-react-for-a-part-of-your-existing-page*/}

Expand Down
Loading