Skip to content

Conversation

@ianbotsf
Copy link
Contributor

Issue #

(none)

Description of changes

This change refactors the trimNavigationFiles task to improve performance by using the Gradle Worker API. I measured the delta on my dev machine:

  • Before: 22m 24.17s
  • After: 13.871s (~97x speed)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ianbotsf ianbotsf requested a review from a team as a code owner October 20, 2025 17:05
@ianbotsf ianbotsf added the no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly. label Oct 20, 2025
Comment on lines +62 to +90
val doc = Jsoup.parse(navigation)

// Remove all parent directory elements from all navigation links
doc.select("a[href^=../]").forEach { anchor ->
var href = anchor.attr("href")

while (href.startsWith("../")) {
href = href.removePrefix("../")
}

anchor.attr("href", href)
}

// Trim side menus
doc.select("div.sideMenu > div.toc--part")
.filterNot { it.id().startsWith("$moduleName-nav-submenu") }
.forEach { moduleMenu ->
val moduleRow = moduleMenu.select("div.toc--row").first()!!
val toggleButton = moduleRow.select("button.toc--button").single()
toggleButton.remove()

moduleMenu.children()
.filterNot { it == moduleRow }
.forEach { it.remove() }
}

// Update navigation.html
val trimmedSideMenuParts = doc.select("div.sideMenu > div.toc--part")
navigation.writeText("<div class=\"sideMenu\">\n$trimmedSideMenuParts\n</div>")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note for reviewers: This section is copied directly from the old task impl. No non-refactoring changes made.

@github-actions
Copy link

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

@github-actions
Copy link

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

@ianbotsf ianbotsf merged commit 43d2ae8 into main Oct 23, 2025
21 checks passed
@ianbotsf ianbotsf deleted the chore-refactor-trim_navigation_files branch October 23, 2025 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants