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

refactor(v2): purify normalizeUrl #4814

Merged
merged 1 commit into from May 18, 2021

Conversation

nam-hle
Copy link
Contributor

@nam-hle nam-hle commented May 18, 2021

Motivation

We use normalizeUrl a lot, and currently, there is no known issue. But it's always the best practice to use the pure function.

I also add some code to keep the ts compiler silent in the test file. Please tell me if it's irrelevant, and I will remove it :)

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Review

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 18, 2021
@netlify
Copy link

netlify bot commented May 18, 2021

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 91
🟢 Accessibility 96
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-4814--docusaurus-2.netlify.app/

@netlify
Copy link

netlify bot commented May 18, 2021

@slorber slorber added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label May 18, 2021
@slorber
Copy link
Collaborator

slorber commented May 18, 2021

Thanks, good catch.

I don't really like those methods with unexpected side-effects.
Wonder if we shouldn't add TS readonly type somehow to prevent this

@slorber slorber merged commit e85ec1a into facebook:master May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants