-
Notifications
You must be signed in to change notification settings - Fork 129
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
chore: type checking in one place makes bundle smaller #843
Conversation
Size Change: -2.55 kB (0%) Total Size: 723 kB
|
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.
Looks good! Is there an easy linting rule that could be added so you don't have to come back and do this again?
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 like it a lot. (Echo David's comment)
BinaryExpression: function (node) { | ||
// Check for `toString.call(obj) == '[object Boolean]'` | ||
if ( | ||
(node.operator === '==' || node.operator === '===') && |
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.
So meta 😂
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.
Amazing!
#ShowerThoughts
We have ~60 instances of type checks which might be smaller in the final bundle if they all point at a function instead of doing the work...
Let's find out ......
Looks like array.js is 1% smaller