-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: store getComputedStyle result to avoid redoing that work (#1048)
Co-authored-by: eps1lon <sebastian.silbermann@vercel.com>
- Loading branch information
1 parent
8ba404d
commit d9ad334
Showing
4 changed files
with
75 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"dom-accessibility-api": minor | ||
--- | ||
|
||
Cache `window.getComputedStyle` results | ||
|
||
Should improve performance in environments that don't cache these results natively e.g. JSDOM. | ||
This increases memory usage. | ||
If this results in adverse effects (e.g. resource constrained browser environments), please file an issue. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
declare global { | ||
class Map<K, V> { | ||
// es2015.collection.d.ts | ||
clear(): void; | ||
delete(key: K): boolean; | ||
forEach( | ||
callbackfn: (value: V, key: K, map: Map<K, V>) => void, | ||
thisArg?: unknown, | ||
): void; | ||
get(key: K): V | undefined; | ||
has(key: K): boolean; | ||
set(key: K, value: V): this; | ||
readonly size: number; | ||
} | ||
} | ||
|
||
// we need to export something here to make this file a module, but don't want to | ||
// actually include a polyfill because it's potentially significantly slower than | ||
// the native implementation | ||
export {}; |