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

Don't transpile async/await in tests #27029

Merged
merged 1 commit into from
Jun 30, 2023

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Jun 30, 2023

Modern runtimes support native async/await, as does the version of Node we use for our tests. To match how most of our users run React, this disables the transpilation of async/await in our test suite.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jun 30, 2023
Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

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

Can we remove it from package.json too?

Modern runtimes support native async/await, as does the version of Node
we use for our tests. To match how most of our users run React, this
disables the transpilation of async/await in our test suite.
@acdlite acdlite force-pushed the dont-transpile-async-tests branch from 5e7136d to f9e1743 Compare June 30, 2023 20:19
Comment on lines +78 to 79
const testOnlyPlugins = [];
const sourceOnlyPlugins = [];
Copy link
Member

Choose a reason for hiding this comment

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

These can just be removed now as both sides of the condition are empty :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sourceOnlyPlugins is used on line 81. My rationalization for leaving testOnlyPlugins is so the next person knows where to add a test-only plugin; the real reason is because I don't want to show up in the git blame for the rest of this code.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I missed that it get's mutated. Thanks!

@react-sizebot
Copy link

Comparing: 1fdacbe...f9e1743

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 = 164.22 kB 164.22 kB = 51.74 kB 51.74 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 171.63 kB 171.63 kB = 53.95 kB 53.95 kB
facebook-www/ReactDOM-prod.classic.js = 566.78 kB 566.78 kB = 99.97 kB 99.97 kB
facebook-www/ReactDOM-prod.modern.js = 550.58 kB 550.58 kB = 97.13 kB 97.13 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against f9e1743

@acdlite acdlite merged commit 47385f8 into facebook:main Jun 30, 2023
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
Modern runtimes support native async/await, as does the version of Node
we use for our tests. To match how most of our users run React, this
disables the transpilation of async/await in our test suite.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
Modern runtimes support native async/await, as does the version of Node
we use for our tests. To match how most of our users run React, this
disables the transpilation of async/await in our test suite.

DiffTrain build for commit 47385f8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants