website icon indicating copy to clipboard operation
website copied to clipboard

Allow search to filter by module size

Open queicherius opened this issue 5 years ago • 5 comments

I would love to be able to

  • see the size of a module directly in the search results
  • filter the search based on the size of the module (e.g. only show modules with 5kb or less)

I think this would help a lot to choose which modules to pick and to reduce package bloat.

queicherius avatar Oct 04 '18 14:10 queicherius

I don't currently have that data in the index, so it won't be able to sort on that right now. What I do now is request data from bundlephobia when people go to the detail page. @pastelsky, could it be an option to get the data in the indexing strategy instead? Maybe we can have it cached somehow?

Are you willing to contribute to this @queicherius ? :)

Haroenv avatar Oct 04 '18 15:10 Haroenv

Are you willing to contribute to this @queicherius ? :)

I'd be happy to whip of a frontend for this if/when it gets into the index 👍

queicherius avatar Oct 04 '18 16:10 queicherius

@Haroenv The nature of the bundlephobia API doesn't lend itself well to bulk queries. How do you think requests to it would come?

pastelsky avatar Oct 04 '18 17:10 pastelsky

Bundlephobia seems to cache past builds sizes, is there maybe a way to only ask for those?

queicherius avatar Oct 04 '18 17:10 queicherius

I think that's the main issue here now, how to get the data in the index without making the process a lot slower (now takes 20h for a full reindex, which happens weekly). Maybe a separate package can be automatically made weekly in a different process, or some kind of db everything cached can be stored in which could be shared by both projects?

Haroenv avatar Oct 05 '18 07:10 Haroenv