Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop babel-node from build process #320

Merged
merged 2 commits into from
Jul 1, 2016
Merged

Conversation

levithomason
Copy link
Member

@levithomason levithomason commented Jul 1, 2016

This PR dials back the build and config syntax to work with vanilla node 6. This means no more babel-node in order to run Karma.

This is good in general because it reduces complexity and deps. The main reason it was done though was in attempt for Windows compatibility. See #316, where we were having issues running karma by referencing the npm bin path. On windows, this needs to be the Windows version which I believe is karma.cmd.

Having removed babel-node means we also remove the need to reference the path directly. Windows should be able to execute the test script now and NPM should do its cross platform magic and run the correct version.

We shall see.

@codecov-io
Copy link

codecov-io commented Jul 1, 2016

Current coverage is 88.30%

No coverage report found for master at 859b5a9.

Powered by Codecov. Last updated by 859b5a9...001ba69

```sh
node -v

v6.2.1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a note to contributing to use Node 6 since babel-node is no longer transpiling build and config code.

@levithomason levithomason force-pushed the feature/no-babel-node branch 2 times, most recently from 3d0e933 to d2ae62d Compare July 1, 2016 00:43
@@ -27,7 +27,7 @@ const webpackConfig = {

const webpackHotPath = `${config.compiler_public_path}__webpack_hmr`

export const webpackHotMiddlewareEntry = `webpack-hot-middleware/client?${_.map({
const webpackHotMiddlewareEntry = `webpack-hot-middleware/client?${_.map({
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This export was never used. I searched the code base as well as tested all the build scripts. All is well.

@levithomason levithomason force-pushed the feature/no-babel-node branch from d2ae62d to 0e5593f Compare July 1, 2016 00:56
@@ -42,23 +42,19 @@ module.exports = (karmaConfig) => {
},
webpack: {
devtool: 'cheap-module-source-map',
module: {
...webpackConfig.module,
module: Object.assign({}, webpackConfig.module, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to use a spread operator here? I believe they're in node6.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Man, I could have sworn it was though I'm on 6.2.1 and Node swears otherwise. Could be I need a flag or use strict or some other something enabled.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@levithomason levithomason Jul 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, but riddle me this:

spread.js

const objA = {
  foo: 'bar'
}

const objB = { ...objA }
$ node -v
v6.2.1

$ node spread.js
/Users/levithomason/src/stardust/spread.js:5
const objB = { ...objA }
               ^^^
SyntaxError: Unexpected token ...
    at Object.exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:513:28)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Function.Module.runMain (module.js:575:10)
    at startup (node.js:160:18)
    at node.js:456:3

There must be some flag or some other config required. I just don't want to risk it not running for anyone when Object.assign() is available.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, it works with arrays. Also seems to be with rest params, but not with objects....

image

source: http://node.green/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated all arrays to use it and it's good. Thanks for the push on it!

@eanplatter
Copy link
Contributor

Just some syntax comments, other than that LGTM! 🍂

@levithomason levithomason force-pushed the feature/no-babel-node branch from 0e5593f to cf45482 Compare July 1, 2016 03:29
@levithomason levithomason force-pushed the feature/no-babel-node branch from cf45482 to 001ba69 Compare July 1, 2016 03:39
@levithomason levithomason merged commit 0f3fb11 into master Jul 1, 2016
@levithomason levithomason deleted the feature/no-babel-node branch July 1, 2016 03:44
jhchill666 pushed a commit to jhchill666/stardust that referenced this pull request Jul 5, 2016
* docs(contributing): add node 6 dep note

* refactor(build): use node 6 compat (no babel-node)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants