Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 1.54 KB

AGENTS.md

File metadata and controls

18 lines (12 loc) · 1.54 KB

AGENTS.md

Working notes for agents (and humans) contributing to this repository.

What matters here

react-chartjs-2 is a thin React wrapper around Chart.js: a <Chart> component, typed components per chart type (<Line>, <Bar> and others) and a few event helpers. Chart.js does the drawing; this package only connects its lifecycle and data updates to React.

  • Stay thin. Anything Chart.js already does belongs to Chart.js. New props and options are added only when they cannot be expressed through Chart.js options, plugins or a ref to the chart instance.
  • Bundle size matters. The package is tree-shakeable and its size is a tested contract (.size-limit.json): a consumer pays only for the components they import. Follow the tree-shaking and size-limit skills.
  • Compatibility is part of the API. The package supports every React version from the peerDependencies range. Since v6 it ships only the ES module build, which Node.js 20.19+ and 22.12+ can also require(). Narrowing either is a breaking change.

Repository layout

  • src — the library sources; unit tests live next to them as *.spec.tsx (see the unit-tests skill).
  • stories — Storybook stories, the place to check a component by eye.
  • sandboxes — standalone example apps. The documentation website builds them into its example pages, and StackBlitz opens them straight from GitHub, so each sandbox keeps its own package.json with dependencies from npm.
  • website — the documentation website, https://react-chartjs-2.js.org.