Skip to content

Commit 7735aa6

Browse files
merging all conflicts
2 parents 81cc997 + 84f29eb commit 7735aa6

22 files changed

+410
-40
lines changed

.github/workflows/analyze.yml

+13-5
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,26 @@ jobs:
1111
analyze:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515

1616
- name: Set up node
17-
uses: actions/setup-node@v3
17+
uses: actions/setup-node@v4
1818
with:
1919
node-version: '20.x'
20+
cache: yarn
21+
cache-dependency-path: yarn.lock
2022

21-
- name: Install dependencies
22-
uses: bahmutov/[email protected]
23+
- name: Restore cached node_modules
24+
uses: actions/cache@v4
25+
with:
26+
path: "**/node_modules"
27+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
28+
29+
- name: Install deps
30+
run: yarn install --frozen-lockfile
2331

2432
- name: Restore next build
25-
uses: actions/cache@v3
33+
uses: actions/cache@v4
2634
id: restore-build-cache
2735
env:
2836
cache-name: cache-next-build

.github/workflows/site_lint.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,22 @@ jobs:
1414
name: Lint on node 20.x and ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v1
17+
- uses: actions/checkout@v4
1818
- name: Use Node.js 20.x
19-
uses: actions/setup-node@v3
19+
uses: actions/setup-node@v4
2020
with:
2121
node-version: 20.x
22+
cache: yarn
23+
cache-dependency-path: yarn.lock
2224

23-
- name: Install deps and build (with cache)
24-
uses: bahmutov/[email protected]
25+
- name: Restore cached node_modules
26+
uses: actions/cache@v4
27+
with:
28+
path: "**/node_modules"
29+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
30+
31+
- name: Install deps
32+
run: yarn install --frozen-lockfile
2533

2634
- name: Lint codebase
2735
run: yarn ci-check

public/.well-known/atproto-did

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
did:plc:uorpbnp2q32vuvyeruwauyhe
67.2 KB
Loading
68.4 KB
Loading
67.1 KB
Loading
67.7 KB
Loading

src/components/Icon/IconBsky.tsx

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*/
4+
5+
import {memo} from 'react';
6+
7+
export const IconBsky = memo<JSX.IntrinsicElements['svg']>(function IconBsky(
8+
props
9+
) {
10+
return (
11+
<svg
12+
aria-label="Bluesky"
13+
viewBox="0 0 16 16"
14+
height="1.25em"
15+
width="1.25em"
16+
fill="currentColor"
17+
xmlns="http://www.w3.org/2000/svg"
18+
{...props}>
19+
<path
20+
className="x19hqcy"
21+
d="M3.468 1.948C5.303 3.325 7.276 6.118 8 7.616c.725-1.498 2.697-4.29 4.532-5.668C13.855.955 16 .186 16 2.632c0 .489-.28 4.105-.444 4.692-.572 2.04-2.653 2.561-4.504 2.246 3.236.551 4.06 2.375 2.281 4.2-3.376 3.464-4.852-.87-5.23-1.98-.07-.204-.103-.3-.103-.218 0-.081-.033.014-.102.218-.379 1.11-1.855 5.444-5.231 1.98-1.778-1.825-.955-3.65 2.28-4.2-1.85.315-3.932-.205-4.503-2.246C.28 6.737 0 3.12 0 2.632 0 .186 2.145.955 3.468 1.948Z"></path>
22+
</svg>
23+
);
24+
});

src/components/Layout/Footer.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import cn from 'classnames';
88
import {ExternalLink} from 'components/ExternalLink';
99
import {IconFacebookCircle} from 'components/Icon/IconFacebookCircle';
1010
import {IconTwitter} from 'components/Icon/IconTwitter';
11+
import {IconBsky} from 'components/Icon/IconBsky';
1112
import {IconGitHub} from 'components/Icon/IconGitHub';
1213

