Skip to content
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

split cli and core into different package #104

Open
upupming opened this issue Oct 6, 2021 · 3 comments
Open

split cli and core into different package #104

upupming opened this issue Oct 6, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@upupming
Copy link
Member

upupming commented Oct 6, 2021

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
  • ...
@Molunerfinn
Copy link
Member

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 Molunerfinn added the enhancement New feature or request label Oct 9, 2021
@upupming
Copy link
Member Author

upupming commented Oct 9, 2021

@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.

@Molunerfinn
Copy link
Member

Molunerfinn commented Nov 15, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants