-
Notifications
You must be signed in to change notification settings - Fork 103
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
Smarter function-passed-to-function heuristics? #1
Comments
Another potential improvement: only apply the function-passed-to-function heuristic at the top level, because that's usually where we find large IIFEs-that-don't-look-like-IIFEs. |
@nolanlawson |
I thought in RequireJS the |
It is executed when it is required and only if it is required. Unfortunately our app defines a lot of modules that it does not use right away and some that it does. |
define is both the best candidate and worse but needs to know what the core modules of an app are, what gets used by most routes/states of the app. The focus of this has been libraries, which is a good place to start, in our app it would likely give it a decent boost but only if applied to some of our defines. |
Good candidates for wrapping:
forEach(function() {})
map(function() {})
then(function() {})
Less-good candidates:
addEventListener('foo', function() {})
on('foo', function() {})
once('foo', function() {})
catch('foo', function() {})
(maybe?)We can check for the function name as a hint to avoid the paren-wrapping, but it ought to be justified by a benchmark. Maybe a UI library that adds a lot of event listeners would be a good test case for this.
The text was updated successfully, but these errors were encountered: