frontend icon indicating copy to clipboard operation
frontend copied to clipboard

refactor(editor): less imports from frontend

Open elbotho opened this issue 1 year ago • 2 comments

Part of PE-157

This duplicates some helpers and simple components to reduce the number of imports from apps/web a lot. I considered creating an additional shared package, but I think duplicating is smarter right now because it brings flexibility (and is simpler).

It's probably not necessary to actually review the code changes, but pleast test if building the editor for integrations still works as expected.

Also all remaining imports from frontend now use @serlo/frontend/src/* (no more @/* imports right now). This makes it easier to find the 50 occurences (down from 390).

What is left?

  • main toolbar (save, undo/redo…)
  • ~i18n~ (see https://github.com/serlo/frontend/pull/4155)
  • serlo specific features (AnchorLinkCopyTool, TemplatePlugins, PrivacyWrapper, experiments, page plugins, Quickbar to search serlo content, …)
  • (and some other stuff)

elbotho avatar Sep 27 '24 19: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 4, 2024 11:11am

vercel[bot] avatar Sep 27 '24 19:09 vercel[bot]

📦 Next.js Bundle Analysis for @serlo/frontend

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

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 104.59 KB (🟡 +66 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.03 KB (🟡 +1.58 KB) 190.61 KB
/404 42.8 KB (🟡 +1.83 KB) 147.38 KB
/500 42.79 KB (🟡 +1.83 KB) 147.38 KB
/[...slug] 86.85 KB (🟡 +2.13 KB) 191.44 KB
/___bot_or_not 101.32 KB (🟡 +1.83 KB) 205.9 KB
/___cf_not_found 41.03 KB (🟡 +1.83 KB) 145.62 KB
/___design 146.34 KB (🟡 +1.83 KB) 250.92 KB
/___editor_preview 560.51 KB (🟡 +13.09 KB) 665.09 KB
/___old_comments 103.63 KB (🟡 +1.83 KB) 208.22 KB
/auth/___activate_vidis 42.21 KB (🟡 +1.84 KB) 146.8 KB
/auth/error 66.64 KB (🟡 +1.83 KB) 171.22 KB
/auth/login 95.05 KB (🟡 +1.84 KB) 199.64 KB
/auth/logout 85.07 KB (🟡 +1.83 KB) 189.65 KB
/auth/oauth/consent 58.9 KB (🟡 +1.83 KB) 163.49 KB
/auth/oauth/login 95.05 KB (🟡 +1.83 KB) 199.64 KB
/auth/oauth/logout 85.07 KB (🟡 +1.84 KB) 189.66 KB
/auth/recovery 76.55 KB (🟡 +1.83 KB) 181.14 KB
/auth/registration 77.47 KB (🟡 +1.83 KB) 182.06 KB
/auth/settings 77.57 KB (🟡 +1.83 KB) 182.16 KB
/auth/verification 76.88 KB (🟡 +1.84 KB) 181.47 KB
/authorization/roles 70.75 KB (🟡 +1.92 KB) 175.34 KB
/backend 43.09 KB (🟡 +1.83 KB) 147.68 KB
/biologie 163.49 KB (🟡 +1.13 KB) 268.08 KB
/chemie 163.49 KB (🟡 +1.13 KB) 268.08 KB
/consent 41.62 KB (🟡 +1.83 KB) 146.21 KB
/content-only/[...slug] 78.93 KB (🟡 +2.13 KB) 183.52 KB
/discussions 100.56 KB (🟡 +1.83 KB) 205.15 KB
/editor 79.73 KB (🟡 +2.11 KB) 184.32 KB
/entity/create/[type]/[taxonomyId] 562.77 KB (🟡 +13.09 KB) 667.36 KB
/entity/license/update/[id] 60.92 KB (🟡 +1.93 KB) 165.5 KB
/entity/repository/add-revision/[...id] 562.45 KB (🟡 +13.09 KB) 667.04 KB
/entity/repository/compare/[entity_id]/[revision_id] 91.63 KB (🟡 +2.11 KB) 196.22 KB
/entity/repository/history/[id] 74.25 KB (🟡 +1.83 KB) 178.84 KB
/entity/taxonomy/update/[id] 73.4 KB (🟡 +1.91 KB) 177.99 KB
/entity/unrevised 48.29 KB (🟡 +2.26 KB) 152.88 KB
/event/history 135.16 KB (🟡 +823 B) 239.74 KB
/event/history/[...slug] 136.15 KB (🟡 +854 B) 240.74 KB
/event/history/user/profile/[username] 139.02 KB (🟡 +1.35 KB) 243.61 KB
/gleichungs-app 165.11 KB (🟡 +1.83 KB) 269.7 KB
/informatik 163.49 KB (🟡 +1.13 KB) 268.08 KB
/jobs/[[...jobId]] 52.31 KB (🟡 +1.83 KB) 156.9 KB
/legal 41.1 KB (🟡 +1.83 KB) 145.69 KB
/lerntipps 163.49 KB (🟡 +1.13 KB) 268.08 KB
/license/detail/[id] 66.85 KB (🟡 +2.11 KB) 171.44 KB
/mathe 163.49 KB (🟡 +1.13 KB) 268.08 KB
/mathe-aufgaben 41.82 KB (🟡 +1.83 KB) 146.4 KB
/mathe-pruefungen/[region] 78.17 KB (🟡 +1.83 KB) 182.76 KB
/metadata 50.9 KB (🟡 +1.94 KB) 155.49 KB
/nachhaltigkeit 163.5 KB (🟡 +1.13 KB) 268.08 KB
/page/create 562.46 KB (🟡 +13.09 KB) 667.05 KB
/pages 62.23 KB (🟡 +1.93 KB) 166.82 KB
/privacy 44.74 KB (🟡 +2.13 KB) 149.33 KB
/search 43.09 KB (🟡 +1.83 KB) 147.68 KB
/spenden 55.38 KB (🟡 +1.83 KB) 159.97 KB
/subscriptions/manage 118.16 KB (🟡 +1006 B) 222.75 KB
/taxonomy/term/[copyOrMove]/batch/[id] 76.03 KB (🟡 +1.92 KB) 180.62 KB
/taxonomy/term/create/[parent_id]/[id] 562.19 KB (🟡 +13.09 KB) 666.78 KB
/taxonomy/term/sort/entities/[id] 97.74 KB (🟡 +1.84 KB) 202.33 KB
/taxonomy/term/update/[id] 562.11 KB (🟡 +13.09 KB) 666.7 KB
/terms 41.12 KB (🟡 +1.83 KB) 145.71 KB
/user/[...userslug] 40.92 KB (🟡 +1.83 KB) 145.51 KB
/user/me 40.91 KB (🟡 +1.83 KB) 145.5 KB
/user/notifications 137.47 KB (🟡 +914 B) 242.05 KB
/user/profile/[username] 186.48 KB (🟡 +1.2 KB) 291.07 KB
/user/settings 561.31 KB (🟡 +13.08 KB) 665.9 KB
/uuid/recycle-bin 91.05 KB (🟡 +1.92 KB) 195.64 KB
/wallet 43.69 KB (🟡 +1.83 KB) 148.28 KB
/willkommen 88.04 KB (🟡 +1.62 KB) 192.62 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 Sep 27 '24 19:09 github-actions[bot]