Repository navigation
perf: load the editor chunk lazily - #3373
Merged
Merged
Conversation
JammingBen
force-pushed
the
perf/lazy-editor-chunk
branch
2 times, most recently
from
September 15, 2026 08:38
ffc4865 to
0ab9dfc
Compare
JammingBen
marked this pull request as ready for review
September 15, 2026 09:01
kulmann
reviewed
Sep 17, 2026
| try { | ||
| await loadEditor() | ||
| } catch { | ||
| // the component reports the failure |
Member
There was a problem hiding this comment.
Claude claims that you would need an errorComponent on the async component definition starting in line 24. Otherwise we would render nothing on failure...
Member
Author
There was a problem hiding this comment.
I think it's cleaner to let the component handle this instead of having a generic error component that might not fit into the caller component. And generally, this only throws if the network or the bundle itself is broken, so the page is dead either way then.
The editor chunk (tiptap, prosemirror, highlight.js, marked) was loaded on first paint. It is now only fetched when an editor is actually opened, and it got smaller. Async loading: - add `TextEditorViewer`, a read-only editor view exported from the web-pkg main entry as an async component. The announcement modal, the files list and space READMEs and the app store details now use it instead of importing the editor directly. - the text editor app resolves its route component and Yjs adapter lazily - mail loads the compose widget async, admin settings the announcement section Bundle size: - pin highlight.js to one version, lowlight pulled in a second copy
JammingBen
force-pushed
the
perf/lazy-editor-chunk
branch
from
September 17, 2026 08:55
968c16e to
38b5969
Compare
kulmann
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The editor chunk (
tiptap,prosemirror,highlight.js,marked) was loaded on first paint. It is now only fetched when an editor is actually opened, and it got slightly smaller.Async loading:
TextEditorViewer, a read-only editor view exported from theweb-pkgmain entry as an async component. The announcement modal, the files list and space READMEs and the app store details now use it instead of importing the editor directly.Bundle size:
highlight.jsto one version, lowlight pulled in a second copyNote that the editor chunk is still around 1 MB (unzipped). We could get it down by a) separating our implementation from the vendor code and b) curating a list of languages we support code highlighting for. Currently, we pull in all common languages from
highlight.js. See #3378 for this.closes #3217