Index of every page on this site: llms.txt
All skills
software-mansion-labs avatar

/enable-worklets-bundle-mode

@43cde80
Run it yourself

Enable react-native-worklets Bundle Mode (imports inside worklets, third party libraries on worklet runtimes) in an Expo, RN CLI or brownfield React Native app, including the mandatory metro/metro-runtime patches. Use when the user asks to enable Bundle Mode, wants to import npm libraries inside worklets or offload JS code to worklet runtimes, or hits "Failed to get the SHA-1" errors in a worklets Bundle Mode project / missing Fast Refresh for worklet code. Covers enabling only — not disabling; upgrades react-native-worklets to a compatible version when needed, but never installs it from scratch and never touches Reanimated.

Use this Skill: https://skilld.dev/gh/software-mansion-labs/skills/enable-worklets-bundle-mode

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencespatching-patch-package.md

≈571 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Bundle Mode metro patches — npm / Yarn 1 classic (patch-package)

Applies the metro + metro-runtime Bundle Mode patches with patch-package. Use the patch-package-format patch files (named metro+{ver}.patch / metro-runtime+{ver}.patch). With Yarn classic the flow is identical — swap npm commands for their yarn equivalents (yarn patch-package instead of npx patch-package, yarn install instead of npm ci).

BASE=https://raw.githubusercontent.com/software-mansion/react-native-reanimated/main/packages/react-native-worklets/bundleMode/patches

Download the patch files from $BASE/patch-package/{metro,metro-runtime}/ into ./patches, then run npx patch-package. Make sure a prepare or postinstall script runs patch-package so it re-applies after installs.

Check where each package physically sits first (ls -d node_modules/metro node_modules/metro-runtime node_modules/*/node_modules/metro-runtime node_modules/@*/*/node_modules/metro-runtime). In npm workspace repos metro-runtime is often NOT hoisted to root (nested under react-native, metro, etc.) and the stock patch fails with "Patch file found for package metro-runtime which is not present at node_modules/metro-runtime".

Do NOT reach for npm dedupe to force hoisting — a full-tree dedupe re-resolution can corrupt the lockfile's peer-dep layout (seen: it hoisted fdir away from its picomatch@^3||^4 peer, making every subsequent npm ci fail validation). Instead patch the nested copy that actually ends up in the app bundle — react-native's own (react-native/Libraries/Utilities/HMRClient.js is what imports metro-runtime/src/modules/HMRClient):

# apply the stock patch content inside react-native (paths line up with -p1 from there)
cd node_modules/react-native && patch -p1 < ../../patches/metro-runtime+0.84.4.patch && cd ../..
# generate the nested patch (note the dir/package syntax → '++' in the filename)
npx patch-package react-native/metro-runtime
# the root-level metro-runtime patch is replaced by the nested one
rm patches/metro-runtime+0.84.4.patch
npx patch-package   # verify: metro ✔ and react-native/metro-runtime ✔

The metro package itself is normally hoisted, so metro+<ver>.patch applies at root as-is.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill enables Bundle Mode for react-native-worklets by updating Babel and Metro configurations and applying official patches to the Metro bundler. It fetches these patches from the official software-mansion GitHub repository and applies them using standard package management tools.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 43cde80. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 4 months ago
metadata
{
  "author": "Tomasz Żelawski",
  "version": "1.0.0"
}
Other metadata
compatibility
Requires network access to raw.githubusercontent.com and api.github.com to fetch metro patches

README badge

README badge for software-mansion-labs/skills/enable-worklets-bundle-mode