Repository navigation
feat(browser): Extract long task and LoAF tracking into longTasksIntegration - #26260
Conversation
size-limit report 📦Compared: 651378b (PR test merge using develop at 1423338) Against: 4202227 (develop) · base run #66528
|
Optional E2E testsSome optional checks were not successful. They do not block the merge. 1 not successful, 27 successful. See the run.
Successful checks
|
1091699 to
b151846
Compare
|
@BugBot run |
b151846 to
23fbb27
Compare
|
|
||
| // oxlint-disable-next-line typescript/no-deprecated -- still honoured until it is removed | ||
| const { enableInp = true, webVitals } = options; | ||
| const { enableInp = true, webVitals, enableLongTask = true, enableLongAnimationFrame = true } = options; |
There was a problem hiding this comment.
these default to true now when they're explicitly set to undefined whereas before, we ...spread them, leaving them at undefined. idk if it's a huge concern, and it might even make more sense to say "undefined == default behavior".
There was a problem hiding this comment.
Yea we don't want to change the semantics here, thanks for catching this!
…egration` `browserTracingIntegration` registers it by default, so nothing changes for its users. `browserTracingCoreIntegration` users only bundle it when they add it.
9bd4d53 to
33f13a0
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 33f13a0. Configure here.
| const INTEGRATION_NAME = 'LongTasks'; | ||
|
|
||
| const _longTasksIntegration = ((options: LongTasksOptions = {}) => { | ||
| const { enableLongTask = true, enableLongAnimationFrame = true } = options; |
There was a problem hiding this comment.
Undefined flags re-enable tracking
Low Severity
DEFAULT_FORWARDED_OPTIONS is spread so an explicit undefined for enableLongTask or enableLongAnimationFrame stays undefined, matching the old falsy behavior. Those values are then passed into longTasksIntegration, whose destructuring defaults turn undefined back into true. A mixed setting such as enableLongAnimationFrame: undefined with enableLongTask left at the default therefore tracks LoAF again instead of falling through to long tasks.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 33f13a0. Configure here.


Long task and LoAF tracking was always bundled with browser tracing. This PR moves the logic to a new
longTasksIntegration, whichbrowserTracingIntegrationregisters by default.I added a test that it's registered unless both long task options are off.
longTasksIntegrationadds ~742 B gzip on top ofbrowserTracingCoreIntegration.