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

FIX: Use typos tool to detect various (~140) typos across react codebase :) ✨ #26424

Closed
wants to merge 5 commits into from

Conversation

Pranav-yadav
Copy link

@Pranav-yadav Pranav-yadav commented Mar 18, 2023

Summary

This diff fixes various (~140) typos across react codebase :)

How did you test this change?

This diff fixes various typos across react including all of the packages and the remaining codebase.

I came across an excellent tool named typos and used it to find the typos, yet I fixed all the typos manually to take into account the context of the words (e.g. React uses some string hashing algo and it provides the name of the algo which seems german, so basically it's kept as it).

For all of the changes, I assumed the en-us locale.

NOTE: I did not use --write-changes flag while running the tool; hence, all changes are done manually.

Finally ran:

  • yarn prettier
  • yarn test takes lot of time... ;)

/**
* @deprecated This is function is deprecated and will be removed in a future release.
* Please use `readContextDuringReconciliation(...)` instead.
*/
Copy link
Author

@Pranav-yadav Pranav-yadav Mar 18, 2023

Choose a reason for hiding this comment

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

For this typo fix,

// deprecated
readContextDuringReconcilation
// new
+ readContextDuringReconciliation

though this fn seems to be private, I deprecated it just in case it might be public.

Lmk if it's private or not and if it's okay to directly rename it.

Copy link
Author

Choose a reason for hiding this comment

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

ping @acdlite
since you added this fn can you comment on the above?

@react-sizebot
Copy link

Comparing: 842bd78...5b71faf

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 = 157.77 kB 157.77 kB = 50.28 kB 50.28 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 159.36 kB 159.36 kB = 50.79 kB 50.79 kB
facebook-www/ReactDOM-prod.classic.js = 542.73 kB 542.74 kB = 96.62 kB 96.63 kB
facebook-www/ReactDOM-prod.modern.js = 526.47 kB 526.47 kB = 94.16 kB 94.16 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 5b71faf

@Pranav-yadav
Copy link
Author

Pranav-yadav commented Mar 18, 2023

Also, can we add this tool (typos) to the CI or as a pre-commit hook?
This should avoid typos in public APIs that could be time-consuming to rename. We know we would need to first deprecate the old API by introducing a new one with a typo fix; then, we can remove the older one entirely after a few releases.

We can set up the typos workflow by keeping the typos.toml config that allows us to skip dirs, files, files w/ specific extensions, and repo-specific spell rules like (react uses seeked and onSeeked etc. that syntactically are typos yet they can be skipped), etc...

Edit: ping @gaearon

@Pranav-yadav Pranav-yadav changed the title FIX: Various typos ✨ FIX: Various typos across react codebase :) ✨ Mar 18, 2023
@Pranav-yadav Pranav-yadav changed the title FIX: Various typos across react codebase :) ✨ FIX: Use typos to detect various (~140) typos across react codebase :) ✨ Mar 19, 2023
@Pranav-yadav Pranav-yadav changed the title FIX: Use typos to detect various (~140) typos across react codebase :) ✨ FIX: Use typos tool to detect various (~140) typos across react codebase :) ✨ Mar 19, 2023
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.

We don't fix typos in comments due to the high volume and noise in the git history they create. Fixes to user-facing typos are always welcome though. So if you reduce this PR to only fix user-facing typos, we can merge

@Pranav-yadav
Copy link
Author

Yeah. I get that part, but you did consider that this PR aims to fix all of the Typos in the "whole react codebase at once"!!

Talking about noise in commit history;

  • this PR actually aims to reduce any future noise from typo-fix PRs (plural)
  • since the # of future typo fix PRs could be completely reduced to 0
  • they will keep opening PRs for typos as soon as they see those.
  • and which creates extra noise in issues and PRs making it difficult to handle and manage for the team.
  • I see a ton of noise coming in the future from such PRs and issues.

Btw, since all PRs are merged as squashing commits, so I don't see the point of noise from single commit (If you want I can force push this branch by squashing all commits or make the PR description a single line like "Fix all typos using typos tool" or even two words "Fix typos", to reduce further noise in history)

There also exists a hard way to merge all changes yet achieve zero noise in history but it would again mean we're polluting existing commit history by amend-ing changes to existing commits in each file resp. (w/ force push), which seems unprofessional and kind of useless.

Do discuss this (the above bullets) with the team and Lmk, also I've no issues reverting typo fixes in comments.

Copy link

github-actions bot commented Apr 9, 2024

This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Apr 9, 2024
Copy link

Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you!

@github-actions github-actions bot closed this Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Resolution: Stale Automatically closed due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants