Skip to content

Harden React Native release publication - #36

Merged
tannerlinsley merged 2 commits into
mainfrom
taren/native-release-followup
Aug 1, 2026
Merged

Harden React Native release publication#36
tannerlinsley merged 2 commits into
mainfrom
taren/native-release-followup

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

  • prevent equivalent scene restoration from re-emitting focus callbacks
  • encode native SVG resource IDs without collisions
  • align React Native install docs and native bundle boundaries
  • add a protected GitHub-hosted path for bootstrapping the sole missing npm package with provenance

Validation

  • pnpm validate
  • pnpm react-native:poc:types
  • pnpm bundle:check
  • pnpm release:artifacts
  • pnpm release:check
  • live bootstrap preparation derived only @tanstack/react-native-charts@0.4.0 as missing and verified attestations for the existing fixed set

Summary by CodeRabbit

  • Bug Fixes

    • Improved chart focus restoration to prevent repeated callbacks when data is unchanged.
    • Preserved distinct SVG resource references, including IDs with punctuation or empty values.
    • Improved tooltip rendering compatibility.
  • New Features

    • Added public access to chart rendering utilities and the React Native chart component.
  • Documentation

    • Updated React Native installation instructions with compatible version requirements and fixture versions.
    • Clarified unsupported React Native environments and scenarios.
    • Documented more reliable package recovery and release procedures.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e020b208-7bf1-4911-970f-f29b3aa74861

📥 Commits

Reviewing files that changed from the base of the PR and between fc02acd and 4fc4454.

📒 Files selected for processing (4)
  • API-FRICTION.md
  • packages/react-native-charts/src/SvgScene.test.tsx
  • packages/react-native-charts/src/SvgScene.tsx
  • scripts/bootstrap-release-package.test.mjs
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/react-native-charts/src/SvgScene.test.tsx
  • API-FRICTION.md

📝 Walkthrough

Walkthrough

Changes

Guarded npm package bootstrap

Layer / File(s) Summary
Release validation contracts
scripts/bootstrap-release-package.mjs, scripts/bootstrap-release-package.test.mjs
The script validates workflow context, release configuration, artifacts, dependencies, registry metadata, integrity, and provenance. Tests cover these rules.
Prepare and publish execution
scripts/bootstrap-release-package.mjs
The script builds artifacts, records a revision-bound plan, publishes one package with provenance, polls registry metadata, and removes temporary credentials.
Workflow wiring and contract tests
.github/workflows/bootstrap-release-package.yml, scripts/bootstrap-release-workflow.test.mjs, API-FRICTION.md
The workflow checks out the exact main revision, prepares the requested package, and conditionally publishes it with restricted permissions and a bootstrap token. Contract tests verify the workflow structure.

React Native rendering and interaction

Layer / File(s) Summary
Focus restoration equality
packages/react-native-charts/src/Chart.tsx, packages/react-native-charts/src/Chart.test.tsx, API-FRICTION.md
Focus restoration compares point values and dates before emitting callbacks. Equivalent inline chart definitions no longer repeat focus callbacks.
Native SVG resource ID encoding
packages/react-native-charts/src/SvgScene.tsx, packages/react-native-charts/src/SvgScene.test.tsx, API-FRICTION.md
Resource IDs encode unsupported characters instead of removing them. Tests verify distinct gradient IDs and matching references.
React Native test rendering support
packages/react-native-charts/src/Tooltip.test.ts, vitest.config.ts, vitest.setup.ts
The React Native View mock renders children and merged styles through a div. Vitest enables the React act environment.

Native distribution and documentation

Layer / File(s) Summary
Native bundle boundary measurement
benchmarks/entries/charts-react-native-universal-boundary.ts, scripts/measure-bundles.mjs, API-FRICTION.md
The benchmark exposes native and universal render entry points. Bundle measurements include the React Native universal static SVG boundary.
React Native installation documentation
docs/installation.md, packages/charts-core/docs/installation.md, packages/react-native-charts/README.md
React Native installation commands pin compatible versions. Documentation lists unsupported scenarios and fixture versions.

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

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant BootstrapScript
  participant NpmRegistry
  participant Npm
  GitHubActions->>BootstrapScript: validate workflow and revision
  BootstrapScript->>NpmRegistry: inspect release metadata
  BootstrapScript->>GitHubActions: write bootstrap plan
  GitHubActions->>BootstrapScript: publish confirmed package
  BootstrapScript->>Npm: publish with provenance
  BootstrapScript->>NpmRegistry: verify integrity and provenance
Loading

Possibly related PRs

🚥 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 summarizes the main objective of hardening React Native release publication and aligns with the bootstrap workflow changes.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch taren/native-release-followup

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.

@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 (2)
scripts/bootstrap-release-package.test.mjs (1)

30-41: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Rename this test and add coverage for a spec outside the fixed set.

The title names two cases, but the body only asserts the multiple-missing case. No test covers the guard that rejects a confirmation that is not a fixed-set package and version (scripts/bootstrap-release-package.mjs lines 85-88). That guard blocks an arbitrary operator-supplied package name, so it deserves a regression.

