Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Make @neutrinojs/node target the currently running node version #985

Closed
edmorley opened this issue Jul 5, 2018 · 3 comments
Closed

Make @neutrinojs/node target the currently running node version #985

edmorley opened this issue Jul 5, 2018 · 3 comments
Assignees
Milestone

Comments

@edmorley
Copy link
Member

edmorley commented Jul 5, 2018

At the moment @neutrinojs/node sets a @babel/preset-env target of:

targets: {
  node: '8.3'
},

However @babel/preset-env also supports passing 'current' as the version, which makes Babel target the same version of Node as is being used to run Babel:
https://babeljs.io/docs/en/next/babel-preset-env.html#targetsnode

This seem preferable for the @neutrinojs/node preset, since it's very likely that the version of Node being used to create the build, is the same version that will run it (the same cannot be said for the library preset when target=node) - and would mean that someone running a newer version of Node has as few Babel transforms being used as possible.

@eliperelman, thoughts? :-)

@edmorley edmorley added this to the v9 milestone Jul 5, 2018
@eliperelman
Copy link
Member

My thoughts for this preset have been to pin it to an LTS version of Node.js. I frequently change Node.js versions, so I'm not sure about my assumptions on this one.

@edmorley
Copy link
Member Author

edmorley commented Jul 9, 2018

What use-case did you have in mind, that would be broken by using 'current'? Having multiple node versions on the same machine is fine. I doubt people are building with one and then running with another (and if they are, they are in the 5% case, where Neutrino should be catering for the 80% case I think).

@eliperelman
Copy link
Member

What use-case did you have in mind, that would be broken by using 'current'?

I don't have anything in particular, I just don't have any strong directions one way or another. I'm fine with going to current as long as it's documented.

edmorley added a commit that referenced this issue Jul 11, 2018
Instead of always targetting Node.js 8.3. This means users running
newer Node.js will have fewer Babel transforms enabled, reducing
build times and improving runtime performance.

Fixes #985.
@edmorley edmorley self-assigned this Jul 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants