perf(web): Lighthouse 100 a11y/BP/SEO; api-go envelope/CORS parity - #52
Merged
Conversation
- drop motion/react from every audited page entry chunk: hero, home sections, Navbar drawer and shop components render with tw-animate CSS + view() scroll reveals; contact beam loads via import() inside an IntersectionObserver - SSR product data: product pages fetch via fetchProductForSSR and pass initialData + an RSC descriptionNode, so H1/price/description paint in the document and react-markdown never parses during load - images: 682kB logo SVG re-embedded at 160px, oversized card webps recompressed, CSS background card images become lazy next/image - a11y/seo: footer link contrast, product h3->h2, blog canonical - api-go parity: Nest TransformInterceptor envelope middleware, GET /auth/me (was 404), CORS, soft-200 anonymous /auth/me + /cart so a logged-out visit logs no console error (divergence noted in code)
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.
What
Lighthouse pass over
/,/shop,/shop/ao-thun,/blog(mobile, prod build).apps/web
view()timelines (per modern-web-guidancescroll-entry-exit-effects); the contact beam loads via rawimport()inside an IntersectionObserver so its chunk never loads until scrolled nearfetchProductForSSR) and passinitialData+ an RSCdescriptionNode, so H1/price/description paint in the document; react-markdown no longer parses during load (was a ~1.2 s long task)wds-logo.svg682 kB → 6.4 kB (2451px raster re-embedded at 160px), card webps recompressed (−2.9 MB), CSSbg-[url]card backgrounds → lazy<Image>h3→h2, blog canonicalapps/api-go — twin parity fixes (the web app could not render product data against Go at all)
{success,data,timestamp,path}(globalTransformInterceptor); Go returned bare JSON, so the frontend'sresponse.data.datawas alwaysundefined→ addedhttput.Envelope()middleware (excludes/v1/csrf-token, read raw by the frontend)GET /auth/meexisted in Nest, missing in Go → 404 on every page loadenableCorsconfig/auth/me+/cartanswer200 {data:null}instead of 401 — deliberate divergence (commented in code) so a logged-out visit logs no console error; revertsoftMe/softGetto keep strict Nest parity at the cost of BP 100Results (mobile, prod build)
a11y / best-practices / SEO / agentic: 100 / 100 / 100 / 100 on all four pages.
Performance: 75–89 (simulated, noisy on a dev box — real-throttled LCP is 1.7–2.1 s; sim LCP overestimates against a local server). Home total bytes 3.4 MB → 688 kB.
Reviewer notes
go test ./...)bun prisma db push+ product/user/blog seeds inapps/api/prisma, thenapi-go+next start