Skip to content

Conversation

poteto
Copy link
Member

@poteto poteto commented Sep 15, 2025

Adds new docs for our new eslint rules.

Copy link

github-actions bot commented Sep 15, 2025

Size changes

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

One Page Changed Size

The following page changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/[[...markdownPath]] 130.38 KB (🟡 +258 B) 240.92 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

@josephsavona
Copy link
Member

Wow this is incredible!!! Still going through all the content but looks great :-)

Comment on lines +49 to +60
The `use` hook doesn't throw errors in the traditional sense, it suspends component execution. When `use` encounters a pending promise, it suspends the component and lets React show a fallback. Only Suspense and Error Boundaries can handle these cases. The linter warns against `try`/`catch` around `use` to prevent confusion as the `catch` block would never run.

```js {expectedErrors: {'react-compiler': [5]}}
// ❌ Try/catch around `use` hook
function Component({promise}) {
try {
const data = use(promise); // Won't catch - `use` suspends, not throws
return <div>{data}</div>;
} catch (error) {
return <div>Failed to load</div>; // Unreachable
}
}
Copy link

@bthall16 bthall16 Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the intention is for the implementation details of use to be unnecessary for React developers, but in the current implementation of use it will throw and the catch block will run. Someone could log to the console before returning <div>Failed to load</div> and see the catch block did indeed run, couldn't they? While it totally makes sense for developers to not catch or otherwise manipulate what use throws, it seems like the docs stating use doesn't throw will cause confusion if and when they encounter it throwing.

EDIT: Maybe this is only relevant when using the compiler. I'm looking at it from the perspective of a non-compiled React component.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be deprecated soon: facebook/react#34032

Copy link
Member

@josephsavona josephsavona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These docs are incredible!

Adds new docs for our new eslint rules.
@poteto poteto merged commit 366b5fb into main Sep 19, 2025
10 checks passed
@poteto poteto deleted the pr7986 branch September 19, 2025 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants