Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ config.watchFolders.push(
module.exports = getBundleModeMetroConfig(config);
```

### 3. Patch Metro for synchronous worklet indexing (recommended)

Bundle Mode isolates worklets into separate modules **on the fly**. Metro builds its file map when it starts, so it can fail to index these freshly generated modules in time — you'll see `Failed to get the SHA-1 for .../.worklets/<id>.js` and need to reload the app a few times before the bundle succeeds.

To avoid this, patch Metro to allow synchronous indexing of the new modules, as described in the [Worklets Bundle Mode setup guide](https://docs.swmansion.com/react-native-worklets/docs/bundleMode/setup). This repository's `example/` app applies such a patch via `resolutions` — use it as a reference.

> Without the patch the app still works, but expect a few extra reloads on first launch while Metro catches up. The one-shot `react-native bundle` command (offline release bundling) requires the patch.

---

## Usage
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"react-native-safe-area-context": "^5.7.0",
"react-native-streamdown": "*",
"react-native-worklets": "0.10.2",
"remend": "1.2.2"
"remend": "1.3.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-streamdown",
"version": "0.2.0",
"version": "0.3.0",
"description": "Markdown Streaming ",
"main": "./lib/module/index.js",
"types": "./lib/typescript/src/index.d.ts",
Expand Down
9 changes: 1 addition & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10566,7 +10566,7 @@ __metadata:
react-native-safe-area-context: "npm:^5.7.0"
react-native-streamdown: "npm:*"
react-native-worklets: "npm:0.10.2"
remend: "npm:1.2.2"
remend: "npm:1.3.0"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -10853,13 +10853,6 @@ __metadata:
languageName: node
linkType: hard

"remend@npm:1.2.2":
version: 1.2.2
resolution: "remend@npm:1.2.2"
checksum: 10c0/e5ff2a4d908114942507765b787e497853a3f58a81adb07f49502bb5e1b9ce492b977fe8cc5b00eb633cd9858b507ee0d0331bd3d667a30e3228ff2ef08332ca
languageName: node
linkType: hard

"remend@npm:1.3.0":
version: 1.3.0
resolution: "remend@npm:1.3.0"
Expand Down
Loading