-
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
No transpile option #1556
Comments
Yeah, I'd like to see that too. Now that Node.js 8 has native async/await, there's no longer a need for me personally to transpile. The main reason we chose to do transpilation by default initially was to get async/await. |
@avajs/core Thoughts? |
Yes. See also #709 (don't worry I'll clean up the issues). Say we have a |
Yes, unless we can figure out a way to run it efficiently at runtime on a failure.
I don't see how you could opt into the throws helper again without having Babel, and then using |
There's something to be said for separating AVA's file manipulations from syntax transforms. The Since we're still looking to integrate source transpilation and also support TypeScript, it makes sense (at least to me) that the enhancements are controlled separately. |
With the new Node LTS as our baseline we don't really have to do extra transpilation. ava still does its own but it does so inconsistently ( avajs/ava#1319 ), so we've switched back from import to require(). Indeed ava might get an option to turn off transpilation altogether ( avajs/ava#1556 ), which we may end up using if it doesn't come with bad tradeoffs.
I would use this a lot and it would have helped me today. 😃 At the moment, transpiling is breaking valid code that runs on LTS versions of Node. |
This new option controls whether the @ava/transform-test-files preset is used at all. Disabling will be one of the things necessary to side-step Babel altogether. Removes support for the `--no-power-assert` CLI flag, without a replacement. Refs #1556.
Set babel=false to disable AVA's default test compilation. *Also* set compileEnhancements=false to disable the Babel pipeline altogether. Fixes #1556.
#1608 includes a |
This new option controls whether the @ava/transform-test-files preset is used at all. Disabling will be one of the things necessary to side-step Babel altogether. Removes support for the `--no-power-assert` CLI flag, without a replacement. Refs #1556.
Set babel=false to disable AVA's default test compilation. *Also* set compileEnhancements=false to disable the Babel pipeline altogether. Fixes #1556.
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.
@novemberborn, you're an 👼 . can't wait to test this out! |
Hmm...
// package.json
"ava": {
"options": {
"compileEnhancements": false
}
} sure enough, breakpoints still jump around, leading me to think something is still being transpiled (or built, run, and sourcemapped at least) |
@cdaringe that's not how AVA's options are set. You'll also still need to disable the regular Babel compilation that AVA applies: "ava": {
"babel": false,
"compileEnhancements": false
} |
What would this do? "ava": {
"babel": false,
"compileEnhancements": true
} Would the |
@sholladay AVA won't apply the Whilst those last two features are currently provided through a Babel preset I think that's an implementation detail. We could change the compiler we use, and when we add native support for TypeScript we may still want to add those features to test files written in TypeScript. |
hey @novemberborn, whoops, sorry for that! even with "ava": {
"babel": false,
"compileEnhancements": false
} i'm still seeing the jumpiness. is the file still being meddled with or source mapped somehow? |
@cdaringe are you per chance applying |
hi @novemberborn, thx for the continued support. indeed, i was using nyc. after removing nyc, however, the issue persists. sorry i was late to see this message. im out for a few days for surgery but will be back soon. i'll try and reach out to you on gitter then. |
OR, here's a teeny tiny reproduction: https://github.com/cdaringe/vscode-ava-no-transpile-party-time it's wired up per instruction. clone, |
@cdaringe aha! |
Is this issue with vscode really a vscode issue? When I add a breakpoint in a jest file with es modules and inside an async function it works fine! Do we provide sourcemaps in ava? |
Description
ava doesn't support a "no transpilation" option. a no transpile option would improve performance and, more importantly, yield a stable, easy debugging experience for those of us who don't need/want transpilation. i use ava for many of it's great features, transpilation not being one of them. transpilation+source_maps+editors frequently don't play nicely.
observe:
^^ shows setting breakpoints, running ava, transpiliation happens behind the scenes, and my editor losing it's cool as it lost refs to the actual lines breakpoints were originally on, pretest
this is already a known issue without a solution--it even says so in the docs. these issues "just go away" when i can use raw node, and the runtime runs just my code, untouched!
thanks for the consideration! great work.
The text was updated successfully, but these errors were encountered: