Add layout thrashing guide with real-world GSAP bug case study#92
Open
matiasperz wants to merge 2 commits intomainfrom
Open
Add layout thrashing guide with real-world GSAP bug case study#92matiasperz wants to merge 2 commits intomainfrom
matiasperz wants to merge 2 commits intomainfrom
Conversation
New log entry covering layout thrashing: what it is, how browser rendering works, a real bug we found (674 forced reflows from GSAP animating `top` instead of transforms), the fix, and rules of thumb for avoiding it. https://claude.ai/code/session_01MVjb1XFW37rx3xo8WKMFtZ
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Cover the 1,010 forced reflows from GSAP's attr plugin calling setAttribute on SVG gradient geometry, and the fix using CSS custom properties + style.setProperty() to batch updates. https://claude.ai/code/session_01MVjb1XFW37rx3xo8WKMFtZ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a comprehensive guide documenting layout thrashing—a critical performance issue where JavaScript forces synchronous layout recalculations. The guide includes a real bug we discovered and fixed in our codebase involving GSAP animations and SVG DOM updates.
Key Changes
content/logs/09-wtf-is-layout-thrashing.mdxtopproperty while SVG paths were being updatedtop/leftwith GSAP'sy/xwhich usetransform: translate())Notable Implementation Details
https://claude.ai/code/session_01MVjb1XFW37rx3xo8WKMFtZ
Greptile Summary
Adds a comprehensive guide on layout thrashing—a critical browser performance issue where JavaScript forces synchronous layout recalculations. The post documents a real production bug discovered in the codebase where GSAP animations triggered 674 forced reflows in 11 seconds.
Key highlights:
topproperty while updating SVG pathstop/leftwith GSAP'sy/x(which usetransform: translate())The content is well-structured with flowcharts, code comparisons, and a reference table. Technical accuracy is solid—correctly explains why transforms don't require layout recalculation while positioned properties do.
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 3652e47