frontend icon indicating copy to clipboard operation
frontend copied to clipboard

refactor(editor): simplify editor plugin config, remove testingsecret image upload

Open elbotho opened this issue 8 months ago • 2 comments

  • only rows, image and textplugin have configs now, and also less fields
  • no plugin needs variables in create-plugin.tsx (no create[…]Plugin) any more
  • only support for new media upload infra
  • new editor prop for disabling media upload

Integrations that used the testingsecret approach should now use the new infra via editor.serlo.dev now by default, where CORS is set to accept all hosts.


remaining config:

export interface RowsPluginConfig {
  allowedPlugins?: (EditorPluginType | string)[]
  parentType: string
  textPluginPlaceholder?: string
}

export interface ImagePluginConfig {
  onMultipleUpload?: (files: File[]) => void
}

export interface TextEditorConfig {
  placeholder?: string
  isInlineChildEditor?: true
  formattingOptions?: TextEditorFormattingOption[]
  noLinebreaks?: boolean
  controls?: InlineTextEditorControls
}

export interface InlineTextEditorConfig {
  placeholder?: TextEditorConfig['placeholder']
  noLinebreaks?: TextEditorConfig['noLinebreaks']
  controls: Required<InlineTextEditorControls>
}

elbotho avatar Apr 29 '25 17:04 elbotho

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

Name Status Preview Updated (UTC)
frontend ✅ Ready (Inspect) Visit Preview Apr 30, 2025 11:41am

vercel[bot] avatar Apr 29 '25 17:04 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 105.52 KB (🟢 -29 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-nine Pages Changed Size

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

Page Size (compressed) First Load
/ 83.24 KB (-4 B) 188.76 KB
/404 39.93 KB (-4 B) 145.45 KB
/500 39.93 KB (-4 B) 145.45 KB
/[...slug] 107.67 KB (-1 B) 213.2 KB
/___batch_license_tool 53.73 KB (-4 B) 159.25 KB
/___bot_or_not 114.89 KB (🟢 -21 B) 220.41 KB
/___cf_not_found 38.15 KB (🟢 -4 B) 143.67 KB
/___design 143.44 KB (-4 B) 248.96 KB
/___editor_preview 88.91 KB (🟢 -113.27 KB) 194.43 KB
/___old_comments 97.26 KB (-5 B) 202.78 KB
/auth/___activate_vidis 38.44 KB (🟢 -4 B) 143.96 KB
/auth/error 62.98 KB (-4 B) 168.5 KB
/auth/login 87.75 KB (-4 B) 193.27 KB
/auth/logout 78.29 KB (-4 B) 183.81 KB
/auth/oauth/consent 52.88 KB (-4 B) 158.4 KB
/auth/oauth/login 87.75 KB (-4 B) 193.27 KB
/auth/oauth/logout 78.3 KB (-4 B) 183.82 KB
/auth/recovery 72.51 KB (-4 B) 178.03 KB
/auth/registration 73.31 KB (-4 B) 178.83 KB
/auth/settings 73.39 KB (-4 B) 178.91 KB
/auth/verification 72.67 KB (-4 B) 178.19 KB
/authorization/roles 64.5 KB (-4 B) 170.02 KB
/backend 40.21 KB (-4 B) 145.73 KB
/biologie 175.63 KB (-1 B) 281.15 KB
/chemie 175.63 KB (-1 B) 281.15 KB
/consent 38.72 KB (🟢 -4 B) 144.24 KB
/content-only/[...slug] 96.55 KB (-1 B) 202.07 KB
/discussions 93.8 KB (-5 B) 199.32 KB
/editor 58.13 KB (🟢 -60 B) 163.65 KB
/entity/create/[type]/[taxonomyId] 160.25 KB (🟢 -63.44 KB) 265.77 KB
/entity/license/update/[id] 63.31 KB (-4 B) 168.83 KB
/entity/repository/add-revision/[...id] 159.91 KB (🟢 -63.45 KB) 265.43 KB
/entity/repository/compare/[entity_id]/[revision_id] 111.46 KB (-1 B) 216.98 KB
/entity/repository/history/[id] 67.67 KB (-4 B) 173.19 KB
/entity/taxonomy/update/[id] 67.61 KB (🟡 +473 B) 173.13 KB
/entity/unrevised 44.99 KB (-4 B) 150.51 KB
/event/history 124.46 KB (-7 B) 229.98 KB
/event/history/[...slug] 125.45 KB (-7 B) 230.97 KB
/event/history/user/profile/[username] 127.83 KB (-7 B) 233.35 KB
/gleichungs-app 162.09 KB (-3 B) 267.61 KB
/informatik 175.63 KB (-1 B) 281.15 KB
/jobs/[[...jobId]] 49.51 KB (-4 B) 155.03 KB
/legal 38.21 KB (🟢 -4 B) 143.73 KB
/lerntipps 175.63 KB (-1 B) 281.15 KB
/license/detail/[id] 82.88 KB (-1 B) 188.4 KB
/mathe 175.63 KB (-1 B) 281.15 KB
/mathe-aufgaben 38.95 KB (🟢 -4 B) 144.47 KB
/mathe-pruefungen/[region] 90.9 KB (-4 B) 196.42 KB
/metadata 47.89 KB (-4 B) 153.41 KB
/nachhaltigkeit 175.64 KB (-1 B) 281.16 KB
/page/create 159.92 KB (🟢 -63.44 KB) 265.44 KB
/pages 56.12 KB (-4 B) 161.64 KB
/privacy 38.69 KB (🟢 -4 B) 144.21 KB
/search 40.21 KB (-4 B) 145.73 KB
/spenden 52.32 KB (-4 B) 157.84 KB
/subscriptions/manage 107.44 KB (-4 B) 212.96 KB
/taxonomy/term/[copyOrMove]/batch/[id] 69.97 KB (🟢 -69 B) 175.5 KB
/taxonomy/term/create/[parent_id]/[id] 159.62 KB (🟢 -63.44 KB) 265.14 KB
/taxonomy/term/sort/entities/[id] 89.51 KB (🟢 -385 B) 195.03 KB
/team 46.02 KB (-4 B) 151.54 KB
/terms 38.23 KB (🟢 -4 B) 143.75 KB
/user/[...userslug] 38.03 KB (🟢 -4 B) 143.55 KB
/user/me 38.02 KB (🟢 -4 B) 143.54 KB
/user/notifications 126.7 KB (-7 B) 232.22 KB
/user/profile/[username] 194.3 KB (🟢 -23 B) 299.82 KB
/user/settings 136.94 KB (🟢 -88.14 KB) 242.46 KB
/uuid/recycle-bin 79.15 KB (-4 B) 184.67 KB
/wallet 44.4 KB (-4 B) 149.92 KB
/willkommen 84.24 KB (-4 B) 189.76 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 Apr 29 '25 17:04 github-actions[bot]