@siteimprove/alfa-performance
Advanced tools
Comparing version 0.93.6 to 0.93.7
# @siteimprove/alfa-performance | ||
## 0.93.7 | ||
### Patch Changes | ||
- **Changed:** `Performance.now()` does not try to use `node:perf_hooks` anymore. ([#1704](https://github.com/Siteimprove/alfa/pull/1704)) | ||
This created problem when trying to bundle `Performance` for browsers, where `node:` imports are not available. | ||
## 0.93.6 | ||
@@ -4,0 +12,0 @@ |
import type { Thunk } from "@siteimprove/alfa-thunk"; | ||
export declare let now: Thunk<number>; | ||
export declare const now: Thunk<number>; | ||
//# sourceMappingURL=now.d.ts.map |
/// <reference lib="dom" /> | ||
import perfHooks from "node:perf_hooks"; | ||
export let now; | ||
/** | ||
* The continuations are needed to correctly handle the "this" bindings. | ||
* Eta-contracting breaks in node 19.0.0 and above. This may be linked to the | ||
* upgrade to V8 10.7. | ||
* | ||
* Date.now actually works without the eta-expansion, keeping it for | ||
* consistency. | ||
*/ | ||
if (typeof performance !== "undefined") { | ||
now = () => performance.now(); | ||
} | ||
else { | ||
try { | ||
now = () => perfHooks.performance.now(); | ||
} | ||
catch { | ||
now = () => Date.now(); | ||
} | ||
} | ||
export const now = typeof performance !== "undefined" | ||
? () => performance.now() | ||
: () => Date.now(); | ||
//# sourceMappingURL=now.js.map |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://alfa.siteimprove.com", | ||
"version": "0.93.6", | ||
"version": "0.93.7", | ||
"license": "MIT", | ||
@@ -26,6 +26,6 @@ "description": "Functionality for working with performance measurements, inspired by the User Timing specification", | ||
"dependencies": { | ||
"@siteimprove/alfa-callback": "^0.93.6", | ||
"@siteimprove/alfa-emitter": "^0.93.6", | ||
"@siteimprove/alfa-json": "^0.93.6", | ||
"@siteimprove/alfa-thunk": "^0.93.6" | ||
"@siteimprove/alfa-callback": "^0.93.7", | ||
"@siteimprove/alfa-emitter": "^0.93.7", | ||
"@siteimprove/alfa-json": "^0.93.7", | ||
"@siteimprove/alfa-thunk": "^0.93.7" | ||
}, | ||
@@ -32,0 +32,0 @@ "publishConfig": { |
12077
242