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

Batch fixed position style updates #337

Merged
merged 1 commit into from
May 7, 2024

Conversation

rortan134
Copy link
Contributor

@rortan134 rortan134 commented May 5, 2024

Updating multiple inline styles at once can be done more efficiently with Object.assign. This portion of code was causing quite a few recalculation renders on some browsers

image

Copy link

vercel bot commented May 5, 2024

@rortan134 is attempting to deploy a commit to the emil Team on Vercel.

A member of the Team first needs to authorize it.

export function set(el?: Element | HTMLElement | null, styles?: Style, ignoreCache = false) {
if (!el || !(el instanceof HTMLElement) || !styles) return;
export function set(el: Element | HTMLElement | null | undefined, styles: Style, ignoreCache = false) {
if (!el || !(el instanceof HTMLElement)) return;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

styles is always defined in the codebase so this check is redundant

@emilkowalski emilkowalski merged commit d3c1cee into emilkowalski:main May 7, 2024
1 of 2 checks passed
@rortan134 rortan134 deleted the fixed-perf branch May 7, 2024 11:26
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.

None yet

2 participants