JonnyBurger / npx-visualize-bundle

Analyse your React Native bundle in 1 command
https://npmjs.com/package/visualize-bundle
MIT License
162 stars 8 forks source link

Mention Hermes? #15

Open henrymoulton opened 3 years ago

henrymoulton commented 3 years ago

Hi Jonny,

Thanks for the library I've used it in most of my projects over the years. I believe that this is is creating a regular bundle to be interpreted with JSC and not the bundle/bytecode that would be interpreted by Hermes.

The final sizes might differ but it's still useful to examine the contents

JonnyBurger commented 3 years ago

Interesting, I did not consider it - I think the library also came out before Hermes was announced.

My goal is for this tool to show the bottlenecks and proportions of the bundle and I would assume they are the same for JSC than they are for Hermes.

Is it even the case that the RN bundler creates a different bundle depending on if it's JSC and Hermes? I thought both were just JS interpreters but it's the same JS.

henrymoulton commented 3 years ago

Is it even the case that the RN bundler creates a different bundle depending on if it's JSC and Hermes? I thought both were just JS interpreters but it's the same JS.

No I don't believe so as Hermes is a bundle of bytecode rather than text.

This post gives a good overview about how to interact with the bundle. https://suam.wtf/posts/react-native-application-static-analysis-en/

JonnyBurger commented 3 years ago

Since the bundle is the same for JSC and Hermes, I don't see how this tool should be adjusted for Hermes. It only looks at the data in on the bundle level, disregarding any JS engine optimizations that one might have in the stack. Also, I have no idea how technically this could be implemented.