-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Align radialLinear coding style #5941
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.
This change is +19 bytes to Chart.min.js
Moving functions in other scales inside module.exports
would be -43 bytes
So is this really the way to go?
Happy New Year @kurkle! Thanks for taking a look Good point on the size. One thing I like about them being outside is that it's easier from a coding perspective to have one less level of indentation. It also makes it a little easier to see what's private vs in the public API when in the file. I'm also not sure how much we should prioritize micro optimizations and think our time might be better spent fixings bugs, etc. than doing before and after size comparisons on every change. @simonbrunel started this convention. I'm mainly just trying to make sure we have one consistent convention that we follow everywhere and don't care as much about which way we pick. @simonbrunel thoughts on this one? |
@benmccann it's not a convention! I'm working on removing the |
Files are importable whether the functions are inside or outside the It might make sense to go ahead and submit your PR. The number of PRs here just keeps growing, so it seems like you'll only ever get further away. And I'm imagining the PR to make the scales importable generally won't conflict with most of the PRs since it will primarily touch the If we want to get the scale-related PRs merged, perhaps we should ask the maintainers to focus their reviews on those and hold off on submitting new scale PRs until your PR makes its way in? I've listed the status of the scale PRs below Pending:
Stale:
Merged: Closed: |
Not true, removing the function export also removes an indent level. |
Another option might be to make the scales importable one at a time. That might be a lot easier to coordinate than getting all nine of those PRs merged and freezing work on all other scale PRs. E.g. this PR could be merged now which would affect very little. And there's a number of other changes we could make that would require only a single PR to be merged in order to unblock making that particular scale importable |
Closing in favor of #5953 |
Align radialLinear coding style with the rest of the files in the project by moving
function
s outsidemodule.exports