Summary
Add a genuinely lightweight Askable entry point and enforce browser bundle-size budgets in CI.
Why
Askable's runtime benchmarks are healthy, but bundle weight is not currently budgeted. A measured consumer that imports only useAskable from @askable-ui/react/core still bundles approximately 63.5 KB minified / 18.2 KB gzip on main (40a3374). Importing from the normal React entry is approximately 65.0 KB minified / 18.5 KB gzip.
The main reason is structural: createAskableContext() is implemented by a large class in packages/core/src/context.ts, so optional source resolution, packet/protocol, async subscription, viewport, serialization, and related behavior cannot be tree-shaken at the method level. The current /core framework subpaths reduce exports but do not provide a truly small runtime.
Package evidence after build:
@askable-ui/core: ~147 KB tarball / ~693 KB unpacked
@askable-ui/react: ~77 KB tarball / ~389 KB unpacked
- core package source maps account for roughly 43% of built
dist
Runtime performance itself is currently good: all 9 existing core benchmark budgets pass, including 10k-element observation in ~26 ms. This proposal is about transfer/parse weight and preventing future regressions.
Proposed direction
- Add a minimal runtime entry point, for example
@askable-ui/core/lite, containing only:
- annotate/observe/select/push
- current focus + bounded history
- sanitization
- basic prompt serialization
- lifecycle/events
- Keep advanced capabilities opt-in through explicit subpaths/plugins:
- sources/async resolution
- context packet protocol
- inspector
- region/text capture
- extended browser sources
- Add matching framework entry points such as
@askable-ui/react/lite.
- Add a deterministic esbuild-based bundle check to CI with committed gzip budgets.
- Consider omitting source maps from published tarballs or making that an explicit release tradeoff while retaining declarations.
Acceptance criteria
Summary
Add a genuinely lightweight Askable entry point and enforce browser bundle-size budgets in CI.
Why
Askable's runtime benchmarks are healthy, but bundle weight is not currently budgeted. A measured consumer that imports only
useAskablefrom@askable-ui/react/corestill bundles approximately 63.5 KB minified / 18.2 KB gzip onmain(40a3374). Importing from the normal React entry is approximately 65.0 KB minified / 18.5 KB gzip.The main reason is structural:
createAskableContext()is implemented by a large class inpackages/core/src/context.ts, so optional source resolution, packet/protocol, async subscription, viewport, serialization, and related behavior cannot be tree-shaken at the method level. The current/coreframework subpaths reduce exports but do not provide a truly small runtime.Package evidence after build:
@askable-ui/core: ~147 KB tarball / ~693 KB unpacked@askable-ui/react: ~77 KB tarball / ~389 KB unpackeddistRuntime performance itself is currently good: all 9 existing core benchmark budgets pass, including 10k-element observation in ~26 ms. This proposal is about transfer/parse weight and preventing future regressions.
Proposed direction
@askable-ui/core/lite, containing only:@askable-ui/react/lite.Acceptance criteria