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

Parse package.json #5

Closed
shaun-sweet opened this issue May 18, 2017 · 5 comments
Closed

Parse package.json #5

shaun-sweet opened this issue May 18, 2017 · 5 comments

Comments

@shaun-sweet
Copy link

Any thoughts on having it parse an entire package.json file and return the combined results? Perhaps even an API end point to pass in package names directly not using this interface in order to calculate that ourselves?

@shaun-sweet
Copy link
Author

actually you effectively have an endpoint of /package after forking your code. I'd like to piggy back on this and create a node command line utility that parses your package.json and gives you these values of the combined size of all your packages. If I submit for example react react-redux (which depends on react) and add them up, is that an accurate number for how big the both of them are in your project?

@pastelsky
Copy link
Owner

pastelsky commented May 21, 2017

Doing so has a couple of challenges -

  1. People often have non-front end dependencies in their package.json. So unless you allow them to select which packages to include, the results wouldn't be very helpful.

  2. Unless the cost packages are cached ( although a good number of popular packages are) the time taken to build and minify a large number packages can be too much (think about the time taken to run production webpack builds). So it kinda becomes like running a webpage test, and you have to build the support framework for queuing stuff and showing progress etc.

I'd be happy to know if you have workarounds, or would want to work on either.

@shaun-sweet
Copy link
Author

https://github.com/shaun-sweet/package-weight

here's what I made so far. I do think your first point could be an issue but perhaps I could put in an exclude flag into the utility. I guess your server would need to cache that info. Last I saw though it seemed you were using firebase to cache to avoid having to re zip and calc stuff?

@pastelsky
Copy link
Owner

pastelsky commented May 23, 2017

Hey @shaun-sweet. Despite of the caching, I don't think the heroku instance would be able to bear the load of multiple people scanning their package.json. There are just too many packages out there and they update quite frequently. The firebase cache is a lazy cache and unless we add queueing and get a better hosting, this will not work out.

I don't think exposing this as an API is a good idea atm with the current infrastructure.

@pastelsky
Copy link
Owner

We now support scanning package.json from within bundlephobia.com (beta) Let me know what you think once you get your hands on.

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

No branches or pull requests

2 participants