Skip to content

chore: Port over useTelemetry hook #122

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

michaeldowseza
Copy link
Member

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

codecov bot commented Mar 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.30%. Comparing base (c4e2bf9) to head (7edb860).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #122   +/-   ##
=======================================
  Coverage   99.30%   99.30%           
=======================================
  Files          29       30    +1     
  Lines         717      721    +4     
  Branches      195      188    -7     
=======================================
+ Hits          712      716    +4     
  Misses          5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


export function createUseTelemetry(environment: Environment) {
return (componentName: string, config?: ComponentConfiguration) => {
const isVisualRefresh = environment.alwaysVisualRefresh || useRuntimeVisualRefresh();
Copy link
Member

@just-boris just-boris Mar 18, 2025

Choose a reason for hiding this comment

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

Suggested change
const isVisualRefresh = environment.alwaysVisualRefresh || useRuntimeVisualRefresh();
const isVisualRefresh = environment.alwaysVisualRefresh ?? useRuntimeVisualRefresh();

because when alwaysVisualRefresh is false you do not want to fallback to runtime

Copy link
Member Author

Choose a reason for hiding this comment

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

In classic this value would be false in the environment file, why wouldn't we want to fallback to runtime?

Copy link
Member

Choose a reason for hiding this comment

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

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