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

underscore.js dependency for a single extend call is overkill #17

Closed
dominikg opened this issue Aug 6, 2019 · 5 comments
Closed

underscore.js dependency for a single extend call is overkill #17

dominikg opened this issue Aug 6, 2019 · 5 comments

Comments

@dominikg
Copy link

dominikg commented Aug 6, 2019

This is a runtime dependency and has to be downloaded, extracted, parsed by every enduser.

Please replace the extend call with Object.assign or some other plain method and drop the dependency.

@dominikg
Copy link
Author

dominikg commented Aug 6, 2019

see

var pluginOptions = _.extend({ addButtonToControlBar: true }, options || {});

@jthomerson
Copy link
Member

Good point. Underscore is just a standard library we use a lot of places, but you're right we only have the one call in this codebase. Pull requests welcome. Make sure to familiarize yourself with our coding standards in order to ensure your PR success.

@yokuze
Copy link
Contributor

yokuze commented Aug 22, 2019

Please also note that our plugins support IE 11, so whatever solution is chosen must be compatible with IE 11, which Object.assign is not.

@dominikg
Copy link
Author

dominikg commented Aug 22, 2019

the most simple solution would be like this:

var pluginOptions =  options || {};
if(pluginOptions.addButtonToControlBar == null ) {
  pluginOptions.addButtonToControlBr = true;
}

this changes the behavior slighly (mutation of passed options if addButtonToControlBar isn't defined)

@jthomerson
Copy link
Member

Fixed by #34

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

No branches or pull requests

3 participants