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

Update to Babel 7 #2793

Closed
kibertoad opened this issue Aug 30, 2018 · 9 comments
Closed

Update to Babel 7 #2793

kibertoad opened this issue Aug 30, 2018 · 9 comments

Comments

@kibertoad
Copy link
Collaborator

Babel 7 just got released, bringing bags of goodies, among them faster transpilation. Probably it's a good idea for us to upgrade as well.

@kibertoad
Copy link
Collaborator Author

@elhigu If you approve, I could work on this.

@elhigu
Copy link
Member

elhigu commented Aug 31, 2018

I suppose it can be updated. I would like more if we could drop it completely, but I don't think that is going to happen at least this year.

@kibertoad
Copy link
Collaborator Author

Well, if we migrate to Typescript we could drop it immediately, but since that isn't likely to be completed anytime soon either, April 2019 sounds realistic for when we could drop Babel directly (I don't think we really need any Node 10 features such as async iterators).

@kibertoad
Copy link
Collaborator Author

@pgebheim
Copy link

pgebheim commented Sep 5, 2018

Well, this means that knex will break other projects which try to use Babel 7.

Would love to see this upgraded, but also -- why do you require babel-runtime as a non-dev-dep?

@kibertoad
Copy link
Collaborator Author

@pgebheim Why would it break them? Other projects consume already transpiled sources so they do not depend on how knex uses Babel.
Babel-runtime is an interesting topic, though. @elhigu Could you comment on why we need it if we transpile anyway?

@pgebheim
Copy link

pgebheim commented Sep 5, 2018

@kibertoad Right now its breaking projects because babel-runtime is specified as a dependency, so it gets tracked into every project that includes knex.

The end result is that there are multiple babel-runtime versions in the project and babel will break.

I'll also note that the babel docs say to add @babel/runtime as a dev dependency:

https://www.npmjs.com/package/@babel/runtime for the readme.

Example error -- in this case this version (^6.26.0) is being satisfied by Knex.

Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect 
the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel. (While processing preset: "/home/pg/Development/augur/augur-app/node_module
s/@babel/preset-react/lib/index.js")

@pgebheim
Copy link

pgebheim commented Sep 5, 2018

Upon further investigation I think the error is a bit of a red herring. Knex definitely shouldn't be exporting babel-runtime as a real dependency, but the issue I am seeing is because electron-compile needs babel6.

It just so happens that since knex provided a real dep for babel-runtime and its version is newer than specified in electron-compile, the loading of the dep resolves to the version specified in Knex.

@kibertoad kibertoad mentioned this issue Sep 19, 2018
@ricardograca
Copy link
Member

Fixed with #2813.

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

No branches or pull requests

4 participants