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

Dev server v2 causes spurious restarts of Architect sandbox services, causing sluggish DX #6780

Closed
1 task done
lpsinger opened this issue Jul 6, 2023 · 4 comments · Fixed by #6781
Closed
1 task done

Comments

@lpsinger
Copy link
Contributor

lpsinger commented Jul 6, 2023

What version of Remix are you using?

1.18.1

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

Architect supports sandbox plugins that implement the sandbox.start method to launch arbitrary background services. (For example, my own plugin @nasa-gcn/architect-plugin-search starts up ElasticSearch to mock up Amazon OpenSearch).

If you are using the Remix v2_dev future feature with Architect and you have sandbox plugins, then every time that you change a file that triggers a rebuild (for example, a route module), it stops restarts all of the sandbox services. This results in a very sluggish and unpleasant DX.

Turning off v2_dev fixes the issue: with the v1 dev server, the sandbox plugins are started once when you launch npm run dev, and are not restarted when you touch files that trigger rebuilds.

Here is an example project with a trivial sandbox plugin that simply prints a message with console.log when it (re)starts.

Expected Behavior

Run npm run dev and make some changes to route module files. You should see the log message Starting example service only once at the startup of npm run dev, and you should not see that log message repeated as you are changing the route module files.

Actual Behavior

On the example branch with v2_dev: true, you see the log message Starting example service when npm run dev starts, and then you see it again every time you save a change to a route module file.

@pcattori
Copy link
Contributor

pcattori commented Jul 6, 2023

@lpsinger can you try using the --no-restart flag in your dev script? That should prevent restarts, but need to confirm that the sandbox plugin correctly sends dev ready messages during rebuilds.

@lpsinger
Copy link
Contributor Author

lpsinger commented Jul 6, 2023

That works! Should I make a PR for that?

@pcattori
Copy link
Contributor

pcattori commented Jul 6, 2023

That works! Should I make a PR for that?

@lpsinger That'd be great! Thanks 🙏

@lpsinger
Copy link
Contributor Author

lpsinger commented Jul 6, 2023

That works! Should I make a PR for that?

@lpsinger That'd be great! Thanks 🙏

#6781

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants