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

[Fresh] Update the list of built-in hooks #27864

Merged

Conversation

damianstasik
Copy link
Contributor

Summary

I've noticed that list of built-in hooks inside react-refresh is a bit outdated. This makes react-refresh handle them as if they were custom hooks, like in the example of generated code below:

var _s2 = $RefreshSig$();
// ...
_s2(App, "bfyXHsONnHV5LIn00sGBmBnlbi4=", false, function() {
  return [useTransition, useId, useCustomHook];
});

This PR updates the list with hooks from both the stable and canary release.

How did you test this change?

I've updated react-refresh in a Vite project and I've confirmed that these hooks no longer were treated as custom hooks.

@facebook-github-bot
Copy link

Hi @damianstasik!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@react-sizebot
Copy link

react-sizebot commented Dec 29, 2023

Comparing: 95ec128...1f2fe14

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 176.57 kB 176.57 kB = 55.00 kB 55.00 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 178.69 kB 178.69 kB = 55.64 kB 55.64 kB
facebook-www/ReactDOM-prod.classic.js = 591.32 kB 591.32 kB = 104.34 kB 104.34 kB
facebook-www/ReactDOM-prod.modern.js = 575.08 kB 575.08 kB = 101.43 kB 101.43 kB
oss-experimental/react-refresh/cjs/react-refresh-babel.production.min.js +4.85% 8.16 kB 8.56 kB +3.41% 2.79 kB 2.88 kB
oss-stable-semver/react-refresh/cjs/react-refresh-babel.production.min.js +4.85% 8.16 kB 8.56 kB +3.41% 2.79 kB 2.88 kB
oss-stable/react-refresh/cjs/react-refresh-babel.production.min.js +4.85% 8.16 kB 8.56 kB +3.41% 2.79 kB 2.88 kB
test_utils/ReactAllWarnings.js Deleted 67.56 kB 0.00 kB Deleted 16.59 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/react-refresh/cjs/react-refresh-babel.production.min.js +4.85% 8.16 kB 8.56 kB +3.41% 2.79 kB 2.88 kB
oss-stable-semver/react-refresh/cjs/react-refresh-babel.production.min.js +4.85% 8.16 kB 8.56 kB +3.41% 2.79 kB 2.88 kB
oss-stable/react-refresh/cjs/react-refresh-babel.production.min.js +4.85% 8.16 kB 8.56 kB +3.41% 2.79 kB 2.88 kB
oss-experimental/react-refresh/cjs/react-refresh-babel.production.js +1.91% 26.61 kB 27.12 kB +1.51% 5.91 kB 6.00 kB
oss-stable-semver/react-refresh/cjs/react-refresh-babel.production.js +1.91% 26.61 kB 27.12 kB +1.51% 5.91 kB 6.00 kB
oss-stable/react-refresh/cjs/react-refresh-babel.production.js +1.91% 26.61 kB 27.12 kB +1.51% 5.91 kB 6.00 kB
oss-experimental/react-refresh/cjs/react-refresh-babel.development.js +1.89% 26.83 kB 27.34 kB +1.56% 5.96 kB 6.06 kB
oss-stable-semver/react-refresh/cjs/react-refresh-babel.development.js +1.89% 26.83 kB 27.34 kB +1.56% 5.96 kB 6.06 kB
oss-stable/react-refresh/cjs/react-refresh-babel.development.js +1.89% 26.83 kB 27.34 kB +1.56% 5.96 kB 6.06 kB
test_utils/ReactAllWarnings.js Deleted 67.56 kB 0.00 kB Deleted 16.59 kB 0.00 kB

Generated by 🚫 dangerJS against 1f2fe14

Copy link
Collaborator

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

Thank you!

@eps1lon eps1lon changed the title Update the list of built-in hooks in react-refresh [Fresh] Update the list of built-in hooks Feb 6, 2024
@eps1lon eps1lon merged commit 7cbd026 into facebook:main Feb 6, 2024
36 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 6, 2024
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
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.

4 participants