Skip to content

build: mark the package side-effect free - #15

Merged
bvandrc merged 2 commits into
mainfrom
build/side-effects-free
Sep 26, 2026
Merged

bvandrc merged 2 commits into
mainfrom
build/side-effects-free

Conversation

@bvandrc

@bvandrc bvandrc commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Requested by Blake · project thread

Before: a consumer's bundler has to assume importing react-component-test-suite may run something, so it can't drop unused parts of it.

After: "sideEffects": false tells it nothing runs at import time, so unused exports tree-shake away.

How: reviewed src/component-suite.tsx and src/utils/index.ts; both are declarations only. Test-runner hooks are only registered when a suite function is called, never at module scope. The key sits after files, where lint-package-json wants it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YWdSih7WB25vSSmht9igpG

No module runs anything at import time, so a consumer's bundler can drop
whatever it does not use.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YWdSih7WB25vSSmht9igpG
@github-actions

Copy link
Copy Markdown
Contributor

PR Diff Line Count

code comment

${\color{#2da44e}+}$

${\color{#bf8700}\sim}$

${\color{#e5534b}-}$

${\color{#2da44e}+}$

${\color{#e5534b}-}$

Config

${\color{#2da44e}1}$

${\color{#848d97}0}$

${\color{#848d97}0}$

${\color{#848d97}0}$

${\color{#848d97}0}$

GitHub reports ${\color{#2da44e}+1}$ / ${\color{#848d97}-0}$

~ is a line changed in place — cloc counts it once rather than as an add plus a delete, so these columns do not sum to GitHub's.
Blank lines are excluded above: ${\color{#848d97}+0}$ / ${\color{#848d97}-0}$.

@github-actions

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 1.42 kB

ℹ️ View Unchanged
Filename Size
dist/index.js 1.42 kB

compressed-size-action

@bvandrc bvandrc self-assigned this Sep 25, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YWdSih7WB25vSSmht9igpG
@bvandrc
bvandrc marked this pull request as ready for review September 26, 2026 00:10
@bvandrc
bvandrc merged commit 08c7027 into main Sep 26, 2026
5 checks passed
@bvandrc
bvandrc deleted the build/side-effects-free branch September 26, 2026 00:10
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.

2 participants