Problem
Lottie animation resources are bundled along the main js bundle. They constitute around 5M of 29M bundle in release mode which is significant. The issue with including such resources in a bundle is that this data needs to be parsed and allocated (these objects will also be quite large and require a tons of allocations because of their structure) which slows down the startup time.
All of that only happens such that this object can be serialized to string and parsed again by the native Lottie code. The source of the issue is the fact Lottie assets are imported using bundler import statement much like you do with other resources like images.
Solution
The fix is to change the way these files are imported and allow Lottie load them directly from the app assets using resource link.
Problem
Lottie animation resources are bundled along the main js bundle. They constitute around 5M of 29M bundle in release mode which is significant. The issue with including such resources in a bundle is that this data needs to be parsed and allocated (these objects will also be quite large and require a tons of allocations because of their structure) which slows down the startup time.
All of that only happens such that this object can be serialized to string and parsed again by the native Lottie code. The source of the issue is the fact Lottie assets are imported using bundler
importstatement much like you do with other resources like images.Solution
The fix is to change the way these files are imported and allow Lottie load them directly from the app assets using resource link.