Skip to content

perf: remove unnecessary async keywords #1809

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

Merged
merged 1 commit into from
Aug 5, 2024
Merged

Conversation

gzm0
Copy link
Contributor

@gzm0 gzm0 commented Aug 2, 2024

Changes

Remove unnecessary async keywords in object returned from createClient.
They simply increase code size (perf in this sense).

I stumbled upon this when working on #1791 / #1526.

I have checked that dist/index.min.js still contains the async keyword, so at least when minified with esbuild, this really contributes to bundle size.

How to Review

  • Check that async does not hint to the JIT.

Checklist

All points N/A.

  • Unit tests updated
  • docs/ updated (if necessary)
  • pnpm run update:examples run (only applicable for openapi-typescript)

@gzm0 gzm0 requested a review from a team as a code owner August 2, 2024 12:24
Copy link

changeset-bot bot commented Aug 2, 2024

🦋 Changeset detected

Latest commit: 13a5866

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
openapi-fetch Patch
openapi-react-query Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@drwpow drwpow left a comment

Choose a reason for hiding this comment

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

Love these little fixes. Please add a patch changeset (see comment) so you’ll be credited for this!

They simply increase code size (perf in this sense).
@gzm0
Copy link
Contributor Author

gzm0 commented Aug 5, 2024

Changeset added, rebased, squashed.

@drwpow drwpow merged commit f21c05b into openapi-ts:main Aug 5, 2024
7 checks passed
@github-actions github-actions bot mentioned this pull request Aug 6, 2024
@gzm0 gzm0 deleted the no-async branch August 12, 2024 06:53
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.

2 participants