Skip to content

Rename portable chart barrel to universal - #20

Merged
tannerlinsley merged 5 commits into
mainfrom
taren/universal-chart-barrel
Jul 31, 2026
Merged

Rename portable chart barrel to universal#20
tannerlinsley merged 5 commits into
mainfrom
taren/universal-chart-barrel

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Jul 31, 2026

Copy link
Copy Markdown
Member

What

  • replace the unreleased @tanstack/charts/portable subpath with @tanstack/charts/universal
  • keep the browser-first @tanstack/charts root entry unchanged
  • expose generic tooltip and portal token contracts from the environment-safe type barrel
  • rename declaration artifacts and update docs, export tests, packed-consumer checks, and release metadata

Why

universal describes the cross-runtime surface without implying a specialized portability mode. The generic token exports let non-DOM hosts implement definition extensions without hidden core imports. The published 0.0.2 package contains neither /portable nor /types, so no compatibility alias is needed.

Impact

This is non-breaking for published consumers. Existing root imports and runtime behavior are unchanged.

Checks

  • pnpm run validate — 17/17 tasks passed before the final type-only token export
  • pnpm package:check
  • pnpm typecheck
  • packed universal entry — 53.95 kB minified / 16.60 kB gzip
  • export tests — 3/3 passed
  • docs sync and docs checks
  • changeset status

Summary by CodeRabbit

  • New Features

    • Added the @tanstack/charts/universal entry point for cross-runtime chart definitions and scene compilation.
    • Added universal tooltip extension and portal token types.
    • Preserved existing browser-focused root exports.
  • Documentation

    • Updated installation, reference, and API documentation from “portable” to “universal.”
    • Documented universal import paths and tooltip token types.
  • Tests

    • Updated compatibility checks to validate universal imports, token types, and Web Worker support.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3b52d289-24cd-4ed2-a38b-d551cb8401c2

📥 Commits

Reviewing files that changed from the base of the PR and between e95fc43 and 6fac158.

📒 Files selected for processing (1)
  • benchmarks/comparison/bundle-baseline.json

📝 Walkthrough

Walkthrough

The package renames portable chart barrels to universal barrels, updates published export maps, adds generic tooltip token exports, and expands packed consumer validation. Documentation and release metadata use universal terminology. Comparison metadata references a newer workspace revision.

Changes

Universal entry points

Layer / File(s) Summary
Universal package contracts
packages/charts-core/package.json, packages/charts-core/src/index.ts, packages/charts-core/src/universal.ts, packages/charts-core/src/universal-types.ts
The package replaces portable exports with universal exports and adds ChartTooltipExtensionToken and ChartTooltipPortalExtensionToken.
Packed consumer validation
packages/charts-core/src/exports.test.ts, scripts/check-packed-consumers.mjs
Tests and packed consumer checks validate the universal entry point, generic tooltip tokens, Web Worker declarations, and universal renderer boundaries.
Documentation and release terminology
API-FRICTION.md, CHANGELOG.md, .changeset/universal-chart-barrels.md, docs/..., packages/charts-core/docs/...
Documentation and release notes describe universal entry points and environment-neutral tooltip contracts.

Comparison metadata

Layer / File(s) Summary
Comparison revision refresh
benchmarks/comparison/bundle-baseline.json, docs/comparison.md, packages/charts-core/docs/comparison.md
Comparison metadata now references workspace revision 4a8a256 and updated benchmark measurements and generation time.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • TanStack/charts#8: Introduced the portable chart barrels that this PR renames and extends.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: renaming the portable chart barrel to universal.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch taren/universal-chart-barrel

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tannerlinsley
tannerlinsley force-pushed the taren/universal-chart-barrel branch from 56b8a45 to 4a8a256 Compare July 31, 2026 20:05
@tannerlinsley
tannerlinsley marked this pull request as ready for review July 31, 2026 20:33

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
scripts/check-packed-consumers.mjs (1)

1114-1127: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Also validate the token re-exports through @tanstack/charts/universal.

