-
Notifications
You must be signed in to change notification settings - Fork 20.6k
Try to reuse div creation #2405
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
Comments
Hi @markelog :) if by "modulize it" you think about doing that: define([
"../var/document"
], function( document ) {
function createElement( nodeName ) {
return document.createElement( nodeName );
}
return createElement;
}); It's save -15 bytes by removing all the 16 occurences of
If you want I can make a PR with this: https://gist.github.com/Mr21/81a1c21e0cbf7136245a |
@mr21 I believe it was more about re-using the test div itself, i.e.: define([
"../var/document"
], function( document ) {
return document.createElement( "div" );
}); & similar for other types of test nodes that are created. If it helps with size, a separate Please don't do anything for |
Yep |
Closing in favor of tracking in the Roadmap. |
Not relevant anymore as |
div = document.createElement( "div" )
construction used in many places, we can try to modulize itThe text was updated successfully, but these errors were encountered: