-
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
New option to disable the automatic babel transpiling and core.js inclusion #1049
Comments
After some discussion regarding this, @sniku proposed that instead of a combined Not sure what the best name for something like that is, but for lack of a better option, I'll go with
|
As discussed last week, I tried to implement the In summary, the
The main problem is that all configuration @na-- @mstoykov @cuonglm Let me know if you have a better idea of handling this so that we can avoid or postpone the config refactor. |
Partially implements #1049. This required a substantial refactor of `compiler.go`, mostly in order to be able to test a compiler with different compatibility mode values during the same test run, which was problematic since `compiler.Compiler` was a singleton. So the solution is to instead make a new `babel` struct the singleton, which encapsulates everything needed for Babel to run, while allowing several `Compiler` instances to exist. In the author's humble opinion, this has the added benefit of being a cleaner design (which was further experimentally expanded in 4e52c78).
Partially implements #1049. This required a substantial refactor of `compiler.go`, mostly in order to be able to test a compiler with different compatibility mode values during the same test run, which was problematic since `compiler.Compiler` was a singleton. So the solution is to instead make a new `babel` struct the singleton, which encapsulates everything needed for Babel to run, while allowing several `Compiler` instances to exist. In the author's humble opinion, this has the added benefit of being a cleaner design (which was further experimentally expanded in 4e52c78).
Partially implements #1049. This required a substantial refactor of `compiler.go`, mostly in order to be able to test a compiler with different compatibility mode values during the same test run, which was problematic since `compiler.Compiler` was a singleton. So the solution is to instead make a new `babel` struct the singleton, which encapsulates everything needed for Babel to run, while allowing several `Compiler` instances to exist. In the author's humble opinion, this has the added benefit of being a cleaner design (which was further experimentally expanded in 4e52c78).
Partially implements #1049. This required a substantial refactor of `compiler.go`, mostly in order to be able to test a compiler with different compatibility mode values during the same test run, which was problematic since `compiler.Compiler` was a singleton. So the solution is to instead make a new `babel` struct the singleton, which encapsulates everything needed for Babel to run, while allowing several `Compiler` instances to exist. In the author's humble opinion, this has the added benefit of being a cleaner design (which was further experimentally expanded in 4e52c78).
Partially implements #1049. This required a substantial refactor of `compiler.go`, mostly in order to be able to test a compiler with different compatibility mode values during the same test run, which was problematic since `compiler.Compiler` was a singleton. So the solution is to instead make a new `babel` struct the singleton, which encapsulates everything needed for Babel to run, while allowing several `Compiler` instances to exist. In the author's humble opinion, this has the added benefit of being a cleaner design (which was further experimentally expanded in 4e52c78).
Partially implements #1049. This required a substantial refactor of `compiler.go`, mostly in order to be able to test a compiler with different compatibility mode values during the same test run, which was problematic since `compiler.Compiler` was a singleton. So the solution is to instead make a new `babel` struct the singleton, which encapsulates everything needed for Babel to run, while allowing several `Compiler` instances to exist. In the author's humble opinion, this has the added benefit of being a cleaner design (which was further experimentally expanded in 4e52c78).
As seen in #1036 (comment), core.js is responsible for the vast majority of VU memory usage and initialization time for simple scripts, even after the fixes from #1038.
Also, currently babel transformation happens on the "do it if it fails without it": https://github.com/loadimpact/k6/blob/2a2fe2cc665e0d2b818c4f3ca7ce4fc9a5821294/js/compiler/compiler.go#L131-L146
I think this is wrong for a few different reasons:
So the proposal is that by default k6 would always transpile files with babel and include core.js, but we'll have a flag to completely disable that behavior for users that don't need these things or for power users that have their own script bundling/transformation pipeline.
The text was updated successfully, but these errors were encountered: