Open Logic-Bits opened 7 months ago
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.
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
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.
@Logic-Bits this would mean we would need to switch the dev build process to Webpack. Generally I think this is not a bad idea. I moved it to "under consideration" as we need to do some more research.
@dlhck sounds good, thank you
This will be covered by #3086
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!