Skip to content

Commit

Permalink
chore: update client check for smaller bundle size (#12975)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored Aug 22, 2024
1 parent b579c5c commit 448f216
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-ears-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

chore: update client check for smaller bundle size
6 changes: 3 additions & 3 deletions packages/svelte/src/internal/client/timing.js
Original file line number Diff line number Diff line change
@@ -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';

const request_animation_frame = is_client ? requestAnimationFrame : noop;
const request_animation_frame = BROWSER ? requestAnimationFrame : noop;

const now = is_client ? () => performance.now() : () => Date.now();
const now = BROWSER ? () => performance.now() : () => Date.now();

/** @type {Raf} */
export const raf = {
Expand Down

0 comments on commit 448f216

Please sign in to comment.