Remove markdown-it library from js bundle
What does this MR do and why?
We have a feature that allows copying HTML as Markdown in issue descriptions, MR descriptions, comments, etc.. You can see the implementation in copy_as_gfm.js. This feature relies on a library called prosemirror-markdown that allows converting Markdown to HTML and Vice-versa.
For the Markdown to HTML conversion, prosemirror-markdown
relies on the markdown-it
Markdown parser. However, we don’t perform Markdown to HTML conversion on the client yet. Therefore, we can remove markdown-it
from the JS bundle by importing the parts of prosemirror-markdown
that we are interested in.
How many bytes does markdown-it contribute to bundle size?
This MR removes 14kbs of gzipped content from this bundle. It’s not a lot but every little byte counts!
Screenshots or screen recordings
This MR doesn’t introduce user-facing changes.
How to set up and validate locally
- Open any resource in the GitLab application that displays Markdown rendered as HTML. For example, an issue, an MR, or a comment.
- Copy the content of that resource.
- Paste it in a textarea. The clipboard should contain Markdown that is equivalent to the content you copied.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.