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

feat: implement reduced size estimation #13

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

std-microblock
Copy link

@std-microblock std-microblock commented Aug 26, 2023

TODOs:

  • estimate nolyfill package size in codegen
  • cache package size so that codegen wouldn't be too slow
  • more accurate size estimation for pnpm users

@@ -425,9 +461,29 @@ const manualPackagesList = /** @type {const} */ ([
}
};

const fetchOriginPackageSize = async (packageName) => {
const packageJson = await makeRequest('https://packagephobia.com/api.json', {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use registry.npmjs.org instead? registry.npmjs.org is way more reliable.

E.g. You can get unpackedSize and fileCount from https://registry.npmjs.org/nolyfill/latest.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible but only if the dependency tree is evaluated correctly. The tree of yarn is incorrect currently, however.

Check the discussions in the tg group for details.

@nonzzz
Copy link
Contributor

nonzzz commented Aug 27, 2023

Question. Why is caching necessary? ( Or where do we want to cache them?

@SukkaW SukkaW marked this pull request as draft August 28, 2023 03:05
@SukkaW SukkaW mentioned this pull request Jul 10, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants