Bump react-native-worklets to 0.10.x#765
Open
tomekzaw wants to merge 3 commits into
Open
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the repository to use react-native-worklets 0.10.1 and adds a compatibility shim to prevent parser worklets from failing serialization when they capture expensify-common’s Log (a Logger instance), which now throws in Worklets 0.10 instead of silently substituting placeholders.
Changes:
- Bump
react-native-workletsfrom 0.9.1 → 0.10.1 (including example + lockfiles). - Register a custom serializer to replace
Loggerinstances with a no-op stand-in on the worklet runtime. - Update README compatibility matrix to include Worklets 0.10.x.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/MarkdownTextInput.tsx | Registers a custom serialization rule so Logger captured in the parser closure won’t crash Worklets 0.10 serialization. |
| README.md | Extends the Worklets compatibility table to include 0.10.x. |
| package.json | Bumps dev dependency react-native-worklets to 0.10.1. |
| package-lock.json | Updates lockfile entries for react-native-worklets 0.10.1 (and transitive deps). |
| example/package.json | Bumps example app’s react-native-worklets to 0.10.1. |
| example/ios/Podfile.lock | Updates CocoaPods lockfile for RNWorklets 0.10.1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+216
to
+218
| | 0.1.333+ | ❌ | ✅ | ✅ | ✅ | ✅ | | ||
| | 0.1.321 – 0.1.332 | ❌ | ✅ | ✅ | ✅ | ❌ | | ||
| | 0.1.308 – 0.1.320 | ✅ | ❌ | ❌ | ❌ | ❌ | |
Comment on lines
22
to
+33
| let initialized = false; | ||
| let workletRuntime: WorkletRuntime | undefined; | ||
|
|
||
| // The worklet closure of the built-in `parseExpensiMark` parser captures the `Log` singleton from | ||
| // `expensify-common`, and serializing the parser worklet fails because `react-native-worklets` 0.10 | ||
| // can't copy `Logger` class instances. The logger is unused on the worklet runtime, so serialize it as a no-op. | ||
| // `registerCustomSerializable` has been available since react-native-worklets 0.7.0, so this stays | ||
| // compatible with every supported version (on 0.9.x and older it's a harmless no-op — they don't throw). | ||
| function registerLoggerSerializableOnceIfNeeded() { | ||
| type NoopLogger = Record<string, (...args: unknown[]) => void>; | ||
| registerCustomSerializable<NoopLogger, Record<string, never>>({ | ||
| name: 'react-native-live-markdown/Logger', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
Bumps
react-native-workletsto0.10.1and adds compatibility with the 0.10.x line.Worklets 0.10 no longer silently substitutes an inaccessible placeholder for non-plain objects it can't serialize — it throws
Cannot copy value of type `Logger`instead. The built-inparseExpensiMarkparser's worklet closure transitively captures theLogsingleton fromexpensify-common(aLoggerclass instance), so registering the parser crashes the moment a<MarkdownTextInput>mounts.The logger is never invoked on the worklet runtime, so we register a custom serializer (
registerCustomSerializable) that replaces anyLoggerwith a no-op stand-in on the worklet side.registerCustomSerializablehas been available since react-native-worklets 0.7.0, so this stays backwards compatible across the whole supported range (0.9.x and older don't throw, so it's a harmless no-op there).Related Issues
N/A
Manual Tests
Cannot copy value of type `Logger`red screen on mount; with the fix the editor renders and live Markdown formatting works (typed*live*→ bold).Linked PRs
N/A
🤖 Generated with Claude Code