Skip to content

replace source view / handler with redirect to crates.io source view#3390

Open
syphar wants to merge 1 commit into
rust-lang:mainfrom
syphar:no-source
Open

replace source view / handler with redirect to crates.io source view#3390
syphar wants to merge 1 commit into
rust-lang:mainfrom
syphar:no-source

Conversation

@syphar

@syphar syphar commented Jul 2, 2026

Copy link
Copy Markdown
Member

IMO with the new crates.io source browser, we don't need our (super old) source browser any more.
Of course we'll keep the rustdoc source browsers. storage-features that were only there for the source browser can go too.

Happy to discuss, not sure if I forget use-cases that crates.io doesn't support?

  • SEO / crawling?
  • binary file download from the archive (I'm actually fine with removing this, for security)

I spent some time to build it in a way that old URLs to specific files are properly redirected to the corresponding crates.io source file.

Source archives stay for now, we use them to fetch readme's later. I might switch that to fetching them from crates.io too, let's see.

When this is deployed and works fine, we can stop storing the source file list in releases.files and drop the column. This will save us some storage and give us some performance.

@syphar syphar self-assigned this Jul 2, 2026
@github-actions github-actions Bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Jul 2, 2026
@syphar syphar force-pushed the no-source branch 3 times, most recently from 51bfa85 to de70f3e Compare July 2, 2026 05:11
@syphar syphar marked this pull request as ready for review July 2, 2026 05:12
@syphar syphar requested a review from a team as a code owner July 2, 2026 05:12
@syphar

syphar commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

@GuillaumeGomez I'm not sure how to best fix the gui tests:

2026-07-02T06:22:53.3451771Z ======== out/gui-tests/crate-pages.goml ========
2026-07-02T06:22:53.3452352Z 
2026-07-02T06:22:53.3452527Z [ERROR] line 16
2026-07-02T06:22:53.3452881Z     at `out/gui-tests/utils.goml` line 51
2026-07-02T06:22:53.3454673Z     at `out/gui-tests/utils.goml` line 6: `.description-container .pure-menu-horizontal ul.pure-menu-list > li a.pure-menu-active .title` not found: for command `assert-text: (|tabs_menu_selector| + " > li a.pure-menu-active .title", |tab_name|)`
2026-07-02T06:22:53.3460806Z     at <https://crates.io/crates/sysinfo/0.23.5/code/>
2026-07-02T06:22:53.3461158Z [ERROR] line 16
2026-07-02T06:22:53.3461394Z     at `out/gui-tests/utils.goml` line 51
2026-07-02T06:22:53.3462417Z     at `out/gui-tests/utils.goml` line 8: ".description-container .pure-menu-horizontal ul.pure-menu-list > li:nth-of-type(2) a.pure-menu-active" not found: for command `assert: |tabs_menu_selector| + " > li:nth-of-type(" + |current_tab| + ") a.pure-menu-active"`
2026-07-02T06:22:53.3463468Z     at <https://crates.io/crates/sysinfo/0.23.5/code/>
2026-07-02T06:22:53.3463783Z [ERROR] line 16
2026-07-02T06:22:53.3464005Z     at `out/gui-tests/utils.goml` line 51
2026-07-02T06:22:53.3464497Z     at `out/gui-tests/utils.goml` line 22: `div.container` not found: for command `assert-css: ("div.container", {
2026-07-02T06:22:53.3464995Z                 "margin-top": "0px",
2026-07-02T06:22:53.3465533Z                 "margin-bottom": "0px",
2026-07-02T06:22:53.3465819Z                 "margin-left": "0px",
2026-07-02T06:22:53.3466083Z                 "margin-right": "0px",
2026-07-02T06:22:53.3466346Z             })`
2026-07-02T06:22:53.3466599Z     at <https://crates.io/crates/sysinfo/0.23.5/code/>
2026-07-02T06:22:53.3466932Z [ERROR] line 16
2026-07-02T06:22:53.3467154Z     at `out/gui-tests/utils.goml` line 51
2026-07-02T06:22:53.3468021Z     at `out/gui-tests/utils.goml` line 31: `.description-container .pure-menu-horizontal ul.pure-menu-list > li:nth-of-type(3)` not found: for command `click: |tabs_menu_selector| + " > li:nth-of-type(" + |current_tab| + ")"`
2026-07-02T06:22:53.3468902Z     at <https://crates.io/crates/sysinfo/0.23.5/code/>
2026-07-02T06:22:53.3469122Z 
2026-07-02T06:22:53.3469126Z 
2026-07-02T06:22:53.3469277Z <= doc-ui tests done: 13 succeeded, 1 failed, 0 filtered out

@GuillaumeGomez

Copy link
Copy Markdown
Member

crates.io source view doesn't work without JS unlike docs.rs. Not sure if important or not though...

@syphar

syphar commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

crates.io source view doesn't work without JS unlike docs.rs. Not sure if important or not though...

oh yeah, valid point. Do you have a tendency?

Non-JS People won't even reach the source view through the menu, only way is probably through search results somehow.

@GuillaumeGomez

Copy link
Copy Markdown
Member

Someone mentioned on the crates.io zulip thread that it was an issue for them.

@syphar

syphar commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

Someone mentioned on the crates.io zulip thread that it was an issue for them.

I'm wondering:

  • if there are enough no-js users to justify a third code browser, and
  • if the non-js users would be fine with the rustdoc source view, which seems to work without js too?

@GuillaumeGomez

Copy link
Copy Markdown
Member

if there are enough no-js users to justify a third code browser, and

I'd say no. But considering we had a meeting about rust websites coherency, I would have expected such discussions to happen before crates.io team decided to do it on their own with an inferior version in pretty much all regards, leaving the debate for us to decide if it's worth keeping these pages or just remove them and leave them to crates.io's.

if the non-js users would be fine with the rustdoc source view, which seems to work without js too?

The rustdoc output is incomplete, it doesn't list all files in the published crate, so the end goal is different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants