Skip to content

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

@cdaringe

Description

@cdaringe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions