Skip to content

JS build optimization#177

Merged
abkfenris merged 2 commits into
mainfrom
phase-1-js-build-optimization
Jun 25, 2026
Merged

JS build optimization#177
abkfenris merged 2 commits into
mainfrom
phase-1-js-build-optimization

Conversation

@abkfenris

@abkfenris abkfenris commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Actually try to optimize the Javascript build sizes (config needs to be in the root workspace Cargo.toml), and add an actions step that compares the built NPM packages sizes and fails if they get too big (5% larger).

Works on #135 #12


This is part 1 of 6 in a stack made with GitButler:

- Move [profile.release] to workspace root (was silently ignored in js/)
- opt-level z, LTO, codegen-units=1, panic=abort, strip
- Gate console_error_panic_hook behind its feature flag (off by default in release)
- Add wasm-opt -Oz pass via wasm-pack metadata
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

Javascript size report

Size
Base (main) 1188.6 KB
PR 1040.4 KB
Delta -148.3 KB (-12.5%)

✅ Size decreased -12.5%.

@abkfenris abkfenris force-pushed the phase-1-js-build-optimization branch from 26ee719 to 150f479 Compare June 24, 2026 22:28
@abkfenris abkfenris force-pushed the phase-1-js-build-optimization branch from 150f479 to 2d12990 Compare June 24, 2026 22:37
Remove the tag-only guard from build_npm so the npm artifact is built
on every push and PR (the publish step still gates on v* tags).

Add wasm_size job (PR-only) that downloads the build_npm artifact for
the HEAD measurement, builds the base branch from source for the
baseline, posts a sticky markdown comment with the size table, and
fails if the .wasm grows by more than 5%.
@abkfenris abkfenris force-pushed the phase-1-js-build-optimization branch from 2d12990 to a5ed33d Compare June 24, 2026 23:42
@abkfenris abkfenris marked this pull request as ready for review June 25, 2026 17:25
@abkfenris abkfenris merged commit bb7e241 into main Jun 25, 2026
20 checks passed
@abkfenris abkfenris deleted the phase-1-js-build-optimization branch June 25, 2026 17:26
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.

1 participant