The public Plate renderer loads a 1.45 MB chunk shared with the editor

Open
#301 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript

Research direction

Run ANALYZE=true pnpm build in apps/aurora and inspect build/stats/stats-client.html, focusing on the somersault-renderer preset and BlockBaseEditorKit. Trace which base kit or shared module brings in Slate/Plate core and micromark/mdast, then identify the renderer’s required dependencies. Done means the renderer loads only what it needs to render, without the editor-only dependencies in its shared chunk.

Written by the indexing model from the issue text.

Description

04 type: enhancement

Found while exploring #300.

In the client build (apps/aurora/build/client/assets, main at e51575e3f), the public SomersaultRenderer-*.js chunk is small (12 kB) and lazy, but it statically imports a 1.45 MB shared chunk (dist-*.js) that the editor's ContentForm-*.js chunk also imports. That shared chunk contains Slate/Plate core and also micromark/mdast, which look like editor-only dependencies (Markdown parsing).

So every public page that renders a page document loads that chunk.

To do:

  • Run ANALYZE=true pnpm build in apps/aurora and look at build/stats/stats-client.html for what the renderer path (somersault-renderer preset, BlockBaseEditorKit) pulls in.
  • Find which base kit or shared module brings in editor-only dependencies, and split them so the renderer only loads what it needs to render.
Dominant language
JavaScript
Stars
10
Forks
9
Avg merge
4d 7h
Merged PRs (30d)
54

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from plone/aurora

All issues in plone/aurora

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.