Skip to content

feat: Add 'sort-by' option#124

Merged
rschristian merged 1 commit intomasterfrom
feat/order-by
Nov 17, 2025
Merged

feat: Add 'sort-by' option#124
rschristian merged 1 commit intomasterfrom
feat/order-by

Conversation

@rschristian
Copy link
Copy Markdown
Member

Closes #118

@github-actions
Copy link
Copy Markdown

Size Change: 0 B

Total Size: 76 kB

ℹ️ View Unchanged
Filename Size
index.js 76 kB

compressed-size-action

Comment on lines 8 to -12
| Filename | Size | Change | |
| :--- | :---: | :---: | :---: |
| \`four.js\` | 4.5 kB | +9 B (+0.2%) | |
| \`one.js\` | 5 kB | +2.5 kB (+100%) | 🆘 |
| \`two.js\` | 5 kB | -2.5 kB (-33.33%) | 🎉 |
| \`four.js\` | 4.5 kB | +9 B (+0.2%) | |
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This change (and the similar ones throughout our snapshots) is from a slight inconsistency with our tests.

In a real use case, size-plugin-core generates the list of files that get passed to our diffTable function that will generate the markdown, and the file list it forms is alphabetically sorted. In our test suite, however, we manually build a list of files and pass it directly to diffTable without sorting it beforehand ourselves.

As such, if you had these exact same files in a real app, the order above is the order you'd really see. Previously we relied on sorting happening prior to forming the table is all.

@rschristian rschristian merged commit 98b0edc into master Nov 17, 2025
2 checks passed
@rschristian rschristian deleted the feat/order-by branch November 17, 2025 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨Order by

2 participants