Skip to content

Commit 366ce19

Browse files
merging all conflicts
2 parents 9eea86d + 6274d4f commit 366ce19

File tree

222 files changed

+11218
-1679
lines changed

Some content is hidden

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

222 files changed

+11218
-1679
lines changed

.github/ISSUE_TEMPLATE/0-bug.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "🐛 Report a bug"
2+
description: "Report a problem on the website."
3+
title: "[Bug]: "
4+
labels: ["bug: unconfirmed"]
5+
body:
6+
- type: textarea
7+
attributes:
8+
label: Summary
9+
description: |
10+
A clear and concise summary of what the bug is.
11+
placeholder: |
12+
Example bug report:
13+
When I click the "Submit" button on "Feedback", nothing happens.
14+
validations:
15+
required: true
16+
- type: input
17+
attributes:
18+
label: Page
19+
description: |
20+
What page(s) did you encounter this bug on?
21+
placeholder: |
22+
https://react.dev/
23+
validations:
24+
required: true
25+
- type: textarea
26+
attributes:
27+
label: Details
28+
description: |
29+
Please provide any additional details about the bug.
30+
placeholder: |
31+
Example details:
32+
The "Submit" button is unresponsive. I've tried refreshing the page and using a different browser, but the issue persists.
33+
validations:
34+
required: false

