Skip to content

fix(recharts): expose strict consumer types - #730

Closed
jonkwheeler wants to merge 2 commits into
octanejs:mainfrom
jonkwheeler:jon/fix-recharts-strict-consumer
Closed

jonkwheeler wants to merge 2 commits into
octanejs:mainfrom
jonkwheeler:jon/fix-recharts-strict-consumer

Conversation

@jonkwheeler

@jonkwheeler jonkwheeler commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Strict TypeScript apps can now import @octanejs/recharts without compiling its internal TSRX and vendored JavaScript source graph. The package selects its existing Octane-native public declarations for type resolution while preserving the source entry for runtime compilation.

The packed-consumer canary now imports and renders a Recharts bar chart and verifies that its exported component props remain typed.

Fixes #726.

Validation

  • pnpm format:check
  • pnpm typecheck
  • pnpm test
  • targeted tests:
    • node --test scripts/package-pack-canaries.test.mjs scripts/typecheck-files.test.mjs (21 passed)
    • packed @octanejs/recharts installed in an external strict TypeScript project with types: []; tsc --noEmit passed
    • targeted Prettier check and git diff --check passed

Risk / follow-ups

The full package-pack canary and Recharts Vitest project could not run locally. This shell uses Node 22.14.0, below the repository's required 22.22.2, and the isolated filtered install lacks unrelated root Vitest configuration dependencies. CI should run both with the supported toolchain.

Provenance

  • An agent produced this diff (agent-authored)

Note

Low Risk
Packaging and declaration-only changes with no runtime logic edits; main consumer impact is clearer typings and fewer accidental deep source compiles.

Overview
@octanejs/recharts now resolves TypeScript through src/index.d.ts instead of the source entry, so strict consumers no longer typecheck the full internal TSRX and vendored JS graph. Runtime still uses src/index.ts via conditional exports.

The public declaration file is expanded with additional components (e.g. Cell, Layer, Surface, ErrorBar), chart hooks (useChartWidth, axis/scale helpers), and AnimationControllerProvider. Brush and Treemap are removed from the declared surface (aligned with the Octane port gaps); the packed type probe expects @ts-expect-error when importing them.

Packed TSRX canary coverage now includes Recharts: a sample BarChart in the consumer fixture and strict AssertNotAny checks on BarProps and related exports, plus an updated changeset and validation messaging.

Reviewed by Cursor Bugbot for commit ef52d8c. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix labels Aug 12, 2026
@github-actions
github-actions Bot marked this pull request as draft August 12, 2026 14:56

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit a2e1d1d. Configure here.

Comment thread packages/recharts/package.json Resolved
trueadm added a commit that referenced this pull request Aug 12, 2026
* fix(bindings): validate strict packed TSRX consumers (#721)

* fix(recharts): expose strict consumer types (#726)

* fix(recharts): align public type exports (#730)

* test(packages): enforce strict TSRX source consumers (#721)

* Address PR review feedback (#733)

- install the complete packed workspace dependency closure
- allow pnpm to install required external peers

* Clarify deferred strict binding coverage (#733)

- defer Recharts source compilation until tsrx-tsc resolves extensionless TSRX imports

* Address PR review feedback (#733)

- keep precise API probe packages installed when source validation is deferred

* Fix packed TSRX consumer dependency graph

---------

Co-authored-by: Dominic Gannaway <[email protected]>
@leonidaz

Copy link
Copy Markdown
Collaborator

this was superseded by #733, and commited in 0b7460e

@leonidaz leonidaz closed this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@octanejs/recharts is unusable under a strict consumer typecheck

2 participants