Skip to content

Fix hydration recovery crashes#1062

Merged
tannerlinsley merged 1 commit into
mainfrom
taren/update-redact-0.0.19
Jul 25, 2026
Merged

Fix hydration recovery crashes#1062
tannerlinsley merged 1 commit into
mainfrom
taren/update-redact-0.0.19

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Jul 25, 2026

Copy link
Copy Markdown
Member

What changed

  • update @tanstack/redact from 0.0.18 to 0.0.19
  • keep the root theme class read safe during document recovery

Why

Browser extensions such as Dark Reader can mutate styles before hydration. Redact 0.0.19 tolerates those mutations and repairs document-shell mismatches in place instead of temporarily removing document.documentElement.

Validation

  • pnpm test — 24 passed, 1 skipped
  • commit hook reran formatting, TypeScript, lint, and unit tests

Summary by CodeRabbit

  • Bug Fixes

    • Improved theme class handling to prevent errors when the page document is unavailable.
    • Ensured consistent HTML class behavior across client-side and server-side rendering environments.
  • Chores

    • Updated an internal development tool to a newer version.

@coderabbitai

coderabbitai Bot commented Jul 25, 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

Run ID: cca2b235-5d46-4177-9095-e00ed9466007

📥 Commits

Reviewing files that changed from the base of the PR and between ba2c61e and bad6929.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • src/components/ThemeProvider.tsx

📝 Walkthrough

Walkthrough

The PR makes client-side HTML class lookup null-safe in ThemeProvider.tsx and updates the @tanstack/redact development dependency version in package.json.

Changes

ThemeProvider DOM safety

Layer / File(s) Summary
Null-safe HTML class lookup
src/components/ThemeProvider.tsx
getHtmlClass uses optional chaining and returns an empty string when document.documentElement is unavailable.

Development dependency update

Layer / File(s) Summary
Redact version constraint
package.json
The @tanstack/redact development dependency is updated from ^0.0.18 to ^0.0.19.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: schiller-manuel

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: fixing crashes during hydration recovery.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch taren/update-redact-0.0.19

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com bad6929 Commit Preview URL

Branch Preview URL
Jul 25 2026, 12:18 AM

@tannerlinsley
tannerlinsley merged commit 936967c into main Jul 25, 2026
7 checks passed
@tannerlinsley
tannerlinsley deleted the taren/update-redact-0.0.19 branch July 25, 2026 00:20
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