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

Hot Reload Modules #2820

Open
Logic-Bits opened this issue Apr 30, 2024 · 3 comments
Open

Hot Reload Modules #2820

Logic-Bits opened this issue Apr 30, 2024 · 3 comments

Comments

@Logic-Bits
Copy link

Hello,

would it be possible to have Plugins being hot-reloaded?

https://docs.nestjs.com/recipes/hot-reload

so plugin updates can be rolled out independend, or even something like a store can be enabled by this.

Thanks!

@michaelbromley
Copy link
Member

Hi,

I'm not sure - but if you'd like to try a proof-of-concept then I'd be interested to hear if you get it to work, and we can consider incorporating any needed changes into the core.

@Logic-Bits
Copy link
Author

maybe you can point me in the right direction. We would need to publish a "lets reload module X" Event - to all instances and workers (in theory). Would the EventBus be the right choice?

Thanks

@michaelbromley
Copy link
Member

I'm not really familiar with the internal workings of HMR, but I don't think the EventBus should be involved since that is for events that occur within the system itself, not in modifications to source code.

Maybe what would be needed is a custom file watcher process which is able to find the associated Module (or VendurePlugin) for any given modified file. This can be done by traversing the TypeScript AST using something like ts-morph.

And is HMR only supported if you use Webpack when developing? Because by default, projects generated with @vendure/create do not use Webpack.

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

2 participants