Skip to content

Commit 448f216

Browse files
authored
chore: update client check for smaller bundle size (#12975)
1 parent b579c5c commit 448f216

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/rare-ears-agree.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
chore: update client check for smaller bundle size

packages/svelte/src/internal/client/timing.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/** @import { Raf } from '#client' */
22
import { noop } from '../shared/utils.js';
33

4-
const is_client = typeof window !== 'undefined';
4+
import { BROWSER } from 'esm-env';
55

6-
const request_animation_frame = is_client ? requestAnimationFrame : noop;
6+
const request_animation_frame = BROWSER ? requestAnimationFrame : noop;
77

8-
const now = is_client ? () => performance.now() : () => Date.now();
8+
const now = BROWSER ? () => performance.now() : () => Date.now();
99

1010
/** @type {Raf} */
1111
export const raf = {

0 commit comments

Comments
 (0)