WhoBuilt

Igniting React Native Upgrades with Flame AI

Oct 11, 2023· 31 min· 1.3K views·Watch on YouTube

Speaker

Jamon Holmgren of Infinite Red presents Flame AI, an AI-assisted React Native upgrade CLI, at React Native EU 2023.

Why React Native upgrades are hard

Holmgren recalls that upgrade effort was already a top complaint in a 2018 React Native issue. He describes how project customizations can make template diffs fail to apply, while Upgrade Helper leaves developers to compare files and make changes manually.

How Flame AI applies upgrades

Flame AI is a TypeScript CLI that uses GPT-4 to apply React Native template diffs to the files in a project. It asks the model for change instructions rather than a rewritten file, which Holmgren says uses fewer tokens. The tool was open source, and required a GPT-4 API key.

Review each change interactively

Interactive mode shows the template diff, lets developers choose whether to upgrade each file, and then displays the changes made to their actual files. Holmgren demonstrates it updating package.json, Gradle files, and a customized MainActivity that includes an Expo wrapper. He estimates about 12 to 15 cents for a typical 150-line file and cautions that the tool is around 90% accurate, so developers need to review its work.

Where Flame could go next

When the settings.gradle update did not match the project's style, Holmgren tried to provide guidance and retry, but a Wi-Fi problem prevented the request. Flame can report custom prompts alongside its change summary, which could help teams share useful upgrade guidance. Holmgren also names monorepo support, other model options, and possible recipes for upgrading libraries such as React Navigation as future directions.

Takeaways

  • Review every generated change; Holmgren says Flame is not fully accurate.
  • Interactive per-file review can make upgrade work easier to track.
  • Project customizations such as Expo wrappers can make template diffs fail.
  • Use a clean Git working tree when trying an automated upgrade.
  • Capture useful prompts in shared team guidance for future upgrades.

Mentioned in this talk

Search inside this talk

What was claimed 7

Related talks

Igniting React Native Upgrades with Flame AI, Jamon Holmgren · WhoBuilt