Skip to content

Bump react-native-worklets to 0.10.x#765

Open
tomekzaw wants to merge 3 commits into
mainfrom
@tomekzaw/worklets-0.10-compat
Open

Bump react-native-worklets to 0.10.x#765
tomekzaw wants to merge 3 commits into
mainfrom
@tomekzaw/worklets-0.10-compat

Conversation

@tomekzaw

@tomekzaw tomekzaw commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Details

Bumps react-native-worklets to 0.10.1 and 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-in parseExpensiMark parser's worklet closure transitively captures the Log singleton from expensify-common (a Logger class 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 any Logger with a no-op stand-in on the worklet side. registerCustomSerializable has 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

  • Ran the example app on the iOS simulator and Android emulator: without the fix both render the 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

tomekzaw and others added 3 commits July 3, 2026 12:16
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-worklets from 0.9.1 → 0.10.1 (including example + lockfiles).
  • Register a custom serializer to replace Logger instances 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 thread README.md
Comment on lines +216 to +218
| 0.1.333+ | ❌ | ✅ | ✅ | ✅ | ✅ |
| 0.1.321 – 0.1.332 | ❌ | ✅ | ✅ | ✅ | ❌ |
| 0.1.308 – 0.1.320 | ✅ | ❌ | ❌ | ❌ | ❌ |
Comment thread src/MarkdownTextInput.tsx
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',
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.

2 participants