Emmanuel’s team was moving native iOS and Android shopping flows to React Native, using the web implementation as a reference. The product card alone had about 13,000 lines of code, many delivery and subscription states, and visual experiments. A one-shot rewrite with Cursor or Gemini failed, even with a 200K-token context window.
Bridging the Platform UI Gap with GenAI
Speaker
Ohans Emmanuel, staff engineer at HelloFresh, explains how his team used GenAI to migrate a complex shopping flow from web to React Native at React Universe Conf 2025, hosted by Callstack.
The team needed agents to understand both the web and React Native repositories without loading everything. They used a multi-root workspace and Cursor rules to narrow what the agent could see. They then split work into focused tasks and used Git worktrees so multiple agent sessions could work independently.
To make agent output more reliable, Emmanuel had agents write a failing test first, confirm it failed, and only then implement the change and verify the test passed. For visual checks, agents could run a web server in a chosen product-card state, take screenshots with Puppeteer MCP, and compare them with the implementation.
The team replaced loose combinations of booleans, which could represent contradictory states such as success and error at once, with explicit variants modeled as TypeScript discriminated unions. Exhaustive switches let TypeScript flag missing cases. Agents could use those types to validate their work and correct errors.
Emmanuel summarized the approach as selective context and self-correcting agent workflows. With these methods, the team converted web components into mobile UI and streamlined work that might have taken weeks or months into a few hours.
Takeaways
- Give coding agents only the repository context and files needed for the task.
- Split large migrations into focused tasks that can run in separate Git worktrees.
- Ask agents to prove a test fails before implementing, then verify it passes.
- Use screenshot checks to compare mobile implementations with a running web reference.
- Model UI states with discriminated unions and exhaustive checks to prevent invalid combinations.
Mentioned in this talk
Search inside this talk
What was claimed 8
- metricHelloFresh: World's largest meal kit company
“the world's largest meal kit company”
YouTube Unverified1 source· Talk
- role atOhans Emmanuel is staff engineer at HelloFresh
“I work as a staff engineer for HelloFresh”
YouTube Unverified1 source· Talk
- metricHelloFresh: The web repository has about 10,000 React components
“The web repository has about 10,000 React components”
YouTube Unverified1 source· Talk
- metricHelloFresh: The shopping journey has about 500 React components
“The shopping journey we cared about has about 500 React components”
YouTube Unverified1 source· Talk
- uses
Cursor uses Git worktrees
“Git worktrees ... helped us ... have the agents all work across them”
YouTube Unverified1 source· Talk
- featurePuppeteer MCP: Take screenshots for visual validation
“use the Puppeteer MCP tool to take screenshots and validate them”
YouTube Unverified1 source· Talk
- featureTypeScript: Discriminated unions and exhaustive switches can catch missing cases and prevent invalid UI states
“if ... I removed any of these cases, TypeScript is going to yell”
YouTube Unverified1 source· Talk
- metricHelloFresh: The team streamlined work that would have taken weeks or months into a few hours
“streamline what would have taken us weeks—some would say months—into a few hours”
YouTube Unverified1 source· Talk









