-
Notifications
You must be signed in to change notification settings - Fork 212
Topbar menu includes links for all past versions of a crate #1999
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
Comments
A solution about this could to get this list only when the menu is opened and make an endpoint on the server to query it. What do you think about this approach? |
I like that idea but for a different reason: it would mean we could set a Last-Modified header on the page based on its build dates, since the versions list would no longer be changing based on other versions being released. |
Oh well, if both back-end and front-end gets an advantage out of it, I guess it's a good idea. 😆 |
JavaScript lazy-loading would fix the perf problems, but I think it would be better to just show the current version, maybe a few previous versions, and a link to a separate page with all of the versions on it:
|
I'm actually not sure to understand what you mean there. Do you suggest actually putting the version numbers into a real dropdown instead with a button "go to this version"?
We could have a threshold like "if we have less than X versions, then we directly render the versions into the HTML, otherwise we include the script to load them". The JS itself would be pretty small since it only requires to be triggered on a given even, send an AJAX query and then populate the list. |
I was actually thinking of having a threshold where if there's more than five or so versions, you get a link to a dedicated page with all the versions, like how feature flags work. Though putting the version numbers into a real dropdown sounds like a good idea, yeah. The important idea that I was trying to get across is that the current UX is inadequate for large numbers of versions, regardless of how good the implementation is.
Sure, but that's probably not worth the extra complexity, and doesn't help with the Last-Modified HTTP header implementation. My version doesn't help either, though. |
We could move the "platforms" dropdown into the crate dropdown, freeing up some space for a standalone "versions" dropdown. As an FYI / addition: the "docs.rs crate page" also has a list of versions (in the sidebar) and it has the same problem: https://docs.rs/crate/libc/latest |
Seems like everyone agrees on that. :)
Last-Modified HTTP header implementation is just the last time the crate was updated, not really difficult to find nor to implement considering we have this information. Still more than what we currently have though indeed.
Do we have statistics of usage of specific platform versus specific version? I think it'd be helpful to have these numbers before modifying things.
A dropdown to fix them all. :D |
I believe depending on the motivation for this change we could have different solutions. Is the motivation page-size? Than making the dropdown async would help. Though seeing that we will cache the pages in the CDN + gzip compression, the difference is probably quite small. Or is it UX? Then it probably boils down to: which versions does a user typically switch to? only between major/minor, and the latest patch is good enough? Or between the most recent patch releases? Here we don't have any data (yet).
Since we can also have yanks or crate/release-deletes, IMO this is not 100% true. The CDN invalidations only help with invalidating the pages in the case of caching the pages in the CDN, and not with the automatic last-modified based caching in the browser ( from a discussion in #1560). some data:there are 363 crates with more than 100 releases. top 20, releases per crate:
|
( about the visited pplatform/version graphs: this only shows us the amount of visited, not who used which dropdown or access method to get there) |
The platform and the version are visible in the URL (although not that easy to parse I suppose in this case). I hoped that we had information about the number of URLs targeting a specific platform and URLs targeting a specific version. |
we currently don't have that specific information collected, and we don't have request logs yet where we could parse it. |
Ah that's too bad. Is it worth adding you think? |
I think not. It would not help decide on the appropriate UI change here. The question is: "how often do people navigate between versions of a crate's documentation?" That's different from "how often do people load a non-latest version of a crate's documentation?" The latter in particular is affected by search engines directing people to specific versions, and blog posts and other web pages linking directly to specific versions.
Yanks, crate deletes, and release deletes all affect two things:
If we make the versions list not a part of the page, we could also tweak the warning icon code to be lazy-loaded via a separate (non-cacheable, non-blocking) request. |
We now have lazy loading which helps with performance, but not yet with the UX part. When we would think about limiting the versions we show in this dropdown, which would be the best choices? The last X patch-versions? |
I thought about grouping versions into a collapsible section by bigger version number. Not sure if it'd be helpful or not though... |
How about time-based? The 10 most recently published versions, with a "see all" link at the bottom that goes to the crate details page? For that matter, the crate details page displays versions in a small box that gets cramped with many versions. Perhaps there should be a dedicated tab for displaying the list of versions? That would also allow room for additional details on a per-version basis, similar to how the crates.io versions tab works. For instance, we might want to show the publication date, plus fully written-out text for "documentation failed to build" or "this version was yanked." |
Steps to reproduce:
Expected result:
It contains a handful of recent versions, or the latest version in each major version sequence.
Actual result:
It contains all of the past versions! This results in this page being 101kB in size.
The text was updated successfully, but these errors were encountered: