Skip to content

Optimise the size of iOS artifacts #368

@grabbou

Description

@grabbou

Problem

Right now, the artifact itself is rather large after all architectures, dSYMs, and bitcode were included - 2GB. We need to find a way to reduce this to a reasonably small size, so that it doesn't affect React Native users.

The goal is to reduce the size so that it comes w/o penalty for new React Native applications.

Solution

  • Optimise size of hermes-engine-darwin npm package
    • Turn off bitcode (2GB with bitcode enabled for three architectures, 12MB without bitcode). While it saves the size, it makes it impossible to build React Native with bitcode, which comes "on" by default. Potential change in the default template possible as long as it makes sense to do so. We can also disable bitcode for iphonesimulator architectures as I think it makes no sense to ship that for non-release architectures (won't be able to build for simulator in the release tho)
    • Decide what to do with symbols - dSYM weights 200mb
  • Make it optional package, so that users will have to install hermes-engine-darwin npm package on demand (unlike for Android) - size constraint doesn't affect the initial setup time. Potential degraded DX as it requires many actions to be done to enable Hermes
  • Do not use npm for hermes-engine-darwin, but use CocoaPods dependency management mechanism. We can publish full Hermes to CocoaPods repository and it will be automatically installed as soon as React Native users change the flag in a Podfile to enable_hermes. This is done by removing path to a Hermes podspec that points to node_modules.
  • Build Hermes in the user land (don't ship artifacts)

Opening this issue to discuss potential ways going forward and options that we have.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions