Skip to content

perf(packages): declare side effects and test single-export tree-shaking #382

Description

@vamgan

Summary

Add correct sideEffects metadata to Askable packages and single-export consumer bundle fixtures so importing one component/hook does not retain unrelated adapter modules.

Evidence

The React package exports dozens of runtime modules but does not declare sideEffects. A verified esbuild fixture importing only Askable measured:

Import shape Minified gzip
Askable from package root 5,825 B 1,534 B
direct dist/Askable.js 329 B 266 B
package graph with temporary sideEffects: false 329 B 261 B

This is a fast, compatible first phase of the broader lightweight-runtime work in #367.

Proposed fix

  • Add "sideEffects": false to packages with no import-time registration.
  • Treat @askable-ui/web-component separately: split definition from registration or use a precise side-effect allow-list.
  • Add representative bundle fixtures for core and every framework adapter.

Acceptance criteria

  • Single-export imports tree-shake to a small deterministic bundle
  • Web Component registration behavior is preserved
  • esbuild and at least one Rollup/Vite or webpack fixture pass
  • Gzip budgets run in CI
  • Package manifests document intentional side effects
  • Work is linked to perf: add a lightweight runtime entry point and bundle-size budgets #367 as the non-breaking first phase

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions