Repository navigation
perf(landing): paint the hero without waiting for JavaScript - #241
Merged
Merged
Conversation
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.
Problem
With JavaScript disabled at 390x844, all 27
.revealblocks stayed atopacity: 0, including.hero-sub, which is the LCP element. The page rendered blank. With JS enabled the hero waited for the script plus the.d1to.d5delays (up to 450 ms), which matches the 947 ms render delay Lighthouse reported on a 2.0 s LCP.Changes
landing/index.html: the hero (eyebrow, h1, subtitle, actions, facts and sync widget) no longer carriesrevealor the delay classes, so it paints with the HTML and CSS.<noscript>block after the stylesheet makes every.revealblock visible when scripts are off.styles.css?v=10,app.js?v=12.Below-the-fold sections keep the scroll animation when JS is available.
Verification
/tmp/opencode/verify-nxs-nojs.js, 22/22 twice: without JS at 360 and 390 px, 0 of 27 blocks hidden, subtitle at opacity 1, h1 painted, no overflow; with JS at 360, 390 and 1280 px, subtitle visible immediately, the last below-fold block still starts hidden and animates in on scroll, no console errors.Deployed and checked on https://nextsync.cloudless.club/ (production serves the
noscriptblock).Closes #239