WIP: Add new media plugin to simplify embeddings of external resources
Fixes https://linear.app/serlo/issue/PE-149/implement-the-proposal-for-a-new-asset-management-in-an-example-pr
There are some changes:
- I didn't use schema.org to describe the embedding types
- This PR does not remove
imageandvideotypes which can in the long run be replaced with the new media plugin (and a config for the allowed plugin) => see the pluginsmediaImageandmediaVideoinstead.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated (UTC) |
|---|---|---|---|
| frontend | ✅ Ready (Inspect) | Visit Preview | Sep 26, 2024 7:25pm |
📦 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 |
105.25 KB (🟡 +31 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!
Twenty-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 |
|---|---|---|
/[...slug] |
86.97 KB (🟡 +18 B) |
192.22 KB |
/___bot_or_not |
99.85 KB (🟡 +18 B) |
205.1 KB |
/___editor_preview |
552.22 KB (🟡 +1.54 KB) |
657.46 KB |
/biologie |
162.84 KB (🟡 +18 B) |
268.09 KB |
/chemie |
162.84 KB (🟡 +18 B) |
268.08 KB |
/content-only/[...slug] |
77.13 KB (🟡 +18 B) |
182.38 KB |
/editor |
77.64 KB (🟡 +17 B) |
182.88 KB |
/entity/create/[type]/[taxonomyId] |
553.72 KB (🟡 +1.54 KB) |
658.96 KB |
/entity/repository/add-revision/[...id] |
552.96 KB (🟡 +1.54 KB) |
658.2 KB |
/entity/repository/compare/[entity_id]/[revision_id] |
89.54 KB (🟡 +18 B) |
194.78 KB |
/informatik |
162.84 KB (🟡 +18 B) |
268.09 KB |
/lerntipps |
162.84 KB (🟡 +18 B) |
268.09 KB |
/license/detail/[id] |
64.77 KB (🟡 +18 B) |
170.02 KB |
/mathe |
162.84 KB (🟡 +18 B) |
268.08 KB |
/nachhaltigkeit |
162.85 KB (🟡 +18 B) |
268.09 KB |
/page/create |
552.96 KB (🟡 +1.54 KB) |
658.21 KB |
/taxonomy/term/[copyOrMove]/batch/[id] |
74.17 KB (🟡 +14 B) |
179.42 KB |
/taxonomy/term/create/[parent_id]/[id] |
552.7 KB (🟡 +1.54 KB) |
657.94 KB |
/taxonomy/term/sort/entities/[id] |
95.96 KB (🟡 +14 B) |
201.2 KB |
/taxonomy/term/update/[id] |
552.62 KB (🟡 +1.54 KB) |
657.86 KB |
/user/profile/[username] |
186.22 KB (🟡 +18 B) |
291.46 KB |
/user/settings |
551.8 KB (🟡 +1.54 KB) |
657.04 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.
some todos:
- i18n
- alt/description field
- renders
- EmbedWrapper
- search interface
- …
@kulla how would we implement a video plugin that supports html-video & e.g. YouTube and Vimeo?
Did you have a way in mind to handle the custom state that e.g. the image plugin needs (caption, alt, source, license) with this approach?
@kulla how would we implement a video plugin that supports html-video & e.g. YouTube and Vimeo?
See https://github.com/serlo/frontend/pull/4107/commits/a2d2230ad977a0f400fc7aad129b6ac5e828188f
At https://serlo.slack.com/archives/C05QWHQP1HT/p1728588506725659 we have described a solution. Since in the implementation we will start new PRs I close this PR since it is not needed any more.