-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
chore: shave off more bytes #9540
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -2225,7 +2225,6 @@ function each(anchor_node, collection, flags, key_fn, render_fn, fallback_fn, re | |||
block.d = null; | |||
} | |||
let anchor = block.a; | |||
const is_controlled = (block.f & EACH_IS_CONTROLLED) !== 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these flags change in between?
Function already closes over block
so this shouldn't really affect perf I think, lmk if it changes anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flag can change FWIW. It’s not static, and can change from transitions being enabled, that turn this off
} | ||
signal.f ^= status; | ||
} | ||
signal.f = (signal.f & STATUS_MASK) | status; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reduces both the code size and the bytecode: https://javascript.godbolt.org/z/xTrY7KTe4
I can't read the bytecode lol so verify that it doesn't affect perf negatively
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
drop 631 bytes, 301 gzipped
Svelte 5 rewrite
Please note that the Svelte codebase is currently being rewritten for Svelte 5. Changes should target Svelte 5, which lives on the default branch (
main
).If your PR concerns Svelte 4 (including updates to svelte.dev.docs), please ensure the base branch is
svelte-4
and notmain
.Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests and linting
pnpm test
and lint the project withpnpm lint