expo-migrate-module
Migrate an Expo Module
Migrate the Swift side of an existing Expo module without changing its observable JS API. Treat the current JS/TypeScript surface and tests as the compatibility contract. Leave Kotlin on the 1.0 DSL unless the user explicitly expands the task.
Prerequisite
The Expo Modules API 2.0 macros require expo 57.0.7 or newer. Before editing, check the target's installed version (expo in package.json/lockfile, or npm ls expo). If it is older, stop and tell the user to upgrade first; do not attempt the migration against an unsupported version. This is a floor, not a guarantee: the exact macro and core surface still varies within 57.x, so step 2 must still verify the checked-out source.
References
- Read
references/migration-map.mdbefore changing source. It contains the 1.0-to-2.0 mappings, semantic traps, and mixed-mode rules. - Read
references/example.mdfor a full before/after walkthrough of one module through mixed mode to a complete migration. Consult it when you need to see how the per-member rules compose. - Read
references/compatibility.mdwhen the checked-outexpo-modules-coreversion or branch is not known to support every requested macro. It explains how to verify the actual compile-time and runtime surface instead of guessing from an SDK number.
Workflow
1. Establish the contract
Inspect repository instructions and the worktree before editing. Locate the Swift module classes, records, shared objects, native views, JS/TS bindings, tests, example app, podspec, and installed or checked-out expo-modules-core.