Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with react.dev @ 5de85198 #44

Open
wants to merge 92 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
b1c4b4e
useId add server rendering usage and server api add options (#6457)
2239559319 Dec 5, 2023
4226fbf
Edits to useId doc (#6464)
gaearon Dec 5, 2023
b9bf666
Oops
gaearon Dec 5, 2023
ae4be84
Fix Next JS link (#6467)
budmc29 Dec 6, 2023
af54fc8
Link to the new Next.js tutorial instead (#6468)
AhmedBaset Dec 6, 2023
bec75ca
Update useSyncExternalStore.md: tweak link
sophiebits Dec 13, 2023
e98c393
fix(sandpack-template): use custom react sandpack template (#6484)
danilowoz Dec 13, 2023
01e80fd
Add React India 2024 conference (#6481)
ehteshamdev0 Dec 15, 2023
e3c25d1
data: add react mumbai meetup (#6396)
ehteshamdev0 Dec 15, 2023
bb65ace
Fix #6487 specify which `Sandpack` files go into a `src` directory (#…
geeseyj Dec 15, 2023
d0a50e8
fix sandpack ts (#6498)
harish-sethuraman Dec 16, 2023
303ecae
Update startTransition.md (#6431)
prajwalkulkarni Dec 16, 2023
9ce4afe
Improve documentation for __html (#6499)
Daniel15 Dec 20, 2023
3bf64e5
Fix diagram alt text in Your UI as a Tree page (#6507)
alinkedd Dec 21, 2023
3009d76
Fix error throw and for useTransition demo (#6510)
lunaleaps Dec 21, 2023
bbb08a5
Add Turkish to deployed languages (#6449)
alioguzhan Dec 21, 2023
fc32af8
Text Display error in Go full-stack with a framework (#6483)
nepalivai Jan 5, 2024
7a28cf6
Fix missing function keyword (#6527)
AhmedBaset Jan 5, 2024
315cb7a
fix wrong quotes around inline codes (#6523)
2wheeh Jan 7, 2024
bb0ac87
Fix typo in experimental_taintObjectReference (#6536)
probeiuscorp Jan 9, 2024
083c308
Fix(Bug) Update Feedback.tsx component visiblity issue (#6533)
Abdul-Rahman-E Jan 9, 2024
10d4a4d
Fix forwardRef and useRef links (#6537)
rickhanlonii Jan 9, 2024
53a1f49
Added React Nexus 2024 conference to the conference list (#6538)
akiran Jan 9, 2024
6f8d4e6
Add pointer-events:none to .exit (#6541)
rickhanlonii Jan 9, 2024
983bda9
Removed unused nextId variable (#6470)
TymeeK Jan 10, 2024
9d8c5ad
Revert "Add useState semicolon (#5823)" (#6543)
rickhanlonii Jan 10, 2024
eff3955
Update meetups.md (#6540)
tazsingh Jan 11, 2024
a3f5b13
fix: Grammar in versioning-policy.md (#6539)
uerkw Jan 11, 2024
0972541
Add React Paris 2024 conference + React Brussels videos link (#6547)
AymenBenAmor Jan 12, 2024
6987f0f
Fix overflowing text content in footer link (#6519)
prajwalkulkarni Jan 12, 2024
8d2664b
Feat: error-decoder (#6214)
SukkaW Jan 12, 2024
df8f301
Use 'trim()' method in `useContext` page to prevent form from accepti…
BartoszKlonowski Jan 12, 2024
6bfde58
docs: fix grammar (#6465)
oxcened Jan 14, 2024
7a15e96
Fix async-await syntax (#6554)
jamiebuilds Jan 18, 2024
9c316b2
Upgrade tailwind version (#6550)
prajwalkulkarni Jan 18, 2024
82723c1
Remove url origin to match all translation forks (#6516)
AhmedBaset Jan 18, 2024
a3cf37d
Update conferences.md - React Miami (#6557)
michellebakels Jan 19, 2024
b9f4f97
Add threads links to team page (#6561)
rickhanlonii Jan 19, 2024
3563d95
Fix typo in Tic-Tac-Toe tutorial (#6565)
t-hamano Jan 21, 2024
4886261
Fix regex lookback crashing older browsers (#6571)
rickhanlonii Jan 22, 2024
98d0f56
add Noah Lemen to team page (#6576)
noahlemen Jan 23, 2024
85653a3
Update alumni (#6577)
rickhanlonii Jan 23, 2024
e33ec30
add upcoming conferences (#6573)
lero62 Jan 24, 2024
5bc1d26
Add useFormState permalink arg (#6402)
sophiebits Jan 26, 2024
5964bfa
conferences: Add Epic Web Conf (#6584)
kentcdodds Jan 26, 2024
1ab7108
Add guiding note (#6501)
smith558 Jan 27, 2024
30f23d7
fix(footer-social-icon): Vertical alignment of social icon (#6579) (#…
muhammadhafijur Jan 28, 2024
5d2f710
Remove unused variables (#6574)
smith558 Jan 28, 2024
adb958a
[Conferences] Add React Conf, order upcoming conferences by date (#6596)
mattcarrollcode Feb 1, 2024
ca98764
[Tutorial] Fix Sandbox download instructions to match current interfa…
victorferreira Feb 1, 2024
f96c528
Add form templates (#6592)
josephsavona Feb 1, 2024
b07fe2e
Tweak getting started guide (#6597)
rickhanlonii Feb 1, 2024
be8668c
removed Unnecessary Horizontal Scrollbar in Learn Section - Reacting …
saranyasri-s Feb 1, 2024
6ca0381
Update conferences.md (#6598)
dhairyadwivedi Feb 1, 2024
8ba8772
Initial Float docs for hoistable/semantic elements (#6486)
davidmccabe Feb 2, 2024
2372ecf
Initial docs for DOM static resource loading functions (#6459)
davidmccabe Feb 2, 2024
47c818c
feat (conferences) add react connection Paris (#6609)
Feb 5, 2024
c118938
Fix SandpackWithHTMLOutput to use src dir (#6613)
mattcarrollcode Feb 6, 2024
9a843b6
Add React Conf banner (#6595)
mattcarrollcode Feb 8, 2024
6d43bff
Fix scrollbar of SidebarNav to make it tappable (#6586)
tamonmon0417 Feb 10, 2024
6ae9922
Update index.md (#6622)
drex44 Feb 11, 2024
4ff80a5
Fix broken link (#6619)
lakshmi930 Feb 11, 2024
d46c360
Fix CSS discrepancy in issue #6508 (#6509)
hidaviddong Feb 11, 2024
bb3a0f5
Fix some typos (#6478)
romain-trotard Feb 11, 2024
a21a942
Fix typo (#6628)
0ldh Feb 14, 2024
2c4f382
Blog: What We've Been Working On – February 2024 (#6629)
rickhanlonii Feb 15, 2024
c1039b3
minor fixes from #6629 (#6630)
rickhanlonii Feb 15, 2024
9d3fc07
tweaks (#6631)
rickhanlonii Feb 15, 2024
bce6e55
Add warning page for RTR deprecation (#6632)
jackpope Feb 15, 2024
b66dece
Update react-labs-what-we-have-been-working-on-february-2024.md
sophiebits Feb 15, 2024
c608570
[blog] labs 2024 - minor grammer fix
mattcarrollcode Feb 16, 2024
1c06fcc
Update conferences.md to include Chain React 2024 (#6640)
robinheinze Feb 17, 2024
74c33a1
Fix typos in latest blog post (#6636)
stephan281094 Feb 17, 2024
156765f
Fix localhost link in script documentation (#6642)
devongovett Feb 17, 2024
35530ee
[typo] syntax looks wrong #6633 (#6641)
felipe-b-oliveira Feb 18, 2024
c9369f4
feat(conferences): add React Universe Conf 2024 (#6649)
szymonrybczak Feb 20, 2024
e16634a
Add options to call signature of react-dom/server legacy APIs (#6477)
eps1lon Feb 20, 2024
af289c3
Update team page (#6652)
josephsavona Feb 20, 2024
5398b47
Add React Alicante to conferences.md (#6655)
VictoriaQ Feb 21, 2024
93aec27
Remove redundant suggestion (#6643)
tomaszwysocki Feb 21, 2024
2ad51d9
feat(conferences): add The GeekConf 2024 (#6654)
apherio Feb 23, 2024
a853e69
Remove useMemo from useFormStatus example (#6658)
rickhanlonii Feb 24, 2024
081d100
fix(sandpack): clear up bundler timeout when there's a syntax error (…
danilowoz Feb 24, 2024
9ceb057
Revert "fix(sandpack): clear up bundler timeout when there's a syntax…
harish-sethuraman Feb 26, 2024
41b1bb3
Update Dan's twitter link
gaearon Feb 26, 2024
6d8e094
fix: Update @codesandbox/sandpack-react version to 2.13.4 (#6664)
danilowoz Feb 27, 2024
6e650f9
update: "Configuring TypeScript" link for Next.js App Directory - to …
tomihq Feb 29, 2024
6310c8a
Add /link redirects (#6670)
rickhanlonii Mar 1, 2024
265fa26
Update small typo in useDeferredValue.md (#6673)
ninjaPixel Mar 3, 2024
716e889
Add hydration-mismatch link (#6678)
rickhanlonii Mar 4, 2024
5de8519
fix: Update sandpack-react version to 2.13.5 (#6668)
danilowoz Mar 8, 2024
c8e2d51
merging all conflicts
react-translations-bot Mar 11, 2024
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
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/0-bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "🐛 Report a bug"
description: "Report a problem on the website."
title: "[Bug]: "
labels: ["bug: unconfirmed"]
body:
- type: textarea
attributes:
label: Summary
description: |
A clear and concise summary of what the bug is.
placeholder: |
Example bug report:
When I click the "Submit" button on "Feedback", nothing happens.
validations:
required: true
- type: input
attributes:
label: Page
description: |
What page(s) did you encounter this bug on?
placeholder: |
https://react.dev/
validations:
required: true
- type: textarea
attributes:
label: Details
description: |
Please provide any additional details about the bug.
placeholder: |
Example details:
The "Submit" button is unresponsive. I've tried refreshing the page and using a different browser, but the issue persists.
validations:
required: false
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/1-typo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "🤦 Typo or mistake"
description: "Report a typo or mistake in the docs."
title: "[Typo]: "
labels: ["type: typos"]
body:
- type: textarea
attributes:
label: Summary
description: |
A clear and concise summary of what the mistake is.
placeholder: |
Example:
The code example on the "useReducer" page includes an unused variable `nextId`.
validations:
required: true
- type: input
attributes:
label: Page
description: |
What page is the typo on?
placeholder: |
https://react.dev/
validations:
required: true
- type: textarea
attributes:
label: Details
description: |
Please provide a explanation for why this is a mistake.
placeholder: |
Example mistake:
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.
validations:
required: false
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/2-suggestion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "💡 Suggestions"
description: "Suggest a new page, section, or edit for an existing page."
title: "[Suggestion]: "
labels: ["type: documentation"]
body:
- type: textarea
attributes:
label: Summary
description: |
A clear and concise summary of what we should add.
placeholder: |
Example:
Add a new page for how to use React with TypeScript.
validations:
required: true
- type: input
attributes:
label: Page
description: |
What page is this about?
placeholder: |
https://react.dev/
validations:
required: false
- type: textarea
attributes:
label: Details
description: |
Please provide a explanation for what you're suggesting.
placeholder: |
Example:
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.
validations:
required: true
116 changes: 116 additions & 0 deletions .github/ISSUE_TEMPLATE/3-framework.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: "📄 Suggest new framework"
description: "I am a framework author applying to be included as a recommended framework."
title: "[Framework]: "
labels: ["type: framework"]
body:
- type: markdown
attributes:
value: |
## Apply to be included as a recommended React framework

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

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.

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

To be included, frameworks must meet the following criteria:

- **Free & open-source**: must be open source and free to use.
- **Well maintained**. must be actively maintained, providing bug fixes and improvements.
- **Active community**: must have a sufficiently large and active community to support users.
- **Clear onboarding**: must have clear install steps to install the React version of the framework.
- **Ecosystem compatibility**: must support using the full range of libraries and tools in the React ecosystem.
- **Self-hosting option**: must support an option to self-host applications without losing access to features.
- **Developer experience**. must allow developers to be productive by supporting features like Fast Refresh.
- **User experience**. must provide built-in support for common problems like routing and data-fetching.
- **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.

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.
- type: input
attributes:
label: Name
description: |
What is the name of your framework?
validations:
required: true
- type: input
attributes:
label: Homepage
description: |
What is the URL of your homepage?
validations:
required: true
- type: input
attributes:
label: Install instructions
description: |
What is the URL of your getting started guide?
validations:
required: true
- type: dropdown
attributes:
label: Is your framework open source?
description: |
We only recommend free and open source frameworks.
options:
- 'No'
- 'Yes'
validations:
required: true
- type: textarea
attributes:
label: Well maintained
description: |
Please describe how your framework is actively maintained. Include recent releases, bug fixes, and improvements as examples.
validations:
required: true
- type: textarea
attributes:
label: Active community
description: |
Please describe your community. Include the size of your community, and links to community resources.
validations:
required: true
- type: textarea
attributes:
label: Clear onboarding
description: |
Please describe how a user can install your framework with React. Include links to any relevant documentation.
validations:
required: true
- type: textarea
attributes:
label: Ecosystem compatibility
description: |
Please describe any limitations your framework has with the React ecosystem. Include any libraries or tools that are not compatible with your framework.
validations:
required: true
- type: textarea
attributes:
label: Self-hosting option
description: |
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.
validations:
required: true
- type: textarea
attributes:
label: Developer Experience
description: |
Please describe how your framework provides a great developer experience. Include any limitations to React features like React DevTools, Chrome DevTools, and Fast Refresh.
validations:
required: true
- type: textarea
attributes:
label: User Experience
description: |
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.
validations:
required: true
- type: textarea
attributes:
label: Compatible with our future vision for React
description: |
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.
validations:
required: true
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
contact_links:
- name: 📃 Bugs in React
url: https://github.com/facebook/react/issues/new/choose
about: This issue tracker is not for bugs in React. Please file React issues here.
- name: 🤔 Questions and Help
url: https://reactjs.org/community/support.html
about: This issue tracker is not for support questions. Please refer to the React community's help and discussion forums.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"check-all": "npm-run-all prettier lint:fix tsc"
},
"dependencies": {
"@codesandbox/sandpack-react": "2.6.0",
"@codesandbox/sandpack-react": "2.13.5",
"@docsearch/css": "3.0.0-alpha.41",
"@docsearch/react": "3.0.0-alpha.41",
"@headlessui/react": "^1.7.0",
Expand Down Expand Up @@ -91,7 +91,7 @@
"retext": "^7.0.1",
"retext-smartypants": "^4.0.0",
"rss": "^1.2.2",
"tailwindcss": "^3.3.2",
"tailwindcss": "^3.4.1",
"typescript": "^4.0.2",
"unist-util-visit": "^2.0.3",
"webpack-bundle-analyzer": "^4.5.0"
Expand Down
47 changes: 44 additions & 3 deletions plugins/remark-smartypants.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*!
* Based on 'silvenon/remark-smartypants'
* https://github.com/silvenon/remark-smartypants/pull/80
*/

const visit = require('unist-util-visit');
const retext = require('retext');
const smartypants = require('retext-smartypants');
Expand All @@ -9,12 +14,48 @@ function check(parent) {
}

module.exports = function (options) {
const processor = retext().use(smartypants, options);
const processor = retext().use(smartypants, {
...options,
// Do not replace ellipses, dashes, backticks because they change string
// length, and we couldn't guarantee right splice of text in second visit of
// tree
ellipses: false,
dashes: false,
backticks: false,
});

const processor2 = retext().use(smartypants, {
...options,
// Do not replace quotes because they are already replaced in the first
// processor
quotes: false,
});

function transformer(tree) {
visit(tree, 'text', (node, index, parent) => {
if (check(parent)) node.value = String(processor.processSync(node.value));
let allText = '';
let startIndex = 0;
const textOrInlineCodeNodes = [];

visit(tree, ['text', 'inlineCode'], (node, _, parent) => {
if (check(parent)) {
if (node.type === 'text') allText += node.value;
// for the case when inlineCode contains just one part of quote: `foo'bar`
else allText += 'A'.repeat(node.value.length);
textOrInlineCodeNodes.push(node);
}
});

// Concat all text into one string, to properly replace quotes around non-"text" nodes
allText = String(processor.processSync(allText));

for (const node of textOrInlineCodeNodes) {
const endIndex = startIndex + node.value.length;
if (node.type === 'text') {
const processedText = allText.slice(startIndex, endIndex);
node.value = String(processor2.processSync(processedText));
}
startIndex = endIndex;
}
}

return transformer;
Expand Down
Binary file added public/images/team/noahlemen.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 9 additions & 7 deletions src/components/DocsFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const DocsPageFooter = memo<DocsPageFooterProps>(
<>
{prevRoute?.path || nextRoute?.path ? (
<>
<div className="max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-2 gap-4 py-4 md:py-12">
<div className="grid grid-cols-1 gap-4 py-4 mx-auto max-w-7xl md:grid-cols-2 md:py-12">
{prevRoute?.path ? (
<FooterLink
type="Previous"
Expand Down Expand Up @@ -69,21 +69,23 @@ function FooterLink({
<NextLink
href={href}
className={cn(
'flex gap-x-4 md:gap-x-6 items-center w-full md:w-80 px-4 md:px-5 py-6 border-2 border-transparent text-base leading-base text-link dark:text-link-dark rounded-lg group focus:text-link dark:focus:text-link-dark focus:bg-highlight focus:border-link dark:focus:bg-highlight-dark dark:focus:border-link-dark focus:border-opacity-100 focus:border-2 focus:ring-1 focus:ring-offset-4 focus:ring-blue-40 active:ring-0 active:ring-offset-0 hover:bg-gray-5 dark:hover:bg-gray-80',
'flex gap-x-4 md:gap-x-6 items-center w-full md:min-w-80 md:w-fit md:max-w-md px-4 md:px-5 py-6 border-2 border-transparent text-base leading-base text-link dark:text-link-dark rounded-lg group focus:text-link dark:focus:text-link-dark focus:bg-highlight focus:border-link dark:focus:bg-highlight-dark dark:focus:border-link-dark focus:border-opacity-100 focus:border-2 focus:ring-1 focus:ring-offset-4 focus:ring-blue-40 active:ring-0 active:ring-offset-0 hover:bg-gray-5 dark:hover:bg-gray-80',
{
'flex-row-reverse justify-self-end text-end': type === 'Next',
}
)}>
<IconNavArrow
className="text-tertiary dark:text-tertiary-dark inline group-focus:text-link dark:group-focus:text-link-dark"
className="inline text-tertiary dark:text-tertiary-dark group-focus:text-link dark:group-focus:text-link-dark"
displayDirection={type === 'Previous' ? 'start' : 'end'}
/>
<span>
<span className="block no-underline text-sm tracking-wide text-secondary dark:text-secondary-dark uppercase font-bold group-focus:text-link dark:group-focus:text-link-dark group-focus:text-opacity-100">
<div className="flex flex-col overflow-hidden">
<span className="text-sm font-bold tracking-wide no-underline uppercase text-secondary dark:text-secondary-dark group-focus:text-link dark:group-focus:text-link-dark group-focus:text-opacity-100">
{type}
</span>
<span className="block text-lg group-hover:underline">{title}</span>
</span>
<span className="text-lg break-words group-hover:underline">
{title}
</span>
</div>
</NextLink>
);
}
23 changes: 23 additions & 0 deletions src/components/ErrorDecoderContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Error Decoder requires reading pregenerated error message from getStaticProps,
// but MDX component doesn't support props. So we use React Context to populate
// the value without prop-drilling.
// TODO: Replace with React.cache + React.use when migrating to Next.js App Router

import {createContext, useContext} from 'react';

const notInErrorDecoderContext = Symbol('not in error decoder context');

export const ErrorDecoderContext = createContext<
| {errorMessage: string | null; errorCode: string | null}
| typeof notInErrorDecoderContext
>(notInErrorDecoderContext);

export const useErrorDecoderParams = () => {
const params = useContext(ErrorDecoderContext);

if (params === notInErrorDecoderContext) {
throw new Error('useErrorDecoder must be used in error decoder pages only');
}

return params;
};
4 changes: 2 additions & 2 deletions src/components/Icon/IconGitHub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export const IconGitHub = memo<JSX.IntrinsicElements['svg']>(
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1.33em"
height="1.33em"
width="1.5em"
height="1.5em"
viewBox="0 -2 24 24"
fill="currentColor"
{...props}>
Expand Down
Loading
Loading