CodeSeven / toastr

Simple javascript toast notifications
http://www.toastrjs.com
MIT License
11.96k stars 2.04k forks source link

[WIP]: Refactor: remove jQuery as dependency #603

Open JPeer264 opened 5 years ago

JPeer264 commented 5 years ago

As I saw in #570 the discussion was open to remove jQuery as dependency. I made just a first step and removed jQuery from the selectors. There are still no transitions made (so all functions with fadeIn or fadeOut are just commented out).

I wonder if this PR has potential to be merged if, of course, everything works as before, just without jQuery. This actually needs another export function, a global variable or build step (maybe TS?) to make it work in older browsers or course.

Small hint: For a better diff just add ?w=1

JPeer264 commented 5 years ago

For all who wants to use Toastr without jQuery. I forked the lib and rewrote so it can be used without jQuery (with Typescript support).

NPM: https://www.npmjs.com/package/toastr2 GH: https://github.com/JPeer264/toastr

colonelchlorine commented 5 years ago

@JPeer264 Is it still forked because there's not much interest here? I was just about to start stripping $ from this library and then bumped into this PR. I'll check it out tomorrow, but excited.

JPeer264 commented 5 years ago

Hey. Ya it is still forked, but I didnt really finish the fork yet, as the animations are missing .

colonelchlorine commented 5 years ago

@JPeer264 Took a look at changes and there's a bunch of npm packages that are not rly comfortable. For example husky installs a series of git hooks. They could be doing anything to your machine, and I don't trust that :(

JPeer264 commented 5 years ago

Hm I am super sorry about that. But this is actually the workflow I use to ensure code quality. I just use a pre-commit hook for eslint. Locally you could remove that package and develop without it :)