-
Notifications
You must be signed in to change notification settings - Fork 17.4k
Support Babel in all of the same ways as CoffeeScript #8416
Comments
/cc @kevinsawicki @nathansobo feel free to clarify or correct the above task list. |
I'm unsure about the wording of the comment header... I see where you're going with Honestly just supporting |
Just a thought - do we need to have an opt-in for Babel? Would there be any significant harm in passing all JS through the Babel parser? In principle I get why we would want to avoid any unnecessary compilation, but if we're really considering making developing with Babel feel more like developing with Coffee, then it would be nice from a "user" perspective to be able to omit the pragma. |
@mnquintana My main concern is the overhead of always assuming the need for Babel for every single JS file, both in terms of performance and complexity. I haven't fully thought through the implications of dropping the pragma, but if you or anyone else wants to do an impact analysis on it, I'd be open to discussing it. It just has to be as close to free as possible. |
Yeah, that probably makes the most sense; use the same wording as the other style. |
electron-compile uses https://github.com/electronjs/compile-cache/blob/master/src/compile-cache.js#L35 It also might be worth looking into just adopting electron-compile wholesale, it solves a lot of the problems that Atom is trying to one-off per-language, in a more general way, and Atom gets the benefit of improvements that the general Electron Community is using. |
@paulcbetts
|
It'd be a pretty big PITA to be honest - how about instead we allow you to reach into node_modules and delete node-sass, then we'll make it so that loading the default compiler set will tolerate failures
We could make that configurable, yeah |
If we can support |
@bolinfest Are you thinking the presence of |
@nathansobo Yes, I think that's completely reasonable since that's what the intent of the presence of a I think that the main tricky bit is figuring out how to construct the cache key correctly, as mentioned in #8182. |
I can't believe I'm saying this, but maybe we could tolerate some amount of un-soundness in the caching? @sebmck What's the best way to let people use |
@nathansobo @sebmck Or maybe we could require people to specify it via the |
I'd prefer it to support and use the same config resolution logic that Babel does for consistency. You can look up the options each time and use it in the hash key like what |
@bolinfest @nathansobo @kittens I would like to use a couple Babel plugins that are specific to my package but it looks like it's currently not possible to bring your own Babel config (using babelrc or package.json). I'd be happy to work on a PR to enable this, but I'm not sure where to start... |
@gnestor The entry point for all on-the-fly transpilation is the compile-cache. You'll see we have a Babel handler listed for |
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks! |
We want to move toward writing new code in javascript, not coffeescript. For example: https://github.com/atom/line-ending-selector. But before we start bundling packages written in Babel, we need to improve some infrastructure around it.
Tasks
The CI script
Bundled Packages
Opting in to Babel
'use babel'
string that fits in better with other babel directives. Maybe this:The text was updated successfully, but these errors were encountered: