Skip to content

Commit f3b3e43

Browse files
committed
Add "crates.io: development update" blog post
1 parent c8d3a4a commit f3b3e43

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
layout: post
3+
title: "crates.io: development update"
4+
author: Tobias Bieniek
5+
team: the crates.io team <https://www.rust-lang.org/governance/teams/crates-io>
6+
---
7+
8+
Since crates.io does not have releases in the classical sense, there are no release notes either. However, the crates.io team still wants to keep you all updated about the ongoing development of crates.io. This blog post is a summary of the most significant changes that have been made to crates.io in the past months.
9+
10+
## `cargo install`
11+
12+
When looking at crates like [ripgrep](https://crates.io/crates/ripgrep) you will notice that the installation instructions now say `cargo install ripgrep` instead of `cargo add ripgrep`. This change was made to make it easier for users to install crates that have binary targets. `cargo add` is still the correct command to use when adding a crate as a dependency to your project, but for binary-only crates like ripgrep, `cargo install` is the way to go.
13+
14+
This change was implemented by analyzing the uploaded crate files when they are published to crates.io. If a crate has binary targets, the names of the binaries will now be saved in our database and then conveniently displayed on the crate page:
15+
16+
> Running the above command will globally install the **rg** binary.
17+
18+
After shipping this feature we got notified that some library crates use binaries for local development purposes and the author would prefer to not have the binaries listed on the crate page. The cargo team has been working on a [solution](https://github.com/rust-lang/cargo/pull/13713) for this by using the `exclude` manifest field, which will be shipped soon.
19+
20+
21+
## Dark mode
22+
23+
If your operating system is set to dark mode, you may have noticed that crates.io now automatically switches to a dark user interface theme. This change was made to make the website more comfortable to use for users who prefer dark themes. If you don't like the dark theme, you can still switch back to the light theme by clicking the color theme icon in the top right corner of the page. By default, the theme will be set based on your operating system's theme settings, but you can also override this setting manually.
24+
25+
Similar to GitHub, we now also support dark/light theme support for images in your `README.md` files:
26+
27+
```html
28+
<picture>
29+
<source media="(prefers-color-scheme: dark)" srcset="https://test.crates.io/logo_dark.svg">
30+
<img src="https://test.crates.io/logo.svg" alt="logo" width="200">
31+
</picture>
32+
```
33+
34+
35+
## RSS feeds
36+
37+
Inspired by our friends at the [Python Package Index](https://warehouse.pypa.io/api-reference/feeds.html), we have introduced a couple of experimental RSS feeds for crates.io:
38+
39+
- <https://static.crates.io/rss/crates.xml>: The latest new crates registered on crates.io (the past 60 minutes, but at least 50 new crates).
40+
- <https://static.crates.io/rss/updates.xml>: The latest version updates on crates.io (the past 60 minutes, but at least 100 version).
41+
- e.g. <https://static.crates.io/rss/crates/serde.xml>: The latest version updates of the `serde` crate (the past 24 hours, but at least 10 versions).
42+
43+
This will allow you to keep track of the latest crate releases and updates in your favorite RSS reader. The original GitHub issue requested a feed for all the crates you "follow" on crates.io, but we decided that per-crate feeds would be more useful for now. If you have any feedback on this feature, please let us know!
44+
45+
46+
## API token expiry notifications
47+
48+
Our crates.io team member [@hi-rustin](https://github.com/hi-rustin) has been very active in improving our API tokens user experience. If you create an API token with an expiry date, you will now receive a notification email three days before the token expires. This will help you to remember to renew your token before it expires and your scripts stop working.
49+
50+
Following this change, he also implemented a way to create API tokens based on existing tokens, which will make it easier to renew tokens without having to reconfigure all the permissions. The user interface on the "API tokens" settings page now shows a "Regenerate" button, which will allow you to copy/clone existing tokens with the same permissions. Similarly, the token expiry notifications will now also contain a link that directly fills in the permissions of the expiring token, so you can easily create a new token with the same permissions.
51+
52+
53+
## Query optimizations
54+
55+
Our latest addition to the crates.io team, [@eth3lbert](https://github.com/eth3lbert), has been working on optimizing the database queries that power crates.io. He has been working on a couple of pull requests that aim to reduce the load on the database server and make the website faster for everyone. Some of the changes he has made include:
56+
57+
- [#7865](https://github.com/rust-lang/crates.io/pull/7865): Further speed-up reverse dependencies query
58+
- [#7941](https://github.com/rust-lang/crates.io/pull/7941): Improve crates endpoint performance
59+
- [#8734](https://github.com/rust-lang/crates.io/pull/8734): Add partial index on versions table
60+
- [#8737](https://github.com/rust-lang/crates.io/pull/8737): Improve the performance of reverse dependencies using the `default_versions` table
61+
62+
In some of these cases we have seen a 10-20x performance improvement. We are very happy to have him on the team and look forward to more improvements in the future!
63+
64+
65+
## New database server
66+
67+
We have recently migrated our database servers to a new provider with more memory and faster storage. This has improved the performance of the website and allowed us to run more complex queries without running into performance issues.
68+
69+
It was previously taking multiple seconds to load e.g. https://crates.io/crates/syn/reverse_dependencies, but now the server usually responds in significantly less than a second. We are very happy with the new servers and hope that you will notice the improved performance as well.

0 commit comments

Comments
 (0)