Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

feat: use requestIdleCallback when possible #61

Merged
merged 2 commits into from
Jan 9, 2019

Conversation

stephenmathieson
Copy link
Member

@stephenmathieson stephenmathieson commented Jan 8, 2019

This patch builds on #59 (hat tip to @agreene-coursera!!) and uses requestIdleCallback rather than setTimeout in environments that support it. If the host environment does not support requestIdleCallback, a shim will be used (via npmjs.com/requestidlecallback).

Closes #59.

Reviewer checks

Required fields, to be filled out by PR reviewer(s)

  • Follows the commit message policy, appropriate for next version
  • Has documentation updated, a DU ticket, or requires no documentation change
  • Includes new tests, or was unnecessary
  • Code is reviewed for security by: dylanb

This patch builds on #59 (hat tip to @agreene-coursera!!) and uses `requestIdleCallback` rather than `setTimeout` in environments that support it. If the host environment does not support `requestIdleCallback`, a shim will be used (via [`npmjs.com/requestidlecallback`](https://www.npmjs.com/package/requestidlecallback)).

Closes #59.
@agreene-coursera
Copy link
Contributor

Thanks for picking up/updating the PR! (I've been on vacation and wasn't checking github for a bit)

I'm also looking into putting a new PR in axe-core to use a similar script yielding technique as the one outlined in the polyfill you linked to to yield in between rule checks since I've noticed that even with using requestIdleCallback in react-axe individual audit runs can be long enough that they can block/slow down DOM updates. Is that something that y'all would be interested in?

Copy link
Contributor

@WilcoFiers WilcoFiers left a comment

Choose a reason for hiding this comment

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

Actually, please resolve the merge conflict.

* develop:
  style: setup Prettier and format all code (#62)
@stephenmathieson stephenmathieson merged commit a9bff13 into develop Jan 9, 2019
@stephenmathieson stephenmathieson deleted the requestidlecallback branch January 9, 2019 15:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants