-
Notifications
You must be signed in to change notification settings - Fork 20
[code-infra] Update renderMarkdownReport #345
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
Conversation
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
The example above shows the same bundles in and above the expandable details. Can we show tracked bundles above and all measured ones in details? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM besides the suggestion from Michal. 👍
Thanks for adding the fallbackDepth
feature. 🙏 💯
@michaldudak Updated, I'm also filtering out the already tracked bundles as they're shown at the top |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A side
* @param {number} [fallbackDepth=3] - How many parent commits to try as fallback | ||
* @returns {Promise<{snapshot: import('./sizeDiff').SizeSnapshot | null, actualCommit: string | null}>} | ||
*/ | ||
export async function fetchSnapshotWithFallback(repo, commit, fallbackDepth = 3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reminds me of the Argos CI logic I wrote in the past, we had to walk the git commit tree to find a usable snapshot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's also possible, but wouldn't work on the frontend
const summaryText = hasMore | ||
? `Show details for ${cappedEntries.length} more ${bundleWord} (${detailsEntries.length - maxDetailsLines} more not shown)` | ||
: `Show details for ${cappedEntries.length} more ${bundleWord}`; | ||
markdownContent += `<details>\n<summary>${summaryText}</summary>\n\n`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A markdown table formatting could probably help the readability. I kind of feel that only the link to the web view is readable. But maybe we don't even need to list the details in markdown. Only having the web view seems fine. So maybe to delete in the first place.
track
option to declare a predefined set of bundles as a summary, it will always show statistics for these bundlesfallbackDepth
option to specify how many commits to go back on the base branch in case a snapshot isn't found. (can be useful when the base branch is still building)Example:
@mui/material/Button/index.js parsed: 🔺+400B(+2.67%) gzip: 🔺+100B(+2.22%)
Show details for 2 more bundles
@mui/icons-material/Add.js parsed: 🔺+100B(+10.00%) gzip: 🔺+50B(+16.67%)
@mui/icons-material/Delete.js parsed: 🔺+100B(+8.33%) gzip: 🔺+50B(+14.29%)
Details of bundle changes