-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Disable some babel plugins that are now part of goja or are not useful #1822
Conversation
351500b
to
928e730
Compare
40282a5
to
37add28
Compare
|
||
// es2017 https://github.com/babel/babel/blob/v6.26.0/packages/babel-preset-es2017/src/index.js | ||
// "syntax-trailing-function-commas", // in goja | ||
// "transform-async-to-generator", // Doesn't really work unless regeneratorRuntime is also added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we consider including this along with transform-runtime then? It would add a lot of value to support generators and this poor-man's async
, unless they would add a lot to the bundle and explode the memory requirements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we discussed this internally and we came to the conclusion that it is better to break all the async/await stuff that is halfway working and letting people do it on their own through the template-es6 or similar.
I removed the generator tests specifically because we were failing practically all of them because it was needing regeneratorRuntime
. And I am heavily against adding regeneratorRuntime
and reenabling plugins, possibly bringing back the polyfill for Promise. It will likely not work great, again all of those tools are not written for k6 but for nodejs/browsers. Goja does implement Ecmascript faithfully, but there are still possibilities that those tools require something special in one of the cases to work.
Testing this will likely show whether I am correct or not, but IMO "not async" async is not worth the time investment and explanation on why it is not working as someone would expect. And then the possibility of breaking changes once we actually start having real async.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't really dig into each enabled plugin and their configuration, but as long as the TC39 tests pass I think we can be confident that we're not breaking anything.
I like that they're now explicitly listed instead of being part of some obscure preset. Nice work! 👏
The configuration is copied from the presets, which are linked above each section of plugins. So it should be exactly the same but without some of them.
Yeah, this also means that in the future removing one will be just commenting a line and rerunning the tests. And let's hope we can remove all of them 🍾 |
b71ee6d
to
97689ae
Compare
Unfortunatelly babel doesn't let you disable plugins from a preset, so we need to specify every plugin that we want with it corresponding configuration.
37add28
to
805c987
Compare
Codecov Report
@@ Coverage Diff @@
## enableAlmostAllTc39Tests #1822 +/- ##
============================================================
- Coverage 71.58% 71.54% -0.04%
============================================================
Files 181 180 -1
Lines 13939 13938 -1
============================================================
- Hits 9978 9972 -6
- Misses 3328 3331 +3
- Partials 633 635 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Unfortunatelly babel doesn't let you disable plugins from a preset, so
we need to specify every plugin that we want with it corresponding
configuration.