frontend icon indicating copy to clipboard operation
frontend copied to clipboard

refactor(editor): move localStorage saving to editor

Open elbotho opened this issue 1 year ago • 1 comments

part of PE-155

elbotho avatar Sep 28 '24 14:09 elbotho

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

Name Status Preview Updated (UTC)
frontend ✅ Ready (Inspect) Visit Preview Oct 8, 2024 11:29am

vercel[bot] avatar Sep 28 '24 14:09 vercel[bot]

📦 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 104.55 KB (🟢 -22 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!

Sixty-eight Pages Changed Size

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

Page Size (compressed) First Load
/ 86.02 KB (-4 B) 190.57 KB
/404 42.79 KB (-4 B) 147.34 KB
/500 42.79 KB (-4 B) 147.34 KB
/[...slug] 86.79 KB (🟡 +18 B) 191.33 KB
/___bot_or_not 101.25 KB (🟡 +18 B) 205.79 KB
/___cf_not_found 41.03 KB (-4 B) 145.57 KB
/___design 146.33 KB (-4 B) 250.88 KB
/___editor_preview 560.95 KB (🟡 +302 B) 665.5 KB
/___old_comments 103.63 KB (-4 B) 208.18 KB
/auth/___activate_vidis 42.21 KB (-4 B) 146.76 KB
/auth/error 66.63 KB (-4 B) 171.18 KB
/auth/login 95.04 KB (-4 B) 199.59 KB
/auth/logout 85.06 KB (-4 B) 189.61 KB
/auth/oauth/consent 58.9 KB (-4 B) 163.45 KB
/auth/oauth/login 95.05 KB (-4 B) 199.6 KB
/auth/oauth/logout 85.07 KB (-4 B) 189.62 KB
/auth/recovery 76.54 KB (-4 B) 181.09 KB
/auth/registration 77.46 KB (-4 B) 182.01 KB
/auth/settings 77.56 KB (-4 B) 182.11 KB
/auth/verification 76.88 KB (-4 B) 181.43 KB
/authorization/roles 70.75 KB (-4 B) 175.3 KB
/backend 43.09 KB (-4 B) 147.64 KB
/biologie 155.36 KB (🟡 +18 B) 259.9 KB
/chemie 155.35 KB (🟡 +18 B) 259.9 KB
/consent 41.62 KB (-4 B) 146.17 KB
/content-only/[...slug] 78.86 KB (🟡 +18 B) 183.41 KB
/discussions 100.56 KB (-4 B) 205.11 KB
/editor 79.66 KB (🟡 +17 B) 184.2 KB
/entity/create/[type]/[taxonomyId] 563.15 KB (🟡 +244 B) 667.7 KB
/entity/license/update/[id] 60.91 KB (-4 B) 165.46 KB
/entity/repository/add-revision/[...id] 562.83 KB (🟡 +241 B) 667.38 KB
/entity/repository/compare/[entity_id]/[revision_id] 91.56 KB (🟡 +18 B) 196.11 KB
/entity/repository/history/[id] 74.25 KB (-4 B) 178.8 KB
/entity/taxonomy/update/[id] 73.4 KB (-4 B) 177.94 KB
/entity/unrevised 48.29 KB (-4 B) 152.84 KB
/event/history 127.08 KB (-4 B) 231.63 KB
/event/history/[...slug] 128.08 KB (-4 B) 232.63 KB
/event/history/user/profile/[username] 130.95 KB (-4 B) 235.5 KB
/gleichungs-app 165.11 KB (-4 B) 269.65 KB
/informatik 155.36 KB (🟡 +18 B) 259.91 KB
/jobs/[[...jobId]] 52.29 KB (🟢 -15 B) 156.84 KB
/legal 41.09 KB (-4 B) 145.64 KB
/lerntipps 155.35 KB (🟡 +18 B) 259.9 KB
/license/detail/[id] 66.78 KB (🟡 +18 B) 171.33 KB
/mathe 155.35 KB (🟡 +18 B) 259.9 KB
/mathe-aufgaben 41.81 KB (-4 B) 146.36 KB
/mathe-pruefungen/[region] 78.17 KB (-4 B) 182.72 KB
/metadata 50.9 KB (-4 B) 155.45 KB
/nachhaltigkeit 155.36 KB (🟡 +18 B) 259.91 KB
/page/create 562.85 KB (🟡 +242 B) 667.39 KB
/pages 62.22 KB (-4 B) 166.77 KB
/privacy 44.73 KB (-4 B) 149.28 KB
/search 43.09 KB (-4 B) 147.63 KB
/spenden 55.37 KB (-4 B) 159.92 KB
/subscriptions/manage 110.09 KB (-4 B) 214.64 KB
/taxonomy/term/[copyOrMove]/batch/[id] 76.02 KB (-4 B) 180.57 KB
/taxonomy/term/create/[parent_id]/[id] 562.58 KB (🟡 +249 B) 667.13 KB
/taxonomy/term/sort/entities/[id] 97.74 KB (-4 B) 202.29 KB
/taxonomy/term/update/[id] 562.5 KB (🟡 +249 B) 667.05 KB
/terms 41.12 KB (-4 B) 145.67 KB
/user/[...userslug] 40.92 KB (-4 B) 145.47 KB
/user/me 40.91 KB (-4 B) 145.46 KB
/user/notifications 129.4 KB (-4 B) 233.94 KB
/user/profile/[username] 178.34 KB (🟡 +18 B) 282.89 KB
/user/settings 561.73 KB (🟡 +277 B) 666.28 KB
/uuid/recycle-bin 84.46 KB (-4 B) 189.01 KB
/wallet 43.68 KB (-4 B) 148.23 KB
/willkommen 88.03 KB (-4 B) 192.58 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.

github-actions[bot] avatar Oct 08 '24 08:10 github-actions[bot]

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ QuotaExceededError: Failed to execute 'setItem' on 'Storage': Setting the value of 'serlo-editor' exceeded the quota. storeStateToLocalStorage(packages/editor/src/ed... View Issue
  • ‼️ QuotaExceededError: Failed to execute 'setItem' on 'Storage': Setting the value of 'serlo-editor' exceeded the quota. storeStateToLocalStorage(packages/editor/src/ed... View Issue

Did you find this useful? React with a 👍 or 👎

sentry[bot] avatar Oct 11 '24 13:10 sentry[bot]

In serlo-editor-as-lti-tool we are in an iframe so window.location.pathname would give us the same value /app everywhere. I have not checked the implementation thoroughly, but I think this might break thinks?

LarsTheGlidingSquirrel avatar Nov 04 '24 10:11 LarsTheGlidingSquirrel