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

[rustdoc] re-add --disable-minification #129908

Open
lolbinarycat opened this issue Sep 2, 2024 · 5 comments
Open

[rustdoc] re-add --disable-minification #129908

lolbinarycat opened this issue Sep 2, 2024 · 5 comments
Assignees
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@lolbinarycat
Copy link
Contributor

the line to change would be in write_shared.rs:154:
cx.shared.fs.write(filename, f.minified())

this should use f.bytes instead of f.minified() if the --no-minify flag is specified.

this flag would mostly be useful for debugging rustdoc itself, allowing js and css errors to accurately report line numbers.

@lolbinarycat lolbinarycat added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Sep 2, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 2, 2024
@lolbinarycat lolbinarycat self-assigned this Sep 2, 2024
@lolbinarycat
Copy link
Contributor Author

apparently this existed before in the form of --disable-minification, but was removed without discussion in #101702, however, the corrosponding config.toml option build.docs-minification was not removed, instead being silently ignored.

@lolbinarycat
Copy link
Contributor Author

silently ignoring removed options is not a good solution, especially when not all of the documentation has been updated to reflect the removal.

@lolbinarycat
Copy link
Contributor Author

the rationale for removal is that is that it would allow the contents of the file to change without the filename hash changing, but this is easily addressed by just adding nominify after the hash if minification is disabled.

@GuillaumeGomez
Copy link
Member

I don't mind putting back the option but you'll need to have a good use-case for it (implementing the option so it doesn't go against why it was removed originally shouldn't be too complicated).

@lolbinarycat
Copy link
Contributor Author

usecase is i don't want to do hacky and fallible symlink stuff just to get accurate line number reporting.

alternative is making a robust symlink override as part of bootstrap, but that seem like a lot more work than just reinstituting the option

@lolbinarycat lolbinarycat removed the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Sep 5, 2024
@lolbinarycat lolbinarycat changed the title add unstable --no-minify flag to rustdoc [rustdoc] re-add --disable-minification Sep 5, 2024
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants