We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b579c5c commit 448f216Copy full SHA for 448f216
.changeset/rare-ears-agree.md
@@ -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
@@ -1,11 +1,11 @@
/** @import { Raf } from '#client' */
import { noop } from '../shared/utils.js';
-const is_client = typeof window !== 'undefined';
+import { BROWSER } from 'esm-env';
6
-const request_animation_frame = is_client ? requestAnimationFrame : noop;
+const request_animation_frame = BROWSER ? requestAnimationFrame : noop;
7
8
-const now = is_client ? () => performance.now() : () => Date.now();
+const now = BROWSER ? () => performance.now() : () => Date.now();
9
10
/** @type {Raf} */
11
export const raf = {
0 commit comments