Hacker News new | ask | show | jobs
by danielstocks 3868 days ago
A plugin for showing notifications, packing ~700 LOC and 25kb of JavaScript. I can admire the "no dependency" ambition but at the same time it's marketed as a plugin that has everything you'll ever need, probably targeting the audience that is already using Bootstrap and/or jQuery. Let's solve all the DOM quirks, again.

That being said, there's a probably a lot of useful stuff in there and some inspiration if you want roll your own solution!

2 comments

You’re very right, I guarantee there is a certain level of bloat to the .js file - the repo you see in there at this moment is not far off of the version 1.0 that I created just to achieve the desired functionality. As you’ve noticed - there are probably a lot of optimizations and improvements to be made.
Please don't depend on bootstrap. Require jQuery if you really need too, otherwise raw DOM would be lovely and keep your deps down.
Building on this, if you do support BS3/4 be sure that the boostrap stuff is either an separate dedicated file/folder or an add-on file. Anyone who cares about those extra files should be using gulp/grunt/webpack anyways.