Replies: 1 comment 2 replies
-
In our experience, minifying the bundle before compiling to byte code always makes the final bundle smaller. You can try it for yourself. esbuild is so fast anyway, I doubt the time savings will be significant compared to the whole bundle step. Would it be possible for you to do the bundling outside of Gradle? We've found that having bundling as part of Gradle (or Xcode) increases build times even though you haven't touched JS files. In our projects, the recommendation is to split the two and run them separately. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently when building my app using
@rnx-kit/metro-serializer-esbuild
, I need to disable Hermes error reporting because Hermes finds a lot of warnings (likethe variable "Promise" was not declared in function
). For each warning, it outputs the error and the line causing the error. But as the custom serializer minifies the JSbundle, this line is the full JSbundle, so the full bundle is displayed once per warning into the terminal. For the Android build, this makes Gradle use ~10 GB of RAM, just due to these messages.Disabling Hermes warnings may not be a good idea as there might be some that are useful.
When using Hermes, an Hermes bundle is compiled once the JS bundle is written. This Hermes bundle is a custom binary format, so I am wondering if we could disable minification for esbuild users when Hermes is used for both Android & iOS?
This makes the builds go faster (no minify step), and when Hermes displays warnings, then show the correct line content and does not flood the terminal.
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions