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

RFC: support advanced notification and require cache swap, vs full process reload #289

Open
cdaringe opened this issue Apr 17, 2022 · 0 comments

Comments

@cdaringe
Copy link

Problem

I could iterate faster if I could avoid a full process restart, but am limited to a full proc restart ATM.

I want

  1. notification of change, and
  2. swapping/re-processing of content into the require cache on change

vs a process restart.

Motivating context

I have a mock server.

Every handler to the mock server invokes a import('./path/to/mock'). When someone changes a mock, I want instant reloads. I have so many mocks in my applications, that a full server restart takes nearly 7 seconds to launch fully from a cold start. This is a ton of data (arguably too much :) ), but the arch i'm stuck w/ at the time.

If I could just invalidate the require cache on change, i'd be happy!

Discussion

Currently, the hook + wrap simply notifies the parent. If I could configure node-dev to invalidate/clear the module and simply notify via IPC, I could go super fast!

I think that consideration for such a feature is arguably in scope. node-dev's core value is fast, consumed module-aware development iteration. This feature is in line with that goal.

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

No branches or pull requests

1 participant