This was a very good summary, and an easy read, well done! But I still think JS development is a clumsy beast. One aspect I didn’t see covered: unit testing.
I was working on a side project, a library, and was very proud of not having to use Babel , because my library would only work in modern browsers anyway, so I was happy to use only ES6 features. I had to take a step back when incorporating unit tests with mocha and Nyc - mocha does not work with ES6 modules, so I had to use a library to transpile my code to an “older” way of doing things, so that I can unit test the code that is written in the modern way. I mean, this is not what a mature development workflow looks like.
JS does not really impose any particular development workflow, if you are not satisfied with your workflow you should probably change it. I get the spirit of what you’re saying, but I disagree that it’s an issue of maturity, JS has a pretty unique set of criteria that have led to the situation we find ourselves in
Mocha was great. It was how I can learned unit testing in JavaScript. But I have to say jest is a joy to use. And it works well with es6. No transpilation needed. I've written thousands of lines of es6 code in the last few months and it's all unit tested with almost 100% coverage. Jest makes it pretty easy. Can't speak for other test libraries but I can say mocha has aged poorly :/
mocha does not work with ES6 modules, so I had to use a library to transpile my code to an “older” way of doing things
Sounds like mocha's not the right tool for your project at this point in time. Look at jasmine and karma (which is what angular uses) or any one of the hundreds of other unit testing frameworks written for JS.
One library not meeting your use case isn't indicative of an issue with JS as a whole. It means you picked the wrong tool, try a different one. If the tool you need doesn't exist yet take a stab at writing your own, or forking mocha. Even if your code isn't the best your ideas might inspire someone else. At the very least submit an issue (or +1) on github.
JS is growing, which means that you can shape the tools, libraries and community. All you need to do is participate.
The fact that some lib doesn't fit your use case (yet) isn't a problem with JS. It just means you (me and everyone else) have some work to do.
It scratches the surface on a lot of areas, but it would be fairly easy to overwhelm the intended audience. There is a lot to understand there without getting into linting, state management, testing, frameworks, etc.
10
u/haschdl Dec 04 '18
This was a very good summary, and an easy read, well done! But I still think JS development is a clumsy beast. One aspect I didn’t see covered: unit testing.
I was working on a side project, a library, and was very proud of not having to use Babel , because my library would only work in modern browsers anyway, so I was happy to use only ES6 features. I had to take a step back when incorporating unit tests with mocha and Nyc - mocha does not work with ES6 modules, so I had to use a library to transpile my code to an “older” way of doing things, so that I can unit test the code that is written in the modern way. I mean, this is not what a mature development workflow looks like.