Skip to content

Conversation

@isoos
Copy link
Collaborator

@isoos isoos commented Sep 18, 2017

No description provided.

@mkustermann
Copy link
Member

May I ask what we are going to use this for? We have only one search box. Do we want to let the user choose (via some drop-down menu) how to rank? I would assume we just need to tweak the way we combine the different metrics in order to get good results.

@isoos
Copy link
Collaborator Author

isoos commented Sep 19, 2017

May I ask what we are going to use this for?

Immediately: I want to replace PackageVersion.detectedTypes (which is flutter-only) with pana-recognized platforms. E.g. /flutter/packages will query search with platforms=flutter (maybe turn of the rest, so that only flutter packages are shown), and it needs to order them in reverse chronological update time (SearchOrder.updated here).

Short term: Query the most popular packages (optional: group by platform), to be displayed on the site's index page.

After that: It kind of enables a search-box like the top-left side of https://www.npmjs.com/search?q=
Whether we want to do something like that is up for debate and UX is to be figured out, but at that point it is just a quick add-on.

I would assume we just need to tweak the way we combine the different metrics in order to get good results.

I believe that is correct, I don't imagine too much work needed to implement it. We will still need the API part for it though...

Copy link
Member

@mkustermann mkustermann left a comment

Choose a reason for hiding this comment

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

Thanks for the explanation, sounds reasonable.

just a few minor comments.

Copy link
Member

Choose a reason for hiding this comment

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

Why not just change {SearchOrder orElse()} to {SearchOrder defaultsTo}? Then call sites don't need to allocate a closure but can just provide a constant.

Copy link
Member

Choose a reason for hiding this comment

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

defaultsTo: SearchOrder.overall

Copy link
Member

Choose a reason for hiding this comment

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

If you write a test, then you might as well add a case for parseSearchOrder('foobar', defaultsTo: ...) :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

Copy link
Member

Choose a reason for hiding this comment

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

What's the difference between health and maintenance? For me, not knowing what it means, I would assume it's the same as health.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • health: How the code qualifies against our tests (e.g. strong mode, some linter rules, works with the tools, doesn't have too many warnings)? E.g. I can have a lot of code in it that is using a deprecated API and it will likely break -> bad health.

  • maintenance: How frequently is the package updated with new versions? E.g. If I publish a new version every 2-3 months, that seems like a steady maintenance. If I publish a new version after 2 years of break, that should score lower, even though it may be fresh. (There is a fundamental difference here with updated, which only cares about the latest publish time.)

Copy link
Member

@mkustermann mkustermann Sep 19, 2017

Choose a reason for hiding this comment

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

Yeah but you can interpret update frequency in different ways: Frequent updates (might indicate active maintenance, or unstable package) or very rarely (might indicate stable package, or unmaintained package)!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I'll remove it for now, it should be cheap to re-introduce it later.

@mkustermann mkustermann merged commit ce685ac into dart-lang:master Sep 19, 2017
@isoos isoos deleted the search_order branch September 19, 2017 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants