-
Notifications
You must be signed in to change notification settings - Fork 604
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
[rush] make incremental build happen on file changes (watch mode) #1122
Comments
@iclanton FYI. We should totally do this. But the design needs to be compatible with the plan for sharded builds. |
@octogonz, out of curiosity, what has been your goto approach when you need to do incremental builds locally during your day-to-day development? |
I've been doing a lot of thinking of how I would solve the issue of rush building using webpack watch instances and avoid blocking execution. My idea consists of these 4 components
Possible concerns:
I think the easiest solution, in 1 sentence, is to create JobRequests that in turn request detached instances of the build, reused or spawned anew based on existing processes. Update: if this solution is very complex or overwhelming, a lock file based ipc solution might work better. I'm going to think about it. Update 2: it would be relatively easy to incorporate something like PM2 into this, making the observation of watch instances more maintainable and perhaps also easier to shutdown. |
Final update to all the above: we just execute build watch scripts on select packages now in my org. A script lists all projects and we choose among them. No upstream or downstream support, so normally you'd start off with a "rush build" before that. |
I'd love a feature where you would type something like rush watch, and then it would invoke rush build whenever it sees that a file has been touched. This would be amazingly performant for a large repo.
Behavior would be is somewhat similar to how nodemon works. Some suggestions by current lerna maintainer here lerna/lerna#1722 (comment)
The main motivation behind this is that we'd be able to skip having watch instances running for each package, and instead have one watch at the top.
I think this would be a big step forward for scaled micro frontend monorepos. We have 30 packages now and the RAM usage of each is killing those poor developer laptops (for each package, npm is 20 mb, the process itself a minimum of 60mb).
Since rush already features incremental builds, and building upstream and downstream, I think this would be the perfect thing to build onto what is in Rush.
Full disclaimer, I'm not using rush yet but Lerna. This feature would tip the scale for me use rush, no doubt.
Another minor thing, I'd love to be able to have this watcher actually start watch instances of webpack. I know this will block execution, so some sort of daemonization would be necessary, and likely not something that rush could offer without some complementary implementation in each micro app. I thought perhaps it would be neat if rush could help the daemonization process by either documenting it, or letting the micro apps do process.send() with some daemon activation message. This area isn't my strong suit but this is a need that we also have, and that I plan to document here later on when it's done in my project (currently using lerna but that doesn't matter in this context).
The text was updated successfully, but these errors were encountered: