next.js
0915a508 - fix(turbopack): Always console.log the "done in" message after receiving a BUILT event (#75730)

Commit
1 year ago
fix(turbopack): Always console.log the "done in" message after receiving a BUILT event (#75730) Previously, when making a change that doesn't actually cause any modules to update, you could see a: ``` [Fast Refresh] rebuilding ``` that is never followed by a ``` [Fast Refresh] done in 90ms ``` message. This PR attempts to more closely emulate webpack's behavior. I've seen people observe this before and wrongly believe that Turbopack is hanging. Doing this right is a little tricky: Turbopack emits the `BUILT` event separately using a debounce (currently 30ms) after the actual HMR updates. I don't think the Turbopack HMR APIs are particularly great overall, but the way Turbopack is handing this sort-of makes sense. A file could be updated multiple times in quick succession (i.e. as the editor is in the middle of writing it), or somebody could save changes to multiple files at once, and there's no way to atomically synchronize all of the potential filesystem/editor interactions.
Author
bgw bgw
Parents
Loading