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

Drop async in the frontend? #4035

Closed
paulmelnikow opened this issue Sep 16, 2019 · 4 comments
Closed

Drop async in the frontend? #4035

paulmelnikow opened this issue Sep 16, 2019 · 4 comments
Labels
frontend The Docusaurus app serving the docs site

Comments

@paulmelnikow
Copy link
Member

My understanding is that the global transform which transforms async calls in the frontend to promises adds a lot of bloat to the frontend build.

Does anyone know if that is true / still true?

We only use async in a few places and I think we could replace these with promises.

@paulmelnikow paulmelnikow added the frontend The Docusaurus app serving the docs site label Sep 16, 2019
@calebcartwright
Copy link
Member

calebcartwright commented Sep 19, 2019

Does anyone know if that is true / still true?

Not this is particularly helpful, but I have no idea 😄

@paulmelnikow
Copy link
Member Author

@Daniel15 any chance you could offer some quick insight on this?

@Daniel15
Copy link
Member

Daniel15 commented Nov 24, 2019

@paulmelnikow - Just catching up on my emails... Sorry I missed this! Async/await is natively supported by the vast majority of browsers (~91% of users, as per https://caniuse.com/#feat=async-functions). Native async/await is actually more efficient than promises these days:
https://v8.dev/blog/fast-async

And Chrome also has "zero-cost async stack traces", which means error stack traces include the entire async stack when using native async/await (whereas this is prohibitively expensive to do with callbacks or promises)

We could potentially have two bundles: One for modern browsers, and one for legacy browsers.

@PyvesB
Copy link
Member

PyvesB commented Jul 12, 2024

We no longer have any async calls in our frontend. Closing as this is no longer relevant.

@PyvesB PyvesB closed this as completed Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend The Docusaurus app serving the docs site
Projects
None yet
Development

No branches or pull requests

4 participants