Hargett argues that translating React could extend it to legacy businesses and devices where JavaScript was not already established. He says the goal was to solve product and business problems, not to promote Lua or encourage teams to leave JavaScript and TypeScript. The project reached 150 million active users and, he reports, doubled frame rates while reducing crashes.
Lifting & Shifting Entire React Ecosystem into New Languages
Speaker
Matt Hargett, founder of Rebecca Specialties, describes how he and collaborators brought React and React Native to Lua for a large legacy game platform, in a talk at React Native EU 2023.
The team translated React file by file, starting with dependency-light parts such as Shared and Scheduler, and brought the upstream tests along. Hargett says tests were more useful than types for catching subtle behavioral errors, though they also translated available type definitions. They benchmarked each layer against Node.js in JITless mode and used results to work with the platform’s language team on performance.
The team encountered circular dependencies that Luau could not support, functions that could not carry instance fields, and garbage collection pressure from short-lived objects. They worked around some constraints with dependency injection and an object pool, and used React Native’s renderer as the basis for a custom renderer. Hargett recommends first porting the test and no-op renderers, which helped surface subtle Suspense and Hooks bugs.
The team benchmarked on lower-end devices, measuring time to first paint, time to interactive, and time to fresh data. They built a phased rollout, starting at 0.1% on a platform and ramping up over four to six weeks while monitoring crashes and monetization. Hargett reports that the React port cut total crash volume by 50%; replacing list components later reduced it by another 80%, with fewer than 10 bugs found across QA and production.
After porting Jest and GraphQL manually, the team used a transpiler to speed up the Apollo client port and automate upstream updates. Hargett says 85% of the Jest 27 to Jest 28 upgrade required no human work beyond approving the merge. A colleague also ported FlatList, and Hargett demonstrates React DevTools tests running on Playdate, a Lua-based console.
Takeaways
- Start at dependency-light layers and carry their tests with the translation.
- Use tests to check behavior; types alone may miss subtle runtime errors.
- Benchmark each layer and test performance on the lowest-end target devices.
- Plan staged deployment and monitoring before replacing a critical runtime.
- Automate upstream updates so a successful port remains maintainable.
Mentioned in this talk
Search inside this talk
What was claimed 12
- role atMatt Hargett is founder at Rebecca Specialties
“I’m the founder of Rebecca Specialties.”
YouTube Unverified1 source· Talk
- foundedMatt Hargett founded Rebecca Specialties
“I’m the founder of Rebecca Specialties.”
YouTube Unverified1 source· Talk
- builtMatt Hargett built ReactLuau port
“translating React to Lua, file by file, line by line, character by character”
YouTube Unverified1 source· Talk
- featureReact: Ported to Luau for a legacy game engine
“we were talking about a legacy game engine that had been around for 16 years”
YouTube Unverified1 source· Talk
- metricReact: 100% deployment cut total crash volume in half
“When it was deployed to 100%, it cut the total crash volume in half—a 50% reduction.”
YouTube Unverified1 source· Talk
- featureJest: Ported to Lua
“they ported Jest”
YouTube Unverified1 source· Talk
- builtThis Dot Labs built GraphQLmanual Lua port
“they ported GraphQL manually, character by character, line by line”
YouTube Unverified1 source· Talk
- builtLua port accelerated with its transpiler
“used to dramatically accelerate the port of the Apollo GraphQL client”
YouTube Unverified1 source· Talk
- builtThis Dot Labs built js2luaJavaScript-to-Lua transpiler
“This Dot Labs made a transpiler”
YouTube Unverified1 source· Talk
- featureFlatList: Lua implementation retained a consistent public API
“The API stayed consistent; we just added one or two extra props.”
YouTube Unverified1 source· Talk
- metricReact: Crash volume reduced by a further 80% after replacing list instances
“That reduced the overall crash volume, which had already been cut in half, by another 80%.”
YouTube Unverified1 source· Talk
- featureSentry: Lua client provides Lua stack traces
“ported the Sentry client so that Sentry gets these awesome Lua stack traces”
YouTube Unverified1 source· Talk







