serlo / frontend

Next.js app that serves serlo.org
https://serlo.org
Apache License 2.0
36 stars 9 forks source link

try to improve INP #3873

Closed elbotho closed 1 month ago

elbotho commented 1 month ago

Problem: Interaction to Next Paint (INP) is quite slow when the solution of an exercise is long.

Approach: Toggling the solutions with css display instead of rendering solution on click improves this (but might cause long exercise collection to load slower overall?)

@hejtful, @Entkenntnis Review not really needed, but maybe you have other suggestions :)

pages to check after some time:

https://pagespeed.web.dev/analysis/https-de-serlo-org-mathe-78918-aufgaben-zum-l%C3%B6sen-linearer-gleichungssysteme/od8fl8oird?utm_source=search_console&form_factor=mobile&hl=de

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
frontend ✅ Ready (Inspect) Visit Preview Jun 10, 2024 11:05am
github-actions[bot] commented 1 month ago

📦 Next.js Bundle Analysis for @serlo/frontend

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 103.83 KB (-1 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Seven Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/___editor_preview 483.53 KB (🟡 +18 B) 587.36 KB
/entity/create/[type]/[taxonomyId] 484.92 KB (🟡 +17 B) 588.75 KB
/entity/repository/add-revision/[...id] 484.21 KB (🟡 +16 B) 588.04 KB
/page/create 484.2 KB (🟡 +16 B) 588.03 KB
/taxonomy/term/create/[parent_id]/[id] 483.97 KB (🟡 +16 B) 587.8 KB
/taxonomy/term/update/[id] 483.92 KB (🟡 +15 B) 587.75 KB
/user/settings 482.88 KB (🟡 +16 B) 586.71 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.