This document details all directories, files, configurations, and dependencies to remove or clean up when dropping legacy API support (react-native-executorch/legacy and 0.10.0-legacy) from the repository.
Every legacy touchpoint in the codebase is demarcated with // === LEGACY SUPPORT === or # === LEGACY SUPPORT ===.
- Delete
apps/legacy/completely:rm -rf apps/legacy
- Delete
packages/react-native-executorch/legacy/completely:rm -rf packages/react-native-executorch/legacy
In the rewrite, resource fetching/caching was moved directly into core (packages/react-native-executorch/src/fetcher/). The standalone fetcher packages only exist to support the legacy example apps and can be completely removed:
- Delete
packages/expo-resource-fetcher/completely:rm -rf packages/expo-resource-fetcher
- Delete
packages/bare-resource-fetcher/completely:rm -rf packages/bare-resource-fetcher
- Delete legacy versioned docs and sidebars:
rm -rf docs/versioned_docs/version-0.10.0-legacy rm -rf docs/versioned_sidebars/version-0.10.0-legacy-sidebars.json
- In
docs/versions.json, remove"0.10.0-legacy". - In
docs/docusaurus.config.js, remove:lastVersion: 'current'(or revert to standard versioning)'0.10.0-legacy'entry and comment underversions- The
currentlabel override if no longer needed
- In
docs/docs/01-fundamentals/03-migrating-from-v0-9.md, remove the legacy migration path Option A and link to0.10.0-legacy. - In
.gitattributes, remove**/legacy/** linguist-vendoredanddocs/versioned_docs/version-0.10.0-legacy/** linguist-vendoredif present.
-
packages/react-native-executorch/src/native/NativeETInstaller.ts -
packages/react-native-executorch/android/src/main/java/com/swmansion/rnexecutorch/ETInstaller.kt -
packages/react-native-executorch/android/src/main/java/com/swmansion/rnexecutorch/ETInstallerUnavailable.kt
- Under
"workspaces" -> "packages", remove:"apps/legacy/*""// === LEGACY SUPPORT: workspaces ==="
- Remove the
# === LEGACY SUPPORT ===section:apps/legacy/*/ios/ apps/legacy/*/android/ !apps/legacy/bare-rn/ios/ !apps/legacy/bare-rn/android/
- Remove the
overridesblock targeting"packages/react-native-executorch/legacy/**/*"and"apps/legacy/**/*".
- In
"exports", remove:"./legacy": { ... }"// === LEGACY SUPPORT: exports ==="
- In
"files", remove:"legacy""!legacy/cpp/**/tests""// === LEGACY SUPPORT: files ==="
- In
"scripts", change"prepare"from:to:"prepare": "bob build && tsc -p legacy/tsconfig.json"
and remove"prepare": "bob build"
"// === LEGACY SUPPORT: prepare script ===". - In
"dependencies", remove legacy-only dependencies:"jsonrepair""jsonschema""react-native-device-info""zod""// === LEGACY SUPPORT: dependencies ==="
- In
"peerDependencies"and"peerDependenciesMeta", remove:"@kesha-antonov/react-native-background-downloader""// === LEGACY SUPPORT: peerDependencies ==="
- Re-enable
verbatimModuleSyntax: true(or removeverbatimModuleSyntax: false).
- In
"exclude", remove"legacy".
- Remove the
# === LEGACY SUPPORT ===source files block:source_files += [ "legacy/ios/**/*.{h,m,mm}", "legacy/cpp/**/*.{cpp,c,h,hpp}", ]
- Remove the
# === LEGACY SUPPORT ===exclusion block:exclude_files += [ "legacy/cpp/rnexecutorch/tests/**/*", "legacy/cpp/rnexecutorch/jsi/*.{h,hpp}", ] s.preserve_paths = "legacy/cpp/rnexecutorch/jsi/*.{h,hpp}"
- Remove the
# === LEGACY SUPPORT ===header search path:"\"$(PODS_TARGET_SRCROOT)/legacy/cpp\"",
- Remove directory definitions:
set(LEGACY_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../legacy/cpp") set(LEGACY_ANDROID_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../legacy/android")
- Remove
find_package(fbjni REQUIRED CONFIG). - Remove
file(GLOB_RECURSE LEGACY_CPP_SOURCES ...). - Remove
list(APPEND RNE_SOURCES ${LEGACY_CPP_SOURCES} ${LEGACY_ANDROID_DIR}/ETInstallerModule.cpp). - Remove
${LEGACY_CPP_DIR}and${LEGACY_ANDROID_DIR}fromtarget_include_directories. - In
target_link_libraries, remove:ReactAndroid::reactnative fbjni::fbjni android
packages/react-native-executorch/android/src/main/java/com/swmansion/rnexecutorch/RnExecutorchPackage.kt
- In
getModule, remove theETInstaller.NAME -> { ... }case. - In
getReactModuleInfoProvider, remove theETInstaller.NAME to ReactModuleInfo(...)entry.
Once the legacy support code and configurations have been removed, run a git diff against the rne-rewrite branch. These modified configuration and build files should be identical to rne-rewrite (i.e. produce zero diff):
# Verify modified configuration/build files are identical to rne-rewrite (must return 0 diff):
git diff --exit-code origin/rne-rewrite -- \
package.json \
.gitignore \
.eslintrc.js \
packages/react-native-executorch/package.json \
packages/react-native-executorch/tsconfig.json \
packages/react-native-executorch/tsconfig.build.json \
packages/react-native-executorch/react-native-executorch.podspec \
packages/react-native-executorch/android/CMakeLists.txt \
packages/react-native-executorch/android/src/main/java/com/swmansion/rnexecutorch/RnExecutorchPackage.kt
# Check overall branch diff (should only show newly added docs or subsequent bugfixes):
git diff --stat origin/rne-rewriteEnsure no leftover legacy markers remain in the repository:
git grep "LEGACY SUPPORT"(This command should return 0 results after complete removal).
Run the following commands to confirm that the clean repository builds and passes all checks:
# 1. Re-link workspace dependencies
yarn install
# 2. Build bundles
yarn prepare
# 3. Typecheck
yarn typecheck
# 4. Run test suites
yarn workspace react-native-executorch test
# 5. Lint
yarn lint