rsbuild icon indicating copy to clipboard operation
rsbuild copied to clipboard

[Feature]: Support `handleHotUpdate` hook similar to Vite

Open niksy opened this issue 1 year ago • 2 comments

What problem does this feature solve?

Similar to Vite, Rsbuild could have easy HMR handling through some specific option. Maybe this is better implemented at lower level like Rspack and it’s exposed as option in Rsbuild.

This could also solve HMR implementation details in Unplugin scenarios such as Vue plugin HMR.

What does the proposed API look like?

Take a look at handleHotUpdate API for Vite. There are a few simple concepts that I think can be implemented in Rsbuild.

niksy avatar Aug 10 '24 10:08 niksy

Thanks, we will investigate this feature after releasing 1.0

chenjiahan avatar Aug 12 '24 09:08 chenjiahan

Rsbuild and Vite have different hot update processes, so it is difficult to support this feature within rsbuild (rspack).

The current research result is that HotModuleReplacementPlugin may need to provide some hooks to support modifying the hot-update module, thus affecting the final generation of hot-update chunk and json. However, this process has not been initially validated due to manpower issues.

9aoy avatar Dec 05 '24 03:12 9aoy