Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update client check for smaller bundle size #12975

Merged
merged 1 commit into from
Aug 22, 2024
Merged

Conversation

benmccann
Copy link
Member

@benmccann benmccann commented Aug 22, 2024

I noticed that we were doing a typeof window !== 'undefined' check in the client output, which seems unnecessary to me. If we use esm-env the bundler will replace BROWSER with true and should eliminate the unused branches.

Do we even need this check though? I notice client in the directory name...

Copy link

changeset-bot bot commented Aug 22, 2024

🦋 Changeset detected

Latest commit: d8f59fd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Rich-Harris
Copy link
Member

It's used by things like spring which are present in both environments, so yes. The code could probably be moved somewhere better but we can worry about that another time

@Rich-Harris Rich-Harris merged commit 448f216 into main Aug 22, 2024
9 checks passed
@Rich-Harris Rich-Harris deleted the window-check branch August 22, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants