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

fix: improve browser detection when running with Bun #1319

Merged
merged 2 commits into from
Nov 15, 2023

Conversation

cipriancaba
Copy link
Contributor

@cipriancaba cipriancaba commented Nov 7, 2023

What/Why/How?

Bun exposes self by default and the validation from

typeof window !== 'undefined' || typeof self !== 'undefined' || typeof process === 'undefined'; // main and worker thread
wrongly assumes isBrowser is true

Reference

Testing

Screenshots (optional)

Check yourself

  • Code is linted
  • Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

@cipriancaba cipriancaba requested a review from a team as a code owner November 7, 2023 12:26
Copy link

changeset-bot bot commented Nov 7, 2023

🦋 Changeset detected

Latest commit: 40cc547

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

This PR includes changesets to release 2 packages
Name Type
@redocly/openapi-core Patch
@redocly/cli 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

@tatomyr
Copy link
Contributor

tatomyr commented Nov 9, 2023

Hi @cipriancaba,
Thanks for your contribution! Could you also add a patch changeset?

@tatomyr tatomyr changed the title Bun exposes self by default fix: improve browser detection when running with Bun Nov 15, 2023
Copy link
Contributor

@lornajane lornajane left a comment

Choose a reason for hiding this comment

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

Changeset looks good!

@tatomyr tatomyr merged commit 6097ff7 into Redocly:main Nov 15, 2023
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants