Repository navigation
chore: add a bundle size summary to the build all examples script - #316
Merged
Merged
Conversation
The sizes are reported in PR descriptions, in the maxGraph release notes and in a follow-up spreadsheet to track how the size of an app changes between maxGraph versions. Collecting them from the per-file listing was manual, so the script now ends with a Markdown table and a CSV line, in the same format as the build script of the maxGraph repository. Unlike the maxGraph script, which keeps only the largest JS file, all JS files of an example are summed: Farm puts part of the maxGraph code in its small file. The app code is counted too, which is fine since it barely changes and only the variations matter. The rsbuild index file is excluded as it only holds the HTML generation and the app initialization. SvelteKit is left out, as its server and client files cannot be told apart reliably for now.
SonarCloud flags a case statement without a default branch. All examples other than rsbuild keep every JS file, so the default branch is intentionally empty.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



The bundle sizes of the examples are reported in PR descriptions, in the maxGraph release notes and in a follow-up spreadsheet, to track how the size of an app changes between maxGraph versions. Until now they had to be collected by hand from the per-file listing printed by
build-all-examples.bash.The script now ends with a Markdown table and a CSV line, in the same format as the build script of the maxGraph repository. It also works with
--list-size-only.How the size is computed
The maxGraph script keeps only the largest JS file of each example. That does not fit the bundlers used here, so the JS files of an example are summed instead:
index.*.jsfile is excluded, as it only holds the HTML generation and the app initialization.distdirectory is reported asN/A.The app code is counted too. This is fine since it barely changes: the goal is to follow the variations between maxGraph versions, not the absolute contribution of maxGraph.
Output example