Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/chart-library-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
- run: pnpm format:check
- run: pnpm docs:check
- run: pnpm typecheck
- run: pnpm react-native:poc:types
- run: pnpm test
- run: pnpm package:check
- run: pnpm bundle:check
Expand Down
113 changes: 113 additions & 0 deletions API-FRICTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ Each entry records:
| F-139 | Top-level entries bypassed tarball validation | Tooling/Release | resolved |
| F-140 | Behavior config could erase responsive datum inference | API | monitoring |
| F-141 | Root barrels crossed the browser host boundary | API/Tooling | resolved |
| F-142 | D3 declarations require a browser image global | Tooling | monitoring |
| F-143 | Native interaction copied DOM-renderer policy | API | monitoring |
| F-144 | CSS theme defaults reach the native scene compiler | API | monitoring |
| F-145 | Text measurement omits native typography | API | monitoring |
| F-146 | Packed declarations assume one platform global set | Tooling | monitoring |
| F-147 | Metro skipped the fixture-owned Babel runtime | Tooling | resolved |

## Findings

Expand Down Expand Up @@ -3420,3 +3426,110 @@ Each entry records:
export, reconciliation, renderer, and SVG surface modules. That full
portable barrel measures 55.26 kB minified and 17.04 kB gzip; granular
subpaths remain the bundle-sensitive option.

### F-142 — D3 declarations require a browser image global

- Status: monitoring
- Severity: medium
- Owner: Tooling
- Observed in: strict DOM-free React Native consumer typecheck
- Friction: after Charts' DOM types were removed from the selected declaration
graph, `skipLibCheck: false` with native libraries still failed in
`@types/d3-array`. Its `blurImage` signature references the browser global
`ImageData`, even though the chart consumer does not import or call that API.
- Current decision: keep the strict configuration as a sentinel. Do not add a
fake `ImageData` declaration, enable DOM libraries, or weaken the package's
runtime boundary to conceal an upstream declaration issue. The normal
React Native configuration passes.
- Verification: the native type gate accepts only the two known
`@types/d3-array` diagnostics or a clean result after the upstream
declaration is fixed. It rejects every other diagnostic.

### F-143 — Native interaction copied DOM-renderer policy

- Status: monitoring
- Severity: high
- Owner: API
- Observed in: React Native focus, selection, and tooltip proof
- Friction: focus preset resolution, stable-point restoration, navigation
order, tooltip content construction, anchor resolution, and placement math
are pure behavior but live as private functions inside `renderer.ts`. The
native proof reproduced them to exercise realistic interaction.
- Current decision: keep the duplication confined to the private proof. A
supported native package requires extracting renderer-neutral interaction
and tooltip state, with the DOM and native hosts consuming the same
implementation.
- Verification: focused native tests cover strategy selection, grouping,
restoration, navigation, supported default content, and placement. The
default native tooltip still lacks the complete `items` formatting contract.

### F-144 — CSS theme defaults reach the native scene compiler

- Status: monitoring
- Severity: high
- Owner: API
- Observed in: React Native paint resolution
- Friction: the shared default theme contains `currentColor`, system CSS names,
and CSS custom properties. The native proof can resolve final paint strings
and their fallbacks, but a dynamic chart builder still receives the web
default theme before the host sees the scene.
- Current decision: the private host resolves final paints explicitly and
never evaluates application CSS. Before release, runtime construction needs
an additive platform-default-theme option used both by dynamic build context
and final theme merging. Structured paint references may be warranted if
more host semantics appear.
- Verification: native paint and full-scene tests contain no unresolved CSS
variable or `currentColor` output. Device themes and dynamic native-theme
builders remain unverified.

### F-145 — Text measurement omits native typography

- Status: monitoring
- Severity: high
- Owner: API
- Observed in: React Native SVG labels and automatic guide layout
- Friction: `ChartTextMeasureOptions` carries size and weight but not font
family, style, stretch, letter spacing, direction, locale, or font-scale
policy. The native painter accepts a `fontFamily`, while the shared layout
cannot ask a native measurer for the same font.
- Current decision: expose the existing injected measurer in the proof and do
not claim text parity. Production work must complete the typography contract
and decide how native asynchronous measurement feeds deterministic scene
layout without hidden mounted views.
- Verification: injected-measurer core tests pass. No iOS or Android font-scale
and clipping matrix has been run.

### F-146 — Packed declarations assume one platform global set

- Status: monitoring
- Severity: medium
- Owner: Tooling
- Observed in: evaluating a release gate for the private React Native package
- Friction: the existing packed fixture compiles web packages under DOM
libraries. Loading React Native declarations in that same TypeScript program
introduces incompatible duplicate globals. Removing DOM libraries makes the
web contracts invalid and also exposes F-142.
- Current decision: keep the private proof out of the publishable-package
matrix. Its source package, native consumer, isolated bundle, Metro bundles,
and no-browser source-map boundary are checked separately.
- Follow-up: add a native-specific build, pack, install, declaration, Metro,
and platform-condition fixture before making the package publishable.

### F-147 — Metro skipped the fixture-owned Babel runtime

- Status: resolved
- Severity: medium
- Owner: Tooling
- Observed in: rebuilding the React Native POC after removing redundant root
dependencies
- Friction: the example correctly declared `@babel/runtime`, but Metro resolved
React Native from pnpm's physical store path and searched that path's
ancestors instead of the example's `node_modules`. Production bundling
failed on `@babel/runtime/helpers/interopRequireDefault` unless the dependency
was duplicated at the workspace root.
- Decision: configure Metro's `resolver.nodeModulesPaths` with the example and
workspace module roots. Keep Babel ownership in the example rather than
masking the monorepo resolution boundary with a root dependency.
- Verification: all eight blank, RNSVG, core, and full-chart production bundles
complete for iOS and Android. The full-chart source-map checks also exclude
every guarded browser implementation module.
Loading
Loading