Skip to content

Conversation

jackpope
Copy link
Contributor

@jackpope jackpope commented Sep 26, 2025

Canary change in facebook/react#34610

Copy link

github-actions bot commented Sep 26, 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.47 KB (🟡 +9 B) 241.01 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.

```js
import { useState, useEffect } from 'react';
import { experimental_useEffectEvent as useEffectEvent } from 'react';
import { useEffectEvent as useEffectEvent } from 'react';
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
import { useEffectEvent as useEffectEvent } from 'react';
import { useEffectEvent } from 'react';

and the rest

jackpope added a commit to facebook/react that referenced this pull request Sep 26, 2025
Bumps `useEffectEvent` from `@experimental` to `@canary`. Removes the
`experimental_` prefix from the export.

## TODO
- [ ] Update useEffectEvent reference page and Canary badging in docs:
reactjs/react.dev#8025
github-actions bot pushed a commit to facebook/react that referenced this pull request Sep 26, 2025
Bumps `useEffectEvent` from `@experimental` to `@canary`. Removes the
`experimental_` prefix from the export.

## TODO
- [ ] Update useEffectEvent reference page and Canary badging in docs:
reactjs/react.dev#8025

DiffTrain build for [8bb7241](8bb7241)
github-actions bot pushed a commit to facebook/react that referenced this pull request Sep 26, 2025
Bumps `useEffectEvent` from `@experimental` to `@canary`. Removes the
`experimental_` prefix from the export.

## TODO
- [ ] Update useEffectEvent reference page and Canary badging in docs:
reactjs/react.dev#8025

DiffTrain build for [8bb7241](8bb7241)

useEffect(() => {
onNavigate(url);
}, [url]);
Copy link
Member

Choose a reason for hiding this comment

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

Isn't the value of visitedUrl the same as the url since useEffectEvent always closes over the latest values? So this feels like useless indirection.

A better example would be using it as an event handler and passing something as an argument that's not from props/state.

Copy link
Contributor Author

@jackpope jackpope Sep 26, 2025

Choose a reason for hiding this comment

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

This shows a mix of reactive and nonreactive values. So visitedUrl and url are the same, but using the url in the effect allows us to log on each render that url changed, without worrying about logging when numberOfItems changes.

Copy link
Member

Choose a reason for hiding this comment

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

It would be good to maybe explicitly say that in the text. Ie explain the resulting behavior.

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Still seeing a lot of references to experimental_useEffectEvent e.g src/content/learn/removing-effect-dependencies.md. The sandboxes can also be updated to canary. Makes it easier for me to ship everything as stable with a simple grep

@jackpope
Copy link
Contributor Author

@eps1lon I cleaned up the prefixes in eec0fe6

@jackpope jackpope merged commit 49c2d26 into reactjs:main Sep 28, 2025
6 checks passed
@jackpope jackpope deleted the useeffectevent-docs branch September 28, 2025 15:36
@eps1lon
Copy link
Member

eps1lon commented Sep 28, 2025

Whoops. That was a pending comment that wasn't supposed to go into this approval.

EugeneChoi4 pushed a commit to EugeneChoi4/react that referenced this pull request Sep 29, 2025
Bumps `useEffectEvent` from `@experimental` to `@canary`. Removes the
`experimental_` prefix from the export.

## TODO
- [ ] Update useEffectEvent reference page and Canary badging in docs:
reactjs/react.dev#8025
@rickhanlonii rickhanlonii mentioned this pull request Sep 30, 2025
6 tasks
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