Performance: Load stylesheets parallel to extensions in Tiptap - #23024
Conversation
|
Claude finished @nielslyngsoe's task in 5m 56s —— View job PR ReviewTarget: Refactors Important
Approved with Suggestions for improvementThe parallelisation is sound and the consolidation of stylesheet logic is a clean improvement. Please address the Labels applied: |
There was a problem hiding this comment.
Pull request overview
Refactors <umb-input-tiptap> so that resolving the stylesheet root path and building the configured stylesheet <link> list runs in parallel with Tiptap extension loading, rather than blocking it.
Changes:
- Removes the
awaiton#loadStylesheetPath()infirstUpdated()so it executes concurrently with#loadExtensions()/#loadEditor(). - Moves the configured-stylesheets URL building from
#loadEditor()into#loadStylesheetPath()(after the root path observable resolves). - Promotes the
#stylesheetsprivate field to a reactive@state() _stylesheetsand updates#renderStyles()to read it.
Set.add() mutates in place; @State() uses identity comparison so no re-render is scheduled. With stylesheet loading now parallel to extension loading, configured stylesheets could be missed if the editor finished loading first. Reassign a new Set to preserve reactivity. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
It should not be necessary to await loading of the stylesheet before loading TipTap Extensions. So this makes them load in parallel.
This item has been added to our backlog AB#68798