Skip to content

Add environment-safe chart barrels - #8

Merged
tannerlinsley merged 4 commits into
mainfrom
taren/portable-barrels
Jul 31, 2026
Merged

Add environment-safe chart barrels#8
tannerlinsley merged 4 commits into
mainfrom
taren/portable-barrels

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Jul 31, 2026

Copy link
Copy Markdown
Member

Summary

  • add @tanstack/charts/portable for common authoring, runtime, scene, and static SVG values without browser hosts or adapters
  • add @tanstack/charts/types for portable public contracts
  • isolate DOM host and renderer declarations internally while preserving every existing root export
  • add packed declaration and bundle-boundary gates plus public documentation

Compatibility

The existing @tanstack/charts runtime and type API is unchanged. Both new subpaths are additive, and no platform-specific export conditions are introduced.

All 175 existing root exports remain present. The 12 relocated DOM types retain identical declarations and root exports, and transpiled JavaScript for every modified existing runtime module is byte-identical.

Unsupported deep imports from @tanstack/charts/dist/types are outside the package export map and are not preserved.

The packed portable barrel is 55.27 kB minified / 17.04 kB gzip. Granular subpaths remain available for bundle-sensitive consumers.

Validation

  • pnpm run validate — all 17 Nx targets pass
  • root and seven framework test environments
  • TypeScript and formatting checks
  • packed declarations, runtime exports, and seven framework adapters
  • browser-free portable bundle boundary and existing bundle budgets
  • documentation and catalog contracts/build
  • pnpm changeset status

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@tannerlinsley, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b6fac4bc-e02c-4f6e-8a9a-10b5c9a88620

📥 Commits

Reviewing files that changed from the base of the PR and between ed7bcde and cda2286.

📒 Files selected for processing (27)
  • .changeset/portable-chart-barrels.md
  • API-FRICTION.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/adapter-renderer.ts
  • packages/charts-core/src/adapter.ts
  • packages/charts-core/src/canvas.test.ts
  • packages/charts-core/src/canvas.ts
  • packages/charts-core/src/dom-types.ts
  • packages/charts-core/src/dom.ts
  • packages/charts-core/src/exports.test.ts
  • packages/charts-core/src/index.ts
  • packages/charts-core/src/portable-types.ts
  • packages/charts-core/src/portable.ts
  • packages/charts-core/src/renderer.test.ts
  • packages/charts-core/src/renderer.ts
  • packages/charts-core/src/svg-surface.ts
  • packages/charts-core/src/types.ts
  • scripts/check-packed-consumers.mjs
📝 Walkthrough

Walkthrough

The package adds portable and types entry points, separates DOM-specific contracts from portable types, preserves browser-oriented root exports, and adds packed declaration and bundle-boundary validation.

Changes

Portable package boundaries

Layer / File(s) Summary
DOM contract separation
packages/charts-core/src/dom-types.ts, packages/charts-core/src/types.ts, packages/charts-core/src/{adapter,adapter-renderer,canvas,dom,renderer,svg-surface}.ts, packages/charts-core/src/index.ts, packages/charts-core/src/*test.ts
DOM host, renderer, surface, and tooltip contracts move to dom-types.ts. Root exports retain these contracts, while portable type exports use portable-types.ts.
Portable entry points
packages/charts-core/src/{portable,portable-types,index,exports.test}.ts, packages/charts-core/package.json
The package adds portable runtime and type-only barrels and publishes both subpaths. Export tests cover the new boundaries.
Packed consumer validation
scripts/check-packed-consumers.mjs
Packed checks validate portable declarations, type-only resolution, per-entry build settings, and exclusion of browser-host modules from portable bundles.
Boundary documentation
docs/**, packages/charts-core/docs/**, API-FRICTION.md
Documentation describes root, portable, and type-only import paths. The API friction record marks the browser-host boundary finding as resolved.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PortableConsumer
  participant PortableEntry
  participant PackedConsumerChecks
  PortableConsumer->>PortableEntry: Import portable runtime and types
  PackedConsumerChecks->>PortableEntry: Resolve packed declarations and bundle entry
  PackedConsumerChecks->>PackedConsumerChecks: Reject browser-host modules in portable output
Loading

Possibly related PRs

  • TanStack/charts#5: The package export and packed-consumer changes extend the release and artifact validation introduced in that PR.
🚥 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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the addition of portable, environment-safe chart entry points.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch taren/portable-barrels

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/portable-barrels branch from ed7bcde to 059faf0 Compare July 31, 2026 18:27
@tannerlinsley
tannerlinsley merged commit 0a19e49 into main Jul 31, 2026
23 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