.github/ISSUE_TEMPLATE/1-typo.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "🤦 Typo or mistake"
2+
description: "Report a typo or mistake in the docs."
3+
title: "[Typo]: "
4+
labels: ["type: typos"]
5+
body:
6+
- type: textarea
7+
attributes:
8+
label: Summary
9+
description: |
10+
A clear and concise summary of what the mistake is.
11+
placeholder: |
12+
Example:
13+
The code example on the "useReducer" page includes an unused variable `nextId`.
14+
validations:
15+
required: true
16+
- type: input
17+
attributes:
18+
label: Page
19+
description: |
20+
What page is the typo on?
21+
placeholder: |
22+
https://react.dev/
23+
validations:
24+
required: true
25+
- type: textarea
26+
attributes:
27+
label: Details
28+
description: |
29+
Please provide a explanation for why this is a mistake.
30+
placeholder: |
31+
Example mistake:
32+
In the "useReducer" section of the "API Reference" page, the code example under "Writing a reducer function" includes an unused variable `nextId` that should be removed.
33+
validations:
34+
required: false
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "💡 Suggestions"
2+
description: "Suggest a new page, section, or edit for an existing page."
3+
title: "[Suggestion]: "
4+
labels: ["type: documentation"]
5+
body:
6+
- type: textarea
7+
attributes:
8+
label: Summary
9+
description: |
10+
A clear and concise summary of what we should add.
11+
placeholder: |
12+
Example:
13+
Add a new page for how to use React with TypeScript.
14+
validations:
15+
required: true
16+
- type: input
17+
attributes:
18+
label: Page
19+
description: |
20+
What page is this about?
21+
placeholder: |
22+
https://react.dev/
23+
validations:
24+
required: false
25+
- type: textarea
26+
attributes:
27+
label: Details
28+
description: |
29+
Please provide a explanation for what you're suggesting.
30+
placeholder: |
31+
Example:
32+
I think it would be helpful to have a page that explains how to use React with TypeScript. This could include a basic example of a component written in TypeScript, and a link to the TypeScript documentation.
33+
validations:
34+
required: true
+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: "📄 Suggest new framework"
2+
description: "I am a framework author applying to be included as a recommended framework."
3+
title: "[Framework]: "
4+
labels: ["type: framework"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
## Apply to be included as a recommended React framework
10+
11+
_This form is for framework authors to apply to be included as a recommended [React framework](https://react.dev/learn/start-a-new-react-project). If you are not a framework author, please contact the authors before submitting._
12+
13+
Our goal when recommending a framework is to start developers with a React project that solves common problems like code splitting, data fetching, routing, and HTML generation without any extra work later. We believe this will allow users to get started quickly with React, and scale their app to production.
14+
15+
While we understand that many frameworks may want to be featured, this page is not a place to advertise every possible React framework or all frameworks that you can add React to. There are many great frameworks that offer support for React that are not listed in our guides. The frameworks we recommend have invested significantly in the React ecosystem, and collaborated with the React team to be compatible with our [full-stack React architecture vision](https://react.dev/learn/start-a-new-react-project#which-features-make-up-the-react-teams-full-stack-architecture-vision).
16+
17+
To be included, frameworks must meet the following criteria:
18+
19+
- **Free & open-source**: must be open source and free to use.
20+
- **Well maintained**. must be actively maintained, providing bug fixes and improvements.
21+
- **Active community**: must have a sufficiently large and active community to support users.
22+
- **Clear onboarding**: must have clear install steps to install the React version of the framework.
23+
- **Ecosystem compatibility**: must support using the full range of libraries and tools in the React ecosystem.
24+
- **Self-hosting option**: must support an option to self-host applications without losing access to features.
25+
- **Developer experience**. must allow developers to be productive by supporting features like Fast Refresh.
26+
- **User experience**. must provide built-in support for common problems like routing and data-fetching.
27+
- **Compatible with our future vision for React**. React evolves over time, and frameworks that do not align with React’s direction risk isolating their users from the main React ecosystem over time. To be included on this page we must feel confident that the framework is setting its users up for success with React over time.
28+
29+
Please note, we have reviewed most of the popular frameworks available today, so it is unlikely we have not considered your framework already. But if you think we missed something, please complete the application below.
30+
- type: input
31+
attributes:
32+
label: Name
33+
description: |
34+
What is the name of your framework?
35+
validations:
36+
required: true
37+
- type: input
38+
attributes:
39+
label: Homepage
40+
description: |
41+
What is the URL of your homepage?
42+
validations:
43+
required: true
44+
- type: input
45+
attributes:
46+
label: Install instructions
47+
description: |
48+
What is the URL of your getting started guide?
49+
validations:
50+
required: true
51+
- type: dropdown
52+
attributes:
53+
label: Is your framework open source?
54+
description: |
55+
We only recommend free and open source frameworks.
56+
options:
57+
- 'No'
58+
- 'Yes'
59+
validations:
60+
required: true
61+
- type: textarea
62+
attributes:
63+
label: Well maintained
64+
description: |
65+
Please describe how your framework is actively maintained. Include recent releases, bug fixes, and improvements as examples.
66+
validations:
67+
required: true
68+
- type: textarea
69+
attributes:
70+
label: Active community
71+
description: |
72+
Please describe your community. Include the size of your community, and links to community resources.
73+
validations:
74+
required: true
75+
- type: textarea
76+
attributes:
77+
label: Clear onboarding
78+
description: |
79+
Please describe how a user can install your framework with React. Include links to any relevant documentation.
80+
validations:
81+
required: true
82+
- type: textarea
83+
attributes:
84+
label: Ecosystem compatibility
85+
description: |
86+
Please describe any limitations your framework has with the React ecosystem. Include any libraries or tools that are not compatible with your framework.
87+
validations:
88+
required: true
89+
- type: textarea
90+
attributes:
91+
label: Self-hosting option
92+
description: |
93+
Please describe how your framework supports self-hosting. Include any limitations to features when self-hosting. Also include whether you require a server to deploy your framework.
94+
validations:
95+
required: true
96+
- type: textarea
97+
attributes:
98+
label: Developer Experience
99+
description: |
100+
Please describe how your framework provides a great developer experience. Include any limitations to React features like React DevTools, Chrome DevTools, and Fast Refresh.
101+
validations:
102+
required: true
103+
- type: textarea
104+
attributes:
105+
label: User Experience
106+
description: |
107+
Please describe how your framework helps developers create high quality user experiences by solving common use-cases. Include specifics for how your framework offers built-in support for code-splitting, routing, HTML generation, and data-fetching in a way that avoids client/server waterfalls by default. Include details on how you offer features such as SSG and SSR.
108+
validations:
109+
required: true
110+
- type: textarea
111+
attributes:
112+
label: Compatible with our future vision for React
113+
description: |
114+
Please describe how your framework aligns with our future vision for React. Include how your framework will evolve with React over time, and your plans to support future React features like React Server Components.
115+
validations:
116+
required: true

.github/ISSUE_TEMPLATE/config.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
contact_links:
2+
- name: 📃 Bugs in React
3+
url: https://github.com/facebook/react/issues/new/choose
4+
about: This issue tracker is not for bugs in React. Please file React issues here.
5+
- name: 🤔 Questions and Help
6+
url: https://reactjs.org/community/support.html
7+
about: This issue tracker is not for support questions. Please refer to the React community's help and discussion forums.

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ yarn-error.log*
3636

3737
# external fonts
3838
public/fonts/**/Optimistic_*.woff2
39+
40+
# rss
41+
public/rss.xml

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Ignore this rule if you're specifically describing an experimental proposal. Mak
7979
- Use semicolons.
8080
- No space between function names and parens (`method() {}` not `method () {}`).
8181
- When in doubt, use the default style favored by [Prettier](https://prettier.io/playground/).
82+
- Always capitalize React concepts such as Hooks, Effects, and Transitions.
8283

8384
### Highlighting
8485

colors.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = {
1111
tertiary: '#5E687E', // gray-50
1212
'tertiary-dark': '#99A1B3', // gray-30
1313
link: '#087EA4', // blue-50
14-
'link-dark': '#149ECA', // blue-40
14+
'link-dark': '#58C4DC', // blue-40
1515
syntax: '#EBECF0', // gray-10
1616
wash: '#FFFFFF',
1717
'wash-dark': '#23272F', // gray-90
@@ -23,6 +23,8 @@ module.exports = {
2323
'border-dark': '#343A46', // gray-80
2424
'secondary-button': '#EBECF0', // gray-10
2525
'secondary-button-dark': '#404756', // gray-70
26+
brand: '#087EA4', // blue-40
27+
'brand-dark': '#58C4DC', // blue-40
2628

2729
// Gray
2830
'gray-95': '#16181D',

package.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@
1515
"prettier:diff": "yarn nit:source",
1616
"lint-heading-ids": "node scripts/headingIdLinter.js",
1717
"fix-headings": "node scripts/headingIdLinter.js --fix",
18-
"ci-check": "npm-run-all prettier:diff --parallel lint tsc lint-heading-ids",
18+
"ci-check": "npm-run-all prettier:diff --parallel lint tsc lint-heading-ids rss",
1919
"tsc": "tsc --noEmit",
2020
"start": "next start",
2121
"postinstall": "patch-package && (is-ci || husky install .husky)",
22-
"check-all": "npm-run-all prettier lint:fix tsc"
22+
"check-all": "npm-run-all prettier lint:fix tsc rss",
23+
"rss": "node scripts/generateRss.js"
2324
},
2425
"dependencies": {
25-
"@codesandbox/sandpack-react": "2.6.0",
26+
"@codesandbox/sandpack-react": "2.13.5",
2627
"@docsearch/css": "3.0.0-alpha.41",
2728
"@docsearch/react": "3.0.0-alpha.41",
2829
"@headlessui/react": "^1.7.0",
30+
"@radix-ui/react-context-menu": "^2.1.5",
2931
"body-scroll-lock": "^3.1.3",
3032
"classnames": "^2.2.6",
3133
"date-fns": "^2.16.1",
@@ -91,13 +93,13 @@
9193
"retext": "^7.0.1",
9294
"retext-smartypants": "^4.0.0",
9395
"rss": "^1.2.2",
94-
"tailwindcss": "^3.3.2",
96+
"tailwindcss": "^3.4.1",
9597
"typescript": "^4.0.2",
9698
"unist-util-visit": "^2.0.3",
9799
"webpack-bundle-analyzer": "^4.5.0"
98100
},
99101
"engines": {
100-
"node": "^16.8.0 || ^18.0.0 || ^19.0.0 || ^20.0.0"
102+
"node": ">=16.8.0"
101103
},
102104
"nextBundleAnalysis": {
103105
"budget": null,

plugins/remark-smartypants.js

+44-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*!
2+
* Based on 'silvenon/remark-smartypants'
3+
* https://github.com/silvenon/remark-smartypants/pull/80
4+
*/
5+
16
const visit = require('unist-util-visit');
27
const retext = require('retext');
38
const smartypants = require('retext-smartypants');
@@ -9,12 +14,48 @@ function check(parent) {
914
}
1015

1116
module.exports = function (options) {
12-
const processor = retext().use(smartypants, options);
17+
const processor = retext().use(smartypants, {
18+
...options,
19+
// Do not replace ellipses, dashes, backticks because they change string
20+
// length, and we couldn't guarantee right splice of text in second visit of
21+
// tree
22+
ellipses: false,
23+
dashes: false,
24+
backticks: false,
25+
});
26+
27+
const processor2 = retext().use(smartypants, {
28+
...options,
29+
// Do not replace quotes because they are already replaced in the first
30+
// processor
31+
quotes: false,
32+
});
1333

1434
function transformer(tree) {
15-
visit(tree, 'text', (node, index, parent) => {
16-
if (check(parent)) node.value = String(processor.processSync(node.value));
35+
let allText = '';
36+
let startIndex = 0;
37+
const textOrInlineCodeNodes = [];
38+
39+
visit(tree, ['text', 'inlineCode'], (node, _, parent) => {
40+
if (check(parent)) {
41+
if (node.type === 'text') allText += node.value;
42+
// for the case when inlineCode contains just one part of quote: `foo'bar`
43+
else allText += 'A'.repeat(node.value.length);
44+
textOrInlineCodeNodes.push(node);
45+
}
1746
});
47+
48+
// Concat all text into one string, to properly replace quotes around non-"text" nodes
49+
allText = String(processor.processSync(allText));
50+
51+
for (const node of textOrInlineCodeNodes) {
52+
const endIndex = startIndex + node.value.length;
53+
if (node.type === 'text') {
54+
const processedText = allText.slice(startIndex, endIndex);
55+
node.value = String(processor2.processSync(processedText));
56+
}
57+
startIndex = endIndex;
58+
}
1859
}
1960

2061
return transformer;

public/android-chrome-192x192.png

5.86 KB
Loading

public/android-chrome-384x384.png

28.3 KB
Loading

public/android-chrome-512x512.png

69.6 KB
Loading

public/apple-touch-icon.png

5.54 KB
Loading

public/browserconfig.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<browserconfig>
3+
<msapplication>
4+
<tile>
5+
<square150x150logo src="/mstile-150x150.png"/>
6+
<TileColor>#2b5797</TileColor>
7+
</tile>
8+
</msapplication>
9+
</browserconfig>

public/favicon-16x16.png

872 Bytes
Loading

public/favicon-32x32.png

1.63 KB
Loading

public/favicon.ico

10.5 KB
Binary file not shown.

public/favicon_old.ico

15 KB
Binary file not shown.

0 commit comments

Comments
 (0)