Skip to content

Commit

Permalink
Report HMR latency when a Server Component changes
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Jul 12, 2024
1 parent 0661bb2 commit d7457d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ function processMessage(
router.fastRefresh()
dispatcher.onRefresh()
})
reportHmrLatency(sendMessage, [])

if (process.env.__NEXT_TEST_MODE) {
if (self.__NEXT_HMR_CB) {
Expand Down
6 changes: 2 additions & 4 deletions test/development/app-hmr/hmr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ describe(`app-dir-hmr`, () => {
expect(await browser.elementByCss('p').text()).toBe('ipad')
})

// FIXME: Should have a message to close off the prior "rebuilding"
expect(logs).not.toEqual(
expect(logs).toEqual(
expect.arrayContaining([
expect.objectContaining({
message: expect.stringContaining('[Fast Refresh] done in'),
Expand Down Expand Up @@ -114,8 +113,7 @@ describe(`app-dir-hmr`, () => {
expect(await browser.elementByCss('p').text()).toBe('ipad')
})

// FIXME: Should have a message to close off the prior "rebuilding"
expect(logs).not.toEqual(
expect(logs).toEqual(
expect.arrayContaining([
expect.objectContaining({
message: expect.stringContaining('[Fast Refresh] done in'),
Expand Down

0 comments on commit d7457d2

Please sign in to comment.