v0.21.0
Last "polish" minor before v1.0 — closes the gaps left over from the
v0.17 deep audit. Frontend test coverage triples, the README finally
gets a TOC + a separate config reference, the Alpine factory stops
using any, autoRetry becomes a proper policy, and the BatchUploader
queue can survive page reloads via a pluggable persistence adapter.
Added
- Vue composable test suite (5 tests). Covers
useBatchUploadreactivity, scope teardown,onCompleteunsub, cancel state, and the polymorphicuseUpload(File | File[]). - React hook test suite (6 tests). Powered by
@testing-library/react. CoversuseBatchUploadshape after mount, state during a successful upload, unmount cleanup,onCompleteforwarding, and theuseUploadpolymorphism. - Alpine factory test suite (10 tests). A fake
Alpineinstance captures the registered factory; tests instantiate the data object with a$dispatchspy and verify the lifecycle events fire on a real upload through a mocked fetch. AlpineLikeandAlpineContexttype interfaces (@netipar/chunky-alpine). The factories no longer takeAlpine: any— they declare the minimalAlpine.data()shape, and the$dispatchcasts go throughas unknown as AlpineContext. Lets TypeScript catch typos inchunky:*event names without dragging Alpine into the package as a peer dep.autoRetrycallback form (@netipar/chunky-core).ChunkUploadOptions.autoRetryacceptsboolean | (error, { chunkIndex, retriesLeft }) => boolean. The default policy now refuses to retry HTTP 400/401/403/404/410/413/415/422 — those won't change on retry. Pass a callback to override.BatchPersistence<T>adapter interface (@netipar/chunky-core). OptionalBatchUploadOptions.persistencelets a host-app IndexedDB / localStorage adapter persist the pending-batch queue across page reloads. Files themselves still need re-resolution by the host app (the type is generic over a serialised representation).scripts/bump-version.shin the repo. Bumps the four npm package.json files in lockstep usingnode(preserves formatting). Replaces the previous out-of-repobump-version.shreference.docs/directory withdocs/configuration.md— the full configuration reference + deployment recipes. The README's giant config table moved here, README is back to a TOC + tutorial-shape document.- README table of contents at the top with anchored links to every major section, plus pointers to UPGRADE / SECURITY / CHANGELOG / docs/configuration.
Changed
ChunkUploaderandBatchUploaderpublic fields are@deprecatedin TypeScript. The replacement is the existinggetState()method. The fields stay until v1.0 for back-compat; new code should read state throughgetState()or thestateChangeevent so the v1.0 private-state migration is mechanical.
Documentation
- README slimmed by ~80 lines — the configuration reference moved to
docs/configuration.md. The README is now intent-shaped (quickstart → install → usage → events) rather than reference-shaped.
npm packages
- All packages bumped to
0.21.0(frontend additions —BatchPersistence, autoRetry callback,AlpineLike/AlpineContext,@deprecatedfield annotations). @testing-library/reactandreact-domadded to root devDependencies for the React hook test suite.