frontend icon indicating copy to clipboard operation
frontend copied to clipboard

feat: enable exercises plugin in some content types, refactor serlo exercise Id code

Open elbotho opened this issue 1 year ago • 2 comments

inspired by https://github.com/serlo/frontend/pull/3754 with a little bit different approach

Exercise Plugin in Editor Plugin suggestions

  • Exercises are enabled in articles, courses, preview pages, etc …

Context

  • ExerciseGroupIdContext is now ExerciseIdsContext and additionally provides:
    • exerciseEntityId (if the exercise is actually a standalone serlo entity)
    • exerciseTrackingId (for the constructed Id that is only used for evaluation)

I hope this way we can avoid confusion here

Comments The comments inside solutions is now only shown on exercises (not exerciseGroups) that are actually entites. Otherwise we always show a link:

  • for injected exerciseGroups (entites): link to the comment section of the standalone view of the exercise (new tab)
  • for exercises/groups in the content of an article/coursePage: scroll to comment section of current page

Follow ups from https://github.com/serlo/frontend/pull/3754 still make sense.

elbotho avatar May 10 '24 12:05 elbotho

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

Name Status Preview Updated (UTC)
frontend ✅ Ready (Inspect) Visit Preview May 10, 2024 0:46am

vercel[bot] avatar May 10 '24 12:05 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 103.75 KB (🟢 -11 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-two Pages Changed Size

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

Page Size (compressed) First Load
/ 84.92 KB (🟡 +3 B) 188.67 KB
/404 38.01 KB (🟡 +3 B) 141.76 KB
/500 38.01 KB (🟡 +3 B) 141.76 KB
/[...slug] 82.95 KB (🟡 +29 B) 186.7 KB
/___bot_or_not 95.81 KB (🟡 +22 B) 199.56 KB
/___cf_not_found 36.72 KB (🟡 +3 B) 140.46 KB
/___design 142.06 KB (🟡 +3 B) 245.8 KB
/___editor_preview 482.9 KB (🟡 +111 B) 586.65 KB
/___old_comments 99.65 KB (🟢 -71 B) 203.4 KB
/auth/error 60.23 KB (🟡 +3 B) 163.98 KB
/auth/login 85.4 KB (🟡 +3 B) 189.15 KB
/auth/logout 78.77 KB (🟡 +3 B) 182.52 KB
/auth/oauth/consent 54.5 KB (🟡 +3 B) 158.25 KB
/auth/oauth/login 85.41 KB (🟡 +3 B) 189.15 KB
/auth/oauth/logout 78.78 KB (🟡 +3 B) 182.53 KB
/auth/recovery 66.95 KB (🟡 +3 B) 170.69 KB
/auth/registration 67.87 KB (🟡 +3 B) 171.62 KB
/auth/settings 67.96 KB (🟡 +3 B) 171.71 KB
/auth/verification 67.29 KB (🟡 +3 B) 171.03 KB
/authorization/roles 66.28 KB (-3 B) 170.03 KB
/backend 38.77 KB (🟡 +3 B) 142.52 KB
/biologie 157.83 KB (🟡 +31 B) 261.57 KB
/chemie 157.82 KB (🟡 +31 B) 261.57 KB
/consent 37.27 KB (🟡 +3 B) 141.01 KB
/content-only/[...slug] 74.44 KB (🟡 +30 B) 178.19 KB
/discussions 96.15 KB (🟡 +177 B) 199.9 KB
/editor 104.14 KB (🟡 +27 B) 207.88 KB
/entity/create/[type]/[taxonomyId] 483.86 KB (🟡 +111 B) 587.61 KB
/entity/license/update/[id] 56.44 KB (🟡 +3 B) 160.19 KB
/entity/link/order/[id]/link 89.71 KB (🟡 +3 B) 193.45 KB
/entity/repository/add-revision/[...id] 483.14 KB (🟡 +117 B) 586.89 KB
/entity/repository/compare/[entity_id]/[revision_id] 85.94 KB (🟡 +28 B) 189.68 KB
/entity/repository/history/[id] 69.65 KB (-4 B) 173.4 KB
/entity/taxonomy/update/[id] 69.03 KB (-4 B) 172.78 KB
/entity/unrevised 43.55 KB (🟡 +3 B) 147.3 KB
/gleichungs-app 163.03 KB (🟡 +3 B) 266.78 KB
/informatik 157.83 KB (🟡 +31 B) 261.57 KB
/jobs/[[...jobId]] 50.79 KB (🟡 +4 B) 154.53 KB
/legal 36.74 KB (🟡 +3 B) 140.49 KB
/lerntipps 157.82 KB (🟡 +31 B) 261.57 KB
/license/detail/[id] 58.01 KB (🟡 +27 B) 161.75 KB
/mathe 157.82 KB (🟡 +31 B) 261.57 KB
/mathe-aufgaben 37.45 KB (🟡 +3 B) 141.19 KB
/mathe-pruefungen/[region] 76.18 KB (🟡 +3 B) 179.93 KB
/metadata 46.39 KB (🟡 +3 B) 150.14 KB
/nachhaltigkeit 157.83 KB (🟡 +31 B) 261.58 KB
/page/create 483.15 KB (🟡 +113 B) 586.89 KB
/pages 57.76 KB (🟡 +3 B) 161.51 KB
/privacy 40.08 KB (🟡 +3 B) 143.83 KB
/search 41.06 KB (🟡 +3 B) 144.8 KB
/spenden 51.68 KB (🟡 +3 B) 155.42 KB
/taxonomy/term/[copyOrMove]/batch/[id] 71.61 KB (-4 B) 175.36 KB
/taxonomy/term/create/[parent_id]/[id] 482.92 KB (🟡 +118 B) 586.67 KB
/taxonomy/term/sort/entities/[id] 93.57 KB (🟡 +3 B) 197.31 KB
/taxonomy/term/update/[id] 482.86 KB (🟡 +119 B) 586.61 KB
/terms 36.76 KB (🟡 +3 B) 140.51 KB
/user/[...userslug] 36.54 KB (🟡 +3 B) 140.29 KB
/user/me 36.53 KB (🟡 +3 B) 140.28 KB
/user/profile/[username] 176.57 KB (🟡 +24 B) 280.31 KB
/user/settings 481.82 KB (🟡 +108 B) 585.57 KB
/uuid/recycle-bin 86.03 KB (-3 B) 189.77 KB
/wallet 41.7 KB (🟡 +3 B) 145.45 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 May 10 '24 12:05 github-actions[bot]