choojs / choo

:steam_locomotive::train: - sturdy 4kb frontend framework
https://choo.io/
MIT License
6.78k stars 595 forks source link

choo should clear performance timers #461

Open yoshuawuyts opened 7 years ago

yoshuawuyts commented 7 years ago

right now we're relying on choo-log but actually choo should be responsible. If choo-log is not used the buffer can fill up which throws an error (after 200 or so events). Given it's an assignment it can easily be overwritten so making it part of { timings: true } makes sense I think.

code

  var hasPerformance = typeof window !== 'undefined' &&
    window.performance &&
    window.performance.onresroucetimingbufferfull
  if (hasPerformance) {
    window.performance.onresourcetimingbufferfull = function () {
      window.performance.clearResourceTimings()
    }
  }
yoshuawuyts commented 7 years ago

Marked as breaking because of ecosystem impact, should be upgraded in the next major