Skip to content

fix: add explicit import of performance to fix bazel compatibility issues #1772

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 2 commits into from
Jul 19, 2024
Merged

Conversation

ashwin153
Copy link
Contributor

Changes

  • Running openapi-typescript through Bazel results in a ReferenceError: performance is not defined error
  • This PR adds an explicit import { performance } from "node:perf_hooks" whenever performance is used in the code.
  • I've tested that this fixes my Bazel compability issues.

How to Review

  • Make sure I didn't miss any usages of performance.
  • Let me know if there's a reason why the import was omitted.

Checklist

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

@ashwin153 ashwin153 requested a review from a team as a code owner July 19, 2024 15:29
Copy link

changeset-bot bot commented Jul 19, 2024

🦋 Changeset detected

Latest commit: 5e4f7a2

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

This PR includes changesets to release 1 package
Name Type
openapi-typescript 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.

Thank you for the fix! While normally I’d recommend raising this upstream with Bazel, this is unopinionated enough it’s safe to merge.

If you add a patch changeset we can release it on merge!

@ashwin153
Copy link
Contributor Author

@drwpow Added a changeset, but it is my first time using the tool. Let me know if it looks ok.

@drwpow
Copy link
Contributor

drwpow commented Jul 19, 2024

Looks great, thank you!

@drwpow drwpow merged commit 41cb9a2 into openapi-ts:main Jul 19, 2024
7 checks passed
@github-actions github-actions bot mentioned this pull request Jul 19, 2024
kerwanp pushed a commit to kerwanp/openapi-typescript that referenced this pull request Jul 29, 2024
…sues (openapi-ts#1772)

* fix: add explicit import of performance to fix bazel compatibility issues

* add changeset

---------

Co-authored-by: Ashwin Madavan <[email protected]>
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