-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Babel 7 support #5101
Comments
So far as I can see, the new version seems to work fine with CS 2.3.1. In a Unix environment, you can do a
in your node_modules directory if you'd like to do a quick sanity check with the new |
This is probably as easy as updating Lines 10 to 12 in 7f8b36a
to also try to require Anyone up for an easy PR? |
@GeoffreyBooth There are three files affected; The changes are all straightforward, seemingly along the lines of: try
babel = require '@babel/core'
catch
try
babel = require 'babel-core'
catch
# This error is only for Node, as CLI users will see a different error
# earlier if they don’t have Babel installed.
throw new Error 'To use the transpile option, you must have the \'@babel/core\' or \'babel-core\' module installed' Though it gets quite duplicative and therefore might be something that should have a common function for, especially given the nested try blocks. However, it's indeed a quick and easy change to all 3, though I'm not sure what the tests would be, other than 'does not explode in flames', I suppose. |
@GeoffreyBooth PR #5102, though as mentioned, an appropriate test other than does not go bang is unclear to me at present. |
Any tests that the old version had would apply to the new one. Though I’m not sure if we wrote tests for the I guess if you wanted to abstract this, you could make a try
babel = getBabel()
catch And you could put the double- |
I think that upon further consideration, this is probably not something that'll need to be dual-pathed for an extended period of time, as those who use Babel are, frankly, likely to upgrade quickly, at least in my opinion. |
@bazineta thanks for the PR. I'm using the symbolic link workaround (in postinstall script) for months now, as Babel 7 has been in beta/RC for a long time. Babel users also didn't wait for the official v7 release to use it. So I guess it is safe now for CS to use Babel 7. |
I don't see the need to break old setups.
The transpile option is ment for ppl who really don't use babel. |
I use Babel a lot, via babel-loader in Webpack. Still I have to run scripts in CS with the transpile option… |
Same here; that's our use of it, via webpack loaders. The PR supports both pre-7 and 7+ babel. |
I'll note that, in the short term anyway, users can probably install |
Done in #5105. |
@GeoffreyBooth could we get a quick bump to |
Please see #5110. Anyone available to review that? |
Thanks everyone 👍 |
Babel 7 is out!
For transpilation CoffeeScript still looks for a
babel-core
package instead of the new Babel 7@babel/core
.More details: http://babeljs.io/blog/2017/12/27/nearing-the-7.0-release#renames-scoped-packages-babel-x
The text was updated successfully, but these errors were encountered: