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

[perf] disallow async/await #1853

Open
aladdin-add opened this issue Jul 3, 2018 · 9 comments
Open

[perf] disallow async/await #1853

aladdin-add opened this issue Jul 3, 2018 · 9 comments

Comments

@aladdin-add
Copy link
Contributor

@aladdin-add aladdin-add commented Jul 3, 2018

No description provided.

@aladdin-add aladdin-add closed this Jul 3, 2018
@ljharb
Copy link
Collaborator

@ljharb ljharb commented Jul 3, 2018

async/await is already disallowed by this guide due to the regenerator-runtime requirement; however, once that is obviated, we'll be allowing it.

@aladdin-add
Copy link
Contributor Author

@aladdin-add aladdin-add commented Jul 3, 2018

however I'm not seeing it in the guide, am I missing something?

@ljharb
Copy link
Collaborator

@ljharb ljharb commented Jul 3, 2018

It's handled by the linter.

@aladdin-add
Copy link
Contributor Author

@aladdin-add aladdin-add commented Jul 3, 2018

no-restricted-syntax? I was not seeing it either. (I am using eslint-config-airbnb, it doesn't report the usage)

@ljharb
Copy link
Collaborator

@ljharb ljharb commented Jul 3, 2018

oh hm, maybe we haven't restricted it explicitly just yet. However, since babel-preset-airbnb doesn't transpile it, and since we use the default parser, it shouldn't parse at all.

If you're using babel-eslint, you've already deviated from the guide.

@aladdin-add
Copy link
Contributor Author

@aladdin-add aladdin-add commented Jul 3, 2018

async/await has been included in ES spec. maybe we can add it in the config.

I can make a PR if no objection. :)

@aladdin-add aladdin-add reopened this Jul 3, 2018
@ljharb
Copy link
Collaborator

@ljharb ljharb commented Jul 3, 2018

That's been true for over a year; there's a number of things in the spec that we don't support because the default eslint parser doesn't yet parse them.

Sure, a PR to add a section to the guide about async/await would be fine.

@riwu
Copy link

@riwu riwu commented May 4, 2020

@ljharb Is async/await still discouraged? I can use it without babel (hence no increase in bundle size).
It's not supported in IE but Promise isn't either.

@ljharb
Copy link
Collaborator

@ljharb ljharb commented May 5, 2020

@riwu but Promise is shimmable/polyfillable, and you should be shimming in your app regardless - async/await is not.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.