chore: add changeset and comment (#14040)

for #14026
pull/14041/head
Ben McCann 6 days ago committed by GitHub
parent 8a2c97a7b8
commit 217e40998a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: don't access `requestAnimationFrame` until needed to reduce need for mocks during testing

@ -7,6 +7,9 @@ const now = BROWSER ? () => performance.now() : () => Date.now();
/** @type {Raf} */
export const raf = {
// don't access requestAnimationFrame eagerly outside method
// this allows basic testing of user code without JSDOM
// bunder will eval and remove ternary when the user's app is built
tick: /** @param {any} _ */ (_) => (BROWSER ? requestAnimationFrame : noop)(_),
now: () => now(),
tasks: new Set()

Loading…
Cancel
Save