Skip to content

Releases: aml2610/react-painter

v1.0.1

01 Apr 09:29

Choose a tag to compare

What's Changed

  • Fixed missing README on npmjs.com by explicitly including README.md in the package files field.

v1.0.0

01 Apr 09:29

Choose a tag to compare

What's Changed

New hooks API

  • usePainter hook — all canvas painting logic extracted into a standalone hook. This is the recommended API for new code:
    import { usePainter } from 'react-painter';
    
    const Drawable = () => {
      const { canvas, triggerSave, setColor } = usePainter({
        width: 300,
        height: 300,
        onSave: blob => console.log(blob),
      });
    
      return <div>{canvas}</div>;
    };
  • ReactPainter render prop still works — it's now a thin wrapper around usePainter, so existing code is unaffected.

Breaking changes

  • React peer dependency bumped to >=16.8.0 (from >=0.14.x) — hooks require React 16.8+. If you're on an older React, stay on 0.5.0.

v0.5.0

01 Apr 09:28

Choose a tag to compare

What's Changed

Modernized build & tooling

  • TypeScript 5 + strict mode — upgraded from TS 2.8, enabled strict, react-jsx transform, bundler module resolution
  • tsup — replaced Babel/tsc with tsup for dual ESM + CJS output with .d.ts declarations
  • ESLint — replaced deprecated tslint with @typescript-eslint/eslint-plugin
  • Vitest — replaced Jest + canvas-prebuilt with Vitest + jsdom + jest-canvas-mock; expanded test coverage to 20 tests
  • Vite demo — replaced Storybook with a lightweight Vite demo app, deployed to GitHub Pages

Breaking changes

  • Dropped prop-types peer dependency — TypeScript types provide the same safety at compile time with zero runtime cost. If you relied on runtime prop validation, this is removed.

Package exports

{
  "import": "./dist/index.mjs",
  "require": "./dist/index.js"
}

Validated with publint and @arethetypeswrong/cli.

Improve code readability

23 Apr 16:52
4ea3327

Choose a tag to compare

  • modularise helpers & keep ReactPainter component lightweight
  • document less clear code paths
  • integrate prettier for code formatting
  • fix image link for story with image (for testing only)
  • fix typos in README

Fix touch

21 Nov 18:42
ffdac06

Choose a tag to compare

The library should be working for touch devices again after a bug fix to event coords extraction.

Bug fix

10 Apr 19:02
50c3daf

Choose a tag to compare

  • fixed a bug causing an intermittent crash while drawing

Change ownership

08 Apr 08:59

Choose a tag to compare

Ownership of the library has changed.
Build and release process have been improved a bit.

Performance Improvement

21 Apr 02:08

Choose a tag to compare

Utilize createImageBitmap (if supported by browser) to improve performance.

Fix README not rendered correctly in npm

15 Apr 05:55

Choose a tag to compare

Version 0.3.0

15 Apr 05:49

Choose a tag to compare

Use render prop object properties to set the line prop e.g. color, lineJoin, and lineCap.
Prop is currently set initialValues of the line prop only.