Hacker News new | ask | show | jobs
by Kequc 3007 days ago
It seems like a strange set of tooling and I don't get to configure it how I like.

Why would I want to use Babel to compile server side code rather than just use the latest version of Node? It's actually doing two compilation steps because it's got TypeScript in there too, which is also a compiler. It uses Jest for testing, which is primarily designed for React.

I haven't found my preferred environment scaffolding yet. As I go I find better and better ways to set up my app and usually it's pretty app specific. If I did find a great scaffolding tool I think it would be one I have full control over. Maybe a lot more like Yeoman which has been around for quite a while.

You can do a lot even without scaffolding, just npm init and git init.

6 comments

Jest isn't primarily designed for React. It has a lot of built in feature for making testing React components easier. But it's a generic Javascript test runner and framework
Yep - the main thing that Jest gives out of the box is jsdom, so allows for dom based testing without needing phantom (or more modern now, headless browser).

I also find it's faster and has better features than Mocha (for instance, coverage out of the box).

I use Babel and TS server side. TS for types, and Babel because the latest stable version of node does not always support the latest Ecmascript features. Example from recent memory: Async generators (async function* yada(){} and for await of).
FYI Jest is great for Node too, not just React. Very happily using Jest for my non-React project right now.
It doesn't do double compilation when using TypeScript, .ts goes goes to tsc and .js to Babel. It uses Babel so you can use ES6/7/8 on the server.

This is meant as a simplified project build tool, not for every use, but you can configure it quite extensively if you need to (although it has limitations). I would estimation that ~80% of projects could use this, and is less than 5 minutes of migration or 30 seconds to get started. It's not for the 20% of projects with very custom needs for build configuration.

You might be interested in Concatapult [1]. I built it to minimally cover server needs (first-time setup, env vars, testing) and optionally add tech as your project needs it (react, knex, typescript, etc).

Basically it's a lego-like version of yeoman, and opinionated towards simplicity.

[1] https://github.com/Concatapult/pult

I am interested. It looks at the very least as interesting as the project in the op thanks for the link.
I'm not really on board with using babel for a server-only project either, but I do like jest for testing and have in fact only used it for node app servers so far.