cferdinandi / atomic

A tiny, Promise-based vanilla JS Ajax/HTTP plugin with great browser support.
MIT License
540 stars 78 forks source link

Fix and update unit tests, npm test to run. #71

Closed garygreen closed 6 years ago

garygreen commented 6 years ago

image

😄

cferdinandi commented 6 years ago

Hey, thanks so much for this! Any reason you ditched Gulp/Karma for NPM on these? Also, the move from PhantomJS to Chrome Headless... can you say more? PhantomJS has had some weird quirks in the past, so I'm curious about what Chrome does differently/better.

garygreen commented 6 years ago

Still using Karma but just using npm scripts to run the test runner. Gulp wasn't running any tests for me, but realise now that you probably want to run tests against the src rather than dist version, so you can switch it back again if you like.

I couldn't get PhantomJS working but it could of just been my local machine. Other problem I had - there wasn't any dev dependencies for karma in your package json which meant you assumed any contributors would have those globally available (not always likely to be the case).

It's recommended to always commit your package-lock file as well, even for libraries, as it leads to better contributor experience. It also helps / speeds up Travis CI. That's probably the reason I was having problems as had totally different versions of gulp / karma to what you test with.

I believe PhantomJS was created because headless Chrome wasn't really around at the time - it was the "go to" way of running tests in a simulated browser environment. But now we have headless Chrome and it's made PhantomJS pretty redundant, the developer decided to stop supporting it and it's now abandoned.

garygreen commented 6 years ago

Also as a side note I noticed the Gulpfile is massively overcomplicated for such a simple project. It seems like it was copied from an existing project and never really stripped out. I personally would just use Rollup. 😄

cferdinandi commented 6 years ago

You've made it pretty clear that you have preferences that are different from mine. That's totally cool, but please stop assuming that the way you like to do things is inherently better than the way I or other people like to do things.

I maintain several dozen open source projects, and use the same configurable Gulp file with all of them for years and consistent and predictable behavior.

Since you seem so dissatisfied with so many of my choices, why don't you just fork this project and do whatever you want with it?

garygreen commented 6 years ago

Come on Chris, that was a totally unnecessary attack. I've spent time contributing to this project and made reasoned, well thought out points and suggestions. You seem to take everything to heart. As I said before, I'm grateful for everything you've done on the project and it's yours do as you wish, which is why I mentioned I would fork and do my own thing. I think that's definitely for the best now. Good luck with everything.

cferdinandi commented 6 years ago

I appreciate your contributions, but its obvious to me that you want something that's more like Axios or jQuery (since you've mentioned "how they do things" at various points).

I think you'd be happier with one of those. Not a personal attack, just an observation.