Skip to content

Conversation

@wizardlyhel
Copy link

@wizardlyhel wizardlyhel commented Apr 19, 2022

Description

Performance tracking has been broken in latest Hydrogen release. This PR is to:

  • Fix performance tracking
  • Make performance tracking an optional implementation from the developer's end
  • Make performance data available to subscribe from ClientAnalytics
  • Rename Boomerang to PerformanceMetrics

Additional context


Before submitting the PR, please make sure you do the following:

  • Read the Contributing Guidelines
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123)
  • Update docs in this repository according to your change
  • Run yarn changeset add if this PR cause a version bump based on Keep a Changelog and adheres to Semantic Versioning

@wizardlyhel wizardlyhel marked this pull request as ready for review April 21, 2022 22:48
@github-actions

This comment has been minimized.

}
);
}
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Could maybe add an empty dep array [] and also return a function that cleans up the subscribe?

Copy link
Author

Choose a reason for hiding this comment

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

I can't - it still double executes. It's either this or that useRef trick documented

Copy link
Contributor

Choose a reason for hiding this comment

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

That's due to StrictMode, correct? If so, it won't double execute in a real build; only in dev mode.

Copy link
Author

Choose a reason for hiding this comment

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

I don't want this to double execute, even in dev. Double firing of analytics should never happen no matter where you are.

Copy link
Contributor

@mcvinci mcvinci left a comment

Choose a reason for hiding this comment

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

Thanks for these updates, @wizardlyhel! I added a couple suggestions. Open to your thoughts!

Copy link
Contributor

@jplhomer jplhomer left a comment

Choose a reason for hiding this comment

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

I like the optionality. It adds more to the template, but it's a similar pattern to what Remix does for their root entrypoint.

Helen Lin and others added 2 commits May 4, 2022 13:27
@wizardlyhel wizardlyhel merged commit 0a15376 into v1.x-2022-07 May 4, 2022
@wizardlyhel wizardlyhel deleted the boomerang-tracking branch May 4, 2022 20:47
blittle added a commit that referenced this pull request May 9, 2022
* v1.x-2022-07:
  Fix stale product options (#1210)
  Upgrade body-parser in hydrogen package (#1232)
  Add new options to Money and useMoney (#1215)
  fix links (#1229)
  Update turbo and instructions for developing `dev` (#1225)
  Heck - deploy all branches to Oxygen
  add context for initialvariantid (#1217)
  Build chunks are inside assets folder (#1211)
  Upgraded to SFAPI 2022-07 (#1214)
  [ci] release v1.x-2022-07 (#1205)
  Make this a patch instead of minor
  add references to video in file_reference block (#1197)
  Laying the foundation for building components in isolation (#1188)
  Make metafields optional within the ProductProvider. Fixes #1127 (#1209)
  Add README to /templates directory (#1163)
  fix perf tracking and make it optional from developer's end (#1096)
  docs fixes (#1204)
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.

5 participants