Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(editor): unified renderer in separate routes #2920

Merged
merged 99 commits into from
Oct 11, 2023

Conversation

elbotho
Copy link
Member

@elbotho elbotho commented Sep 22, 2023

For #2933

Demos/Tools

Bundle Size

+ 25,1 KB on static/[...slug] compared to [...slug]

Overview

image

Right now using the same approach as we landed on for the plugin registry there is a function to register the static renderers before we run the StaticRender.
This way integrations can choose to use custom static renderers as well, or wrap the default ones with extra code.

We have a default static renderer for each plugin that is inside the plugin folder but only uses code from the renderer.tsx and should otherwise be independent from the editor.

Overall it's very similar to the current frontend-approach, but the code is moved into the editor and runs on serialized editor state directly with no custom types, conversions (no server-side-only steps at all).

@vercel
Copy link

vercel bot commented Sep 22, 2023

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

Name Status Preview Updated (UTC)
frontend ✅ Ready (Inspect) Visit Preview Oct 11, 2023 7:09pm

@github-actions
Copy link
Contributor

github-actions bot commented Sep 22, 2023

📦 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 101.75 KB (🟡 +294 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!

New Pages Added

The following pages were added to the bundle from the code in this PR:

Page Size (compressed) First Load
/___editor_preview 478.99 KB 580.74 KB
/static/[...slug] 97.06 KB 198.81 KB
/static/show-revision 79.6 KB 181.36 KB

Sixty Pages Changed Size

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

Page Size (compressed) First Load
/ 85.83 KB (🟡 +46 B) 187.58 KB
/404 37.69 KB (🟡 +46 B) 139.44 KB
/500 37.69 KB (🟡 +46 B) 139.45 KB
/[...slug] 81.66 KB (🟡 +1.79 KB) 183.41 KB
/___ab_dashboard/[id] 39.18 KB (🟡 +46 B) 140.94 KB
/___bot_or_not 108.88 KB (🟡 +1.34 KB) 210.63 KB
/___design 144.97 KB (🟡 +46 B) 246.72 KB
/___exercise_folder_dashboard/[id] 46.35 KB (🟡 +13 B) 148.1 KB
/___graphql 276.39 KB (-2 B) 378.14 KB
/___old_comments 99.36 KB (🟢 -879 B) 201.11 KB
/auth/error 57.82 KB (🟡 +46 B) 159.58 KB
/auth/login 81.78 KB (🟡 +44 B) 183.53 KB
/auth/logout 75.92 KB (🟡 +44 B) 177.67 KB
/auth/oauth/consent 54.22 KB (🟡 +46 B) 155.98 KB
/auth/oauth/login 81.78 KB (🟡 +46 B) 183.54 KB
/auth/oauth/logout 75.93 KB (🟡 +46 B) 177.68 KB
/auth/recovery 63.79 KB (🟡 +46 B) 165.54 KB
/auth/registration 64.72 KB (🟡 +46 B) 166.47 KB
/auth/settings 64.84 KB (🟡 +46 B) 166.59 KB
/auth/verification 64.15 KB (🟡 +46 B) 165.9 KB
/authorization/roles 64.5 KB (🟡 +45 B) 166.25 KB
/backend 38.97 KB (🟡 +46 B) 140.72 KB
/biologie 159.04 KB (🟡 +1.07 KB) 260.79 KB
/chemie 159.04 KB (🟡 +1.07 KB) 260.79 KB
/consent 37.4 KB (🟡 +46 B) 139.15 KB
/content-only/[...slug] 79.18 KB (🟡 +1.18 KB) 180.93 KB
/discussions 94.15 KB (🟢 -949 B) 195.9 KB
/editor 198.6 KB (🟡 +984 B) 300.35 KB
/entity/create/[type]/[taxonomyId] 475.76 KB (🟡 +295 B) 577.51 KB
/entity/license/update/[id] 56.31 KB (🟡 +47 B) 158.06 KB
/entity/link/order/[id]/link 104.37 KB (🟡 +550 B) 206.12 KB
/entity/repository/add-revision/[...id] 475.45 KB (🟡 +288 B) 577.2 KB
/entity/repository/compare/[entity_id]/[revision_id] 96.71 KB (🟡 +977 B) 198.46 KB
/entity/repository/history/[id] 68.25 KB (-1 B) 170 KB
/entity/taxonomy/update/[id] 68.45 KB (🟡 +348 B) 170.2 KB
/entity/unrevised 43.29 KB (🟢 -386 B) 145.04 KB
/event/history 213.11 KB (🟢 -135 B) 314.86 KB
/event/history/[...slug] 216.56 KB (🟢 -632 B) 318.31 KB
/informatik 159.04 KB (🟡 +1.08 KB) 260.8 KB
/jobs/[[...jobId]] 51.55 KB (🟡 +45 B) 153.31 KB
/lerntipps 159.04 KB (🟡 +1.08 KB) 260.8 KB
/license/detail/[id] 68.95 KB (🟡 +1.4 KB) 170.71 KB
/mathe 159.04 KB (🟡 +1.07 KB) 260.79 KB
/metadata 46.69 KB (🟡 +46 B) 148.44 KB
/nachhaltigkeit 159.04 KB (🟡 +1.07 KB) 260.8 KB
/page/create 475.46 KB (🟡 +284 B) 577.22 KB
/pages 57.55 KB (🟡 +45 B) 159.31 KB
/search 41.43 KB (🟡 +46 B) 143.18 KB
/spenden 52.44 KB (🟡 +65 B) 154.19 KB
/subscriptions/manage 107.28 KB (🟡 +55 B) 209.04 KB
/taxonomy/term/[copyOrMove]/batch/[id] 68.91 KB (🟡 +331 B) 170.66 KB
/taxonomy/term/create/[parent_id]/[id] 475.17 KB (🟡 +322 B) 576.92 KB
/taxonomy/term/sort/entities/[id] 104.38 KB (🟡 +553 B) 206.13 KB
/taxonomy/term/update/[id] 475.08 KB (🟡 +325 B) 576.84 KB
/user/[...userslug] 266.35 KB (🟡 +455 B) 368.1 KB
/user/me 36.74 KB (🟡 +46 B) 138.5 KB
/user/notifications 215.46 KB (🟢 -146 B) 317.21 KB
/user/settings 473.76 KB (🟡 +364 B) 575.52 KB
/uuid/recycle-bin 81.71 KB (🟡 +7 B) 183.46 KB
/wallet 41.97 KB (🟡 +60 B) 143.73 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.

@elbotho elbotho changed the title refactor(editor): unified renderer draft refactor(editor): unified renderer in separate routes Oct 10, 2023
@elbotho elbotho marked this pull request as ready for review October 10, 2023 16:23
@elbotho elbotho removed a link to an issue Oct 11, 2023
58 tasks
@elbotho elbotho merged commit d956f07 into staging Oct 11, 2023
9 checks passed
@elbotho elbotho deleted the unified-renderer-draft branch October 11, 2023 19:10
@elbotho elbotho mentioned this pull request Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants