WhoBuilt

You’re Loading Too Much Unnecessary Hermes Polyfills

Jun 5, 2025· 6 min· 9.3K views·Watch on YouTube

Speaker

Michał, a principal engineer at Callstack, explains how React Native teams can reduce app size and improve startup performance by removing unnecessary Hermes internationalization polyfills and choosing platform-specific libraries.

Check which Hermes polyfills you need

Michał shows a project using the Internationalization API to format numbers in German. The app includes several polyfills because the team thought Hermes lacked some internationalization support. The React Native Optimization Guide says that, as of January 2025, some of those polyfills are unnecessary.

Measure the bundle and bytecode

Michał explains that React Native tooling normally bundles JavaScript and compiles it to Hermes bytecode before it reaches users. In his example, the original JavaScript bundle is 3.5 MB and the bytecode is 2.3 MB.

Remove redundant polyfills

After removing unnecessary polyfills, the JavaScript bundle falls to 3.2 MB and the Hermes bytecode to 2.1 MB. Michał says the smaller output can reduce app size and may improve time to interactive on some devices.

Prefer platform-specific libraries

Michał recommends React Native Quick Crypto instead of CryptoJS, saying it can execute around 50 times faster. He also suggests native stack and bottom-tab navigators from React Navigation, alongside other platform-specific libraries listed in Callstack’s guide.

Takeaways

  • Check whether your Hermes version already supports the internationalization APIs covered by your polyfills.
  • Measure both the JavaScript bundle and Hermes bytecode before and after removing polyfills.
  • Evaluate React Native Quick Crypto as an alternative to CryptoJS when using cryptographic operations.
  • Consider native stack and bottom-tab navigators for platform-specific navigation optimizations.

Mentioned in this talk

Search inside this talk

What was claimed 8

Related talks