11 Commits

Author SHA1 Message Date
lauren
b6a32d1e0e Add local eslint rule to validate markdown codeblocks with React Compiler (#7988)
In https://github.com/facebook/react/pull/34462 for example, we found an issue where the compiler was incorrectly validating an example straight from the docs.

In order to find more issues like this + also provide more feedback to doc authors on valid/invalid patterns, this PR adds a new local eslint rule which validates all markdown codeblocks containing components/hooks with React Compiler. An autofixer is also provided.

To express that a codeblock has an expected error, we can use the following metadata:

```ts
// pseudo type def
type MarkdownCodeBlockMetadata = {
    expectedErrors?: {
      'react-compiler'?: number[];
    };
  };
```

and can be used like so:

````
```js {expectedErrors: {'react-compiler': [4]}}
//  setState directly in render
function Component({value}) {
  const [count, setCount] = useState(0);
  setCount(value); // error on L4
  return <div>{count}</div>;
}
```
````

Because this is defined as a local rule, we don't have the same granular reporting that `eslint-plugin-react-hooks` yet. I can look into that later but for now this first PR just sets us up with something basic.
2025-09-18 15:32:18 -04:00
dan
af0358f1d2 Revert "feat: migrate React.dev to the App Router (#7437)" (#7466)
This reverts commit 0eb0f889b1.
2025-02-01 19:21:43 +00:00
Jimmy Lai
0eb0f889b1 feat: migrate React.dev to the App Router (#7437)
* update version to latest + move folders around

* getting home page working

* make the mdx setup work

* bypass mdxname

* split out mdx components

* re-add meta mdx logic

* replace mdxName usage

* fix code blocks

* fix max width

* convert mdx post processing to actual plugins

* fix tailwind

* fix incorrect iframe props

* cleanup mdx dic

* make it actually build

* align fonts

* fix uwu script

* fix search

* remove _app

* make it actually build

* replace next-watch-remote with custom setup

* clean up logs + clean up inline scripts

* add rss handler

* remove rss generation

* remove rss generation

* support MDX components for TOC

* clean up log + bump cache

* fix toc

* add back translations + add new overlay

* use MDX link instead of Next.js links for translation

* fix analytics

* add myself to the contributors

* fix blinking sidebar

* avoid rendering toc on the client

* plugin metadata

* simplify metadata

* fix title

* clean up metadata

* add back error decoder

* Update src/content/learn/index.md

---------

Co-authored-by: Ricky <rickhanlonii@gmail.com>
2025-02-01 11:35:16 -05:00
lauren
316230adfc Update React compiler and install eslint plugin (#7428) 2025-01-13 17:53:40 -05:00
Matt Carroll
855ce2373d Upgrade to React 19, Next 15.1 and enable React Compiler (#6996)
Co-authored-by: Sebastian Markbåge <sebastian@calyptus.eu>
Co-authored-by: Rick Hanlon <rickhanlonii@fb.com>
Co-authored-by: eps1lon <sebastian.silbermann@vercel.com>
2025-01-13 08:48:01 -08:00
Ricky
b9eea4da28 Fix lint warnings (#6174) 2023-07-21 19:24:36 -04:00
Dan Abramov
dd65dcac3b Move beta to top level 2023-03-18 22:35:53 +00:00
dan
4c2503a83e Move the old site to another repo (#5739)
* Delete the old site from this repo

* Remove old GH workflow

* Remove other files
2023-03-18 22:28:17 +00:00
jxom
de3bd87f4b Added fbjs eslint config, fixed lint errors and warnings 2017-10-10 08:41:44 +11:00
jxom
5a96b1da03 Rename check-all:verbose to ci-check, add some useful eslint config 2017-10-10 08:22:12 +11:00
Brian Vaughn
9d9b2021ed Migrated Gatsby website source and config 2017-10-04 14:56:10 -07:00