💚 Proposed test changes
-  it('rejects zero-confirmation and multiple-missing publication', () => {
+  it('rejects publication when more than one fixed package is missing', () => {
     expect(() =>
       selectBootstrapCandidate({
         artifacts,
         expectedSpec: '`@tanstack/react-native-charts`@0.4.0',
         registryPackages: new Map([
           ['`@tanstack/charts`', null],
           ['`@tanstack/react-native-charts`', null],
         ]),
       }),
     ).toThrow(/exactly one missing fixed-set package/)
   })
+
+  it('rejects a confirmation outside the fixed release set', () => {
+    expect(() =>
+      selectBootstrapCandidate({
+        artifacts,
+        expectedSpec: '`@tanstack/unknown-charts`@0.4.0',
+        registryPackages: new Map([
+          ['`@tanstack/charts`', registry(artifacts[0])],
+          ['`@tanstack/react-native-charts`', null],
+        ]),
+      }),
+    ).toThrow(/is not the exact fixed-set package and version/)
+  })
🤖 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/bootstrap-release-package.test.mjs` around lines 30 - 41, Rename the
existing test to describe only the multiple-missing fixed-set package case, then
add a separate test covering selectBootstrapCandidate rejecting an expectedSpec
whose package and version are outside the fixed set. Assert the guard’s
rejection error for the arbitrary operator-supplied spec while preserving the
current multiple-missing assertion.
scripts/bootstrap-release-package.mjs (1)

285-306: 🗄️ Data Integrity & Integration | 🔵 Trivial | 💤 Low value

No change needed for external dependency declarations currently.

The fixed release set uses dependencies for @tanstack/charts workspaces, so validateBootstrapDependencies() validates the current internal links. If the fixed-set packages later add internal links to peerDependencies or optionalDependencies, include those fields in this loop.

🤖 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/bootstrap-release-package.mjs` around lines 285 - 306, No code change
is needed in validateBootstrapDependencies; retain its current dependencies-only
validation because fixed release packages currently declare internal links
there. If fixed-set packages later introduce internal links through
peerDependencies or optionalDependencies, extend the validation loop to process
those fields as well.
🤖 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 `@packages/charts-core/docs/installation.md`:
- Line 21: Update the installation commands in the source documentation under
the root docs/ tree rather than the generated packages/charts-core/docs copy,
then run pnpm docs:sync to regenerate all affected documentation copies.

In `@packages/react-native-charts/src/SvgScene.tsx`:
- Around line 275-281: Update resolveScenePaint to parse empty and
delimiter-containing resource IDs consistently with encodeResourceId, replacing
the non-empty `([^)]+)` capture and truthiness check with parsing that permits
empty IDs and an explicit undefined check. Add regression tests covering empty
IDs and IDs containing `)` to verify the encoded gradient definitions are
correctly resolved and applied.

---

Nitpick comments:
In `@scripts/bootstrap-release-package.mjs`:
- Around line 285-306: No code change is needed in
validateBootstrapDependencies; retain its current dependencies-only validation
because fixed release packages currently declare internal links there. If
fixed-set packages later introduce internal links through peerDependencies or
optionalDependencies, extend the validation loop to process those fields as
well.

In `@scripts/bootstrap-release-package.test.mjs`:
- Around line 30-41: Rename the existing test to describe only the
multiple-missing fixed-set package case, then add a separate test covering
selectBootstrapCandidate rejecting an expectedSpec whose package and version are
outside the fixed set. Assert the guard’s rejection error for the arbitrary
operator-supplied spec while preserving the current multiple-missing assertion.
🪄 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: 1a1cae7a-520f-4086-b540-31d4762d2041

📥 Commits

Reviewing files that changed from the base of the PR and between f7d041f and fc02acd.

📒 Files selected for processing (17)
  • .github/workflows/bootstrap-release-package.yml
  • API-FRICTION.md
  • benchmarks/entries/charts-react-native-universal-boundary.ts
  • docs/installation.md
  • packages/charts-core/docs/installation.md
  • packages/react-native-charts/README.md
  • packages/react-native-charts/src/Chart.test.tsx
  • packages/react-native-charts/src/Chart.tsx
  • packages/react-native-charts/src/SvgScene.test.tsx
  • packages/react-native-charts/src/SvgScene.tsx
  • packages/react-native-charts/src/Tooltip.test.ts
  • scripts/bootstrap-release-package.mjs
  • scripts/bootstrap-release-package.test.mjs
  • scripts/bootstrap-release-workflow.test.mjs
  • scripts/measure-bundles.mjs
  • vitest.config.ts
  • vitest.setup.ts


# React Native
pnpm add @tanstack/react-native-charts react react-native react-native-svg
pnpm add @tanstack/react-native-charts react@^19.2.3 react-native@^0.86.0 react-native-svg@^15.15.4

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

Update the source documentation instead of this generated copy.

These changes are in packages/charts-core/docs/installation.md. Update docs/installation.md, then run pnpm docs:sync to regenerate this file. Direct edits can be overwritten and can leave the published documentation out of sync.

As per coding guidelines, author public documentation only in the root docs/ tree; do not directly edit packages/charts-core/docs because those copies are generated by pnpm docs:sync.

Also applies to: 83-83, 100-100

🤖 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/installation.md` at line 21, Update the
installation commands in the source documentation under the root docs/ tree
rather than the generated packages/charts-core/docs copy, then run pnpm
docs:sync to regenerate all affected documentation copies.

Source: Coding guidelines

Comment thread packages/react-native-charts/src/SvgScene.tsx
@tannerlinsley
tannerlinsley merged commit e08e12c into main Aug 1, 2026
17 checks passed
@tannerlinsley
tannerlinsley deleted the taren/native-release-followup branch August 1, 2026 21:11
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