frontend icon indicating copy to clipboard operation
frontend copied to clipboard

feat: Enable exercises in articles/courses/... & make UuidContext provide entity type

Open LarsTheGlidingSquirrel opened this issue 1 year ago • 2 comments

Changes:

  • Exercises are enabled in articles, courses, ...
  • UuidContext provides entity type ('Article', 'TaxonomyTerm', ...) alongside entity id and revision id. If you are on a page rendering multiple entities (with unique uuids) the context provides different values depending on from where you access it.
  • SolutionSerloStaticRenderer shows comment section only if the exercise has a Serlo uuid. Examples: Show on entity type 'Exercise', not show on entity type 'Article'. Uses entity type to figure that out.
  • Before: UuidContext was used to provide IDs of groupedExercise (no longer an entity) or fake IDs for exercise analytics. Both are no valid uuids that you can query. After: UuidContext is now only providing valid uuids you can query. ExerciseIdContext provides the exercise ID used for exercise analytics.

Followups:

  • Remove exerciseVisibleInSuggestion from editor API (no need to customize that any more)

Potential followups:

  • exerciseSubmission is also used for tracking "spoiler opened" events which has nothing to do with exercises. Could be renamed.
  • Move AnchorLinkCopyTool out of @serlo/editor and inject it into toolbar only on serlo.org. Come up with editor api changes.
  • Rename entityId to serloEntityId and document in code that this is the id in the uuid query.
  • Rename UuidContext to SerloContext
  • Provide the entity type also in the editor (and other pages)
  • Remove serloContext from exercise props and use context instead?

LarsTheGlidingSquirrel avatar May 07 '24 08:05 LarsTheGlidingSquirrel

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

Name Status Preview Updated (UTC)
frontend ✅ Ready (Inspect) Visit Preview May 7, 2024 8:05am

vercel[bot] avatar May 07 '24 08:05 vercel[bot]

📦 Next.js Bundle Analysis for @serlo/frontend

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

Sixty-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
/ 84.95 KB (🟡 +30 B) 188.7 KB
/404 38.04 KB (🟡 +30 B) 141.79 KB
/500 38.04 KB (🟡 +30 B) 141.79 KB
/[...slug] 83.04 KB (🟡 +123 B) 186.8 KB
/___bot_or_not 95.82 KB (🟡 +30 B) 199.58 KB
/___cf_not_found 36.74 KB (🟡 +30 B) 140.5 KB
/___design 142.08 KB (🟡 +30 B) 245.84 KB
/___editor_preview 483.11 KB (🟡 +38 B) 586.86 KB
/___old_comments 99.75 KB (🟡 +34 B) 203.51 KB
/auth/error 60.26 KB (🟡 +30 B) 164.02 KB
/auth/login 85.43 KB (🟡 +30 B) 189.19 KB
/auth/logout 78.8 KB (🟡 +30 B) 182.56 KB
/auth/oauth/consent 54.53 KB (🟡 +30 B) 158.29 KB
/auth/oauth/login 85.43 KB (🟡 +30 B) 189.19 KB
/auth/oauth/logout 78.81 KB (🟡 +30 B) 182.56 KB
/auth/recovery 66.97 KB (🟡 +30 B) 170.73 KB
/auth/registration 67.89 KB (🟡 +30 B) 171.65 KB
/auth/settings 67.99 KB (🟡 +30 B) 171.75 KB
/auth/verification 67.31 KB (🟡 +30 B) 171.07 KB
/authorization/roles 66.32 KB (🟡 +30 B) 170.07 KB
/backend 38.8 KB (🟡 +30 B) 142.56 KB
/biologie 157.82 KB (🟡 +30 B) 261.58 KB
/chemie 157.82 KB (🟡 +30 B) 261.58 KB
/consent 37.29 KB (🟡 +30 B) 141.05 KB
/content-only/[...slug] 74.55 KB (🟡 +146 B) 178.31 KB
/discussions 96.01 KB (🟡 +34 B) 199.77 KB
/editor 104.14 KB (🟡 +33 B) 207.9 KB
/entity/create/[type]/[taxonomyId] 484.08 KB (🟡 +38 B) 587.84 KB
/entity/license/update/[id] 56.46 KB (🟡 +30 B) 160.22 KB
/entity/link/order/[id]/link 89.73 KB (🟡 +30 B) 193.49 KB
/entity/repository/add-revision/[...id] 483.33 KB (🟡 +39 B) 587.08 KB
/entity/repository/compare/[entity_id]/[revision_id] 85.94 KB (🟡 +30 B) 189.7 KB
/entity/repository/history/[id] 69.69 KB (🟡 +30 B) 173.44 KB
/entity/taxonomy/update/[id] 69.07 KB (🟡 +30 B) 172.82 KB
/entity/unrevised 43.58 KB (🟡 +30 B) 147.33 KB
/event/history 131.06 KB (🟡 +30 B) 234.82 KB
/event/history/[...slug] 132.03 KB (🟡 +30 B) 235.79 KB
/event/history/user/profile/[username] 134.42 KB (🟡 +30 B) 238.17 KB
/gleichungs-app 163.05 KB (🟡 +30 B) 266.81 KB
/informatik 157.83 KB (🟡 +30 B) 261.58 KB
/jobs/[[...jobId]] 50.81 KB (🟡 +30 B) 154.57 KB
/legal 36.77 KB (🟡 +30 B) 140.53 KB
/lerntipps 157.82 KB (🟡 +30 B) 261.58 KB
/license/detail/[id] 58.01 KB (🟡 +30 B) 161.77 KB
/mathe 157.82 KB (🟡 +30 B) 261.58 KB
/mathe-aufgaben 37.47 KB (🟡 +30 B) 141.23 KB
/mathe-pruefungen/[region] 76.21 KB (🟡 +30 B) 179.97 KB
/metadata 46.42 KB (🟡 +30 B) 150.18 KB
/nachhaltigkeit 157.83 KB (🟡 +30 B) 261.59 KB
/page/create 483.33 KB (🟡 +40 B) 587.09 KB
/pages 57.79 KB (🟡 +30 B) 161.54 KB
/privacy 40.11 KB (🟡 +30 B) 143.87 KB
/search 41.08 KB (🟡 +30 B) 144.84 KB
/spenden 51.7 KB (🟡 +30 B) 155.46 KB
/subscriptions/manage 113.78 KB (🟡 +30 B) 217.54 KB
/taxonomy/term/[copyOrMove]/batch/[id] 71.65 KB (🟡 +30 B) 175.4 KB
/taxonomy/term/create/[parent_id]/[id] 483.1 KB (🟡 +39 B) 586.86 KB
/taxonomy/term/sort/entities/[id] 93.59 KB (🟡 +30 B) 197.35 KB
/taxonomy/term/update/[id] 483.05 KB (🟡 +39 B) 586.81 KB
/terms 36.79 KB (🟡 +30 B) 140.55 KB
/user/[...userslug] 36.57 KB (🟡 +30 B) 140.33 KB
/user/me 36.56 KB (🟡 +30 B) 140.32 KB
/user/notifications 133.29 KB (🟡 +30 B) 237.04 KB
/user/profile/[username] 176.57 KB (🟡 +30 B) 280.33 KB
/user/settings 482 KB (🟡 +37 B) 585.76 KB
/uuid/recycle-bin 86.06 KB (🟡 +30 B) 189.82 KB
/wallet 41.72 KB (🟡 +30 B) 145.48 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 07 '24 08:05 github-actions[bot]