Skip to content

refactor(Reanimated): rename Mutable.setDirty to setDirtyFlag - #10261

Open
tjzel wants to merge 4 commits into
@tjzel/reanimated/non-optional-synchronizablefrom
@tjzel/reanimated/mutable-mark-dirty
Open

refactor(Reanimated): rename Mutable.setDirty to setDirtyFlag#10261
tjzel wants to merge 4 commits into
@tjzel/reanimated/non-optional-synchronizablefrom
@tjzel/reanimated/mutable-mark-dirty

Conversation

@tjzel

@tjzel tjzel commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Note

This PR description is AI-generated.

Summary

Depends on #10298.

Merge only after Reanimated 4.6.0 is released.

I renamed the mutable-side dirty flag setter from Mutable.setDirty to Mutable.setDirtyFlag. This will avoid adding confusion when I implement a Synchronizable that has setDirty method later on. I also moved the setter into a local function in mutableHostDecorator, so the call from the _value setter is type checked - it used to go through this, which Object.defineProperties types as any.

Test plan

n/a

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fe39ad90-f2a5-4d5b-9247-be52b1936735

📥 Commits

Reviewing files that changed from the base of the PR and between ae28de2 and f442037.

📒 Files selected for processing (3)
  • packages/react-native-reanimated/src/commonTypes.ts
  • packages/react-native-reanimated/src/mutables.native.ts
  • packages/react-native-reanimated/src/mutablesCommon.ts

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Improved internal tracking of mutable value changes.
    • Updated synchronization behavior to consistently recognize clean and dirty states.
    • Preserved existing behavior while improving reliability when mutable values are updated and synchronized.

Walkthrough

The mutable dirty-state method is renamed from setDirty to setDirtyFlag in the public interface, mutable implementation, and synchronization callback.

Changes

Mutable dirty-state API

Layer / File(s) Summary
Rename the mutable dirty-state contract
packages/react-native-reanimated/src/commonTypes.ts, packages/react-native-reanimated/src/mutablesCommon.ts
The Mutable interface and mutable implementation expose setDirtyFlag instead of setDirty. A shared helper updates the dirty flag and internal state.
Update dirty-state synchronization calls
packages/react-native-reanimated/src/mutables.native.ts
The native synchronization callback clears the dirty state with setDirtyFlag(false).

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

Merge Risk: ⚪ Minimal · up to f4420

This is a localized API rename with no actionable merge-blocking risk remaining; it is merge-ready after normal checks and review.

Possibly related PRs

Suggested reviewers: tshmieldev

🚥 Pre-merge checks | ✅ 4
✅ 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 The description accurately explains the Mutable.setDirty to Mutable.setDirtyFlag rename and related implementation changes.
Title check ✅ Passed The title clearly and concisely describes the primary changeset: renaming Mutable.setDirty to Mutable.setDirtyFlag.
✨ 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 @tjzel/reanimated/mutable-mark-dirty

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.

@tjzel
tjzel force-pushed the @tjzel/reanimated/mutable-mark-dirty branch from a7e2f70 to c2f2541 Compare August 13, 2026 12:04
@tjzel
tjzel changed the base branch from @tjzel/worklets/synchronizable-fast-path to @tjzel/reanimated/non-optional-synchronizable August 13, 2026 12:04
@tjzel
tjzel marked this pull request as ready for review August 13, 2026 12:14
@tjzel tjzel changed the title refactor(Reanimated): rename Mutable.setDirty to markDirty refactor(Reanimated): rename Mutable.setDirty to setDirtyFlag Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant