akamai / boomerang

End user oriented web performance testing and beaconing
http://akamai.github.io/boomerang/
Other
1.86k stars 293 forks source link

History argument unused in history plugin #262

Closed gcoombe closed 5 years ago

gcoombe commented 5 years ago

I am trying to use boomerang with a react app and am finding a couple of things confusing:

  1. When inspecting the code it seems like the history argument is unused now: https://github.com/akamai/boomerang/blob/master/plugins/history.js#L373 do we still need to be passing this in?
  2. I am not totally sure when I should be setting the hadRouteChange flag. The docs use onEnter which is no longer in use in react-router 4. https://github.com/ReactTraining/react-router/blob/master/packages/react-router/docs/guides/migrating.md#on-properties . Is this supposed to represent if the route has changed (ex: loaded "#/overview" and has since changed to "#/details") or if the initial route has completed rendering?

Any assistance on these questions would be helpful. I am finding it difficult to get the initial spa_hard event firing and answers to these questions would help me narrow down the cause. I get an event if I pass true to hadRouteChange but not if I pass false.

querymetrics commented 5 years ago
  1. The argument is no longer used and can be omitted.
  2. The hadRouteChange should be set to true when Boomerang arrived on the page too late to capture the React Router event. If we don't let Boomerang know that the route had already changed and was missed then it will wait until the next route triggers (which will be a soft nav).

You can skip the React specific setup and let the History plugin handle the spa hard beacon for you. In your config add {"History": {"enabled": true, "auto": true}}

gcoombe commented 5 years ago

Great thanks! Looking through the code it seemed like I could set auto to true but wanted to double check.