diplodoc-platform / diplodoc-platform/transform

Client bundle size for client-side application

Open
#446 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
69
Forks
59
Avg merge
1d 21h
Merged PRs (30d)
6

Description

I use `@diplodoc/transform` and `@gravity-ui/markdown-editor` in my client project to display and edit user messages. While working on it I noticed while throttling the internet connection, that the page bundle that contains both of these components takes up 2.4mb gzipped and it takes a long time to load on a throttled connection.

After reviewing the bundle with bundle analyzer, I noticed that lowlight and higlight.js takes up a lot of space in the bundle. Due to the fact that these are optional deps, I removed them, but still, the bundle takes up 1.4mb, although I don't use custom plugins in @diplodoc/transform and use the minimal `commonmark` preset in @gravity-ui/markdown-editor. In the bundle I see a lot of packages that are not being used (like plugins and table module).

I prepared a sample project [here](https://github.com/danonechik94/diplodoc-bundle-test). You can use it to see the lazy-loaded bundle on the /editor page, that takes up 2.4mb.

I believe that both of these libraries can be optimized a bit, so that the size is adequate for a client application. I will also create an issue in the @gravity-ui/markdown-editor repo regarding this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.