Skip to content

Conversation

@KaanOzkan
Copy link
Contributor

We have to safely ensure vernier is available and we can load the constant

@KaanOzkan KaanOzkan marked this pull request as ready for review January 29, 2025 19:45

def vernier_supported?
RUBY_VERSION >= "3.2.1"
defined?(AppProfiler::Backend::VernierBackend.name) && RUBY_VERSION >= "3.2.1"
Copy link
Member

Choose a reason for hiding this comment

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

These conditions should probably be reversed. The version check is likely lighter than the defined? check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking we should prioritize the one that's more likely to fail. Wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess it's so cheap that it's better to skip defined? whenever we can. I'll change it.

Copy link
Member

Choose a reason for hiding this comment

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

I'd like to open an issue to make it so we don't have to use defined? at all, so I'll record my thoughts there. We should not need to reference a const that loads vernier unless the user configures the gem to do so.

We have to safely ensure vernier is available and we can load the constant
@KaanOzkan KaanOzkan merged commit 35992cd into main Jan 29, 2025
7 checks passed
@KaanOzkan KaanOzkan deleted the ko/vernier branch January 29, 2025 20:25
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