Skip to content
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

this would be much better as a babel plugin #1

Open
capaj opened this issue Apr 12, 2018 · 7 comments
Open

this would be much better as a babel plugin #1

capaj opened this issue Apr 12, 2018 · 7 comments

Comments

@capaj
Copy link

capaj commented Apr 12, 2018

using this directly in my code make is quite ugly and much harder to read. We need a babel plugin to hide this mess away.

@zatziky
Copy link
Contributor

zatziky commented Apr 12, 2018

Hello Jirko @capaj , we do not use any transpilers but I do agree that it needs some improvements in readability.

There's maybe another way how to hide the ugly part. We are using JetBrains IDEs (PhpStorm and IntelliJ), I remember that in times when Java had no closures, the IDE had been making anonymous classes look like a closure. In our case, it would optically replace await me(() => E(), ...) with await ....
Would it be a sufficient solution?

@capaj
Copy link
Author

capaj commented Apr 12, 2018

@zatziky well this was just a suggestion, not really a "github issue" in the true sense of the word. I'll close it and who knows-maybe some day I'll make the plugin myself.

@capaj capaj closed this as completed Apr 12, 2018
@zatziky
Copy link
Contributor

zatziky commented Apr 12, 2018

@capaj Don't worry, I understood it was a suggestion and a good one. I like it and will reopen the issue. Maybe someone else will implement a PR.

@zatziky zatziky reopened this Apr 12, 2018
@nbransby
Copy link

100% needs to be a babel plugin!

@andreineculau
Copy link

we made it a babel plugin in our preset https://github.com/tobiipro/babel-preset-firecloud/blob/master/plugins/babel-plugin-firecloud-await-trace.js

at the moment, I'm short on time for a PR, etc

PS: I've just made a fix so that we don't loose this when transpiling tobiipro/babel-preset-firecloud@a84a45c

@zatziky
Copy link
Contributor

zatziky commented May 15, 2019

Good job @andreineculau We are moving our projects to Node 12 that should already cover the async stack traces. Check it out. If you ever find time I will happily merge your PR.

@andreineculau
Copy link

@zatziky true that, but we decided to still go ahead with this babel plugin because most of the js work at https://github.com/tobiipro is target AWS Lambdas which has only a few days ago started supporting nodejs10.x . We could use layers and use node 12, but that has another set of disadvantages...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants