Meeting Notes 2021-09-21 #653
afoxman
started this conversation in
Bundle Working Group
Replies: 1 comment 2 replies
-
Hi there! I'm Jon, an engineer at Stripe working on Metro stuff and I'm keen to talk about this stuff with other folks working in the same space. If you all are open to it I'd like to participate here and join meetings if they're open. Email: jdlm at stripe dot com For context we are pretty far along the path to running Metro as a dev time bundler in one of our largest frontend codebases. Early results are showing substantial speed improvements over our existing Webpack 4 setup. Thanks! |
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
-
Meeting Notes
Thank you for meeting and sharing your ideas and work! Below are my notes from the meeting. There were lots of details flying around, so there's a chance I missed something or misunderstood. Please reply with corrections/comments.
How we'll communicate
I'll record monthly meetings and post them for all members of the working group.
Metro Module IDs
Currently numeric. Can change between builds.
AirBNB needs stability between builds. They've updated a private fork of Metro to support using a hash.
Facebook (Hermes) also needs stability, but they like the optimizations they get from using a range of nubmers from 0-N. Internally, they associate modules with their IDs, and use that to inform module assignment in future builds (where possible).
AirBNB is interested in upstreaming their work to Metro, and Facebook is on-board with that so long as numeric IDs are still available.
Developer pain points
Expo:
Facebook:
Q: Has anyone experimented with Metro to only watch files that are "require()"d (avoiding full FS-crawl)? Or chunked-up the crawl?
Metro uses a haste-map which needs a full crawl to discover modules.
Metro just recently added support for replacing the default haste-map with a custom implementation
Could try replacing with a "dumb" map that hits the file-system to fulfill each request
Could also integrate with more complex build systems which have their own cache
Metro now allows a custom haste-map implementation, which opens up areas for experimentation to address perf issues around FS crawling/caching.
Metro remote caching
Facebook: All the pieces are there, we just need a guide for developers to make use of them. Show them how to set up an S3 bucket, for example.
AirBNB: Already implemented this exact solution. Seeing major gains during dependency-graph computation, in particular. Down from minutes to under a minute.
Opportunity here to open-source the docs, if not the code for an S3 bucket, and have a big impact.
esbuild
Expo:
Microsoft:
A promising area for continued experimentation, including other native tools like SWC as they mature.
Summary
Metro Module IDs: AirBNB may open-source their hash-based solution. Facebook would support it.
Haste-maps and crawling the file-system: Metro config supports a custom haste-map implementation. Opens up experiments for possible haste-map / watchman replacement.
esbuild: Experiments ongoing. Expo and Microsoft working in this area for both react-native and web apps. AirBNB interested. Other native tools like SWC aren't there yet but could change things yet again.
Beta Was this translation helpful? Give feedback.
All reactions