-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
perf(v2): replace unnecessary json stringify(string) with inline string #2039
Conversation
Deploy preview for docusaurus-2 ready! Built with commit fd142fa |
Deploy preview for docusaurus-preview ready! Built with commit fd142fa |
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.
Good catch. I wonder why we even wrote that in the first place.
previously it wasnt a string. Its an object iirc. Some refactor did previously and sometimes miss this small detail |
Seems like regression. Need to revert this. Turns out I put JSON.stringify previously to escape backslash on windows. Should've put comment lol.. |
Haha we should have also went to see the commit in the past to see why we added that (isn't always useful, but could be useful). Feel free to revert. |
Doing it tonight. I am quite occupied this week with personal stuff (eg: renewing my passport) |
Motivation
Rather than doing stringify for simple string like below
Better do
https://jsperf.com/stringifyvsdirect/1
Have you read the Contributing Guidelines on pull requests?
yes
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)