Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(metro-service): avoid spinning up the file watcher #2334

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/polite-needles-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rnx-kit/metro-service": patch
"@rnx-kit/cli": patch
---

Avoid spinning up the file watcher when bundling
2 changes: 1 addition & 1 deletion packages/metro-service/src/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export async function bundle(
platform: args.platform,
unstable_transformProfile: args.unstableTransformProfile,
};
const server = new Server(config);
const server = new Server(config, { watch: false });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this change will we be able to still spin up the file watcher if we want? Rather than hardcoding this as false, shall it make sense to take this option as an input?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would you want to watch the files for a bundle command?
If you are starting a metro server then it would make sense. But I believe this code is only hit in the single bundle case, in which case spinning up a watcher is just overhead.


try {
const bundle = await output.build(server, requestOpts);
Expand Down