1314
export function Footer() {
@@ -366,6 +367,12 @@ export function Footer() {
366367
className={socialLinkClasses}>
367368
<IconTwitter />
368369
</ExternalLink>
370+
<ExternalLink
371+
aria-label="React on Bluesky"
372+
href="https://bsky.app/profile/react.dev"
373+
className={socialLinkClasses}>
374+
<IconBsky />
375+
</ExternalLink>
369376
<ExternalLink
370377
aria-label="React on Github"
371378
href="https://github.com/facebook/react"

src/components/MDX/Diagram.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ interface DiagramProps {
1515

1616
function Caption({text}: {text: string}) {
1717
return (
18-
<div className="w-full table">
19-
<figcaption className="p-1 sm:p-2 mt-0 sm:mt-0 text-gray-40 text-base lg:text-lg text-center leading-tight table-caption">
18+
<div className="w-full flex justify-center">
19+
<figcaption className="p-1 sm:p-2 mt-0 sm:mt-0 text-gray-40 text-base lg:text-lg text-center leading-tight table-caption max-w-lg">
2020
{text}
2121
</figcaption>
2222
</div>

src/components/MDX/TeamMember.tsx

+17-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as React from 'react';
66
import Image from 'next/image';
77
import {IconTwitter} from '../Icon/IconTwitter';
88
import {IconThreads} from '../Icon/IconThreads';
9+
import {IconBsky} from '../Icon/IconBsky';
910
import {IconGitHub} from '../Icon/IconGitHub';
1011
import {ExternalLink} from '../ExternalLink';
1112
import {H3} from './Heading';
@@ -19,6 +20,7 @@ interface TeamMemberProps {
1920
photo: string;
2021
twitter?: string;
2122
threads?: string;
23+
bsky?: string;
2224
github?: string;
2325
personal?: string;
2426
}
@@ -33,6 +35,7 @@ export function TeamMember({
3335
github,
3436
twitter,
3537
threads,
38+
bsky,
3639
personal,
3740
}: TeamMemberProps) {
3841
if (name == null || title == null || permalink == null || children == null) {
@@ -62,11 +65,11 @@ export function TeamMember({
6265
</H3>
6366
{title && <div>{title}</div>}
6467
{children}
65-
<div className="sm:flex sm:flex-row flex-wrap">
68+
<div className="sm:flex sm:flex-row flex-wrap text-secondary dark:text-secondary-dark">
6669
{twitter && (
6770
<div className="me-4">
6871
<ExternalLink
69-
aria-label="React on Twitter"
72+
aria-label={`${name} on Twitter`}
7073
href={`https://twitter.com/${twitter}`}
7174
className="hover:text-primary hover:underline dark:text-primary-dark flex flex-row items-center">
7275
<IconTwitter className="pe-1" />
@@ -77,14 +80,25 @@ export function TeamMember({
7780
{threads && (
7881
<div className="me-4">
7982
<ExternalLink
80-
aria-label="React on Threads"
83+
aria-label={`${name} on Threads`}
8184
href={`https://threads.net/${threads}`}
8285
className="hover:text-primary hover:underline dark:text-primary-dark flex flex-row items-center">
8386
<IconThreads className="pe-1" />
8487
{threads}
8588
</ExternalLink>
8689
</div>
8790
)}
91+
{bsky && (
92+
<div className="me-4">
93+
<ExternalLink
94+
aria-label={`${name} on Bluesky`}
95+
href={`https://bsky.app/profile/${bsky}`}
96+
className="hover:text-primary hover:underline dark:text-primary-dark flex flex-row items-center">
97+
<IconBsky className="pe-1" />
98+
{bsky}
99+
</ExternalLink>
100+
</div>
101+
)}
88102
{github && (
89103
<div className="me-4">
90104
<ExternalLink

src/content/blog/2024/04/25/react-19-upgrade-guide.md

+18
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,24 @@ When double rendering in Strict Mode in development, `useMemo` and `useCallback`
536536

537537
As with all Strict Mode behaviors, these features are designed to proactively surface bugs in your components during development so you can fix them before they are shipped to production. For example, during development, Strict Mode will double-invoke ref callback functions on initial mount, to simulate what happens when a mounted component is replaced by a Suspense fallback.
538538

539+
### Improvements to Suspense {/*improvements-to-suspense*/}
540+
541+
In React 19, when a component suspends, React will immediately commit the fallback of the nearest Suspense boundary without waiting for the entire sibling tree to render. After the fallback commits, React schedules another render for the suspended siblings to "pre-warm" lazy requests in the rest of the tree:
542+
543+
<Diagram name="prerender" height={162} width={1270} alt="Diagram showing a tree of three components, one parent labeled Accordion and two children labeled Panel. Both Panel components contain isActive with value false.">
544+
545+
Previously, when a component suspended, the suspended siblings were rendered and then the fallback was committed.
546+
547+
</Diagram>
548+
549+
<Diagram name="prewarm" height={162} width={1270} alt="The same diagram as the previous, with the isActive of the first child Panel component highlighted indicating a click with the isActive value set to true. The second Panel component still contains value false." >
550+
551+
In React 19, when a component suspends, the fallback is committed and then the suspended siblings are rendered.
552+
553+
</Diagram>
554+
555+
This change means Suspense fallbacks display faster, while still warming lazy requests in the suspended tree.
556+
539557
### UMD builds removed {/*umd-builds-removed*/}
540558

541559
UMD was widely used in the past as a convenient way to load React without a build step. Now, there are modern alternatives for loading modules as scripts in HTML documents. Starting with React 19, React will no longer produce UMD builds to reduce the complexity of its testing and release process.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
title: "React Compiler Beta Release"
3+
author: Lauren Tan
4+
date: 2024/10/21
5+
description: At React Conf 2024, we announced the experimental release of React Compiler, a build-time tool that optimizes your React app through automatic memoization. In this post, we want to share what's next for open source, and our progress on the compiler.
6+
7+
---
8+
9+
October 21, 2024 by [Lauren Tan](https://twitter.com/potetotes).
10+
11+
---
12+
13+
<Intro>
14+
15+
The React team is excited to share new updates:
16+
17+
</Intro>
18+
19+
1. We're publishing React Compiler Beta today, so that early adopters and library maintainers can try it and provide feedback.
20+
2. We're officially supporting React Compiler for apps on React 17+, through an optional `react-compiler-runtime` package.
21+
3. We're opening up public membership of the [React Compiler Working Group](https://github.com/reactwg/react-compiler) to prepare the community for gradual adoption of the compiler.
22+
23+
---
24+
25+
At [React Conf 2024](/blog/2024/05/22/react-conf-2024-recap), we announced the experimental release of React Compiler, a build-time tool that optimizes your React app through automatic memoization. [You can find an introduction to React Compiler here](/learn/react-compiler).
26+
27+
Since the first release, we've fixed numerous bugs reported by the React community, received several high quality bug fixes and contributions[^1] to the compiler, made the compiler more resilient to the broad diversity of JavaScript patterns, and have continued to roll out the compiler more widely at Meta.
28+
29+
In this post, we want to share what's next for React Compiler.
30+
31+
## Try React Compiler Beta today {/*try-react-compiler-beta-today*/}
32+
33+
At [React India 2024](https://www.youtube.com/watch?v=qd5yk2gxbtg), we shared an update on React Compiler. Today, we are excited to announce a new Beta release of React Compiler and ESLint plugin. New betas are published to npm using the `@beta` tag.
34+
35+
To install React Compiler Beta:
36+
37+
<TerminalBlock>
38+
npm install -D babel-plugin-react-compiler@beta eslint-plugin-react-compiler@beta
39+
</TerminalBlock>
40+
41+
Or, if you're using Yarn:
42+
43+
<TerminalBlock>
44+
yarn add -D babel-plugin-react-compiler@beta eslint-plugin-react-compiler@beta
45+
</TerminalBlock>
46+
47+
You can watch [Sathya Gunasekaran's](https://twitter.com/_gsathya) talk at React India here:
48+
49+
<YouTubeIframe src="https://www.youtube.com/embed/qd5yk2gxbtg" />
50+
51+
## We recommend everyone use the React Compiler linter today {/*we-recommend-everyone-use-the-react-compiler-linter-today*/}
52+
53+
React Compiler’s ESLint plugin helps developers proactively identify and correct [Rules of React](/reference/rules) violations. **We strongly recommend everyone use the linter today**. The linter does not require that you have the compiler installed, so you can use it independently, even if you are not ready to try out the compiler.
54+
55+
To install the linter only:
56+
57+
<TerminalBlock>
58+
npm install -D eslint-plugin-react-compiler@beta
59+
</TerminalBlock>
60+
61+
Or, if you're using Yarn:
62+
63+
<TerminalBlock>
64+
yarn add -D eslint-plugin-react-compiler@beta
65+
</TerminalBlock>
66+
67+
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.
68+
69+
## Backwards Compatibility {/*backwards-compatibility*/}
70+
71+
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).
72+
73+
## Using React Compiler in libraries {/*using-react-compiler-in-libraries*/}
74+
75+
Our initial release was focused on identifying major issues with using the compiler in applications. We've gotten great feedback and have substantially improved the compiler since then. We're now ready for broad feedback from the community, and for library authors to try out the compiler to improve performance and the developer experience of maintaining your library.
76+
77+
React Compiler can also be used to compile libraries. Because React Compiler needs to run on the original source code prior to any code transformations, it is not possible for an application's build pipeline to compile the libraries they use. Hence, our recommendation is for library maintainers to independently compile and test their libraries with the compiler, and ship compiled code to npm.
78+
79+
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.
80+
81+
[You can find more docs on this here.](/learn/react-compiler#using-the-compiler-on-libraries)
82+
83+
## Opening up React Compiler Working Group to everyone {/*opening-up-react-compiler-working-group-to-everyone*/}
84+
85+
We previously announced the invite-only [React Compiler Working Group](https://github.com/reactwg/react-compiler) at React Conf to provide feedback, ask questions, and collaborate on the compiler's experimental release.
86+
87+
From today, together with the Beta release of React Compiler, we are opening up Working Group membership to everyone. The goal of the React Compiler Working Group is to prepare the ecosystem for a smooth, gradual adoption of React Compiler by existing applications and libraries. Please continue to file bug reports in the [React repo](https://github.com/facebook/react), but please leave feedback, ask questions, or share ideas in the [Working Group discussion forum](https://github.com/reactwg/react-compiler/discussions).
88+
89+
The core team will also use the discussions repo to share our research findings. As the Stable Release gets closer, any important information will also be posted on this forum.
90+
91+
## React Compiler at Meta {/*react-compiler-at-meta*/}
92+
93+
At [React Conf](/blog/2024/05/22/react-conf-2024-recap), we shared that our rollout of the compiler on Quest Store and Instagram were successful. Since then, we've deployed React Compiler across several more major web apps at Meta, including [Facebook](https://www.facebook.com) and [Threads](https://www.threads.net). That means if you've used any of these apps recently, you may have had your experience powered by the compiler. We were able to onboard these apps onto the compiler with few code changes required, in a monorepo with more than 100,000 React components.
94+
95+
We've seen notable performance improvements across all of these apps. As we've rolled out, we're continuing to see results on the order of [the wins we shared previously at ReactConf](https://youtu.be/lyEKhv8-3n0?t=3223). These apps have already been heavily hand tuned and optimized by Meta engineers and React experts over the years, so even improvements on the order of a few percent are a huge win for us.
96+
97+
We also expected developer productivity wins from React Compiler. To measure this, we collaborated with our data science partners at Meta[^2] to conduct a thorough statistical analysis of the impact of manual memoization on productivity. Before rolling out the compiler at Meta, we discovered that only about 8% of React pull requests used manual memoization and that these pull requests took 31-46% longer to author[^3]. This confirmed our intuition that manual memoization introduces cognitive overhead, and we anticipate that React Compiler will lead to more efficient code authoring and review. Notably, React Compiler also ensures that *all* code is memoized by default, not just the (in our case) 8% where developers explicitly apply memoization.
98+
99+
## Roadmap to Stable {/*roadmap-to-stable*/}
100+
101+
*This is not a final roadmap, and is subject to change.*
102+
103+
We intend to ship a Release Candidate of the compiler in the near future following the Beta release, when the majority of apps and libraries that follow the Rules of React have been proven to work well with the compiler. After a period of final feedback from the community, we plan on a Stable Release for the compiler. The Stable Release will mark the beginning of a new foundation for React, and all apps and libraries will be strongly recommended to use the compiler and ESLint plugin.
104+
105+
* ✅ Experimental: Released at React Conf 2024, primarily for feedback from early adopters.
106+
* ✅ Public Beta: Available today, for feedback from the wider community.
107+
* 🚧 Release Candidate (RC): React Compiler works for the majority of rule-following apps and libraries without issue.
108+
* 🚧 General Availability: After final feedback period from the community.
109+
110+
These releases also include the compiler's ESLint plugin, which surfaces diagnostics statically analyzed by the compiler. We plan to combine the existing eslint-plugin-react-hooks plugin with the compiler's ESLint plugin, so only one plugin needs to be installed.
111+
112+
Post-Stable, we plan to add more compiler optimizations and improvements. This includes both continual improvements to automatic memoization, and new optimizations altogether, with minimal to no change of product code. Upgrading to each new release of the compiler is aimed to be straightforward, and each upgrade will continue to improve performance and add better handling of diverse JavaScript and React patterns.
113+
114+
Throughout this process, we also plan to prototype an IDE extension for React. It is still very early in research, so we expect to be able to share more of our findings with you in a future React Labs blog post.
115+
116+
---
117+
118+
Thanks to [Sathya Gunasekaran](https://twitter.com/_gsathya), [Joe Savona](https://twitter.com/en_JS), [Ricky Hanlon](https://twitter.com/rickhanlonii), [Alex Taylor](https://github.com/alexmckenley), [Jason Bonta](https://twitter.com/someextent), and [Eli White](https://twitter.com/Eli_White) for reviewing and editing this post.
119+
120+
---
121+
122+
[^1]: Thanks [@nikeee](https://github.com/facebook/react/pulls?q=is%3Apr+author%3Anikeee), [@henryqdineen](https://github.com/facebook/react/pulls?q=is%3Apr+author%3Ahenryqdineen), [@TrickyPi](https://github.com/facebook/react/pulls?q=is%3Apr+author%3ATrickyPi), and several others for their contributions to the compiler.
123+
124+
[^2]: Thanks [Vaishali Garg](https://www.linkedin.com/in/vaishaligarg09) for leading this study on React Compiler at Meta, and for reviewing this post.
125+
126+
[^3]: After controlling on author tenure, diff length/complexity, and other potential confounding factors.

0 commit comments

Comments
 (0)