carrot / share-button

:warning: :warning: Currently Unmaintained :warning: :warning: - fast, beautiful, and painless social shares:
http://sharebutton.co/
Other
2.95k stars 381 forks source link

dependencies - the plugin is not lightweight #298

Open neuropass opened 8 years ago

neuropass commented 8 years ago

Hi, I noticed there are still many dependencies and saying that the plugin doesn't add overhead its not quite true. Iwould argue the opposite in fact.

for example ,the lato font @import is a terrible practice and its not useful to anyone just to add a "share" text. it should not be part of the default css for sure.

regarding the script, 60kb is not what I consider lightweight. 29, minified still not lightweight. it seems that you can use the plugin if you select the code from line 634 to 1563 so why not to just break it down fro production and explain these things better?

kylemac commented 8 years ago

@neuropass if you're willing to help slim it down - we'd very likely be open to a PR

neuropass commented 8 years ago

I would If I had the knowledge. I like the plugin but saying its lightweight , no overhead etc etc is simply not true. less experienced users are installing this thinking is some great addon. it is but comes with a cost on your web page. I dont think you can ignore this. Lato font alone is not needed. all that JS is it really needed to create a simple share button? what's the logic behind it?

kylemac commented 8 years ago

@neuropass you'll have to show me where were are billing it as "no overhead etc etc". we don't use that language in the readme anywhere. if i had to guess you're referring to where we say "Simple, light, flexible, and good-looking share button" - which I don't feel is a stretch.

I agree in principle the Lato font is not required. Perhaps we'll make it optional someday. We'll be sure to ping you if we do end up addressing your concerns in the future.

hhsnopek commented 8 years ago

Just to chime in; in share-button's current state we've added the ability for users to integrate the button in various ways and allow a lot more customization than previous versions. Regarding how lightweight share-button is, well that's left to one's opinion. I do agree that it's current state isn't the lightest, but some people will consider jquery to be light and that's pretty big. Tho in the end we have trade-offs, the reason we jumped in size so much between v0.5.0 & v1.0.3 is due to the switch from coffeescript & babel, this is due to everything that goes into transpiling. If you wanted the lighter version, I'd recommend going with v0.5.0, but be aware that it comes with the downside of less customization. In the future I'd like to have the ability to have a couple options for building share-button, like no polyfills or removal of collision-detection, these were features that the community requested, but not everybody uses them. In the end if you want to cut down on everything, you have the ability to customize the button and completely remove lato, you just need to clone it down and compile your changes :smile:

Here's the size comparisons between v1.0.3 & v0.5.0

v1.0.3 size
share-button.css 31.2 KB
share-button.js 65 KB
share-button.min.css 30.1 KB
share-button.min.js 29.2 KB
v0.5.0 size
share.js 20.6 KB
share.min.js 15.2 KB