[6.x] Code-split tiptap, codemirror, prosemirror #11469
Draft
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.
This introduces code splitting in a number of places.
Before this, the js file was
3,555.16 kB │ gzip: 995.28 kB
.I noticed
tiptap
,codemirror
,prosemirror
, etc are quite large and take up a big chunk of the JS. These are only ever used by specific fieldtypes like Bard, Code, Yaml, and Markdown.This PR makes those fieldtypes into async components. Their JS will now only get loaded when they are used.
The Bard JS API needed to change too in order to support dynamic imports. The
tiptap
property needs to become a method.After these changes, the js file is
2,266.68 kB │ gzip: 607.05 kB
.