Skip to content

feat(Worklets): getCurrentThreadId function - #10441

Open
tjzel wants to merge 4 commits into
mainfrom
@tjzel/worklets/tid
Open

feat(Worklets): getCurrentThreadId function#10441
tjzel wants to merge 4 commits into
mainfrom
@tjzel/worklets/tid

Conversation

@tjzel

@tjzel tjzel commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

I added a utility function to check current thread id from JavaScript.

TODO: add docs

Test plan

I added a new runtime test suite.

Changelog

  • I added an entry to the Unpublished section of each changed package's CHANGELOG.md, or this PR does not change react-native-reanimated or react-native-worklets.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 887cddb7-5445-446a-b8fa-af80dcaf5f9c

📥 Commits

Reviewing files that changed from the base of the PR and between 99a2ce1 and e0a8d57.

📒 Files selected for processing (1)
  • docs/docs-worklets/docs/utility/getCurrentThreadId.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/docs-worklets/docs/utility/getCurrentThreadId.mdx

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Adds the public getCurrentThreadId API to Worklets. The native JSI proxy serializes the current thread ID and returns it as a string. TypeScript declarations, native delegation, worklet exports, package exports, and the mock API now include the method. The web implementation throws an unsupported-platform error. Runtime tests and documentation cover the API.

Merge Risk: ⚪ Minimal · up to e0a8d

The PR adds a utility for reading the current thread ID with accompanying runtime coverage and documentation; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the primary change: adding the getCurrentThreadId function to Worklets.
Description check ✅ Passed The description directly relates to the changeset. It identifies the new utility function, runtime test suite, and changelog update.
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.

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 requested a review from tshmieldev August 31, 2026 13:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4e38257b-00e5-43a3-832b-f7e5d1627924

📥 Commits

Reviewing files that changed from the base of the PR and between 27f17e8 and 99a2ce1.

📒 Files selected for processing (5)
  • apps/common-app/runtime-tests/worklets/suites.ts
  • apps/common-app/runtime-tests/worklets/tests/runtimes/getCurrentThreadId.test.tsx
  • docs/docs-worklets/docs/utility/getCurrentThreadId.mdx
  • packages/react-native-worklets/src/threads.native.ts
  • packages/react-native-worklets/src/threads.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/react-native-worklets/src/threads.native.ts
  • packages/react-native-worklets/src/threads.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Comment thread docs/docs-worklets/docs/utility/getCurrentThreadId.mdx Outdated
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