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

Use babel-preset-latest #9

Merged
merged 1 commit into from
Nov 2, 2016
Merged

Conversation

gnestor
Copy link
Contributor

@gnestor gnestor commented Nov 2, 2016

I’m submitting this and opening it up for discussion.

  • Node 6 supports 99% of es2015. babel-preset-latest includes es2015, es2016, es2017. I think that jp-babel should provide support for these by default but I acknowledge that there might be issues in doing so.
  • I added a “preinstall” script that should delete the node_modules directory before installing, so that upgrading doesn’t cause conflicts (e.g. I upgraded the babel dependencies without removing node_modules and got a You gave us a visitor for the node type "ForAwaitStatement" but it's not a valid type error). This should also address "Error: Could not locate the bindings file." ijavascript#76 regarding version mismatch of Node bindings for zmq (which require a rebuilding if the Node environment version changes).

@n-riesco
Copy link
Owner

n-riesco commented Nov 2, 2016

It would've been better to submit this commits in different PRs (since they address independent issues).

Here's my review:

  • 848c1f6 is unnecessary 6 and ^6 are equivalent. See the version calculator here.
  • 8167477 only works if you installed jp-babel using git clone. I also have the following arguments against the idea of wiping node_modules:
    • babel is a huge dependency (and thus, slow to install)
    • node_modules is npm's responsibility (messing with node_modules should be a last resort).
    • The way I'd like to address this issue is with a try-catch block and throwing and error message that tells the users how to solve it (ideally, in a cross-platform way).
  • a93f3e3 Other than the size of the babel dependency, what would the issues of defaulting to babel-preset-latest?

@gnestor
Copy link
Contributor Author

gnestor commented Nov 2, 2016

I just removed the other commits regarding dependency versions and preinstall script.

848c1f6 is unnecessary 6 and ^6 are equivalent. See the version calculator here.

Ok, thanks for clarifying.

The way I'd like to address this issue is with a try-catch block and throwing and error message that tells the users how to solve it (ideally, in a cross-platform way).

This approach sounds good to me, except that the error I encountered (You gave us a visitor for the node type "ForAwaitStatement" but it's not a valid type) was a babel compilation error (that I saw in the output of a cell), so I don't know how easy it would be to catch that, let alone dynamically suggest a solution. Although I did a git clean -xfd && npm install to resolve it, I bet an npm update would've resolved it too. Regarding Node bindings issue with zmq, it looks like jmp now depends on zmq-prebuilt, so this issue is resolved now?

a93f3e3 Other than the size of the babel dependency, what would the issues of defaulting to babel-preset-latest?

I don't see any issue myself, I just wanted to see what others thought about it, to be safe.

@n-riesco n-riesco merged commit d183385 into n-riesco:master Nov 2, 2016
@gnestor gnestor deleted the babel-preset-latest branch November 2, 2016 20:10
@n-riesco
Copy link
Owner

n-riesco commented Nov 2, 2016

On 02/11/16 19:54, Grant Nestor wrote:

The way I'd like to address this issue is with a try-catch block and throwing and error message that tells the users how to solve it (ideally, in a cross-platform way).

This approach sounds good to me, except that the error I encountered (|You gave us a visitor for the node type "ForAwaitStatement" but it's not a valid type|) was a babel compilation error (that I saw in the output of a cell), so I don't know how easy it would be to catch that, let alone dynamically suggest a solution. Although I did a |git clean -xfd && npm install| to resolve it, I bet an |npm update| would've resolved it too.

Could you open an issue for this (so I don't forget)?

Regarding Node bindings issue with zmq, it looks like jmp now depends on zmq-prebuilt, so this issue is resolved now?

No, it doesn't solve the issue (it compiles zmq statically, but the issue is with Node's V8).

Kyle mentioned https://github.com/juliangruber/require-rebuild may help.

a93f3e3 <https://github.com/n-riesco/jp-babel/commit/a93f3e3ec3b95ecaedd8e3b0d56aca2515a524bf> Other than the size of the babel dependency, what would the issues of defaulting to babel-preset-latest?

I don't see any issue myself, I just wanted to see what others thought about it, to be safe.

OK. I'm merging the PR.

@Announcement
Copy link
Contributor

update this to babel-preset-env

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.

3 participants