The contract validates ChartTooltipExtensionToken and ChartTooltipPortalExtensionToken only through @tanstack/charts/types. It does not exercise the export type * from './universal-types' path in packages/charts-core/src/universal.ts. Add aliased imports from @tanstack/charts/universal and assign the fixtures to those aliases. Keep the existing /types imports to retain coverage for both public paths.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/check-packed-consumers.mjs` around lines 1114 - 1127, Extend the
universalSource fixture in check-packed-consumers to import
ChartTooltipExtensionToken and ChartTooltipPortalExtensionToken from
`@tanstack/charts/universal` under distinct aliases, while keeping the existing
imports from `@tanstack/charts/types`. Assign the token fixtures to those aliases
so both public re-export paths are validated.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/universal-chart-barrels.md:
- Around line 5-7: Update the changeset description to explicitly name both
tooltip-extension and portal-token contracts, while preserving its existing
statements about the /universal and /types entry points and browser-oriented
root exports.

In `@packages/charts-core/docs/comparison.md`:
- Around line 15-22: Update the source documentation file corresponding to
docs/comparison.md rather than editing the generated packages/charts-core copy,
then run pnpm docs:sync to regenerate packages/charts-core/docs/comparison.md
and preserve the documented comparison entries.

---

Nitpick comments:
In `@scripts/check-packed-consumers.mjs`:
- Around line 1114-1127: Extend the universalSource fixture in
check-packed-consumers to import ChartTooltipExtensionToken and
ChartTooltipPortalExtensionToken from `@tanstack/charts/universal` under distinct
aliases, while keeping the existing imports from `@tanstack/charts/types`. Assign
the token fixtures to those aliases so both public re-export paths are
validated.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7cbfe4d2-6774-4f96-8e2b-25fca9e7b4d9

📥 Commits

Reviewing files that changed from the base of the PR and between d5f11d2 and e95fc43.

📒 Files selected for processing (19)
  • .changeset/portable-chart-barrels.md
  • .changeset/universal-chart-barrels.md
  • API-FRICTION.md
  • CHANGELOG.md
  • benchmarks/comparison/bundle-baseline.json
  • docs/comparison.md
  • docs/installation.md
  • docs/reference/index.md
  • docs/reference/types.md
  • packages/charts-core/docs/comparison.md
  • packages/charts-core/docs/installation.md
  • packages/charts-core/docs/reference/index.md
  • packages/charts-core/docs/reference/types.md
  • packages/charts-core/package.json
  • packages/charts-core/src/exports.test.ts
  • packages/charts-core/src/index.ts
  • packages/charts-core/src/universal-types.ts
  • packages/charts-core/src/universal.ts
  • scripts/check-packed-consumers.mjs
💤 Files with no reviewable changes (1)
  • .changeset/portable-chart-barrels.md

Comment on lines +5 to +7
Add environment-safe `/universal` and `/types` entry points, including generic
tooltip-extension token contracts for non-DOM hosts, while preserving the
existing browser-oriented root exports.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Name both token contracts in the changeset.

The changeset mentions tooltip-extension token contracts but does not explicitly mention portal-token contracts. Name both tooltip and portal token contracts so the release note matches the public API.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.changeset/universal-chart-barrels.md around lines 5 - 7, Update the
changeset description to explicitly name both tooltip-extension and portal-token
contracts, while preserving its existing statements about the /universal and
/types entry points and browser-oriented root exports.

Comment on lines +15 to +22
| [TanStack Charts](./overview.md) | `@tanstack/charts` | workspace `4a8a256` |
| [Chart.js](https://www.chartjs.org/docs/latest/) | `chart.js` | npm `4.5.1` |
| [Apache ECharts](https://echarts.apache.org/handbook/en/best-practices/canvas-vs-svg/) | `echarts` | npm `6.1.0` |
| [Recharts](https://recharts.github.io/en-US/) | `recharts` | npm `3.10.1` |
| [Observable Plot](https://observablehq.com/plot/features/plots) | `@observablehq/plot` | npm `0.6.17` |

The competitor versions are exact package pins, not latest versions inferred
at page render time. The measured TanStack workspace revision is `b1bba0e`.
at page render time. The measured TanStack workspace revision is `4a8a256`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Regenerate this documentation copy instead of editing it directly.

Update docs/comparison.md, then run pnpm docs:sync to produce packages/charts-core/docs/comparison.md. Direct edits to the generated copy can be overwritten and can cause documentation drift.

As per coding guidelines: do not directly edit packages/charts-core/docs because these copies are generated by pnpm docs:sync.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/charts-core/docs/comparison.md` around lines 15 - 22, Update the
source documentation file corresponding to docs/comparison.md rather than
editing the generated packages/charts-core copy, then run pnpm docs:sync to
regenerate packages/charts-core/docs/comparison.md and preserve the documented
comparison entries.

Source: Coding guidelines

@tannerlinsley
tannerlinsley merged commit 8e327e0 into main Jul 31, 2026
13 of 15 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant