This PR improves the performance of doiuse in two ways, making it run 3-10 times faster:
Cache the result of BrowserSelection.missingSupport(), since compiling the list of missing features is an expensive operation. This improves performance when the postcss plugin is run over multiple CSS files, like when linting an entire codebase.
Refactor Detector to flatten and normalise all feature checks during initialization, rather than using expensive Object.entries operations to parse the rules at every node in the syntax tree.
This PR improves the performance of
doiuse
in two ways, making it run 3-10 times faster:BrowserSelection.missingSupport()
, since compiling the list of missing features is an expensive operation. This improves performance when the postcss plugin is run over multiple CSS files, like when linting an entire codebase.Detector
to flatten and normalise all feature checks during initialization, rather than using expensiveObject.entries
operations to parse the rules at every node in the syntax tree.missingSupport
Detector