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

Generate scraped examples buttons in JS #130069

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Sep 7, 2024

Follow-up of #129796.

To reduce the page size when there are scraped examples, we can generate their buttons in JS since they require JS to work in any case. There should be no changes in display or in functionality.

You can test it here.

cc @willcrichton
r? @notriddle

@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 Sep 7, 2024
@rustbot
Copy link
Collaborator

rustbot commented Sep 7, 2024

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @jsha

@rust-log-analyzer

This comment has been minimized.

if (!example.classList.contains("expanded")) {
expandButton = createScrapeButton(buttonHolder, "expand", "↕");
}
const isHidden = example.parentElement.classList.contains("more-scraped-examples");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed something while hunting through the code behind this variable.

image

Notice something wrong with this screenshot?

According to this code, the isHidden variable is actually used because the number of lines is supposed to be different depending on whether it's hidden or not. It looks like this was silently broken and nobody noticed.

Is this important, or should it just be simplified away?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a question for @willcrichton. :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an issue with this PR? If I glance at the Bevy docs, they seem to show the correct behavior:
Screenshot 2024-09-07 at 3 33 24 PM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link you gave is for 0.14.1. Try 0.14.2.

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm planning to send a follow-up PR to revert the height change since it's not linked to the current PR. Does it sound good to you @notriddle ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. 👍

@notriddle
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Sep 19, 2024

📌 Commit 1ca3e90 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 Sep 19, 2024
@GuillaumeGomez
Copy link
Member Author

Ok, opening an issue then.

@bors rollup

@bors
Copy link
Contributor

bors commented Sep 19, 2024

⌛ Testing commit 1ca3e90 with merge 749f80a...

@bors
Copy link
Contributor

bors commented Sep 19, 2024

☀️ Test successful - checks-actions
Approved by: notriddle
Pushing 749f80a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 19, 2024
@bors bors merged commit 749f80a into rust-lang:master Sep 19, 2024
7 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Sep 19, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (749f80a): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 769.055s -> 769.206s (0.02%)
Artifact size: 341.32 MiB -> 341.23 MiB (-0.03%)

@GuillaumeGomez GuillaumeGomez deleted the gen-scraped-buttons branch September 19, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

7 participants