Skip to content

chore: code-golf a bit #10893

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

Merged
merged 1 commit into from
Mar 23, 2024
Merged

chore: code-golf a bit #10893

merged 1 commit into from
Mar 23, 2024

Conversation

Rich-Harris
Copy link
Member

a few more cosmetic changes, plus a couple of small fixes:

  • tag should always be a string. If it's an Element, the variable should be element
  • node = parent.appendChild(empty()) minifies better than node = empty(); parent.appendChild(node), and often allows us to simplify code by collapsing a sequence of statements into e.g. a single ternary expression
  • we were appending an empty() to the <head> every time the <svelte:head> effect re-ran. oops
  • i broke the treeshaking script in chore: tidy up hydration code #10891. oops

Copy link

changeset-bot bot commented Mar 23, 2024

⚠️ No Changeset found

Latest commit: 87c3db1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@Rich-Harris Rich-Harris merged commit 1fc5f8b into main Mar 23, 2024
@Rich-Harris Rich-Harris deleted the golf branch March 23, 2024 19:11
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.

1 participant