-
-
Notifications
You must be signed in to change notification settings - Fork 38.8k
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
feat(client): ts-migrate WithInstantSearch.js #42923
feat(client): ts-migrate WithInstantSearch.js #42923
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there. Thanks again, for another contribution.
I am just double checking, but do you follow the suggestion on the issue for how to rename files and keep their history?:
Keeping Git History
Sometimes changing the file from .js -> .tsx? causes the original file to be deleted, and a new one created, and other times the filename just changes - in terms of Git. Ideally, we want the file history to be preserved.
The best bet at achieving this is by:
- Rename the file
- Commit with the flag --no-verify to prevent husky from complaining about the errors
- Refactor to TS for migration, in a separate commit.
Note: Editors like VSCode are still likely to show you the file has been deleted and a new one created. If you use the CLI to git add ., then VSCode will show the file as renamed in stage
Yes, the first commit is for renaming files only with no content changes. What's strange is that Git correctly identifies the renaming commit and the migrating commit individually, but not together in Files changed. |
Thanks, for confirming. It is just odd why it sometimes works. |
It is a bit odd. For what it's worth, Git Graph is still very readable, as is the last commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just want to address the algolia id/key issue first, so that we can get past the linting step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing the conflicts, @awu43
This PR does look good, but one general observation: it's difficult to properly review (and potentially debug) PRs that do multiple things at once. In this case, we can't simply look at the diff to see which changes are just part of the the TS migration and which are caused by the change to use functional components.
That aside, there's one nitpick below:
Good to know about the component types, I'll keep it in mind. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Thanks @awu43 this looks solid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM 👍
Thank you, for your contribution to the page! 👍 |
Checklist:
Update index.md
)main
branch of freeCodeCamp.Refers #42256
Converted
InstantSearchRoot
to functional component.