PicGo-Core icon indicating copy to clipboard operation
PicGo-Core copied to clipboard

split cli and core into different package

Open upupming opened this issue 2 years ago • 3 comments

Currently, the bundled size of picgo core when bundling all of its dependencies with minification is 2MB, which is very large. I think the CLI part is the heaviest part, it uses many 3rd party libs. Also the CLI feature will not be possible on the web, so if we want to support picgo on web environment, we have to split cli and core into different packages.

Now we aslo have a @picgo/store repo, I think we can setup a monorepo and contains all packages to reduce our time for changing different projects. For example, a monorepo with:

  • @picgo/core
  • @picge/cli
  • @picgo/store
  • ...

upupming avatar Oct 06 '21 06:10 upupming

The bundled size is not the most important thing for now. And this is a node project, bundled size is not important. Node project will not just focus on the bundled size. Because node project will not just use bundled pkg. However, the pkg size is just 180K

image

If we want to support web, we will focus the bundled size. But I think the web bundled size will also be small cause many of the deps will not be used in web

Molunerfinn avatar Oct 09 '21 02:10 Molunerfinn

@Molunerfinn Actually I means when we bundle picgo and all dependencies together, the minified size will be ~2MB. As a VSCode extension, vscode won't do npm i over your extension's package.json after installation. So you have to bundle all picgo's dependencies into one file, the final size can be ~3MB.

image

This may make the vscode extension vsix installation file larger, for example, vscode-gitlens is only 2MB zipped:

image

Anyway, the larger bundle size does not hurt too much, it just makes npm i picgo or downloads the vscode extension slower.

upupming avatar Oct 09 '21 02:10 upupming

In 2.x, we will seprate the core package to multiple packages, use monorepo

Molunerfinn avatar Nov 15 '22 14:11 Molunerfinn