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

feat(eslint): Add no-return-await rule to eslint config #8388

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

AbhiPrasad
Copy link
Member

Add https://eslint.org/docs/latest/rules/no-return-await to eslint config to remove usage of uneeded async/await calls. This helps reduce microtasks being generated, which can help reduce memory pressure caused by the SDK.

The downside of removing return await is that stacktraces get slightly worse for async errors that use these methods, as we no longer pause execution on return for the engine to grab context on, but instead just pass through the promise, but I think it's worth it for this to be the default, and for us to opt-in to the better stacktraces if need be.

@AbhiPrasad AbhiPrasad requested review from a team, stephanie-anderson and Lms24 and removed request for a team June 22, 2023 15:52
Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice one!

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, TIL 😅 Didn't even think about this before but it makes a lot of sense. I Agree with your stack trace point. IIUC this would only be problematic in case a stack frame from our SDK code would be of interest for our users. I don't see this being much of a problem but as you said, we can revisit on a case-by-case basis.

@AbhiPrasad AbhiPrasad merged commit a34581d into develop Jun 23, 2023
@AbhiPrasad AbhiPrasad deleted the abhi-no-return-await branch June 23, 2023 12:21
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

Successfully merging this pull request may close these issues.

3 participants