Skip to content
Source
Sign inSign up
TanStack/redact

docs: explain the native renderer module boundary #161

Mergedtannerlinsleymerged 1 commit intomain fromfactory/native-renderer-graph-guidancemerged by tannerlinsley

tannerlinsleycommented

This adds the missing distinction for pages that need both React Three Fiber and Redact. Put the native renderer in its own module graph and DOM root. Keep hook dependencies on the runtime used by that root.

AI review notes: Tested React Three Fiber 9.8.2 with native React and ReactDOM 19.3.1, Vite 8.3.4, and Redact 0.3.1. The two graphs hydrated their original buttons, updated both roots and rendered a WebGL frame in Chromium, Firefox and WebKit. Independent Fast Refresh edits preserved both roots on all three browsers. Package-wide routing failed when both roots used Zustand. This documents the boundary. It makes no runtime or Vite option changes.

Follow-up for #157.

Summary by CodeRabbit

  • Documentation
    • Updated custom-renderer guidance for pages using React Three Fiber and Redact, including how to isolate the renderer and its React dependencies to avoid issues with the Redact root.
    1. ⚠️ No Changeset found

      Latest commit: ee0be28f56c11f1f0a7af639c2755d5c9a71ac16

      Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

      This PR includes no changesets

      When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

      Click here to learn what changesets are, and how to add one.

      Click here if you're a maintainer who wants to add a changeset to this PR

    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      The compatibility guide now explains how to isolate a React Three Fiber renderer from Redact’s React module graph and mount it in a separate DOM root. It also notes that routing all Zustand React imports to native React can break the Redact root.

      Changes: Renderer compatibility

      Layer / File(s)Summary
      React Three Fiber module graph guidance
      docs/compatibility.md
      The guide specifies a separate native React module graph and DOM root for React Three Fiber alongside Redact. It also notes that the graph needs its own React hook dependencies, such as Zustand’s React hook module.

      Estimated code review effort: 1 (Trivial) | ~3 minutes

      Change: Other

      Possibly related issues

      • TanStack/redact#157 — The issue reports React reconciler renderers crashing at import under the Redact Vite plugin. This PR documents a module graph and DOM root boundary, but does not change the runtime or shim.

      Possibly related PRs

      • TanStack/redact#159 — Documents custom renderer compatibility limits; this PR adds React Three Fiber module graph and DOM root guidance.
      • TanStack/redact#72 — Changes the Zustand 4 hook alias path, while this PR documents where Zustand’s React hook module should remain in a React and Redact setup.
      Merge Risk: Minimal · up to ee0be

      The guidance clarifies how to isolate native renderer dependencies and DOM roots. No actionable merge-blocking risk is identified.

      Pre-merge checks: Passed 5
      Check nameStatusExplanation
      Description CheckPassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title checkPassedThe title clearly and concisely describes the main documentation change: explaining the native renderer module boundary.
      Docstring CoveragePassedNo eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Docstring Coverage

      Explanation

      No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

      Finishing Touches
      Generate unit tests (beta)
      • Commit to this branch
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      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
      Recent review info
      Run configuration
      • Source mode: Auto
      • Repository: Unavailable
      • Branch: Unavailable
      • File: No configuration file from this repository applied
      • Commit: Unavailable
      • Layers: defaults
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: ea15e4d2-f3ae-4bab-abb8-9b1d0e1618a6
      Commits

      Reviewing files that changed from the base of the PR and between 105f52fb194d4f55f653b7493c66463b30aac62f and ee0be28f56c11f1f0a7af639c2755d5c9a71ac16.

      Files selected for processing: 1
      • docs/compatibility.md

      Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

    3. tannerlinsley merged thisd86fc21

    4. tannerlinsley closed this

Sign in to join this conversation.