Native code in Expo SDK 56: inline modules and type generation
Blog post from Expo
Integrating native code with React Native applications is simplified by Expo modules, particularly with the introduction of inline-modules and the expo-type-information package in SDK 56. These updates address previous challenges such as creating package boilerplate and manually maintaining TypeScript interfaces that match native ones in Swift and Kotlin. Inline modules allow developers to write Swift and Kotlin code directly within their project's structure, streamlining the process and reducing overhead. The expo-type-information package further eases the development workflow by automatically generating TypeScript interfaces from Swift modules, using the SourceKitten tool to parse Swift files. This package includes a CLI tool that handles type generation and allows for the efficient creation of TypeScript files corresponding to Swift modules. Despite these enhancements, some limitations persist, such as file naming constraints, language and platform support currently restricted to Swift on macOS, and challenges in resolving certain native types due to SourceKitten's parsing limitations. However, these tools represent a significant step toward more seamless native code integration for React Native developers.