pebblecode / node-starter-kit

node starter kit project, for npm packages, react components or even a base for a project
3 stars 0 forks source link

Use of Babel #4

Open shapeshed opened 9 years ago

shapeshed commented 9 years ago

A discussion point: Do we really need Babel?

Node has support for ES6 via the --harmony flag

node --harmony server.js

https://nodejs.org/en/docs/es6/

poshaughnessy commented 9 years ago

Most ES6 stuff is available in Node 4 without a flag now (--harmony now is a synonym of --es_staging which currently just adds https://nodejs.org/en/docs/es6/#which-features-are-behind-the-es_staging-flag).

But... we'll most likely want to use Babel for the front-end, so if we have the dependency anyway?

And one of the annoying things that's missing is ES6 import/export. If we use Babel we can use that.

export-mike commented 9 years ago

I feel that using babel allows us to not compromise on older browsers, its definitely less important in a node environment, as node 4 has most of the killer features.

However in a node environment with JSX for server side rendering we still require babel and probably will need it for some time.

I guess this project is just a 'seed' 'starter' with the linting, tests and pre-commit which is pretty useful to have. All of it can be taken out pretty easily. at the mininum case you can just change in package json "main":"src/index.js" rather than "main":"lib/index.js"