-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Getting ready for Babel 7 #1598
Comments
Looking at avajs/babel-preset-stage-4#11 this is tricky though, since all the v7 plugins are still released as betas. We'll probably have to install our dependencies from GitHub until Babel 7 is released officially. |
With the tight babel integration and no support for using a peer version of Babel, is Ava concerned about users who cannot upgrade yet to Babel 6 becoming locked out of support for the next version of Ava? This issue is exacerbated by not using semver as this change would normally force a major version bump leaving the previous version open for PRs to backport security fixes and bug fixes. |
@razor-x bug fixes could still be backported (they count as patch releases anyhow), but as a general rule the AVA team does not have the resources to maintain earlier versions. I think this would impact users who customize the Babel configuration that AVA applies to their test files. As far as the official Babel plugins are concerned the Babel 7 versions will be published under new package names, so the test configuration could use new versions whereas sources can still be compiled using Babel 6. Another workaround would be to precompile test files using Babel 6. I did consider supporting both versions, but as I'm doing the work on the dependencies that seems increasingly complicated. |
That's all reasonable. Mostly want to bring up this issue for an official response so affected users understand what Ava development will support and can plan accordingly. I'd say it's dangerous to assume code that passes tests run through Babel 7 but compiled with Babel 6 will run identically in production. Ideally that's not the case, but one cannot guarantee perfect parity between two major versions. |
AVA doesn't compile source code though, it only compiles test files, and by default only to deliver stage-4 syntax to older Node.js versions (plus some other enhancements under our control). I don't expect any breakage there once we finish the upgrade. |
Are you saying Ava does not run relative |
Other than helper files, AVA does not compile source files (the stuff you're testing). You have to use |
@vjpr, @citycide, @cwonrails Please give #1608 a whirl if you have a moment. Note that |
@novemberborn was about to try it out but it looks like Until then npm will fail with a very unhelpful message: npm ERR! code 1
npm ERR! Command failed: /usr/bin/git checkout babel7
npm ERR! error: pathspec 'babel7' did not match any file(s) known to git. while yarn is a bit more useful since it actually gave me some kind of idea where the problem was: yarn install v1.3.2
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
error Couldn't find match for "babel7" in "_c" for "https://github.com/power-assert-js/babel-plugin-espower.git".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. |
@citycide thanks for the heads up. I've updated the dependencies, please give it another go! |
Fixes #1598. Switches AVA's Babel implementation to use Babel 7. This applies to test and helper file compilation. Adds a `compileEnhancements` option which can be set to `false` to disable Power Assert and our `t.throws()` helper. Changes the Babel configuration. If you had this before: ```json "ava": { "babel": { "plugins": [] } } ``` You'll now need: ```json "ava": { "babel": { "testOptions": { "plugins": [] } } } ``` `ava.babel.testOptions.babelrc` now defaults to `true`. You can disable our stage-4 preset by adding `["ava/stage-4", false]` to `ava.babel.testOptions.presets`. Set `ava.babel` to `false` to disable AVA's test file compilation, **whilst still compiling enhancements**. If `compileEnhancements` is *also* set to `false` then Babel is skipped completely. Fixes #1225, #1488 and #1556.
Babel 7 will be released soon (#1575). Here's what we're going to do:
Any changes that are required in the dependencies will be released to npm when they're ready. The remaining changes in AVA itself will be held back until Babel 7 is officially released. We'll do a new AVA release once the dust settles. Those of you working with Babel's beta versions will be able to install from GitHub.
It's possible that AVA won't fully support all the new configuration options, but that won't stop us from releasing Babel 7 support. We'll just have to document what's still missing.
There's a lot of pieces to coordinate here, so for now I've assigned myself to this effort. If you've got some time in the next few weeks and are looking to help out, please chime in here and I'll see where we are. There's lots of other issues labeled "help wanted" too 😉
Thanks!
The text was updated successfully, but these errors were encountered: