Skip to content

Update navigator.gpu usage guidance for react-native-worklets - #509

Merged
wcandillon merged 1 commit into
mainfrom
claude/jolly-sagan-u85j2h
Oct 8, 2026
Merged

wcandillon merged 1 commit into
mainfrom
claude/jolly-sagan-u85j2h

Conversation

@wcandillon

Copy link
Copy Markdown
Owner

Summary

Updated documentation and code examples to reflect improved support for navigator.gpu on worklet runtimes in recent versions of react-native-worklets, while maintaining guidance for older versions.

Key Changes

  • Updated JSDoc comments in packages/webgpu/src/install.ts: Changed the known limitations section to clarify that the globalThis.navigator workaround is only needed for react-native-worklets versions before 0.13.0, and updated the example to use bare navigator instead
  • Simplified API documentation in apps/docs/content/api/install-webgpu.mdx:
    • Removed outdated explanation about the Worklets babel plugin limitation
    • Updated code examples to use bare navigator.gpu instead of globalThis.navigator.gpu
    • Added a warning callout specifically noting the workaround requirement for older versions (< 0.13.0)

Implementation Details

The changes reflect that react-native-worklets 0.13.0+ now properly treats bare navigator as a known global in the Worklets babel plugin, eliminating the need for the globalThis prefix. However, backward compatibility guidance is preserved for users on older versions of the library.

https://claude.ai/code/session_01RsoYkvJ8tYvuA1iddPzK1n

The Worklets babel plugin treats navigator as a known global since
react-native-worklets 0.13.0, so the globalThis.navigator workaround is
only needed on older versions.
@wcandillon
wcandillon merged commit 0420879 into main Oct 8, 2026
4 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.13.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant