Skip to content
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

Fix missing minification for static files #104404

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

GuillaumeGomez
Copy link
Member

It's a fix for #101702.

The problem was that Path::ends_with doesn't do what we thought it does: it checks if the entire item is the last path part, no just if the "path string" ends with the given argument. So instead, I just used the extension() method to get the information we want.

cc @jsha
r? @notriddle

PS: Is it worth it to add a CI test to ensure that the minification was performed on JS and CSS files or not?

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 14, 2022
@notriddle
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Nov 14, 2022

📌 Commit e6baae5 has been approved by notriddle

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 14, 2022
@GuillaumeGomez
Copy link
Member Author

@bors rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 15, 2022
…iaskrgr

Rollup of 13 pull requests

Successful merges:

 - rust-lang#103842 (Adding Fuchsia compiler testing script, docs)
 - rust-lang#104354 (Remove leading newlines from `NonZero*` doc examples)
 - rust-lang#104372 (Update compiler-builtins)
 - rust-lang#104380 (rustdoc: remove unused CSS `code { opacity: 1 }`)
 - rust-lang#104381 (Remove dead NoneError diagnostic handling)
 - rust-lang#104383 (Remove unused symbols and diagnostic items)
 - rust-lang#104391 (Deriving cleanups)
 - rust-lang#104403 (Specify language of code comment to generate document)
 - rust-lang#104404 (Fix missing minification for static files)
 - rust-lang#104413 ([llvm-wrapper] adapt for LLVM API change)
 - rust-lang#104415 (rustdoc: fix corner case in search keyboard commands)
 - rust-lang#104422 (Fix suggest associated call syntax)
 - rust-lang#104426 (Add test for rust-lang#102154)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f0978ee into rust-lang:master Nov 15, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 15, 2022
@GuillaumeGomez GuillaumeGomez deleted the fix-missing-minification branch November 15, 2022 09:57
@nnethercote
Copy link
Contributor

This caused a significant doc perf regression when it was merged as part of the rolloup in #104428. @GuillaumeGomez, is this expected? Is it because more data is being minified and that takes more time?

@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented Nov 16, 2022

It was not expected. Minification isn't supposed to take so much time. There isn't much we can do about it though I'm afraid... Maybe check if the file exists before generating it? I'll send a PR for that.

@GuillaumeGomez
Copy link
Member Author

Actually I need the file to be minified to get the hash so it wouldn't change anything. I guess there is nothing we can do in here. It's just a perf regression that wasn't taken into account when #101702 was made because it wasn't using minification.

@jsha
Copy link
Contributor

jsha commented Nov 16, 2022

Actually, #101702 had a performance improvement of the same size as the regression. At the time I thought it was because it was more efficiently interpolating filenames; but in retrospect it looks like the improvement was due to accidentally not minifying anything. So I think the perf regressions from this PR just take us back to baseline.

@GuillaumeGomez
Copy link
Member Author

More or less yes. I personally think it's acceptable for the time being to not require an immediate action. We are working on performance continuously so it'll be fixed at some point. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants