5 ms·
Notie.js: A JavaScript notification plugin without dependencies
- choward 11y agoNot to be an ass, but I wouldn't consider using a project (especially javascript) that doesn't have tests these days.
- nbrempel 11y agoIt's open source. Why not write some?
- romanovcode 11y agoDo you look at tests of all of your projects? In my experience many packages have pretty low code-coverage in the first place.
- 91bananas 11y agoSounds exactly like you're being an ass
- kevindeasis 11y agoI've put an issue that creator should do at least some unit testing.
- bunkat 11y agoWhy? He obviously doesn't need them, nor do the 1800 people that have starred this project. Why make more work for the developer just because some guy on HN says he needs them (even though he will never use this library anyways)?
- kevindeasis 11y agoWouldn't it help for maintainability and ease of mind (for future users)?
- bobwaycott 11y agoIs it just the presence of "tests" that are going to provide this ease of mind for these hypothetical future users? And exactly how would these desired tests provide demonstrable help for maintainability. It's a small project. The creator knows what it does. If s/he adds more features, I'd be willing to bet s/he will know if s/he breaks something. Moreover, who is to say these desired tests actually test anything meaningful. If there was a set of tests, would you actually read through the tests to determine they did something substantial and meaningful for the project, and weren't just terrible nonsense added in that don't actually test anything at all that matters? Or would you simply see there were tests and feel this peace of mind and think to yourself they will help for maintainability (maintenance you probably aren't doing yourself). In short, is it tests you want, or simply peace of mind?
- kevindeasis 11y agotesting is used to be more productive in the long run. [1] I feel like there are numerous amount of developers who write code, and in the future would forget if they have created bugs or would not remember exactly everything that their code does. http://nparc.cisti-icist.nrc-cnrc.gc.ca/npsi/ctrl?action=shwart&index=an&req=5763742&lang=en http://nparc.cisti-icist.nrc-cnrc.gc.ca/npsi/ctrl?action=shw... Would it not be smart to write test code that actually test anything meaningful, because who would want to write testing that is not meaningful? So would ease of mind not come from proper testing?
- bobwaycott 11y agoWhat I was getting at is that the original comment under which we are discussing was suggesting that "having tests" was a reason to not use the project ... and that's poor reasoning. To your points specifically, I'm saying the existence of tests does nothing to provide any meaningful, dependable, worthwhile benefits. Regarding a couple of your points ... - How can tests at all help a developer remember anything about their code in the future? That's what documentation is for. - Sure, tests can help quickly identify bugs. Tests are supposed to identify when a problem has been introduced, or verify that code meets expectations. But that itself depends on the tests being correct. - To depend on tests, you need meaningful, accurate tests that were properly thought out and implemented. If a project has tests, but those tests were poorly thought out, don't adequately cover complicated, critical parts of code, what good are they? - Sure, peace of mind can come from proper testing. However, that requires the tests to actually be proper. What does that mean? How does that get defined and implemented? Designing and implementing tests is, in my opinion, quite different from writing some code that does a thing--especially as the complexity of the code increases. - That tests exist for a project, or that tests are absent from a project, is to me a poor reasoning for using or not using a given project. This was the original commenter's point--that the project would not be used because it did not have tests. That tells absolutely zilch about the quality and dependability of the project. Moreover, if tests did exist, and one wanted to judge whether or not to use a project, one would need to actually read the tests, and the code they test, and then determine if the tests properly cover what matters. At least then, the original commenter may have been adding something helpful to the discussion. Identifying that a project's tests do not actually provide any meaningful proofs is an important thing to do. I don't think too many people actually do that when they judge a project on the existence of tests. Full disclosure of my own related weakness: For me, the existence of documentation is a much more important metric for decisions on whether to use a project or not. But if I were to say, "Doesn't have (or does have) docs; will therefore use/not use", I'm not really making much of a quality decision here. That's why I actually check out the docs. I read them and see whether they actually cover enough material to use a project, or if they are hastily written and not a reliable help. However, sometimes there aren't formal docs at all. So, I might take a look at the code, and find incredibly well-documented code in comments throughout the project. If I just make a decision to reject a project based on the maxim "doesn't have docs", I wind up missing that there actually is extensive documentation ... just not where I may have been looking. The same should be done for tests, I think.
- teen 11y agotests are so overrated
- jordanlev 11y ago> Works in all modern browsers (Chrome, Firefox, Safari, IE, Edge, Opera) For people who are concerned with backwards compatibility (which I know isn't everyone, but it is a necessity for my work), it would be super helpful to clarify this statement. Specifically, how far back in IE does it go? What about mobile Safari vs. desktop, and what about the Android browser? Thanks, looks like a neat little utility.
- jaredreich 11y agoYou're welcome, it was fun to make! It is a good idea to add detail to the browser compatibility and I will eventually do so. It was before this repo gained popularity that I did the quick browser testing to warrant that statement. Thank you for the suggestion.
- danielstocks 11y agoA 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!
- jaredreich 11y agoYou’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.
- nailer 11y agoPlease don't depend on bootstrap. Require jQuery if you really need too, otherwise raw DOM would be lovely and keep your deps down.
- Can_Not 11y agoBuilding 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.
- SimeVidas 11y agoKeyboard accessibility is missing.
- bunkat 11y agoNothing is missing, the library does what it does. If you need keyboard accessibility you are free to add it.
- SimeVidas 11y agoLibraries that display overlays with interactive elements should be keyboard accessible, by default.
- bunkat 11y agoSure, if you want to pay the developer to create interactive elements for you feel free to specify the requirements. Since nobody paid for this work, and nobody is requiring anybody to use it, there is not a single feature that should be included 'by default'.
- jaredreich 11y agoThere is a GitHub issue for keyboard accessibility, although I don’t see this as a necessity it shouldn’t be too hard to add, so I will probably get to it at some point. Thanks for the feedback.
- Diederich 11y agoI've used this lightly/moderately, and it's worked well with no surprises.
- fcanela 11y agoIt is a pity: I consider this kind of notification really attractive but proved to be a antipattern in the projects I implemented. Notifications are better when shown near the event source. If your user base includes some non-technical profiles they can become confused by this kind of message without context. It can work for global announcements that can not be tied so a specific source or they are hidden and are important ("remember to activate your email"). This was just my experience. Congrats anyway for the work, it is really visually appealing.
- jaredreich 11y agoThis is true about the notification potentially not being close to the action point - though the way I thought of it is that the user should know what action they just took therefore will understand the message they just got. Especially if the site uses this library throughout, the user will be used to this kind of feedback on their actions. It also makes it a bit more friendly for responsiveness as the developer doesn’t have to worry about placement or if the alert will fit on the screen properly.
- iamthepieman 11y agoI try to keep related interactions near each other so showing notifications near the source turned out to be more problematic than having a single place for notifications (like near the top where there useful information can be seen but no interactions occur) It was apparent after just a simple mockup that the notifications would get int he way if the user was makign many rapid interactions. In my paricular application the notifications could be used as a history of interactions that could be opened up and examined in more detail.
- univerio 11y agoNeat, though I read the name as "Not IE" at first.
- deleted 11y ago[deleted]
- jaredreich 11y agoHello everyone! I'm the creator of notie.js and although I'm a frequent browser of HN, I found this post from a fellow who placed the link in a comment in one of the GitHub issues. Very cool to see someone promoted this! Thank you for all the comments/suggestions/feedback!
- roadbeats 11y agoIt's ok to have dependencies. If you want to avoid big dependencies like jQuery, there are tiny DOM modules that you can pick and use; http://github.com/npm-dom http://github.com/npm-dom
- pacomerh 11y agoHandy. But was browsing through the code, and I didn't find it that clean, maybe personal taste. I like to use plugins that are solid. function input(title, submit_text, cancel_text, type, placeholder, submit_callback, prefilled_value_optional) Feels like this function has too many parameters, might be doing too much.