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

perf: avoid calling toFilename on constants #1624

Merged
merged 5 commits into from Jul 25, 2020
Merged

Conversation

merceyz
Copy link
Member

@merceyz merceyz commented Jul 24, 2020

What's the problem this PR addresses?

Yarn unnecessarily calls toFilename to assert that constant strings are valid filenames, which they always are.

How did you fix it?

Replaced the toFilename calls on constants with as Filename assertions, removing the runtime overhead of toFilename and reducing the bundle size by 213 bytes

Checklist

  • I have read the Contributing Guide.
  • I have set the packages that need to be released for my changes to be effective.
  • I have verified that all automated PR checks pass.

@merceyz merceyz requested a review from arcanis as a code owner July 24, 2020 12:08
@arcanis arcanis merged commit 9e4aaca into master Jul 25, 2020
@arcanis arcanis deleted the merceyz/tofilename branch July 25, 2020 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants