Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ef0f64d
Merge upstream react.dev main branch - align with React 19 updates
Mohamed-Hashem Nov 5, 2025
1fb342b
Fix TypeScript errors and add missing dependencies
Mohamed-Hashem Nov 5, 2025
4ad7ce8
remove yarn.lock ensures that everyone working on the project install…
Mohamed-Hashem Nov 5, 2025
316863b
Fix: Change font URLs from external CDN to local paths
Mohamed-Hashem Nov 5, 2025
b12113a
Fix: Add lock files to .gitignore to prevent accidental commits
Mohamed-Hashem Nov 5, 2025
10c464a
Fix Vercel build: Add .npmrc for legacy peer deps
Mohamed-Hashem Nov 5, 2025
0d430f4
Better fix: Upgrade @codesandbox/sandpack-react to v2.20.0
Mohamed-Hashem Nov 5, 2025
2867906
Upgrade dependencies to support React 19
Mohamed-Hashem Nov 5, 2025
4f45799
Refactor code structure for improved readability and maintainability
Mohamed-Hashem Nov 5, 2025
b301b28
Translate all sidebar navigation to Arabic
Mohamed-Hashem Nov 6, 2025
2b0b203
Translate React Labs blog post to Arabic, update sidebar titles for c…
Mohamed-Hashem Nov 6, 2025
e0ada4e
Update documentation links for React Compiler and hooks, improve erro…
Mohamed-Hashem Nov 6, 2025
414c700
Fix formatting of section header in importing-and-exporting-component…
Mohamed-Hashem Nov 6, 2025
7cc1c36
Translate various documentation files to Arabic, including sections o…
Mohamed-Hashem Nov 6, 2025
9aa6a0d
Normalize file paths in deadLinkChecker and update documentation link…
Mohamed-Hashem Nov 6, 2025
5399e60
Refactor analyze_comment.yml to ensure conditional execution based on…
Mohamed-Hashem Nov 6, 2025
203ded4
Refactor .eslintrc for improved plugin formatting and change local-ru…
Mohamed-Hashem Nov 6, 2025
ec40854
Translate "Choosing the State Structure" documentation to Arabic for …
Mohamed-Hashem Nov 6, 2025
ec92937
Translate various components and documentation to Arabic for improved…
Mohamed-Hashem Nov 6, 2025
3ed8196
Update src/content/reference/react/ViewTransition.md
Mohamed-Hashem Nov 6, 2025
a9d772d
Update src/content/reference/react-dom/static/resumeAndPrerenderToNod…
Mohamed-Hashem Nov 6, 2025
a36652d
Update src/content/reference/react-dom/static/resumeAndPrerenderToNod…
Mohamed-Hashem Nov 6, 2025
d51b969
Update src/content/reference/react-dom/static/resumeAndPrerenderToNod…
Mohamed-Hashem Nov 6, 2025
310d5dc
Add react-hooks plugin to ESLint configuration
Mohamed-Hashem Nov 6, 2025
7f70a87
Refactor ESLint integration for improved readability and error handling
Mohamed-Hashem Nov 6, 2025
fb33c74
Remove react-hooks plugin from ESLint configuration
Mohamed-Hashem Nov 6, 2025
04d46f9
Fix incorrect return description in addTransitionType documentation
Mohamed-Hashem Nov 6, 2025
1cdf1b8
Fix dead link in startTransition.md after upstream rebase
Mohamed-Hashem Nov 9, 2025
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
8 changes: 6 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"root": true,
"extends": "next/core-web-vitals",
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "eslint-plugin-react-compiler", "local-rules"],
"plugins": [
"@typescript-eslint",
"eslint-plugin-react-compiler",
"local-rules"
],
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", {"varsIgnorePattern": "^_"}],
Expand Down Expand Up @@ -30,7 +34,7 @@
"react-hooks/exhaustive-deps": "off",
"react/no-unknown-property": "off",
"react-compiler/react-compiler": "off",
"local-rules/lint-markdown-code-blocks": "error"
"local-rules/lint-markdown-code-blocks": "warn"
}
}
]
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/analyze_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
contents: read
issues: write
pull-requests: write

jobs:
comment:
runs-on: ubuntu-latest
Expand All @@ -20,6 +20,8 @@ jobs:
steps:
- name: Download base branch bundle stats
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
continue-on-error: true
id: download-analysis
with:
workflow: analyze.yml
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -28,6 +30,7 @@ jobs:

- name: Download PR number
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
if: steps.download-analysis.outcome == 'success'
with:
workflow: analyze.yml
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -36,7 +39,7 @@ jobs:

- name: Get comment body
id: get-comment-body
if: success()
if: steps.download-analysis.outcome == 'success'
run: |
echo 'body<<EOF' >> $GITHUB_OUTPUT
echo '' >> $GITHUB_OUTPUT
Expand All @@ -54,6 +57,7 @@ jobs:

- name: Comment
uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728
if: steps.download-analysis.outcome == 'success'
with:
header: next-bundle-analysis
number: ${{ steps.get-comment-body.outputs.pr-number }}
Expand Down
23 changes: 5 additions & 18 deletions eslint-local-rules/__tests__/lint-markdown-code-blocks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ const path = require('path');
const {ESLint} = require('eslint');
const plugin = require('..');

const FIXTURES_DIR = path.join(
__dirname,
'fixtures',
'src',
'content'
);
const FIXTURES_DIR = path.join(__dirname, 'fixtures', 'src', 'content');
const PARSER_PATH = path.join(__dirname, '..', 'parser.js');

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

async function run() {
const basicResult = await lintFixture('basic-error.md');
assert.strictEqual(
basicResult.messages.length,
1,
'expected one diagnostic'
);
assert.strictEqual(basicResult.messages.length, 1, 'expected one diagnostic');
assert(
basicResult.messages[0].message.includes('Calling setState during render'),
'expected message to mention setState during render'
Expand Down Expand Up @@ -91,9 +82,7 @@ async function run() {
fix: true,
});
assert(
duplicateFixed.output.includes(
"{expectedErrors: {'react-compiler': [4]}}"
),
duplicateFixed.output.includes("{expectedErrors: {'react-compiler': [4]}}"),
'expected duplicates to be rewritten to a single canonical block'
);
assert(
Expand All @@ -118,14 +107,12 @@ async function run() {
fix: true,
});
assert(
malformedFixed.output.includes(
"{expectedErrors: {'react-compiler': [4]}}"
),
malformedFixed.output.includes("{expectedErrors: {'react-compiler': [4]}}"),
'expected malformed metadata to be replaced with canonical form'
);
}

run().catch(error => {
run().catch((error) => {
console.error(error);
process.exitCode = 1;
});
6 changes: 6 additions & 0 deletions eslint-local-rules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"scripts": {
"test": "node __tests__/lint-markdown-code-blocks.test.js"
},
"dependencies": {
"@babel/core": "^7.12.9",
"@babel/parser": "^7.12.9",
"babel-plugin-react-compiler": "^1.0.0",
"eslint": "^7.0.0"
},
"devDependencies": {
"eslint-mdx": "^2"
}
Expand Down
12 changes: 9 additions & 3 deletions eslint-local-rules/rules/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,19 @@ function parseExpectedErrorsEntries(rawEntries) {

if (parsed && typeof parsed === 'object') {
for (const [key, value] of Object.entries(parsed)) {
entries[key] = normalizeEntryValues(Array.isArray(value) ? value.flat() : value);
entries[key] = normalizeEntryValues(
Array.isArray(value) ? value.flat() : value
);
}
}

return entries;
}

function parseExpectedErrorsToken(tokenText) {
const match = tokenText.match(/^\{\s*expectedErrors\s*:\s*(\{[\s\S]*\})\s*\}$/);
const match = tokenText.match(
/^\{\s*expectedErrors\s*:\s*(\{[\s\S]*\})\s*\}$/
);
if (!match) {
return null;
}
Expand Down Expand Up @@ -203,7 +207,9 @@ function cloneMetadata(metadata) {
}

function findExpectedErrorsToken(metadata) {
return metadata.tokens.find((token) => token.type === 'expectedErrors') || null;
return (
metadata.tokens.find((token) => token.type === 'expectedErrors') || null
);
}

function getCompilerExpectedLines(metadata) {
Expand Down
14 changes: 8 additions & 6 deletions eslint-local-rules/rules/react-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,19 @@ function runReactCompiler(code, filename) {
continue;
}

const loc = typeof detail.primaryLocation === 'function'
? detail.primaryLocation()
: null;
const loc =
typeof detail.primaryLocation === 'function'
? detail.primaryLocation()
: null;

if (loc == null || typeof loc === 'symbol') {
continue;
}

const message = typeof detail.printErrorMessage === 'function'
? detail.printErrorMessage(result.sourceCode, {eslint: true})
: detail.description || 'Unknown React Compiler error';
const message =
typeof detail.printErrorMessage === 'function'
? detail.printErrorMessage(result.sourceCode, {eslint: true})
: detail.description || 'Unknown React Compiler error';

diagnostics.push({detail, loc, message});
}
Expand Down
Loading