7 ms·
Show HN: Test your JavaScript modules simultaneously in 32 different versions of Node.js
- deleted 11y ago[deleted]
- diggan 11y agoThis is a utility I build to be able to make sure my JS CLI's actually work across the version I want to support. Right now, the tool also works across any language where there is docker images with versions, not just for JavaScript/NodeJS. It's enough with having a Dockerfile with $VERSION (that will be replaced by the tool) and changing the test command. I will make this easier in the future. Thanks for taking a look and please let me know what you think about it.
- nosefrog 11y agoThis is great! Nice work.
- caffinatedmonk 11y agoJust out of curiosity, can't this be implemented with `nvm` and some sand boxing? Why did you choose to use docker?
- diggan 11y agoYes, it can indeed. I have three reasons for not doing it though. The first is that nvm is nodejs specific and since I knew I wanted it to eventually work with multiple languages, nvm is out. Second is that docker has a API I can work with (via Dockerode in this case), makes it easier to use/debug and such. Third is the easy of isolation. It's basically what docker is about while nvm is more for just managing versions. I still use nvm locally, when developing. But when I want to rapidly test in multiple versions, I use docker with autochecker.
- caffeinewriter 11y agoThis is definitely something that's needed, by myself, and many other developers. Determining module compatibility across versions is always a pain. Great tool!
- diggan 11y agoThanks a lot for those kind words! Yeah, it was needed by myself as well, so I had to scratch my own itch for a while.
- raould42 11y agoFrankly, I feel like this is an indictment of all software development, everywhere. When you need to do this kind of a thing, you are doing it wrong. I do not mean I am doing it any better, I have the same issues e.g. working on Android, but there are probably some fundamental things we could be doing to avoid all these horrible symptoms. Things like NixOS come to mind, where people are actively researching and experimenting with possibly better alternatives. I pray somehow somebody smart and motivated can find some fundamental solutions instead of this rube goldberg overkill type answer.
- nemild 11y agoWhat do you recommend for how we could do it better?
- tobltobs 11y agoTake a look outside of the node.js micro cosmos.
- diggan 11y agoI see where you are coming from, for sure. I wish I was smart enough and motivated enough to try to come up with a solution to this, but my motivation goes elsewhere. Sometimes, for you to focus on other (what for you is important), you need to throw together some rube goldberg thing to be able to move forward.
- andreasklinger 11y ago
- xcopy 11y agoNice NPM
- geophile 11y agoDumb question, from someone who doesn't work with Node.js: Why are there 32 versions of it?
- deleted 11y ago[deleted]
- mayank 11y agoSemantic versioning -- basically each version here is x.y.z for some x, y, z. Node patch releases (.z) happen reasonably fast and constitute a "version of node" as used here.
- stronglikedan 11y agoEven though Node isn't a framework (it's a cross-platform, runtime environment), it is used a base for application development. However, over time, things are changed and improved, but that breaks some of the API functionality upon which some existing applications are already built around. Since these applications still run fine with a previous version, they are not likely to be constantly updated to work with later versions. Therefore, previous versions are still offered to maintain compatibility with applications that have already been developed. However, if you're starting work on a new Node application, then you are better off using the latest version.
- swalsh 11y agoNode.js has that 60's free love nudist colony experiment feel.
- tomc1985 11y agoExcept that everyone is crazy and high off the fumes of DIY ...actually that does sound pretty 60s
- tlrobinson 11y agoThere are actually 303 versions of node (including iojs, according to the Node Version Manager): $ nvm ls-remote | wc -l 303 Most of those are patch releases. There are 47 minor releases and 6 major releases: $ nvm ls-remote | grep -oE 'v\d+\.\d+' | uniq | wc -l 47 $ nvm ls-remote | grep -oE 'v\d+' | uniq | wc -l 6 Most language implementations probably have similar number of releases.
- orliesaurus 11y agoNice one Victor :)
- jdjb 11y agoVery nice project. I built something similar for PHP: https://github.com/vectorface/dunit https://github.com/vectorface/dunit
- diggan 11y agoOh, that's very nice. Thanks for sharing this here, always nice to see how different people implement the same thing basically :)
- tdvorak 11y agoI've implemented something similar to be able to run tests with different MongoDB versions: https://github.com/variety/variety/blob/master/test.sh https://github.com/variety/variety/blob/master/test.sh
- rrobukef 11y agoWould you implement binary search? A feature like git-bisect could be usefull to find breaking changes.
- diggan 11y agoHaven't thought about that but it makes a lot of sense to have that. If you don't mind, could you open up a issue on Github, explaining how you can imagine it to work to help you the most? https://github.com/VictorBjelkholm/autochecker/issues/new https://github.com/VictorBjelkholm/autochecker/issues/new Would appreciate that a lot and thanks for the feedback.
- shiift 11y agoI might give it a go. That was one of the first things I thought of!
- diggan 11y agoBy all means, please do :) Would be very interesting in having this as a feature.
- software_radio 11y agoWhy are there 32 different versions of Node.js?
- topherbullock 11y agoFinally... a place to make sure my left pad module works cross-version.
- erikpukinskis 11y agoThis is why I hate ES6. JavaScript used to be a write once, run anywhere language. We sacrificed that for syntactic sugar.
- aeharding 11y agoThen just write es5. It'll still run everywhere forever.
- deleted 11y ago[deleted]
- erikpukinskis 11y agoThat's my plan. But it means I can't use other people's modules anymore.
- mschuster91 11y agoWhy? Put a transpiler inside your build chain.
- deleted 11y ago[deleted]
- erikpukinskis 11y agoThis almost always leads to broken debugging, which I think is a bad tradeoff. Most node developers seem to not use a debugger, but I think that's a huge productivity sacrifice.
- pluma 11y agoExcept <= IE8, of course. The problem with nostalgia is that the past we so fondly remember never existed.
- maaaats 11y agoYou could write vanilla JS and your code still could fail in some versions of node because of bugs or breaking changes. And in browsers, the JS language is the same, but the implementation of the various APIs has varied greatly. So ES6 is not the problem.
- jgillich 11y agoA few months ago, I wrote something similar with the goal to test on multiple Linux distributions: https://github.com/jgillich/chimera https://github.com/jgillich/chimera It however doesn't execute the containers simultaneously, that is really cool!
- full-of-foo 11y agoAwesome job! Can't wait to try it. An aside - over the last few months I began running my containers on two popular CI services and have had some serious pain. I have a slight feeling you will regret the words: "works well with CI as well!"
- diggan 11y agoHah, we'll see! Did some initial testing on Circle, Travis and Jenkins but still have a lot to test left. Maybe I should be more careful with my words in the future...
- rcarmo 11y agoI can't help it - the first thing I thought of was doing a mashup of this and leftpad as a service :)
- pedalpete 11y agoHave you thought of running this as a service? Would be nice to just through an NPM module at it and make sure it will run across multiple versions. Without having to install docker, etc. Not sure I'd pay for it, but maybe somebody would...
- greglindahl 11y agoOther languages have this sort of test service available for open-source modules. One example is cpantesters.org, which is integrated into Perl's package repository. Not only is it easy to check what passes in your environment, it also makes it easy for module authors to fix bugs in environments that the author has no (other) access to.
- diggan 11y agoFunny you should say so, the origin of the idea behind autochecker, is actually CPAN's and CRAN's way of automatically test packages.
- diggan 11y agoIf I could do it open-source and still earn money on it to cover cost of hosting, I'll try. Still haven't figured out a way though. Someone else is working on something like that: https://twitter.com/bahmutov/status/720316267173810176 https://twitter.com/bahmutov/status/720316267173810176
- diggan 11y agoThanks everyone for the feedback and discussions, been very helpful and also motivating to see that people like/dislike the project in different ways! As a small update, I've now made autochecker completely language agnostic, so you can test basically anything you can put in a docker container. There is some examples on how to use this here: https://github.com/VictorBjelkholm/autochecker/tree/master/examples https://github.com/VictorBjelkholm/autochecker/tree/master/e... Again, thank you all for taking the time to give feedback, I'm forever grateful to the HN community.