-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(NcRichText): async import remark-gfm library #6259
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is a good idea with remark-gfm
.
If the connection is slow - it first renders the raw text value, and then it flashes to rendered Markdown.
Unlike code => code with highlights
update, this is a huge visible change. Imagine a message with headings and lists, that is first a plain text and then formatted.
I'm not sure we need a dynamic module here. But if we do it, we should render content ONLY when remark-gfm
is loaded, and render nothing during loading.
Signed-off-by: Maksim Sukharev <[email protected]>
Signed-off-by: Maksim Sukharev <[email protected]>
cc74645
to
49ce673
Compare
But I'm still not sure we need an async module with an addition request for text rendering to save quite a small chunk. Unlike |
Adding |
/backport to next |
☑️ Resolves
remark-gfm
could be async loaded to reduce initial size #6246remark-gfm
is 39.5 kB in dev build, which is 30% of rehype-highlight library size (111kB which we're also importing async)rehype-highlight
won't be imported for code blocks without language provided/recognised🖼️ Screenshots
No visual changes
🏁 Checklist
next
requested with a Vue 3 upgradeSigned-off-by: Maksim Sukharev [email protected]